@appbaseio/reactivecore
Advanced tools
Comparing version 10.0.0-alpha.22.1 to 10.0.0-alpha.23
@@ -1,290 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_SUGGESTIONS_SEARCH_VALUE = 'SET_SUGGESTIONS_SEARCH_VALUE'; | ||
var CLEAR_SUGGESTIONS_SEARCH_VALUE = 'CLEAR_SUGGESTIONS_SEARCH_VALUE'; | ||
var UPDATE_ANALYTICS_CONFIG = 'UPDATE_ANALYTICS_CONFIG'; | ||
var RECENT_SEARCHES_SUCCESS = 'RECENT_SEARCHES_SUCCESS'; | ||
var RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
/** | ||
* Sets the suggestionsSearchValue in analytics | ||
* @param {String} value | ||
*/ | ||
function setSuggestionsSearchValue(value) { | ||
return { | ||
type: SET_SUGGESTIONS_SEARCH_VALUE, | ||
value: value | ||
}; | ||
} | ||
/** | ||
* Clears the suggestionsSearchValue in analytics | ||
* @param {String} value | ||
*/ | ||
function clearSuggestionsSearchValue() { | ||
return { | ||
type: CLEAR_SUGGESTIONS_SEARCH_VALUE | ||
}; | ||
} | ||
/** | ||
* Updates the analytics config object | ||
* @param {Object} analyticsConfig | ||
*/ | ||
function updateAnalyticsConfig(analyticsConfig) { | ||
return { | ||
type: UPDATE_ANALYTICS_CONFIG, | ||
analyticsConfig: analyticsConfig | ||
}; | ||
} | ||
function getRecentSearches() { | ||
var queryOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { | ||
size: 5, | ||
minChars: 3 | ||
}; | ||
return function (dispatch, getState) { | ||
var _getState = getState(), | ||
config = _getState.config, | ||
headers = _getState.headers, | ||
_getState$appbaseRef = _getState.appbaseRef, | ||
url = _getState$appbaseRef.url, | ||
protocol = _getState$appbaseRef.protocol, | ||
credentials = _getState$appbaseRef.credentials; | ||
var app = config.app, | ||
mongodb = config.mongodb; | ||
var esURL = "".concat(protocol, "://").concat(url); | ||
var parsedURL = (esURL || '').replace(/\/+$/, ''); | ||
var requestOptions = { | ||
headers: _objectSpread(_objectSpread({}, headers), {}, { | ||
'Content-Type': 'application/json', | ||
Authorization: "Basic ".concat(btoa(credentials)) | ||
}) | ||
}; | ||
var queryString = ''; | ||
var addParam = function addParam(key, value) { | ||
if (queryString) { | ||
queryString += "&".concat(key, "=").concat(value); | ||
} else { | ||
queryString += "".concat(key, "=").concat(value); | ||
} | ||
}; | ||
// Add user id in query param if defined | ||
if (config.analyticsConfig && config.analyticsConfig.userId) { | ||
addParam('user_id', config.analyticsConfig.userId); | ||
} | ||
if (queryOptions) { | ||
if (queryOptions.size) { | ||
addParam('size', String(queryOptions.size)); | ||
} | ||
if (queryOptions.from) { | ||
addParam('from', queryOptions.from); | ||
} | ||
if (queryOptions.to) { | ||
addParam('to', queryOptions.to); | ||
} | ||
if (queryOptions.minChars) { | ||
addParam('min_chars', String(queryOptions.minChars)); | ||
} | ||
if (queryOptions.customEvents) { | ||
Object.keys(queryOptions.customEvents).forEach(function (key) { | ||
addParam(key, queryOptions.customEvents[key]); | ||
}); | ||
} | ||
} | ||
if (mongodb) { | ||
return dispatch({ | ||
type: RECENT_SEARCHES_SUCCESS, | ||
data: [] | ||
}); | ||
} | ||
return fetch("".concat(parsedURL, "/_analytics/").concat(app, "/recent-searches?").concat(queryString), requestOptions).then(function (res) { | ||
if (res.status >= 500 || res.status >= 400) { | ||
return dispatch({ | ||
type: RECENT_SEARCHES_ERROR, | ||
error: res | ||
}); | ||
} | ||
return res.json().then(function (recentSearches) { | ||
return dispatch({ | ||
type: RECENT_SEARCHES_SUCCESS, | ||
data: recentSearches | ||
}); | ||
})["catch"](function (e) { | ||
return dispatch({ | ||
type: RECENT_SEARCHES_ERROR, | ||
error: e | ||
}); | ||
}); | ||
})["catch"](function (e) { | ||
return dispatch({ | ||
type: RECENT_SEARCHES_ERROR, | ||
error: e | ||
}); | ||
}); | ||
}; | ||
} | ||
function recordClick(_ref) { | ||
var documentId = _ref.documentId, | ||
clickPosition = _ref.clickPosition, | ||
analyticsInstance = _ref.analyticsInstance, | ||
isSuggestionClick = _ref.isSuggestionClick; | ||
if (!documentId) { | ||
console.warn('ReactiveSearch: document id is required to record the click analytics'); | ||
} else { | ||
analyticsInstance.click({ | ||
queryID: analyticsInstance.getQueryID(), | ||
objects: _defineProperty({}, documentId, clickPosition + 1), | ||
isSuggestionClick: isSuggestionClick | ||
}); | ||
} | ||
} | ||
function recordResultClick(searchPosition, documentId) { | ||
return function (dispatch, getState) { | ||
var _getState2 = getState(), | ||
config = _getState2.config, | ||
searchId = _getState2.analytics.searchId, | ||
headers = _getState2.headers, | ||
_getState2$appbaseRef = _getState2.appbaseRef, | ||
url = _getState2$appbaseRef.url, | ||
protocol = _getState2$appbaseRef.protocol, | ||
credentials = _getState2$appbaseRef.credentials, | ||
analyticsInstance = _getState2.analyticsRef; | ||
var app = config.app; | ||
var esURL = "".concat(protocol, "://").concat(url); | ||
if (config.analytics && searchId) { | ||
var parsedHeaders = headers; | ||
delete parsedHeaders['X-Search-Query']; | ||
var parsedURL = (esURL || '').replace(/\/+$/, ''); | ||
if (parsedURL.includes('scalr.api.appbase.io')) { | ||
fetch("".concat(parsedURL, "/").concat(app, "/_analytics"), { | ||
method: 'POST', | ||
headers: _objectSpread(_objectSpread({}, parsedHeaders), {}, { | ||
'Content-Type': 'application/json', | ||
Authorization: "Basic ".concat(btoa(credentials)), | ||
'X-Search-Id': searchId, | ||
'X-Search-Click': true, | ||
'X-Search-ClickPosition': searchPosition + 1 | ||
}) | ||
}); | ||
} else { | ||
recordClick({ | ||
documentId: documentId, | ||
clickPosition: searchPosition, | ||
analyticsInstance: analyticsInstance | ||
}); | ||
} | ||
} | ||
}; | ||
} | ||
function recordSuggestionClick(searchPosition, documentId) { | ||
return function (dispatch, getState) { | ||
var _getState3 = getState(), | ||
config = _getState3.config, | ||
suggestionsSearchId = _getState3.analytics.suggestionsSearchId, | ||
headers = _getState3.headers, | ||
_getState3$appbaseRef = _getState3.appbaseRef, | ||
url = _getState3$appbaseRef.url, | ||
protocol = _getState3$appbaseRef.protocol, | ||
credentials = _getState3$appbaseRef.credentials, | ||
analyticsInstance = _getState3.analyticsRef; | ||
var app = config.app; | ||
var esURL = "".concat(protocol, "://").concat(url); | ||
if (config.analytics && (config.analyticsConfig === undefined || config.analyticsConfig.suggestionAnalytics === undefined || config.analyticsConfig.suggestionAnalytics)) { | ||
var parsedHeaders = headers; | ||
delete parsedHeaders['X-Search-Query']; | ||
var parsedURL = (esURL || '').replace(/\/+$/, ''); | ||
if (parsedURL.includes('scalr.api.appbase.io') && searchPosition !== undefined && suggestionsSearchId) { | ||
fetch("".concat(parsedURL, "/").concat(app, "/_analytics"), { | ||
method: 'POST', | ||
headers: _objectSpread(_objectSpread({}, parsedHeaders), {}, { | ||
'Content-Type': 'application/json', | ||
Authorization: "Basic ".concat(btoa(credentials)), | ||
'X-Search-Id': suggestionsSearchId, | ||
'X-Search-Suggestions-Click': true, | ||
'X-Search-Suggestions-ClickPosition': searchPosition + 1 | ||
}) | ||
}); | ||
} else if (searchPosition !== undefined) { | ||
recordClick({ | ||
documentId: documentId, | ||
clickPosition: searchPosition, | ||
analyticsInstance: analyticsInstance, | ||
isSuggestionClick: true | ||
}); | ||
} | ||
} | ||
}; | ||
} | ||
// impressions represents an array of impression objects, for e.g {"index": "test", "id": 1213} | ||
function recordImpressions(queryId) { | ||
var impressions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; | ||
return function (dispatch, getState) { | ||
var _getState4 = getState(), | ||
_getState4$appbaseRef = _getState4.appbaseRef, | ||
url = _getState4$appbaseRef.url, | ||
protocol = _getState4$appbaseRef.protocol, | ||
analyticsInstance = _getState4.analyticsRef, | ||
config = _getState4.config; | ||
var esURL = "".concat(protocol, "://").concat(url); | ||
var parsedURL = esURL.replace(/\/+$/, ''); | ||
if (config.analytics && !parsedURL.includes('scalr.api.appbase.io') && queryId && impressions.length) { | ||
analyticsInstance.search({ | ||
queryID: analyticsInstance.getQueryID(), | ||
impressions: impressions | ||
}); | ||
} | ||
}; | ||
} | ||
exports.clearSuggestionsSearchValue = clearSuggestionsSearchValue; | ||
exports.getRecentSearches = getRecentSearches; | ||
exports.recordImpressions = recordImpressions; | ||
exports.recordResultClick = recordResultClick; | ||
exports.recordSuggestionClick = recordSuggestionClick; | ||
exports.setSuggestionsSearchValue = setSuggestionsSearchValue; | ||
exports.updateAnalyticsConfig = updateAnalyticsConfig; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setSuggestionsSearchValue=setSuggestionsSearchValue;exports.clearSuggestionsSearchValue=clearSuggestionsSearchValue;exports.updateAnalyticsConfig=updateAnalyticsConfig;exports.getRecentSearches=getRecentSearches;exports.recordResultClick=recordResultClick;exports.recordSuggestionClick=recordSuggestionClick;exports.recordImpressions=recordImpressions;exports.recordAISessionUsefulness=recordAISessionUsefulness;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function setSuggestionsSearchValue(value){return{type:_constants.SET_SUGGESTIONS_SEARCH_VALUE,value:value};}function clearSuggestionsSearchValue(){return{type:_constants.CLEAR_SUGGESTIONS_SEARCH_VALUE};}function updateAnalyticsConfig(analyticsConfig){return{type:_constants.UPDATE_ANALYTICS_CONFIG,analyticsConfig:analyticsConfig};}function getRecentSearches(){var queryOptions=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{size:5,minChars:3};return function(dispatch,getState){var _getState=getState(),config=_getState.config,headers=_getState.headers,_getState$appbaseRef=_getState.appbaseRef,url=_getState$appbaseRef.url,protocol=_getState$appbaseRef.protocol,credentials=_getState$appbaseRef.credentials;var app=config.app,mongodb=config.mongodb;var esURL=protocol+'://'+url;var parsedURL=(esURL||'').replace(/\/+$/,'');var requestOptions={headers:_extends({},headers,{'Content-Type':'application/json',Authorization:'Basic '+btoa(credentials)})};var queryString='';var addParam=function addParam(key,value){if(queryString){queryString+='&'+key+'='+value;}else{queryString+=key+'='+value;}};if(config.analyticsConfig&&config.analyticsConfig.userId){addParam('user_id',config.analyticsConfig.userId);}if(queryOptions){if(queryOptions.size){addParam('size',String(queryOptions.size));}if(queryOptions.from){addParam('from',queryOptions.from);}if(queryOptions.to){addParam('to',queryOptions.to);}if(queryOptions.minChars){addParam('min_chars',String(queryOptions.minChars));}if(queryOptions.customEvents){Object.keys(queryOptions.customEvents).forEach(function(key){addParam(key,queryOptions.customEvents[key]);});}}if(mongodb){return dispatch({type:_constants.RECENT_SEARCHES_SUCCESS,data:[]});}return fetch(parsedURL+'/_analytics/'+app+'/recent-searches?'+queryString,requestOptions).then(function(res){if(res.status>=500||res.status>=400){return dispatch({type:_constants.RECENT_SEARCHES_ERROR,error:res});}return res.json().then(function(recentSearches){return dispatch({type:_constants.RECENT_SEARCHES_SUCCESS,data:recentSearches});}).catch(function(e){return dispatch({type:_constants.RECENT_SEARCHES_ERROR,error:e});});}).catch(function(e){return dispatch({type:_constants.RECENT_SEARCHES_ERROR,error:e});});};}function recordClick(_ref){var documentId=_ref.documentId,clickPosition=_ref.clickPosition,analyticsInstance=_ref.analyticsInstance,isSuggestionClick=_ref.isSuggestionClick;if(!documentId){console.warn('ReactiveSearch: document id is required to record the click analytics');}else{analyticsInstance.click({queryID:analyticsInstance.getQueryID(),objects:_defineProperty({},documentId,clickPosition+1),isSuggestionClick:isSuggestionClick});}}function recordResultClick(searchPosition,documentId){return function(dispatch,getState){var _getState2=getState(),config=_getState2.config,searchId=_getState2.analytics.searchId,headers=_getState2.headers,_getState2$appbaseRef=_getState2.appbaseRef,url=_getState2$appbaseRef.url,protocol=_getState2$appbaseRef.protocol,credentials=_getState2$appbaseRef.credentials,analyticsInstance=_getState2.analyticsRef;var app=config.app;var esURL=protocol+'://'+url;if(config.analytics&&searchId){var parsedHeaders=headers;delete parsedHeaders['X-Search-Query'];var parsedURL=(esURL||'').replace(/\/+$/,'');if(parsedURL.includes('scalr.api.appbase.io')){fetch(parsedURL+'/'+app+'/_analytics',{method:'POST',headers:_extends({},parsedHeaders,{'Content-Type':'application/json',Authorization:'Basic '+btoa(credentials),'X-Search-Id':searchId,'X-Search-Click':true,'X-Search-ClickPosition':searchPosition+1})});}else{recordClick({documentId:documentId,clickPosition:searchPosition,analyticsInstance:analyticsInstance});}}};}function recordSuggestionClick(searchPosition,documentId){return function(dispatch,getState){var _getState3=getState(),config=_getState3.config,suggestionsSearchId=_getState3.analytics.suggestionsSearchId,headers=_getState3.headers,_getState3$appbaseRef=_getState3.appbaseRef,url=_getState3$appbaseRef.url,protocol=_getState3$appbaseRef.protocol,credentials=_getState3$appbaseRef.credentials,analyticsInstance=_getState3.analyticsRef;var app=config.app;var esURL=protocol+'://'+url;if(config.analytics&&(config.analyticsConfig===undefined||config.analyticsConfig.suggestionAnalytics===undefined||config.analyticsConfig.suggestionAnalytics)){var parsedHeaders=headers;delete parsedHeaders['X-Search-Query'];var parsedURL=(esURL||'').replace(/\/+$/,'');if(parsedURL.includes('scalr.api.appbase.io')&&searchPosition!==undefined&&suggestionsSearchId){fetch(parsedURL+'/'+app+'/_analytics',{method:'POST',headers:_extends({},parsedHeaders,{'Content-Type':'application/json',Authorization:'Basic '+btoa(credentials),'X-Search-Id':suggestionsSearchId,'X-Search-Suggestions-Click':true,'X-Search-Suggestions-ClickPosition':searchPosition+1})});}else if(searchPosition!==undefined){recordClick({documentId:documentId,clickPosition:searchPosition,analyticsInstance:analyticsInstance,isSuggestionClick:true});}}};}function recordImpressions(queryId){var impressions=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return function(dispatch,getState){var _getState4=getState(),_getState4$appbaseRef=_getState4.appbaseRef,url=_getState4$appbaseRef.url,protocol=_getState4$appbaseRef.protocol,analyticsInstance=_getState4.analyticsRef,config=_getState4.config;var esURL=protocol+'://'+url;var parsedURL=esURL.replace(/\/+$/,'');if(config.analytics&&!parsedURL.includes('scalr.api.appbase.io')&&queryId&&impressions.length){analyticsInstance.search({queryID:analyticsInstance.getQueryID(),impressions:impressions});}};}function recordAISessionUsefulness(sessionId,otherInfo){return function(dispatch,getState){var _getState5=getState(),analyticsInstance=_getState5.analyticsRef,config=_getState5.config;if(!config||!config.analyticsConfig||!config.analyticsConfig.recordAnalytics){console.warn('ReactiveSearch: Unable to record usefulness of session. To enable analytics, make sure to include the following prop on your <ReactiveBase> component: reactivesearchAPIConfig={{ recordAnalytics: true }}');return;}var userID=config&&config.analyticsConfig&&config.analyticsConfig.userId;if(!sessionId){console.warn('ReactiveSearch: AI sessionID is required to record the usefulness of session.');return;}analyticsInstance.saveSessionUsefulness(sessionId,_extends({},otherInfo,{userID:userID}),function(err,res){console.log('res',res);});};} |
@@ -1,486 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
var UPDATE_HITS = 'UPDATE_HITS'; | ||
var UPDATE_AGGS = 'UPDATE_AGGS'; | ||
var UPDATE_COMPOSITE_AGGS = 'UPDATE_COMPOSITE_AGGS'; | ||
var SET_ERROR = 'SET_ERROR'; | ||
var SET_QUERY_TO_HITS = 'SET_QUERY_TO_HITS'; | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
var dayjs_min = {exports: {}}; | ||
(function (module, exports) { | ||
!function (t, e) { | ||
module.exports = e() ; | ||
}(commonjsGlobal, function () { | ||
var t = 1e3, | ||
e = 6e4, | ||
n = 36e5, | ||
r = "millisecond", | ||
i = "second", | ||
s = "minute", | ||
u = "hour", | ||
a = "day", | ||
o = "week", | ||
f = "month", | ||
h = "quarter", | ||
c = "year", | ||
d = "date", | ||
l = "Invalid Date", | ||
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, | ||
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, | ||
M = { | ||
name: "en", | ||
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), | ||
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), | ||
ordinal: function ordinal(t) { | ||
var e = ["th", "st", "nd", "rd"], | ||
n = t % 100; | ||
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; | ||
} | ||
}, | ||
m = function m(t, e, n) { | ||
var r = String(t); | ||
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; | ||
}, | ||
v = { | ||
s: m, | ||
z: function z(t) { | ||
var e = -t.utcOffset(), | ||
n = Math.abs(e), | ||
r = Math.floor(n / 60), | ||
i = n % 60; | ||
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); | ||
}, | ||
m: function t(e, n) { | ||
if (e.date() < n.date()) return -t(n, e); | ||
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), | ||
i = e.clone().add(r, f), | ||
s = n - i < 0, | ||
u = e.clone().add(r + (s ? -1 : 1), f); | ||
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); | ||
}, | ||
a: function a(t) { | ||
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); | ||
}, | ||
p: function p(t) { | ||
return { | ||
M: f, | ||
y: c, | ||
w: o, | ||
d: a, | ||
D: d, | ||
h: u, | ||
m: s, | ||
s: i, | ||
ms: r, | ||
Q: h | ||
}[t] || String(t || "").toLowerCase().replace(/s$/, ""); | ||
}, | ||
u: function u(t) { | ||
return void 0 === t; | ||
} | ||
}, | ||
g = "en", | ||
D = {}; | ||
D[g] = M; | ||
var p = function p(t) { | ||
return t instanceof _; | ||
}, | ||
S = function t(e, n, r) { | ||
var i; | ||
if (!e) return g; | ||
if ("string" == typeof e) { | ||
var s = e.toLowerCase(); | ||
D[s] && (i = s), n && (D[s] = n, i = s); | ||
var u = e.split("-"); | ||
if (!i && u.length > 1) return t(u[0]); | ||
} else { | ||
var a = e.name; | ||
D[a] = e, i = a; | ||
} | ||
return !r && i && (g = i), i || !r && g; | ||
}, | ||
w = function w(t, e) { | ||
if (p(t)) return t.clone(); | ||
var n = "object" == _typeof(e) ? e : {}; | ||
return n.date = t, n.args = arguments, new _(n); | ||
}, | ||
O = v; | ||
O.l = S, O.i = p, O.w = function (t, e) { | ||
return w(t, { | ||
locale: e.$L, | ||
utc: e.$u, | ||
x: e.$x, | ||
$offset: e.$offset | ||
}); | ||
}; | ||
var _ = function () { | ||
function M(t) { | ||
this.$L = S(t.locale, null, !0), this.parse(t); | ||
} | ||
var m = M.prototype; | ||
return m.parse = function (t) { | ||
this.$d = function (t) { | ||
var e = t.date, | ||
n = t.utc; | ||
if (null === e) return new Date(NaN); | ||
if (O.u(e)) return new Date(); | ||
if (e instanceof Date) return new Date(e); | ||
if ("string" == typeof e && !/Z$/i.test(e)) { | ||
var r = e.match($); | ||
if (r) { | ||
var i = r[2] - 1 || 0, | ||
s = (r[7] || "0").substring(0, 3); | ||
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); | ||
} | ||
} | ||
return new Date(e); | ||
}(t), this.$x = t.x || {}, this.init(); | ||
}, m.init = function () { | ||
var t = this.$d; | ||
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); | ||
}, m.$utils = function () { | ||
return O; | ||
}, m.isValid = function () { | ||
return !(this.$d.toString() === l); | ||
}, m.isSame = function (t, e) { | ||
var n = w(t); | ||
return this.startOf(e) <= n && n <= this.endOf(e); | ||
}, m.isAfter = function (t, e) { | ||
return w(t) < this.startOf(e); | ||
}, m.isBefore = function (t, e) { | ||
return this.endOf(e) < w(t); | ||
}, m.$g = function (t, e, n) { | ||
return O.u(t) ? this[e] : this.set(n, t); | ||
}, m.unix = function () { | ||
return Math.floor(this.valueOf() / 1e3); | ||
}, m.valueOf = function () { | ||
return this.$d.getTime(); | ||
}, m.startOf = function (t, e) { | ||
var n = this, | ||
r = !!O.u(e) || e, | ||
h = O.p(t), | ||
l = function l(t, e) { | ||
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); | ||
return r ? i : i.endOf(a); | ||
}, | ||
$ = function $(t, e) { | ||
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); | ||
}, | ||
y = this.$W, | ||
M = this.$M, | ||
m = this.$D, | ||
v = "set" + (this.$u ? "UTC" : ""); | ||
switch (h) { | ||
case c: | ||
return r ? l(1, 0) : l(31, 11); | ||
case f: | ||
return r ? l(1, M) : l(0, M + 1); | ||
case o: | ||
var g = this.$locale().weekStart || 0, | ||
D = (y < g ? y + 7 : y) - g; | ||
return l(r ? m - D : m + (6 - D), M); | ||
case a: | ||
case d: | ||
return $(v + "Hours", 0); | ||
case u: | ||
return $(v + "Minutes", 1); | ||
case s: | ||
return $(v + "Seconds", 2); | ||
case i: | ||
return $(v + "Milliseconds", 3); | ||
default: | ||
return this.clone(); | ||
} | ||
}, m.endOf = function (t) { | ||
return this.startOf(t, !1); | ||
}, m.$set = function (t, e) { | ||
var n, | ||
o = O.p(t), | ||
h = "set" + (this.$u ? "UTC" : ""), | ||
l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], | ||
$ = o === a ? this.$D + (e - this.$W) : e; | ||
if (o === f || o === c) { | ||
var y = this.clone().set(d, 1); | ||
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; | ||
} else l && this.$d[l]($); | ||
return this.init(), this; | ||
}, m.set = function (t, e) { | ||
return this.clone().$set(t, e); | ||
}, m.get = function (t) { | ||
return this[O.p(t)](); | ||
}, m.add = function (r, h) { | ||
var d, | ||
l = this; | ||
r = Number(r); | ||
var $ = O.p(h), | ||
y = function y(t) { | ||
var e = w(l); | ||
return O.w(e.date(e.date() + Math.round(t * r)), l); | ||
}; | ||
if ($ === f) return this.set(f, this.$M + r); | ||
if ($ === c) return this.set(c, this.$y + r); | ||
if ($ === a) return y(1); | ||
if ($ === o) return y(7); | ||
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, | ||
m = this.$d.getTime() + r * M; | ||
return O.w(m, this); | ||
}, m.subtract = function (t, e) { | ||
return this.add(-1 * t, e); | ||
}, m.format = function (t) { | ||
var e = this, | ||
n = this.$locale(); | ||
if (!this.isValid()) return n.invalidDate || l; | ||
var r = t || "YYYY-MM-DDTHH:mm:ssZ", | ||
i = O.z(this), | ||
s = this.$H, | ||
u = this.$m, | ||
a = this.$M, | ||
o = n.weekdays, | ||
f = n.months, | ||
h = function h(t, n, i, s) { | ||
return t && (t[n] || t(e, r)) || i[n].slice(0, s); | ||
}, | ||
c = function c(t) { | ||
return O.s(s % 12 || 12, t, "0"); | ||
}, | ||
d = n.meridiem || function (t, e, n) { | ||
var r = t < 12 ? "AM" : "PM"; | ||
return n ? r.toLowerCase() : r; | ||
}, | ||
$ = { | ||
YY: String(this.$y).slice(-2), | ||
YYYY: this.$y, | ||
M: a + 1, | ||
MM: O.s(a + 1, 2, "0"), | ||
MMM: h(n.monthsShort, a, f, 3), | ||
MMMM: h(f, a), | ||
D: this.$D, | ||
DD: O.s(this.$D, 2, "0"), | ||
d: String(this.$W), | ||
dd: h(n.weekdaysMin, this.$W, o, 2), | ||
ddd: h(n.weekdaysShort, this.$W, o, 3), | ||
dddd: o[this.$W], | ||
H: String(s), | ||
HH: O.s(s, 2, "0"), | ||
h: c(1), | ||
hh: c(2), | ||
a: d(s, u, !0), | ||
A: d(s, u, !1), | ||
m: String(u), | ||
mm: O.s(u, 2, "0"), | ||
s: String(this.$s), | ||
ss: O.s(this.$s, 2, "0"), | ||
SSS: O.s(this.$ms, 3, "0"), | ||
Z: i | ||
}; | ||
return r.replace(y, function (t, e) { | ||
return e || $[t] || i.replace(":", ""); | ||
}); | ||
}, m.utcOffset = function () { | ||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); | ||
}, m.diff = function (r, d, l) { | ||
var $, | ||
y = O.p(d), | ||
M = w(r), | ||
m = (M.utcOffset() - this.utcOffset()) * e, | ||
v = this - M, | ||
g = O.m(this, M); | ||
return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g); | ||
}, m.daysInMonth = function () { | ||
return this.endOf(f).$D; | ||
}, m.$locale = function () { | ||
return D[this.$L]; | ||
}, m.locale = function (t, e) { | ||
if (!t) return this.$L; | ||
var n = this.clone(), | ||
r = S(t, e, !0); | ||
return r && (n.$L = r), n; | ||
}, m.clone = function () { | ||
return O.w(this.$d, this); | ||
}, m.toDate = function () { | ||
return new Date(this.valueOf()); | ||
}, m.toJSON = function () { | ||
return this.isValid() ? this.toISOString() : null; | ||
}, m.toISOString = function () { | ||
return this.$d.toISOString(); | ||
}, m.toString = function () { | ||
return this.$d.toUTCString(); | ||
}, M; | ||
}(), | ||
T = _.prototype; | ||
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { | ||
T[t[1]] = function (e) { | ||
return this.$g(e, t[0], t[1]); | ||
}; | ||
}), w.extend = function (t, e) { | ||
return t.$i || (t(e, _, w), t.$i = !0), w; | ||
}, w.locale = S, w.isDayjs = p, w.unix = function (t) { | ||
return w(1e3 * t); | ||
}, w.en = D[g], w.Ls = D, w.p = {}, w; | ||
}); | ||
})(dayjs_min); | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var queryTypes = { | ||
search: 'search', | ||
term: 'term', | ||
range: 'range', | ||
geo: 'geo', | ||
suggestion: 'suggestion' | ||
}; | ||
var _componentTypeToDefau; | ||
(_componentTypeToDefau = {}, _defineProperty(_componentTypeToDefau, componentTypes.singleList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiList, []), _defineProperty(_componentTypeToDefau, componentTypes.singleDataList, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDataList, []), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownList, []), _defineProperty(_componentTypeToDefau, componentTypes.tagCloud, ''), _defineProperty(_componentTypeToDefau, componentTypes.toggleButton, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownRange, []), _defineProperty(_componentTypeToDefau, componentTypes.singleRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiRange, []), _componentTypeToDefau); | ||
var _componentToTypeMap; | ||
(_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, componentTypes.reactiveList, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.dataSearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.categorySearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.searchBox, queryTypes.suggestion), _defineProperty(_componentToTypeMap, componentTypes.singleList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.tagCloud, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.toggleButton, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.reactiveChart, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.treeList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.numberBox, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.datePicker, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dateRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dynamicRangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.ratingsFilter, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeInput, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceDropdown, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceSlider, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.reactiveMap, queryTypes.geo), _componentToTypeMap); | ||
function setError(component, error) { | ||
return { | ||
type: SET_ERROR, | ||
component: component, | ||
error: error | ||
}; | ||
} | ||
function updateAggs(component, aggregations) { | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
return { | ||
type: UPDATE_AGGS, | ||
component: component, | ||
aggregations: aggregations, | ||
append: append | ||
}; | ||
} | ||
function updateCompositeAggs(component, aggregations) { | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
return { | ||
type: UPDATE_COMPOSITE_AGGS, | ||
component: component, | ||
aggregations: aggregations, | ||
append: append | ||
}; | ||
} | ||
function updateHits(component, hits, time, hidden) { | ||
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; | ||
return { | ||
type: UPDATE_HITS, | ||
component: component, | ||
hits: hits.hits, | ||
// make compatible with es7 | ||
total: _typeof(hits.total) === 'object' ? hits.total.value : hits.total, | ||
hidden: hidden, | ||
time: time, | ||
append: append | ||
}; | ||
} | ||
function saveQueryToHits(component, query) { | ||
return { | ||
type: SET_QUERY_TO_HITS, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
function mockDataForTesting(component, data) { | ||
return function (dispatch) { | ||
if (data.hasOwnProperty('error')) { | ||
dispatch(setError(component, data.error)); | ||
} | ||
if (data.hasOwnProperty('aggregations')) { | ||
// set aggs | ||
dispatch(updateAggs(component, data.aggregations)); | ||
} | ||
if (data.hasOwnProperty('hits')) { | ||
// set hits | ||
dispatch(updateHits(component, data, data.time || undefined)); | ||
} | ||
}; | ||
} | ||
exports.mockDataForTesting = mockDataForTesting; | ||
exports.saveQueryToHits = saveQueryToHits; | ||
exports.updateAggs = updateAggs; | ||
exports.updateCompositeAggs = updateCompositeAggs; | ||
exports.updateHits = updateHits; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.updateAggs=updateAggs;exports.updateCompositeAggs=updateCompositeAggs;exports.updateHits=updateHits;exports.saveQueryToHits=saveQueryToHits;exports.mockDataForTesting=mockDataForTesting;var _constants=require('../constants');var _constants2=require('../../lib/constants');var _misc=require('./misc');function updateAggs(component,aggregations){var append=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return{type:_constants.UPDATE_AGGS,component:component,aggregations:aggregations,append:append};}function updateCompositeAggs(component,aggregations){var append=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return{type:_constants.UPDATE_COMPOSITE_AGGS,component:component,aggregations:aggregations,append:append};}function updateHits(component,hits,time,hidden){var append=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;return{type:_constants.UPDATE_HITS,component:component,hits:hits.hits,total:typeof hits.total==='object'?hits.total.value:hits.total,hidden:hidden,time:time,append:append};}function saveQueryToHits(component,query){return{type:_constants2.SET_QUERY_TO_HITS,component:component,query:query};}function mockDataForTesting(component,data){return function(dispatch){if(data.hasOwnProperty('error')){dispatch((0,_misc.setError)(component,data.error));}if(data.hasOwnProperty('aggregations')){dispatch(updateAggs(component,data.aggregations));}if(data.hasOwnProperty('hits')){dispatch(updateHits(component,data,data.time||undefined));}};} |
@@ -1,971 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_QUERY = 'SET_QUERY'; | ||
var SET_APPBASE_QUERY = 'SET_APPBASE_QUERY'; | ||
var SET_QUERY_OPTIONS = 'SET_QUERY_OPTIONS'; | ||
var UPDATE_HITS = 'UPDATE_HITS'; | ||
var UPDATE_AGGS = 'UPDATE_AGGS'; | ||
var UPDATE_COMPOSITE_AGGS = 'UPDATE_COMPOSITE_AGGS'; | ||
var UPDATE_CONFIG = 'UPDATE_CONFIG'; | ||
var LOG_QUERY = 'LOG_QUERY'; | ||
var LOG_COMBINED_QUERY = 'LOG_COMBINED_QUERY'; | ||
var SET_LOADING = 'SET_LOADING'; | ||
var SET_ERROR = 'SET_ERROR'; | ||
var SET_TIMESTAMP = 'SET_TIMESTAMP'; | ||
var SET_HEADERS = 'SET_HEADERS'; | ||
var SET_QUERY_LISTENER = 'SET_QUERY_LISTENER'; | ||
var SET_SEARCH_ID = 'SET_SEARCH_ID'; | ||
var SET_PROMOTED_RESULTS = 'SET_PROMOTED_RESULTS'; | ||
var SET_DEFAULT_QUERY = 'SET_DEFAULT_QUERY'; | ||
var SET_CUSTOM_QUERY = 'SET_CUSTOM_QUERY'; | ||
var SET_CUSTOM_HIGHLIGHT_OPTIONS = 'SET_CUSTOM_HIGHLIGHT_OPTIONS'; | ||
var SET_CUSTOM_DATA = 'SET_CUSTOM_DATA'; | ||
var SET_APPLIED_SETTINGS = 'SET_APPLIED_SETTINGS'; | ||
var SET_SUGGESTIONS_SEARCH_ID = 'SET_SUGGESTIONS_SEARCH_ID'; | ||
var SET_RAW_DATA = 'SET_RAW_DATA'; | ||
var SET_POPULAR_SUGGESTIONS = 'SET_POPULAR_SUGGESTIONS'; | ||
var SET_DEFAULT_POPULAR_SUGGESTIONS = 'SET_DEFAULT_POPULAR_SUGGESTIONS'; | ||
var SET_VALUES = 'SET_VALUES'; | ||
var SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING'; | ||
var SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED'; | ||
var SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR'; | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
function getDefaultExportFromCjs (x) { | ||
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; | ||
} | ||
var dayjs_min = {exports: {}}; | ||
(function (module, exports) { | ||
!function (t, e) { | ||
module.exports = e() ; | ||
}(commonjsGlobal, function () { | ||
var t = 1e3, | ||
e = 6e4, | ||
n = 36e5, | ||
r = "millisecond", | ||
i = "second", | ||
s = "minute", | ||
u = "hour", | ||
a = "day", | ||
o = "week", | ||
f = "month", | ||
h = "quarter", | ||
c = "year", | ||
d = "date", | ||
l = "Invalid Date", | ||
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, | ||
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, | ||
M = { | ||
name: "en", | ||
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), | ||
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), | ||
ordinal: function ordinal(t) { | ||
var e = ["th", "st", "nd", "rd"], | ||
n = t % 100; | ||
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; | ||
} | ||
}, | ||
m = function m(t, e, n) { | ||
var r = String(t); | ||
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; | ||
}, | ||
v = { | ||
s: m, | ||
z: function z(t) { | ||
var e = -t.utcOffset(), | ||
n = Math.abs(e), | ||
r = Math.floor(n / 60), | ||
i = n % 60; | ||
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); | ||
}, | ||
m: function t(e, n) { | ||
if (e.date() < n.date()) return -t(n, e); | ||
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), | ||
i = e.clone().add(r, f), | ||
s = n - i < 0, | ||
u = e.clone().add(r + (s ? -1 : 1), f); | ||
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); | ||
}, | ||
a: function a(t) { | ||
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); | ||
}, | ||
p: function p(t) { | ||
return { | ||
M: f, | ||
y: c, | ||
w: o, | ||
d: a, | ||
D: d, | ||
h: u, | ||
m: s, | ||
s: i, | ||
ms: r, | ||
Q: h | ||
}[t] || String(t || "").toLowerCase().replace(/s$/, ""); | ||
}, | ||
u: function u(t) { | ||
return void 0 === t; | ||
} | ||
}, | ||
g = "en", | ||
D = {}; | ||
D[g] = M; | ||
var p = function p(t) { | ||
return t instanceof _; | ||
}, | ||
S = function t(e, n, r) { | ||
var i; | ||
if (!e) return g; | ||
if ("string" == typeof e) { | ||
var s = e.toLowerCase(); | ||
D[s] && (i = s), n && (D[s] = n, i = s); | ||
var u = e.split("-"); | ||
if (!i && u.length > 1) return t(u[0]); | ||
} else { | ||
var a = e.name; | ||
D[a] = e, i = a; | ||
} | ||
return !r && i && (g = i), i || !r && g; | ||
}, | ||
w = function w(t, e) { | ||
if (p(t)) return t.clone(); | ||
var n = "object" == _typeof(e) ? e : {}; | ||
return n.date = t, n.args = arguments, new _(n); | ||
}, | ||
O = v; | ||
O.l = S, O.i = p, O.w = function (t, e) { | ||
return w(t, { | ||
locale: e.$L, | ||
utc: e.$u, | ||
x: e.$x, | ||
$offset: e.$offset | ||
}); | ||
}; | ||
var _ = function () { | ||
function M(t) { | ||
this.$L = S(t.locale, null, !0), this.parse(t); | ||
} | ||
var m = M.prototype; | ||
return m.parse = function (t) { | ||
this.$d = function (t) { | ||
var e = t.date, | ||
n = t.utc; | ||
if (null === e) return new Date(NaN); | ||
if (O.u(e)) return new Date(); | ||
if (e instanceof Date) return new Date(e); | ||
if ("string" == typeof e && !/Z$/i.test(e)) { | ||
var r = e.match($); | ||
if (r) { | ||
var i = r[2] - 1 || 0, | ||
s = (r[7] || "0").substring(0, 3); | ||
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); | ||
} | ||
} | ||
return new Date(e); | ||
}(t), this.$x = t.x || {}, this.init(); | ||
}, m.init = function () { | ||
var t = this.$d; | ||
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); | ||
}, m.$utils = function () { | ||
return O; | ||
}, m.isValid = function () { | ||
return !(this.$d.toString() === l); | ||
}, m.isSame = function (t, e) { | ||
var n = w(t); | ||
return this.startOf(e) <= n && n <= this.endOf(e); | ||
}, m.isAfter = function (t, e) { | ||
return w(t) < this.startOf(e); | ||
}, m.isBefore = function (t, e) { | ||
return this.endOf(e) < w(t); | ||
}, m.$g = function (t, e, n) { | ||
return O.u(t) ? this[e] : this.set(n, t); | ||
}, m.unix = function () { | ||
return Math.floor(this.valueOf() / 1e3); | ||
}, m.valueOf = function () { | ||
return this.$d.getTime(); | ||
}, m.startOf = function (t, e) { | ||
var n = this, | ||
r = !!O.u(e) || e, | ||
h = O.p(t), | ||
l = function l(t, e) { | ||
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); | ||
return r ? i : i.endOf(a); | ||
}, | ||
$ = function $(t, e) { | ||
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); | ||
}, | ||
y = this.$W, | ||
M = this.$M, | ||
m = this.$D, | ||
v = "set" + (this.$u ? "UTC" : ""); | ||
switch (h) { | ||
case c: | ||
return r ? l(1, 0) : l(31, 11); | ||
case f: | ||
return r ? l(1, M) : l(0, M + 1); | ||
case o: | ||
var g = this.$locale().weekStart || 0, | ||
D = (y < g ? y + 7 : y) - g; | ||
return l(r ? m - D : m + (6 - D), M); | ||
case a: | ||
case d: | ||
return $(v + "Hours", 0); | ||
case u: | ||
return $(v + "Minutes", 1); | ||
case s: | ||
return $(v + "Seconds", 2); | ||
case i: | ||
return $(v + "Milliseconds", 3); | ||
default: | ||
return this.clone(); | ||
} | ||
}, m.endOf = function (t) { | ||
return this.startOf(t, !1); | ||
}, m.$set = function (t, e) { | ||
var n, | ||
o = O.p(t), | ||
h = "set" + (this.$u ? "UTC" : ""), | ||
l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], | ||
$ = o === a ? this.$D + (e - this.$W) : e; | ||
if (o === f || o === c) { | ||
var y = this.clone().set(d, 1); | ||
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; | ||
} else l && this.$d[l]($); | ||
return this.init(), this; | ||
}, m.set = function (t, e) { | ||
return this.clone().$set(t, e); | ||
}, m.get = function (t) { | ||
return this[O.p(t)](); | ||
}, m.add = function (r, h) { | ||
var d, | ||
l = this; | ||
r = Number(r); | ||
var $ = O.p(h), | ||
y = function y(t) { | ||
var e = w(l); | ||
return O.w(e.date(e.date() + Math.round(t * r)), l); | ||
}; | ||
if ($ === f) return this.set(f, this.$M + r); | ||
if ($ === c) return this.set(c, this.$y + r); | ||
if ($ === a) return y(1); | ||
if ($ === o) return y(7); | ||
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, | ||
m = this.$d.getTime() + r * M; | ||
return O.w(m, this); | ||
}, m.subtract = function (t, e) { | ||
return this.add(-1 * t, e); | ||
}, m.format = function (t) { | ||
var e = this, | ||
n = this.$locale(); | ||
if (!this.isValid()) return n.invalidDate || l; | ||
var r = t || "YYYY-MM-DDTHH:mm:ssZ", | ||
i = O.z(this), | ||
s = this.$H, | ||
u = this.$m, | ||
a = this.$M, | ||
o = n.weekdays, | ||
f = n.months, | ||
h = function h(t, n, i, s) { | ||
return t && (t[n] || t(e, r)) || i[n].slice(0, s); | ||
}, | ||
c = function c(t) { | ||
return O.s(s % 12 || 12, t, "0"); | ||
}, | ||
d = n.meridiem || function (t, e, n) { | ||
var r = t < 12 ? "AM" : "PM"; | ||
return n ? r.toLowerCase() : r; | ||
}, | ||
$ = { | ||
YY: String(this.$y).slice(-2), | ||
YYYY: this.$y, | ||
M: a + 1, | ||
MM: O.s(a + 1, 2, "0"), | ||
MMM: h(n.monthsShort, a, f, 3), | ||
MMMM: h(f, a), | ||
D: this.$D, | ||
DD: O.s(this.$D, 2, "0"), | ||
d: String(this.$W), | ||
dd: h(n.weekdaysMin, this.$W, o, 2), | ||
ddd: h(n.weekdaysShort, this.$W, o, 3), | ||
dddd: o[this.$W], | ||
H: String(s), | ||
HH: O.s(s, 2, "0"), | ||
h: c(1), | ||
hh: c(2), | ||
a: d(s, u, !0), | ||
A: d(s, u, !1), | ||
m: String(u), | ||
mm: O.s(u, 2, "0"), | ||
s: String(this.$s), | ||
ss: O.s(this.$s, 2, "0"), | ||
SSS: O.s(this.$ms, 3, "0"), | ||
Z: i | ||
}; | ||
return r.replace(y, function (t, e) { | ||
return e || $[t] || i.replace(":", ""); | ||
}); | ||
}, m.utcOffset = function () { | ||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); | ||
}, m.diff = function (r, d, l) { | ||
var $, | ||
y = O.p(d), | ||
M = w(r), | ||
m = (M.utcOffset() - this.utcOffset()) * e, | ||
v = this - M, | ||
g = O.m(this, M); | ||
return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g); | ||
}, m.daysInMonth = function () { | ||
return this.endOf(f).$D; | ||
}, m.$locale = function () { | ||
return D[this.$L]; | ||
}, m.locale = function (t, e) { | ||
if (!t) return this.$L; | ||
var n = this.clone(), | ||
r = S(t, e, !0); | ||
return r && (n.$L = r), n; | ||
}, m.clone = function () { | ||
return O.w(this.$d, this); | ||
}, m.toDate = function () { | ||
return new Date(this.valueOf()); | ||
}, m.toJSON = function () { | ||
return this.isValid() ? this.toISOString() : null; | ||
}, m.toISOString = function () { | ||
return this.$d.toISOString(); | ||
}, m.toString = function () { | ||
return this.$d.toUTCString(); | ||
}, M; | ||
}(), | ||
T = _.prototype; | ||
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { | ||
T[t[1]] = function (e) { | ||
return this.$g(e, t[0], t[1]); | ||
}; | ||
}), w.extend = function (t, e) { | ||
return t.$i || (t(e, _, w), t.$i = !0), w; | ||
}, w.locale = S, w.isDayjs = p, w.unix = function (t) { | ||
return w(1e3 * t); | ||
}, w.en = D[g], w.Ls = D, w.p = {}, w; | ||
}); | ||
})(dayjs_min); | ||
var dayjs_minExports = dayjs_min.exports; | ||
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports); | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var queryTypes = { | ||
search: 'search', | ||
term: 'term', | ||
range: 'range', | ||
geo: 'geo', | ||
suggestion: 'suggestion' | ||
}; | ||
var dateFormats = { | ||
date: 'YYYY-MM-DD', | ||
basic_date: 'YYYYMMDD', | ||
basic_date_time: 'YYYYMMDD[T]HHmmss.SSSZ', | ||
basic_date_time_no_millis: 'YYYYMMDD[T]HHmmssZ', | ||
date_time_no_millis: 'YYYY-MM-DD[T]HH:mm:ssZ', | ||
basic_time: 'HHmmss.SSSZ', | ||
basic_time_no_millis: 'HHmmssZ', | ||
epoch_millis: 'epoch_millis', | ||
epoch_second: 'epoch_second' | ||
}; | ||
var _componentTypeToDefau; | ||
function formatDate(date, props) { | ||
if (props.parseDate) { | ||
// We would be passing an instance of dayjs instead of xdate below. Users need to know. | ||
return props.parseDate(date, props); | ||
} | ||
switch (props.queryFormat) { | ||
case 'epoch_millis': | ||
return date.valueOf(); | ||
case 'epoch_second': | ||
return Math.floor(date.valueOf() / 1000); | ||
default: | ||
{ | ||
if (dateFormats[props.queryFormat]) { | ||
return date.format(dateFormats[props.queryFormat]); | ||
} | ||
return date.valueOf(); | ||
} | ||
} | ||
} | ||
(_componentTypeToDefau = {}, _defineProperty(_componentTypeToDefau, componentTypes.singleList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiList, []), _defineProperty(_componentTypeToDefau, componentTypes.singleDataList, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDataList, []), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownList, []), _defineProperty(_componentTypeToDefau, componentTypes.tagCloud, ''), _defineProperty(_componentTypeToDefau, componentTypes.toggleButton, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownRange, []), _defineProperty(_componentTypeToDefau, componentTypes.singleRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiRange, []), _componentTypeToDefau); | ||
var _componentToTypeMap; | ||
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
(_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, componentTypes.reactiveList, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.dataSearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.categorySearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.searchBox, queryTypes.suggestion), _defineProperty(_componentToTypeMap, componentTypes.singleList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.tagCloud, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.toggleButton, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.reactiveChart, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.treeList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.numberBox, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.datePicker, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dateRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dynamicRangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.ratingsFilter, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeInput, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceDropdown, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceSlider, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.reactiveMap, queryTypes.geo), _componentToTypeMap); | ||
var transformValueToComponentStateFormat = function transformValueToComponentStateFormat(value, componentProps) { | ||
var componentType = componentProps.componentType, | ||
data = componentProps.data, | ||
queryFormat = componentProps.queryFormat; | ||
var transformedValue = value; | ||
var meta = {}; | ||
if (value) { | ||
switch (componentType) { | ||
case componentTypes.singleDataList: | ||
case componentTypes.tabDataList: | ||
transformedValue = ''; | ||
if (Array.isArray(value) && typeof value[0] === 'string') { | ||
transformedValue = value[0]; | ||
} else if (_typeof(value) === 'object' && value.label) { | ||
transformedValue = value.label; | ||
} else { | ||
transformedValue = value; | ||
} | ||
break; | ||
case componentTypes.multiDataList: | ||
transformedValue = []; | ||
if (Array.isArray(value)) { | ||
value.forEach(function (valObj) { | ||
if (_typeof(valObj) === 'object' && (valObj.label || valObj.value)) { | ||
transformedValue.push(valObj.label || valObj.value); | ||
} else if (typeof valObj === 'string') { | ||
transformedValue.push(valObj); | ||
} | ||
}); | ||
} | ||
break; | ||
case componentTypes.toggleButton: | ||
transformedValue = []; // array of objects | ||
if (Array.isArray(value)) { | ||
value.forEach(function (valObj) { | ||
if (_typeof(valObj) === 'object' && valObj.label && valObj.value) { | ||
transformedValue.push(valObj); | ||
} else if (typeof valObj === 'string') { | ||
var findDataObj = data.find(function (item) { | ||
return item.label.trim() === valObj.trim() || item.value.trim() === valObj.trim(); | ||
}); | ||
transformedValue.push(findDataObj); | ||
} | ||
}); | ||
} else if (_typeof(value) === 'object' && value.label && value.value) { | ||
transformedValue = value.value; | ||
} else if (typeof value === 'string') { | ||
var findDataObj = data.find(function (item) { | ||
return item.label.trim() === value.trim() || item.value.trim() === value.trim(); | ||
}); | ||
transformedValue = findDataObj.value; | ||
} | ||
break; | ||
case componentTypes.singleRange: | ||
case componentTypes.singleDropdownRange: | ||
transformedValue = {}; | ||
if (!Array.isArray(value) && _typeof(value) === 'object') { | ||
transformedValue = _objectSpread$1({}, value); | ||
} else if (typeof value === 'string') { | ||
var _findDataObj = data.find(function (item) { | ||
return item.label.trim() === value.trim(); | ||
}); | ||
transformedValue = _objectSpread$1({}, _findDataObj); | ||
} | ||
break; | ||
case componentTypes.multiDropdownRange: | ||
case componentTypes.multiRange: | ||
transformedValue = []; // array of objects | ||
if (Array.isArray(value)) { | ||
value.forEach(function (valObj) { | ||
if (_typeof(valObj) === 'object' && typeof valObj.start === 'number' && typeof valObj.end === 'number') { | ||
var _findDataObj2 = _objectSpread$1({}, valObj); | ||
if (!_findDataObj2.label) { | ||
_findDataObj2 = data.find(function (item) { | ||
return item.start === valObj.start && item.end === valObj.end; | ||
}); | ||
} | ||
transformedValue.push(_findDataObj2); | ||
} else if (typeof valObj === 'string') { | ||
var _findDataObj3 = data.find(function (item) { | ||
return item.label.trim() === valObj.trim(); | ||
}); | ||
transformedValue.push(_findDataObj3); | ||
} | ||
}); | ||
} else if (typeof value === 'string') { | ||
var _findDataObj4 = data.find(function (item) { | ||
return item.label.trim() === value.trim(); | ||
}); | ||
transformedValue.push(_findDataObj4); | ||
} | ||
break; | ||
case componentTypes.rangeSlider: | ||
case componentTypes.ratingsFilter: | ||
case componentTypes.dynamicRangeSlider: | ||
case componentTypes.reactiveChart: | ||
transformedValue = []; | ||
if (queryFormat) { | ||
if (Array.isArray(value)) { | ||
transformedValue = value.map(function (item) { | ||
return formatDate(dayjs(item), componentProps); | ||
}); | ||
} else if (_typeof(value) === 'object') { | ||
transformedValue = [formatDate(dayjs(value.start), componentProps), formatDate(dayjs(value.end), componentProps)]; | ||
} | ||
} else if (Array.isArray(value)) { | ||
transformedValue = _toConsumableArray(value); | ||
} else if (_typeof(value) === 'object') { | ||
transformedValue = [value.start, value.end]; | ||
} else { | ||
transformedValue = value; | ||
} | ||
break; | ||
case componentTypes.numberBox: | ||
transformedValue = []; | ||
if (!Array.isArray(value) && _typeof(value) === 'object') { | ||
transformedValue = value.start; | ||
} else if (typeof value === 'number') { | ||
transformedValue = value; | ||
} | ||
break; | ||
case componentTypes.datePicker: | ||
transformedValue = ''; | ||
if (_typeof(value) !== 'object') { | ||
transformedValue = dayjs(value).format('YYYY-MM-DD'); | ||
} else if (value.end) { | ||
transformedValue = dayjs(value.end).format('YYYY-MM-DD'); | ||
} else if (value.start) { | ||
transformedValue = dayjs(value.start).add(24, 'hour').format('YYYY-MM-DD'); | ||
} | ||
break; | ||
case componentTypes.dateRange: | ||
transformedValue = []; // array of strings | ||
if (Array.isArray(value)) { | ||
transformedValue = value.map(function (t) { | ||
return dayjs(t).format('YYYY-MM-DD'); | ||
}); | ||
} else if (_typeof(value) === 'object') { | ||
transformedValue = [dayjs(value.start).format('YYYY-MM-DD'), dayjs(value.end).format('YYYY-MM-DD')]; | ||
} | ||
break; | ||
case componentTypes.categorySearch: | ||
transformedValue = ''; | ||
if (_typeof(value) === 'object') { | ||
transformedValue = value.value; | ||
if (value.category !== undefined) { | ||
meta.category = value.category; | ||
} | ||
} else if (typeof value === 'string') { | ||
transformedValue = value; | ||
} | ||
break; | ||
} | ||
} | ||
return { | ||
value: transformedValue, | ||
meta: meta | ||
}; | ||
}; | ||
function updateAggs(component, aggregations) { | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
return { | ||
type: UPDATE_AGGS, | ||
component: component, | ||
aggregations: aggregations, | ||
append: append | ||
}; | ||
} | ||
function updateCompositeAggs(component, aggregations) { | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
return { | ||
type: UPDATE_COMPOSITE_AGGS, | ||
component: component, | ||
aggregations: aggregations, | ||
append: append | ||
}; | ||
} | ||
function updateHits(component, hits, time, hidden) { | ||
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; | ||
return { | ||
type: UPDATE_HITS, | ||
component: component, | ||
hits: hits.hits, | ||
// make compatible with es7 | ||
total: _typeof(hits.total) === 'object' ? hits.total.value : hits.total, | ||
hidden: hidden, | ||
time: time, | ||
append: append | ||
}; | ||
} | ||
function updateStoreConfig(payload) { | ||
return function (dispatch) { | ||
dispatch({ | ||
type: UPDATE_CONFIG, | ||
config: payload | ||
}); | ||
}; | ||
} | ||
function setValues(componentsValues) { | ||
return function (dispatch) { | ||
dispatch(updateStoreConfig({ | ||
queryLockConfig: { | ||
initialTimestamp: new Date().getTime(), | ||
lockTime: 300 | ||
} | ||
})); | ||
dispatch({ | ||
type: SET_VALUES, | ||
componentsValues: componentsValues | ||
}); | ||
}; | ||
} | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function setRawData(component, response) { | ||
return { | ||
type: SET_RAW_DATA, | ||
component: component, | ||
response: response | ||
}; | ||
} | ||
function setLoading(component, isLoading) { | ||
return { | ||
type: SET_LOADING, | ||
component: component, | ||
isLoading: isLoading | ||
}; | ||
} | ||
function setError(component, error) { | ||
return { | ||
type: SET_ERROR, | ||
component: component, | ||
error: error | ||
}; | ||
} | ||
function setTimestamp(component, timestamp) { | ||
return { | ||
type: SET_TIMESTAMP, | ||
component: component, | ||
timestamp: timestamp | ||
}; | ||
} | ||
function setSearchId() { | ||
var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
return { | ||
type: SET_SEARCH_ID, | ||
searchId: searchId | ||
}; | ||
} | ||
function setSuggestionsSearchId() { | ||
var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
return { | ||
type: SET_SUGGESTIONS_SEARCH_ID, | ||
searchId: searchId | ||
}; | ||
} | ||
function setQuery(component, query) { | ||
return { | ||
type: SET_QUERY, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
function setCustomQuery(component, query) { | ||
return { | ||
type: SET_CUSTOM_QUERY, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
function setDefaultQuery(component, query) { | ||
return { | ||
type: SET_DEFAULT_QUERY, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
function setCustomHighlightOptions(component, data) { | ||
return { | ||
type: SET_CUSTOM_HIGHLIGHT_OPTIONS, | ||
component: component, | ||
data: data | ||
}; | ||
} | ||
function updateQueryOptions(component, options) { | ||
return { | ||
type: SET_QUERY_OPTIONS, | ||
component: component, | ||
options: options | ||
}; | ||
} | ||
// gatekeeping for normal queries | ||
function logQuery(component, query) { | ||
return { | ||
type: LOG_QUERY, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
// gatekeeping for queries combined with map queries | ||
function logCombinedQuery(component, query) { | ||
return { | ||
type: LOG_COMBINED_QUERY, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
function setHeaders(headers) { | ||
return { | ||
type: SET_HEADERS, | ||
headers: headers | ||
}; | ||
} | ||
function setPromotedResults() { | ||
var results = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_PROMOTED_RESULTS, | ||
results: results, | ||
component: component | ||
}; | ||
} | ||
function setPopularSuggestions() { | ||
var suggestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_POPULAR_SUGGESTIONS, | ||
suggestions: suggestions, | ||
component: component | ||
}; | ||
} | ||
function setDefaultPopularSuggestions() { | ||
var suggestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_DEFAULT_POPULAR_SUGGESTIONS, | ||
suggestions: suggestions, | ||
component: component | ||
}; | ||
} | ||
function setCustomData() { | ||
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_CUSTOM_DATA, | ||
data: data, | ||
component: component | ||
}; | ||
} | ||
function setAppliedSettings() { | ||
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_APPLIED_SETTINGS, | ||
data: data, | ||
component: component | ||
}; | ||
} | ||
function setQueryListener(component, onQueryChange, onError) { | ||
return { | ||
type: SET_QUERY_LISTENER, | ||
component: component, | ||
onQueryChange: onQueryChange, | ||
onError: onError | ||
}; | ||
} | ||
function setGoogleMapScriptLoading(bool) { | ||
return { | ||
type: SET_GOOGLE_MAP_SCRIPT_LOADING, | ||
loading: bool | ||
}; | ||
} | ||
function setGoogleMapScriptLoaded(bool) { | ||
return { | ||
type: SET_GOOGLE_MAP_SCRIPT_LOADED, | ||
loaded: bool | ||
}; | ||
} | ||
function setGoogleMapScriptError(error) { | ||
return { | ||
type: SET_GOOGLE_MAP_SCRIPT_ERROR, | ||
error: error | ||
}; | ||
} | ||
function resetStoreForComponent(componentId) { | ||
return function (dispatch) { | ||
dispatch(setRawData(componentId, null)); | ||
dispatch(setCustomData(null, componentId)); | ||
dispatch(setPromotedResults([], componentId)); | ||
dispatch(setPopularSuggestions([], componentId)); | ||
dispatch(setDefaultPopularSuggestions([], componentId)); | ||
dispatch(updateAggs(componentId, null)); | ||
dispatch(updateCompositeAggs(componentId, {})); | ||
dispatch(updateHits(componentId, { | ||
hits: [], | ||
total: 0 | ||
}, 0)); | ||
}; | ||
} | ||
function setLastUsedAppbaseQuery(query) { | ||
return { | ||
type: SET_APPBASE_QUERY, | ||
query: query | ||
}; | ||
} | ||
function setSearchState() { | ||
var componentsValueAndTypeMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return function (dispatch) { | ||
var componentValues = {}; | ||
Object.keys(componentsValueAndTypeMap).forEach(function (componentId) { | ||
var _componentsValueAndTy = componentsValueAndTypeMap[componentId], | ||
value = _componentsValueAndTy.value, | ||
componentProps = _componentsValueAndTy.componentProps; | ||
var _transformValueToComp = transformValueToComponentStateFormat(value, componentProps), | ||
transformedValue = _transformValueToComp.value, | ||
_transformValueToComp2 = _transformValueToComp.meta, | ||
meta = _transformValueToComp2 === void 0 ? {} : _transformValueToComp2; | ||
componentValues[componentId] = _objectSpread({ | ||
value: transformedValue | ||
}, meta); | ||
}); | ||
dispatch(setValues(componentValues)); | ||
}; | ||
} | ||
exports.logCombinedQuery = logCombinedQuery; | ||
exports.logQuery = logQuery; | ||
exports.resetStoreForComponent = resetStoreForComponent; | ||
exports.setAppliedSettings = setAppliedSettings; | ||
exports.setCustomData = setCustomData; | ||
exports.setCustomHighlightOptions = setCustomHighlightOptions; | ||
exports.setCustomQuery = setCustomQuery; | ||
exports.setDefaultPopularSuggestions = setDefaultPopularSuggestions; | ||
exports.setDefaultQuery = setDefaultQuery; | ||
exports.setError = setError; | ||
exports.setGoogleMapScriptError = setGoogleMapScriptError; | ||
exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded; | ||
exports.setGoogleMapScriptLoading = setGoogleMapScriptLoading; | ||
exports.setHeaders = setHeaders; | ||
exports.setLastUsedAppbaseQuery = setLastUsedAppbaseQuery; | ||
exports.setLoading = setLoading; | ||
exports.setPopularSuggestions = setPopularSuggestions; | ||
exports.setPromotedResults = setPromotedResults; | ||
exports.setQuery = setQuery; | ||
exports.setQueryListener = setQueryListener; | ||
exports.setRawData = setRawData; | ||
exports.setSearchId = setSearchId; | ||
exports.setSearchState = setSearchState; | ||
exports.setSuggestionsSearchId = setSuggestionsSearchId; | ||
exports.setTimestamp = setTimestamp; | ||
exports.updateQueryOptions = updateQueryOptions; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setRawData=setRawData;exports.setLoading=setLoading;exports.setError=setError;exports.setTimestamp=setTimestamp;exports.setSearchId=setSearchId;exports.setSuggestionsSearchId=setSuggestionsSearchId;exports.setQuery=setQuery;exports.setCustomQuery=setCustomQuery;exports.setDefaultQuery=setDefaultQuery;exports.setCustomHighlightOptions=setCustomHighlightOptions;exports.updateQueryOptions=updateQueryOptions;exports.logQuery=logQuery;exports.logCombinedQuery=logCombinedQuery;exports.setHeaders=setHeaders;exports.setPromotedResults=setPromotedResults;exports.setPopularSuggestions=setPopularSuggestions;exports.setDefaultPopularSuggestions=setDefaultPopularSuggestions;exports.setCustomData=setCustomData;exports.setAppliedSettings=setAppliedSettings;exports.setQueryListener=setQueryListener;exports.setGoogleMapScriptLoading=setGoogleMapScriptLoading;exports.setGoogleMapScriptLoaded=setGoogleMapScriptLoaded;exports.setGoogleMapScriptError=setGoogleMapScriptError;exports.resetStoreForComponent=resetStoreForComponent;exports.setLastUsedAppbaseQuery=setLastUsedAppbaseQuery;exports.setSearchState=setSearchState;exports.setAIResponse=setAIResponse;exports.setAIResponseDelayed=setAIResponseDelayed;exports.removeAIResponse=removeAIResponse;exports.setAIResponseError=setAIResponseError;exports.setAIResponseLoading=setAIResponseLoading;var _constants=require('../constants');var _transform=require('../utils/transform');var _hits=require('./hits');var _value=require('./value');function setRawData(component,response){return{type:_constants.SET_RAW_DATA,component:component,response:response};}function setLoading(component,isLoading){return{type:_constants.SET_LOADING,component:component,isLoading:isLoading};}function setError(component,error){return{type:_constants.SET_ERROR,component:component,error:error};}function setTimestamp(component,timestamp){return{type:_constants.SET_TIMESTAMP,component:component,timestamp:timestamp};}function setSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SEARCH_ID,searchId:searchId};}function setSuggestionsSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SUGGESTIONS_SEARCH_ID,searchId:searchId};}function setQuery(component,query){return{type:_constants.SET_QUERY,component:component,query:query};}function setCustomQuery(component,query){return{type:_constants.SET_CUSTOM_QUERY,component:component,query:query};}function setDefaultQuery(component,query){return{type:_constants.SET_DEFAULT_QUERY,component:component,query:query};}function setCustomHighlightOptions(component,data){return{type:_constants.SET_CUSTOM_HIGHLIGHT_OPTIONS,component:component,data:data};}function updateQueryOptions(component,options){return{type:_constants.SET_QUERY_OPTIONS,component:component,options:options};}function logQuery(component,query){return{type:_constants.LOG_QUERY,component:component,query:query};}function logCombinedQuery(component,query){return{type:_constants.LOG_COMBINED_QUERY,component:component,query:query};}function setHeaders(headers){return{type:_constants.SET_HEADERS,headers:headers};}function setPromotedResults(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var component=arguments[1];return{type:_constants.SET_PROMOTED_RESULTS,results:results,component:component};}function setPopularSuggestions(){var suggestions=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var component=arguments[1];return{type:_constants.SET_POPULAR_SUGGESTIONS,suggestions:suggestions,component:component};}function setDefaultPopularSuggestions(){var suggestions=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var component=arguments[1];return{type:_constants.SET_DEFAULT_POPULAR_SUGGESTIONS,suggestions:suggestions,component:component};}function setCustomData(){var data=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var component=arguments[1];return{type:_constants.SET_CUSTOM_DATA,data:data,component:component};}function setAppliedSettings(){var data=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var component=arguments[1];return{type:_constants.SET_APPLIED_SETTINGS,data:data,component:component};}function setQueryListener(component,onQueryChange,onError){return{type:_constants.SET_QUERY_LISTENER,component:component,onQueryChange:onQueryChange,onError:onError};}function setGoogleMapScriptLoading(bool){return{type:_constants.SET_GOOGLE_MAP_SCRIPT_LOADING,loading:bool};}function setGoogleMapScriptLoaded(bool){return{type:_constants.SET_GOOGLE_MAP_SCRIPT_LOADED,loaded:bool};}function setGoogleMapScriptError(error){return{type:_constants.SET_GOOGLE_MAP_SCRIPT_ERROR,error:error};}function resetStoreForComponent(componentId){return function(dispatch){dispatch(setRawData(componentId,null));dispatch(setCustomData(null,componentId));dispatch(setPromotedResults([],componentId));dispatch(setPopularSuggestions([],componentId));dispatch(setDefaultPopularSuggestions([],componentId));dispatch((0,_hits.updateAggs)(componentId,null));dispatch((0,_hits.updateCompositeAggs)(componentId,{}));dispatch((0,_hits.updateHits)(componentId,{hits:[],total:0},0));};}function setLastUsedAppbaseQuery(query){return{type:_constants.SET_APPBASE_QUERY,query:query};}function setSearchState(){var componentsValueAndTypeMap=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){var componentValues={};Object.keys(componentsValueAndTypeMap).forEach(function(componentId){var _componentsValueAndTy=componentsValueAndTypeMap[componentId],value=_componentsValueAndTy.value,componentProps=_componentsValueAndTy.componentProps;var _transformValueToComp=(0,_transform.transformValueToComponentStateFormat)(value,componentProps),transformedValue=_transformValueToComp.value,_transformValueToComp2=_transformValueToComp.meta,meta=_transformValueToComp2===undefined?{}:_transformValueToComp2;componentValues[componentId]=_extends({value:transformedValue},meta);});dispatch((0,_value.setValues)(componentValues));};}function setAIResponse(component,payload){return{type:_constants.SET_AI_RESPONSE,component:component,payload:payload};}function setAIResponseDelayed(component,payload){return{type:_constants.SET_AI_RESPONSE_DELAYED,component:component,payload:payload};}function removeAIResponse(component){return{type:_constants.REMOVE_AI_RESPONSE,component:component};}function setAIResponseError(component,error){var meta=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return{type:_constants.SET_AI_RESPONSE_ERROR,component:component,error:error,meta:meta};}function setAIResponseLoading(component,isLoading){return{type:_constants.SET_AI_RESPONSE_LOADING,component:component,isLoading:isLoading};} |
@@ -1,124 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_PROPS = 'SET_PROPS'; | ||
var UPDATE_PROPS = 'UPDATE_PROPS'; | ||
var REMOVE_PROPS = 'REMOVE_PROPS'; | ||
var validProps = [ | ||
// common | ||
'type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', | ||
// Specific to ReactiveList | ||
'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', | ||
// Specific to DataSearch | ||
'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', | ||
// Specific to Category Search | ||
'categoryField', 'strictSelection', | ||
// Specific to List Components | ||
'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', | ||
// TagCloud and ToggleButton | ||
'multiSelect', | ||
// Range Components | ||
'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', | ||
// Map components | ||
'unit', | ||
// Specific to searchBox | ||
'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions']; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
var getfilteredOptions = function getfilteredOptions() { | ||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var filteredOptions = {}; | ||
Object.keys(options).forEach(function (option) { | ||
if (validProps.includes(option)) { | ||
filteredOptions[option] = options[option]; | ||
} | ||
}); | ||
return filteredOptions; | ||
}; | ||
/** | ||
* Sets the external props for a component | ||
* @param {String} component | ||
* @param {Object} options | ||
*/ | ||
function setComponentProps(component, options, componentType) { | ||
return { | ||
type: SET_PROPS, | ||
component: component, | ||
options: getfilteredOptions(_objectSpread(_objectSpread({}, options), {}, { | ||
componentType: componentType | ||
})) | ||
}; | ||
} | ||
/** | ||
* Updates the external props for a component, overrides the duplicates | ||
* @param {String} component | ||
* @param {Object} options | ||
*/ | ||
function updateComponentProps(component, options, componentType) { | ||
return { | ||
type: UPDATE_PROPS, | ||
component: component, | ||
options: getfilteredOptions(_objectSpread(_objectSpread({}, options), {}, { | ||
componentType: componentType | ||
})) | ||
}; | ||
} | ||
/** | ||
* Remove the external props for a component | ||
* @param {String} component | ||
* @param {Object} options | ||
*/ | ||
function removeComponentProps(component) { | ||
return { | ||
type: REMOVE_PROPS, | ||
component: component | ||
}; | ||
} | ||
exports.removeComponentProps = removeComponentProps; | ||
exports.setComponentProps = setComponentProps; | ||
exports.updateComponentProps = updateComponentProps; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setComponentProps=setComponentProps;exports.updateComponentProps=updateComponentProps;exports.removeComponentProps=removeComponentProps;var _constants=require('../constants');var _constants2=require('../utils/constants');var getfilteredOptions=function getfilteredOptions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var filteredOptions={};Object.keys(options).forEach(function(option){if(_constants2.validProps.includes(option)){filteredOptions[option]=options[option];}});return filteredOptions;};function setComponentProps(component,options,componentType){return{type:_constants.SET_PROPS,component:component,options:getfilteredOptions(_extends({},options,{componentType:componentType}))};}function updateComponentProps(component,options,componentType){return{type:_constants.UPDATE_PROPS,component:component,options:getfilteredOptions(_extends({},options,{componentType:componentType}))};}function removeComponentProps(component){return{type:_constants.REMOVE_PROPS,component:component};} |
@@ -1,783 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_APPBASE_QUERY = 'SET_APPBASE_QUERY'; | ||
var UPDATE_HITS = 'UPDATE_HITS'; | ||
var UPDATE_AGGS = 'UPDATE_AGGS'; | ||
var UPDATE_COMPOSITE_AGGS = 'UPDATE_COMPOSITE_AGGS'; | ||
var UPDATE_CONFIG = 'UPDATE_CONFIG'; | ||
var SET_LOADING = 'SET_LOADING'; | ||
var SET_ERROR = 'SET_ERROR'; | ||
var SET_TIMESTAMP = 'SET_TIMESTAMP'; | ||
var SET_SEARCH_ID = 'SET_SEARCH_ID'; | ||
var SET_PROMOTED_RESULTS = 'SET_PROMOTED_RESULTS'; | ||
var SET_CUSTOM_DATA = 'SET_CUSTOM_DATA'; | ||
var SET_APPLIED_SETTINGS = 'SET_APPLIED_SETTINGS'; | ||
var SET_SUGGESTIONS_SEARCH_ID = 'SET_SUGGESTIONS_SEARCH_ID'; | ||
var SET_RAW_DATA = 'SET_RAW_DATA'; | ||
var SET_QUERY_TO_HITS = 'SET_QUERY_TO_HITS'; | ||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
var dayjs_min = {exports: {}}; | ||
(function (module, exports) { | ||
!function (t, e) { | ||
module.exports = e() ; | ||
}(commonjsGlobal, function () { | ||
var t = 1e3, | ||
e = 6e4, | ||
n = 36e5, | ||
r = "millisecond", | ||
i = "second", | ||
s = "minute", | ||
u = "hour", | ||
a = "day", | ||
o = "week", | ||
f = "month", | ||
h = "quarter", | ||
c = "year", | ||
d = "date", | ||
l = "Invalid Date", | ||
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, | ||
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, | ||
M = { | ||
name: "en", | ||
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), | ||
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), | ||
ordinal: function ordinal(t) { | ||
var e = ["th", "st", "nd", "rd"], | ||
n = t % 100; | ||
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; | ||
} | ||
}, | ||
m = function m(t, e, n) { | ||
var r = String(t); | ||
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; | ||
}, | ||
v = { | ||
s: m, | ||
z: function z(t) { | ||
var e = -t.utcOffset(), | ||
n = Math.abs(e), | ||
r = Math.floor(n / 60), | ||
i = n % 60; | ||
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); | ||
}, | ||
m: function t(e, n) { | ||
if (e.date() < n.date()) return -t(n, e); | ||
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), | ||
i = e.clone().add(r, f), | ||
s = n - i < 0, | ||
u = e.clone().add(r + (s ? -1 : 1), f); | ||
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); | ||
}, | ||
a: function a(t) { | ||
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); | ||
}, | ||
p: function p(t) { | ||
return { | ||
M: f, | ||
y: c, | ||
w: o, | ||
d: a, | ||
D: d, | ||
h: u, | ||
m: s, | ||
s: i, | ||
ms: r, | ||
Q: h | ||
}[t] || String(t || "").toLowerCase().replace(/s$/, ""); | ||
}, | ||
u: function u(t) { | ||
return void 0 === t; | ||
} | ||
}, | ||
g = "en", | ||
D = {}; | ||
D[g] = M; | ||
var p = function p(t) { | ||
return t instanceof _; | ||
}, | ||
S = function t(e, n, r) { | ||
var i; | ||
if (!e) return g; | ||
if ("string" == typeof e) { | ||
var s = e.toLowerCase(); | ||
D[s] && (i = s), n && (D[s] = n, i = s); | ||
var u = e.split("-"); | ||
if (!i && u.length > 1) return t(u[0]); | ||
} else { | ||
var a = e.name; | ||
D[a] = e, i = a; | ||
} | ||
return !r && i && (g = i), i || !r && g; | ||
}, | ||
w = function w(t, e) { | ||
if (p(t)) return t.clone(); | ||
var n = "object" == _typeof(e) ? e : {}; | ||
return n.date = t, n.args = arguments, new _(n); | ||
}, | ||
O = v; | ||
O.l = S, O.i = p, O.w = function (t, e) { | ||
return w(t, { | ||
locale: e.$L, | ||
utc: e.$u, | ||
x: e.$x, | ||
$offset: e.$offset | ||
}); | ||
}; | ||
var _ = function () { | ||
function M(t) { | ||
this.$L = S(t.locale, null, !0), this.parse(t); | ||
} | ||
var m = M.prototype; | ||
return m.parse = function (t) { | ||
this.$d = function (t) { | ||
var e = t.date, | ||
n = t.utc; | ||
if (null === e) return new Date(NaN); | ||
if (O.u(e)) return new Date(); | ||
if (e instanceof Date) return new Date(e); | ||
if ("string" == typeof e && !/Z$/i.test(e)) { | ||
var r = e.match($); | ||
if (r) { | ||
var i = r[2] - 1 || 0, | ||
s = (r[7] || "0").substring(0, 3); | ||
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); | ||
} | ||
} | ||
return new Date(e); | ||
}(t), this.$x = t.x || {}, this.init(); | ||
}, m.init = function () { | ||
var t = this.$d; | ||
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); | ||
}, m.$utils = function () { | ||
return O; | ||
}, m.isValid = function () { | ||
return !(this.$d.toString() === l); | ||
}, m.isSame = function (t, e) { | ||
var n = w(t); | ||
return this.startOf(e) <= n && n <= this.endOf(e); | ||
}, m.isAfter = function (t, e) { | ||
return w(t) < this.startOf(e); | ||
}, m.isBefore = function (t, e) { | ||
return this.endOf(e) < w(t); | ||
}, m.$g = function (t, e, n) { | ||
return O.u(t) ? this[e] : this.set(n, t); | ||
}, m.unix = function () { | ||
return Math.floor(this.valueOf() / 1e3); | ||
}, m.valueOf = function () { | ||
return this.$d.getTime(); | ||
}, m.startOf = function (t, e) { | ||
var n = this, | ||
r = !!O.u(e) || e, | ||
h = O.p(t), | ||
l = function l(t, e) { | ||
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); | ||
return r ? i : i.endOf(a); | ||
}, | ||
$ = function $(t, e) { | ||
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); | ||
}, | ||
y = this.$W, | ||
M = this.$M, | ||
m = this.$D, | ||
v = "set" + (this.$u ? "UTC" : ""); | ||
switch (h) { | ||
case c: | ||
return r ? l(1, 0) : l(31, 11); | ||
case f: | ||
return r ? l(1, M) : l(0, M + 1); | ||
case o: | ||
var g = this.$locale().weekStart || 0, | ||
D = (y < g ? y + 7 : y) - g; | ||
return l(r ? m - D : m + (6 - D), M); | ||
case a: | ||
case d: | ||
return $(v + "Hours", 0); | ||
case u: | ||
return $(v + "Minutes", 1); | ||
case s: | ||
return $(v + "Seconds", 2); | ||
case i: | ||
return $(v + "Milliseconds", 3); | ||
default: | ||
return this.clone(); | ||
} | ||
}, m.endOf = function (t) { | ||
return this.startOf(t, !1); | ||
}, m.$set = function (t, e) { | ||
var n, | ||
o = O.p(t), | ||
h = "set" + (this.$u ? "UTC" : ""), | ||
l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], | ||
$ = o === a ? this.$D + (e - this.$W) : e; | ||
if (o === f || o === c) { | ||
var y = this.clone().set(d, 1); | ||
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; | ||
} else l && this.$d[l]($); | ||
return this.init(), this; | ||
}, m.set = function (t, e) { | ||
return this.clone().$set(t, e); | ||
}, m.get = function (t) { | ||
return this[O.p(t)](); | ||
}, m.add = function (r, h) { | ||
var d, | ||
l = this; | ||
r = Number(r); | ||
var $ = O.p(h), | ||
y = function y(t) { | ||
var e = w(l); | ||
return O.w(e.date(e.date() + Math.round(t * r)), l); | ||
}; | ||
if ($ === f) return this.set(f, this.$M + r); | ||
if ($ === c) return this.set(c, this.$y + r); | ||
if ($ === a) return y(1); | ||
if ($ === o) return y(7); | ||
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, | ||
m = this.$d.getTime() + r * M; | ||
return O.w(m, this); | ||
}, m.subtract = function (t, e) { | ||
return this.add(-1 * t, e); | ||
}, m.format = function (t) { | ||
var e = this, | ||
n = this.$locale(); | ||
if (!this.isValid()) return n.invalidDate || l; | ||
var r = t || "YYYY-MM-DDTHH:mm:ssZ", | ||
i = O.z(this), | ||
s = this.$H, | ||
u = this.$m, | ||
a = this.$M, | ||
o = n.weekdays, | ||
f = n.months, | ||
h = function h(t, n, i, s) { | ||
return t && (t[n] || t(e, r)) || i[n].slice(0, s); | ||
}, | ||
c = function c(t) { | ||
return O.s(s % 12 || 12, t, "0"); | ||
}, | ||
d = n.meridiem || function (t, e, n) { | ||
var r = t < 12 ? "AM" : "PM"; | ||
return n ? r.toLowerCase() : r; | ||
}, | ||
$ = { | ||
YY: String(this.$y).slice(-2), | ||
YYYY: this.$y, | ||
M: a + 1, | ||
MM: O.s(a + 1, 2, "0"), | ||
MMM: h(n.monthsShort, a, f, 3), | ||
MMMM: h(f, a), | ||
D: this.$D, | ||
DD: O.s(this.$D, 2, "0"), | ||
d: String(this.$W), | ||
dd: h(n.weekdaysMin, this.$W, o, 2), | ||
ddd: h(n.weekdaysShort, this.$W, o, 3), | ||
dddd: o[this.$W], | ||
H: String(s), | ||
HH: O.s(s, 2, "0"), | ||
h: c(1), | ||
hh: c(2), | ||
a: d(s, u, !0), | ||
A: d(s, u, !1), | ||
m: String(u), | ||
mm: O.s(u, 2, "0"), | ||
s: String(this.$s), | ||
ss: O.s(this.$s, 2, "0"), | ||
SSS: O.s(this.$ms, 3, "0"), | ||
Z: i | ||
}; | ||
return r.replace(y, function (t, e) { | ||
return e || $[t] || i.replace(":", ""); | ||
}); | ||
}, m.utcOffset = function () { | ||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); | ||
}, m.diff = function (r, d, l) { | ||
var $, | ||
y = O.p(d), | ||
M = w(r), | ||
m = (M.utcOffset() - this.utcOffset()) * e, | ||
v = this - M, | ||
g = O.m(this, M); | ||
return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g); | ||
}, m.daysInMonth = function () { | ||
return this.endOf(f).$D; | ||
}, m.$locale = function () { | ||
return D[this.$L]; | ||
}, m.locale = function (t, e) { | ||
if (!t) return this.$L; | ||
var n = this.clone(), | ||
r = S(t, e, !0); | ||
return r && (n.$L = r), n; | ||
}, m.clone = function () { | ||
return O.w(this.$d, this); | ||
}, m.toDate = function () { | ||
return new Date(this.valueOf()); | ||
}, m.toJSON = function () { | ||
return this.isValid() ? this.toISOString() : null; | ||
}, m.toISOString = function () { | ||
return this.$d.toISOString(); | ||
}, m.toString = function () { | ||
return this.$d.toUTCString(); | ||
}, M; | ||
}(), | ||
T = _.prototype; | ||
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { | ||
T[t[1]] = function (e) { | ||
return this.$g(e, t[0], t[1]); | ||
}; | ||
}), w.extend = function (t, e) { | ||
return t.$i || (t(e, _, w), t.$i = !0), w; | ||
}, w.locale = S, w.isDayjs = p, w.unix = function (t) { | ||
return w(1e3 * t); | ||
}, w.en = D[g], w.Ls = D, w.p = {}, w; | ||
}); | ||
})(dayjs_min); | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var queryTypes = { | ||
search: 'search', | ||
term: 'term', | ||
range: 'range', | ||
geo: 'geo', | ||
suggestion: 'suggestion' | ||
}; | ||
var _componentTypeToDefau; | ||
(_componentTypeToDefau = {}, _defineProperty(_componentTypeToDefau, componentTypes.singleList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiList, []), _defineProperty(_componentTypeToDefau, componentTypes.singleDataList, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDataList, []), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownList, []), _defineProperty(_componentTypeToDefau, componentTypes.tagCloud, ''), _defineProperty(_componentTypeToDefau, componentTypes.toggleButton, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownRange, []), _defineProperty(_componentTypeToDefau, componentTypes.singleRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiRange, []), _componentTypeToDefau); | ||
var _componentToTypeMap; | ||
(_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, componentTypes.reactiveList, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.dataSearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.categorySearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.searchBox, queryTypes.suggestion), _defineProperty(_componentToTypeMap, componentTypes.singleList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.tagCloud, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.toggleButton, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.reactiveChart, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.treeList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.numberBox, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.datePicker, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dateRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dynamicRangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.ratingsFilter, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeInput, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceDropdown, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceSlider, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.reactiveMap, queryTypes.geo), _componentToTypeMap); | ||
var getInternalComponentID = function getInternalComponentID() { | ||
var componentID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return "".concat(componentID, "__internal"); | ||
}; | ||
function updateAggs(component, aggregations) { | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
return { | ||
type: UPDATE_AGGS, | ||
component: component, | ||
aggregations: aggregations, | ||
append: append | ||
}; | ||
} | ||
function updateCompositeAggs(component, aggregations) { | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
return { | ||
type: UPDATE_COMPOSITE_AGGS, | ||
component: component, | ||
aggregations: aggregations, | ||
append: append | ||
}; | ||
} | ||
function updateHits(component, hits, time, hidden) { | ||
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; | ||
return { | ||
type: UPDATE_HITS, | ||
component: component, | ||
hits: hits.hits, | ||
// make compatible with es7 | ||
total: _typeof(hits.total) === 'object' ? hits.total.value : hits.total, | ||
hidden: hidden, | ||
time: time, | ||
append: append | ||
}; | ||
} | ||
function saveQueryToHits(component, query) { | ||
return { | ||
type: SET_QUERY_TO_HITS, | ||
component: component, | ||
query: query | ||
}; | ||
} | ||
function setRawData(component, response) { | ||
return { | ||
type: SET_RAW_DATA, | ||
component: component, | ||
response: response | ||
}; | ||
} | ||
function setLoading(component, isLoading) { | ||
return { | ||
type: SET_LOADING, | ||
component: component, | ||
isLoading: isLoading | ||
}; | ||
} | ||
function setError(component, error) { | ||
return { | ||
type: SET_ERROR, | ||
component: component, | ||
error: error | ||
}; | ||
} | ||
function setTimestamp(component, timestamp) { | ||
return { | ||
type: SET_TIMESTAMP, | ||
component: component, | ||
timestamp: timestamp | ||
}; | ||
} | ||
function setSearchId() { | ||
var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
return { | ||
type: SET_SEARCH_ID, | ||
searchId: searchId | ||
}; | ||
} | ||
function setSuggestionsSearchId() { | ||
var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
return { | ||
type: SET_SUGGESTIONS_SEARCH_ID, | ||
searchId: searchId | ||
}; | ||
} | ||
function setPromotedResults() { | ||
var results = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_PROMOTED_RESULTS, | ||
results: results, | ||
component: component | ||
}; | ||
} | ||
function setCustomData() { | ||
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_CUSTOM_DATA, | ||
data: data, | ||
component: component | ||
}; | ||
} | ||
function setAppliedSettings() { | ||
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var component = arguments.length > 1 ? arguments[1] : undefined; | ||
return { | ||
type: SET_APPLIED_SETTINGS, | ||
data: data, | ||
component: component | ||
}; | ||
} | ||
function setLastUsedAppbaseQuery(query) { | ||
return { | ||
type: SET_APPBASE_QUERY, | ||
query: query | ||
}; | ||
} | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
var handleTransformResponse = function handleTransformResponse() { | ||
var res = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var component = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; | ||
if (config.transformResponse && typeof config.transformResponse === 'function') { | ||
return config.transformResponse(res, component); | ||
} | ||
return new Promise(function (resolve) { | ||
return resolve(res); | ||
}); | ||
}; | ||
// Checks if a component is active or not at a particular time | ||
var isComponentActive = function isComponentActive() { | ||
var getState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; | ||
var componentId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
var _getState = getState(), | ||
components = _getState.components; | ||
if (components.includes(componentId)) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
var getQuerySuggestionsId = function getQuerySuggestionsId() { | ||
var componentId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return "".concat(componentId, "__suggestions"); | ||
}; | ||
var handleError = function handleError() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$orderOfQueries = _ref.orderOfQueries, | ||
orderOfQueries = _ref$orderOfQueries === void 0 ? [] : _ref$orderOfQueries, | ||
_ref$error = _ref.error, | ||
error = _ref$error === void 0 ? null : _ref$error; | ||
var getState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; | ||
var dispatch = arguments.length > 2 ? arguments[2] : undefined; | ||
var _getState2 = getState(), | ||
queryListener = _getState2.queryListener; | ||
try { | ||
console.error(JSON.stringify(error)); | ||
} catch (e) { | ||
console.error(error); | ||
} | ||
orderOfQueries.forEach(function (component) { | ||
if (isComponentActive(getState, component)) { | ||
// Only update state for active components | ||
if (queryListener[component] && queryListener[component].onError) { | ||
queryListener[component].onError(error); | ||
} | ||
dispatch(setError(component, error)); | ||
dispatch(setLoading(component, false)); | ||
} | ||
}); | ||
}; | ||
var handleResponse = function handleResponse() { | ||
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
res = _ref2.res, | ||
_ref2$orderOfQueries = _ref2.orderOfQueries, | ||
orderOfQueries = _ref2$orderOfQueries === void 0 ? [] : _ref2$orderOfQueries, | ||
_ref2$appendToHits = _ref2.appendToHits, | ||
appendToHits = _ref2$appendToHits === void 0 ? false : _ref2$appendToHits, | ||
_ref2$appendToAggs = _ref2.appendToAggs, | ||
appendToAggs = _ref2$appendToAggs === void 0 ? false : _ref2$appendToAggs, | ||
_ref2$isSuggestionsQu = _ref2.isSuggestionsQuery, | ||
isSuggestionsQuery = _ref2$isSuggestionsQu === void 0 ? false : _ref2$isSuggestionsQu, | ||
query = _ref2.query, | ||
queryId = _ref2.queryId; | ||
var getState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; | ||
var dispatch = arguments.length > 2 ? arguments[2] : undefined; | ||
var _getState3 = getState(), | ||
config = _getState3.config, | ||
internalValues = _getState3.internalValues, | ||
lastUsedAppbaseQuery = _getState3.lastUsedAppbaseQuery, | ||
analyticsRef = _getState3.analyticsRef; | ||
var searchId = res._headers ? res._headers.get('X-Search-Id') : null; | ||
if (searchId) { | ||
if (isSuggestionsQuery) { | ||
// set suggestions search id for internal request of search components | ||
dispatch(setSuggestionsSearchId(searchId)); | ||
} else { | ||
// if search id was updated set it in store | ||
dispatch(setSearchId(searchId)); | ||
if (analyticsRef) { | ||
analyticsRef.queryID = searchId; | ||
} | ||
} | ||
} | ||
// handle promoted results | ||
orderOfQueries.forEach(function (component) { | ||
// Only update state for active components | ||
if (isComponentActive(getState, component)) { | ||
// Avoid settings stale results | ||
if (lastUsedAppbaseQuery[component] && lastUsedAppbaseQuery[component].queryId && queryId && lastUsedAppbaseQuery[component].queryId !== queryId) { | ||
return; | ||
} | ||
// Update applied settings | ||
if (res.settings) { | ||
dispatch(setAppliedSettings(res.settings, component)); | ||
} | ||
handleTransformResponse(res[component], config, component).then(function (response) { | ||
if (response) { | ||
var _getState4 = getState(), | ||
timestamp = _getState4.timestamp, | ||
props = _getState4.props; | ||
if (timestamp[component] === undefined || timestamp[component] < res._timestamp) { | ||
var promotedResults = response.promoted; | ||
if (promotedResults) { | ||
var parsedPromotedResults = promotedResults.map(function (promoted) { | ||
return _objectSpread(_objectSpread({}, promoted.doc), {}, { | ||
_position: promoted.position | ||
}); | ||
}); | ||
dispatch(setPromotedResults(parsedPromotedResults, component)); | ||
} else { | ||
dispatch(setPromotedResults([], component)); | ||
} | ||
// set raw response in rawData | ||
dispatch(setRawData(component, response)); | ||
// Update custom data | ||
dispatch(setCustomData(response.customData, component)); | ||
if (response.hits) { | ||
dispatch(setTimestamp(component, res._timestamp)); | ||
// store last used query for REACTIVE_LIST only | ||
if (props[component].componentType === componentTypes.reactiveList && query.find(function (queryItem) { | ||
return queryItem.id === component; | ||
}).execute) { | ||
dispatch(setLastUsedAppbaseQuery(_defineProperty({}, component, query))); | ||
} | ||
dispatch(updateHits(component, response.hits, response.took, response.hits && response.hits.hidden, appendToHits)); | ||
// get query value | ||
var internalComponentID = getInternalComponentID(component); | ||
// Store the last query value associated with `hits` | ||
if (internalValues[internalComponentID]) { | ||
dispatch(saveQueryToHits(component, internalValues[internalComponentID].value)); | ||
} | ||
} | ||
if (response.aggregations) { | ||
dispatch(updateAggs(component, response.aggregations, appendToAggs)); | ||
dispatch(updateCompositeAggs(component, response.aggregations, appendToAggs)); | ||
} | ||
} | ||
dispatch(setLoading(component, false)); | ||
} | ||
})["catch"](function (err) { | ||
handleError({ | ||
orderOfQueries: orderOfQueries, | ||
error: err | ||
}, getState, dispatch); | ||
}); | ||
} | ||
// } | ||
}); | ||
}; | ||
var isPropertyDefined = function isPropertyDefined(property) { | ||
return property !== undefined && property !== null; | ||
}; | ||
var getSuggestionQuery = function getSuggestionQuery() { | ||
var getState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; | ||
var componentId = arguments.length > 1 ? arguments[1] : undefined; | ||
var _getState5 = getState(), | ||
internalValues = _getState5.internalValues; | ||
var internalValue = internalValues[componentId]; | ||
var value = internalValue && internalValue.value || ''; | ||
return [{ | ||
id: getQuerySuggestionsId(componentId), | ||
dataField: ['key', 'key.autosuggest'], | ||
size: 5, | ||
value: value, | ||
defaultQuery: { | ||
query: { | ||
bool: { | ||
minimum_should_match: 1, | ||
should: [{ | ||
function_score: { | ||
field_value_factor: { | ||
field: 'count', | ||
modifier: 'sqrt', | ||
missing: 1 | ||
} | ||
} | ||
}, { | ||
multi_match: { | ||
fields: ['key^9', 'key.autosuggest^1', 'key.keyword^10'], | ||
fuzziness: 0, | ||
operator: 'or', | ||
query: value, | ||
type: 'best_fields' | ||
} | ||
}, { | ||
multi_match: { | ||
fields: ['key^9', 'key.autosuggest^1', 'key.keyword^10'], | ||
operator: 'or', | ||
query: value, | ||
type: 'phrase' | ||
} | ||
}, { | ||
multi_match: { | ||
fields: ['key^9'], | ||
operator: 'or', | ||
query: value, | ||
type: 'phrase_prefix' | ||
} | ||
}] | ||
} | ||
} | ||
} | ||
}]; | ||
}; | ||
function executeQueryListener(listener, oldQuery, newQuery) { | ||
if (listener && listener.onQueryChange) { | ||
listener.onQueryChange(oldQuery, newQuery); | ||
} | ||
} | ||
function updateStoreConfig(payload) { | ||
return function (dispatch) { | ||
dispatch({ | ||
type: UPDATE_CONFIG, | ||
config: payload | ||
}); | ||
}; | ||
} | ||
exports.executeQueryListener = executeQueryListener; | ||
exports.getQuerySuggestionsId = getQuerySuggestionsId; | ||
exports.getSuggestionQuery = getSuggestionQuery; | ||
exports.handleError = handleError; | ||
exports.handleResponse = handleResponse; | ||
exports.handleTransformResponse = handleTransformResponse; | ||
exports.isComponentActive = isComponentActive; | ||
exports.isPropertyDefined = isPropertyDefined; | ||
exports.updateStoreConfig = updateStoreConfig; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.getSuggestionQuery=exports.isPropertyDefined=exports.handleResponse=exports.handleError=exports.getQuerySuggestionsId=exports.isComponentActive=exports.handleTransformResponse=undefined;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.executeQueryListener=executeQueryListener;exports.updateStoreConfig=updateStoreConfig;var _misc=require('./misc');var _hits=require('./hits');var _transform=require('../../lib/utils/transform');var _constants=require('../../lib/utils/constants');var _constants2=require('../constants');var _query=require('./query');var _constants3=require('../utils/constants');var _helper=require('../utils/helper');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var handleTransformResponse=exports.handleTransformResponse=function handleTransformResponse(){var res=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var config=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var component=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';if(config.transformResponse&&typeof config.transformResponse==='function'){return config.transformResponse(res,component);}return new Promise(function(resolve){return resolve(res);});};var isComponentActive=exports.isComponentActive=function isComponentActive(){var getState=arguments.length>0&&arguments[0]!==undefined?arguments[0]:function(){};var componentId=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var _getState=getState(),components=_getState.components;if(components.includes(componentId)){return true;}return false;};var getQuerySuggestionsId=exports.getQuerySuggestionsId=function getQuerySuggestionsId(){var componentId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return componentId+'__suggestions';};var handleError=exports.handleError=function handleError(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$orderOfQueries=_ref.orderOfQueries,orderOfQueries=_ref$orderOfQueries===undefined?[]:_ref$orderOfQueries,_ref$error=_ref.error,error=_ref$error===undefined?null:_ref$error;var getState=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};var dispatch=arguments[2];var _getState2=getState(),queryListener=_getState2.queryListener;try{console.error(JSON.stringify(error));}catch(e){console.error(error);}orderOfQueries.forEach(function(component){if(isComponentActive(getState,component)){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}dispatch((0,_misc.setError)(component,error));dispatch((0,_misc.setLoading)(component,false));}});};var handleResponse=exports.handleResponse=function handleResponse(){var _ref2=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},res=_ref2.res,_ref2$orderOfQueries=_ref2.orderOfQueries,orderOfQueries=_ref2$orderOfQueries===undefined?[]:_ref2$orderOfQueries,_ref2$appendToHits=_ref2.appendToHits,appendToHits=_ref2$appendToHits===undefined?false:_ref2$appendToHits,_ref2$appendToAggs=_ref2.appendToAggs,appendToAggs=_ref2$appendToAggs===undefined?false:_ref2$appendToAggs,_ref2$isSuggestionsQu=_ref2.isSuggestionsQuery,isSuggestionsQuery=_ref2$isSuggestionsQu===undefined?false:_ref2$isSuggestionsQu,query=_ref2.query,queryId=_ref2.queryId;var getState=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};var dispatch=arguments[2];var _getState3=getState(),config=_getState3.config,internalValues=_getState3.internalValues,lastUsedAppbaseQuery=_getState3.lastUsedAppbaseQuery,analyticsRef=_getState3.analyticsRef;var searchId=res._headers?res._headers.get('X-Search-Id'):null;if(searchId){if(isSuggestionsQuery){dispatch((0,_misc.setSuggestionsSearchId)(searchId));}else{dispatch((0,_misc.setSearchId)(searchId));if(analyticsRef){analyticsRef.queryID=searchId;}}}orderOfQueries.forEach(function(component){if(isComponentActive(getState,component)){if(lastUsedAppbaseQuery[component]&&lastUsedAppbaseQuery[component].queryId&&queryId&&lastUsedAppbaseQuery[component].queryId!==queryId){return;}if(res.settings){dispatch((0,_misc.setAppliedSettings)(res.settings,component));}handleTransformResponse(res[component],config,component).then(function(response){if(response){var _getState4=getState(),timestamp=_getState4.timestamp,props=_getState4.props;if(timestamp[component]===undefined||timestamp[component]<res._timestamp){var promotedResults=response.promoted;if(promotedResults){var parsedPromotedResults=promotedResults.map(function(promoted){return _extends({},promoted.doc,{_position:promoted.position});});dispatch((0,_misc.setPromotedResults)(parsedPromotedResults,component));}else{dispatch((0,_misc.setPromotedResults)([],component));}dispatch((0,_misc.setRawData)(component,response));if(response.AISessionId){var localCache=((0,_helper.getObjectFromLocalStorage)(_constants3.AI_LOCAL_CACHE_KEY)||{})[props.componentId];if(localCache&&localCache.sessionId&&localCache.sessionId===response.AISessionId){dispatch((0,_misc.setAIResponse)(component,localCache));}else{(0,_helper.setObjectInLocalStorage)('AISessions',_defineProperty({},component,{}));dispatch((0,_query.fetchAIResponse)(response.AISessionId,component,'',{hits:response.hits||{}},props[component].componentType===_constants.componentTypes.searchBox));}}else if(response.AIAnswer){if(response.AIAnswer.error){dispatch((0,_misc.setAIResponseError)(component,{message:response.AIAnswer.error}));dispatch((0,_misc.setLoading)(component,false));return;}var input=response.AIAnswer;var finalResponse={answer:{documentIds:input.documentIds,model:input.model,text:input.choices[0].message.content}};dispatch((0,_misc.setAIResponse)(component,{response:finalResponse,meta:response.hits,isTyping:false}));}dispatch((0,_misc.setCustomData)(response.customData,component));if(response.hits&&!((response.AIAnswer||response.AISessionId)&&props[component].componentType===_constants.componentTypes.searchBox)){dispatch((0,_misc.setTimestamp)(component,res._timestamp));if(props[component].componentType===_constants.componentTypes.reactiveList&&query.find(function(queryItem){return queryItem.id===component;}).execute){dispatch((0,_misc.setLastUsedAppbaseQuery)(_defineProperty({},component,query)));}dispatch((0,_hits.updateHits)(component,response.hits,response.took,response.hits&&response.hits.hidden,appendToHits));var internalComponentID=(0,_transform.getInternalComponentID)(component);if(internalValues[internalComponentID]){dispatch((0,_hits.saveQueryToHits)(component,internalValues[internalComponentID].value));}}if(response.aggregations){dispatch((0,_hits.updateAggs)(component,response.aggregations,appendToAggs));dispatch((0,_hits.updateCompositeAggs)(component,response.aggregations,appendToAggs));}}dispatch((0,_misc.setLoading)(component,false));}}).catch(function(err){handleError({orderOfQueries:orderOfQueries,error:err},getState,dispatch);});}});};var isPropertyDefined=exports.isPropertyDefined=function isPropertyDefined(property){return property!==undefined&&property!==null;};var getSuggestionQuery=exports.getSuggestionQuery=function getSuggestionQuery(){var getState=arguments.length>0&&arguments[0]!==undefined?arguments[0]:function(){};var componentId=arguments[1];var _getState5=getState(),internalValues=_getState5.internalValues;var internalValue=internalValues[componentId];var value=internalValue&&internalValue.value||'';return[{id:getQuerySuggestionsId(componentId),dataField:['key','key.autosuggest'],size:5,value:value,defaultQuery:{query:{bool:{minimum_should_match:1,should:[{function_score:{field_value_factor:{field:'count',modifier:'sqrt',missing:1}}},{multi_match:{fields:['key^9','key.autosuggest^1','key.keyword^10'],fuzziness:0,operator:'or',query:value,type:'best_fields'}},{multi_match:{fields:['key^9','key.autosuggest^1','key.keyword^10'],operator:'or',query:value,type:'phrase'}},{multi_match:{fields:['key^9'],operator:'or',query:value,type:'phrase_prefix'}}]}}}}];};function executeQueryListener(listener,oldQuery,newQuery){if(listener&&listener.onQueryChange){listener.onQueryChange(oldQuery,newQuery);}}function updateStoreConfig(payload){return function(dispatch){dispatch({type:_constants2.UPDATE_CONFIG,config:payload});};} |
@@ -1,623 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var queryTypes = { | ||
search: 'search', | ||
term: 'term', | ||
range: 'range', | ||
geo: 'geo', | ||
suggestion: 'suggestion' | ||
}; | ||
var _componentTypeToDefau; | ||
function isEqual(x, y) { | ||
if (x === y) return true; | ||
if (!(x instanceof Object) || !(y instanceof Object)) return false; | ||
if (x.constructor !== y.constructor) return false; | ||
/* eslint-disable */ | ||
for (var p in x) { | ||
if (!x.hasOwnProperty(p)) continue; | ||
if (!y.hasOwnProperty(p)) return false; | ||
if (x[p] === y[p]) continue; | ||
if (_typeof(x[p]) !== 'object') return false; | ||
if (!isEqual(x[p], y[p])) return false; | ||
} | ||
for (var _p in y) { | ||
if (y.hasOwnProperty(_p) && !x.hasOwnProperty(_p)) return false; | ||
} | ||
/* eslint-enable */ | ||
return true; | ||
} | ||
(_componentTypeToDefau = {}, _defineProperty(_componentTypeToDefau, componentTypes.singleList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiList, []), _defineProperty(_componentTypeToDefau, componentTypes.singleDataList, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDataList, []), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownList, []), _defineProperty(_componentTypeToDefau, componentTypes.tagCloud, ''), _defineProperty(_componentTypeToDefau, componentTypes.toggleButton, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownRange, []), _defineProperty(_componentTypeToDefau, componentTypes.singleRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiRange, []), _componentTypeToDefau); | ||
var UPDATE_CONFIG = 'UPDATE_CONFIG'; | ||
var SET_INTERNAL_VALUE = 'SET_INTERNAL_VALUE'; | ||
var PATCH_VALUE = 'PATCH_VALUE'; | ||
var CLEAR_VALUES = 'CLEAR_VALUES'; | ||
var SET_VALUE = 'SET_VALUE'; | ||
var SET_VALUES = 'SET_VALUES'; | ||
var RESET_TO_DEFAULT = 'RESET_TO_DEFAULT'; | ||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
var dayjs_min = {exports: {}}; | ||
(function (module, exports) { | ||
!function (t, e) { | ||
module.exports = e() ; | ||
}(commonjsGlobal, function () { | ||
var t = 1e3, | ||
e = 6e4, | ||
n = 36e5, | ||
r = "millisecond", | ||
i = "second", | ||
s = "minute", | ||
u = "hour", | ||
a = "day", | ||
o = "week", | ||
f = "month", | ||
h = "quarter", | ||
c = "year", | ||
d = "date", | ||
l = "Invalid Date", | ||
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, | ||
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, | ||
M = { | ||
name: "en", | ||
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), | ||
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), | ||
ordinal: function ordinal(t) { | ||
var e = ["th", "st", "nd", "rd"], | ||
n = t % 100; | ||
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; | ||
} | ||
}, | ||
m = function m(t, e, n) { | ||
var r = String(t); | ||
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; | ||
}, | ||
v = { | ||
s: m, | ||
z: function z(t) { | ||
var e = -t.utcOffset(), | ||
n = Math.abs(e), | ||
r = Math.floor(n / 60), | ||
i = n % 60; | ||
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); | ||
}, | ||
m: function t(e, n) { | ||
if (e.date() < n.date()) return -t(n, e); | ||
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), | ||
i = e.clone().add(r, f), | ||
s = n - i < 0, | ||
u = e.clone().add(r + (s ? -1 : 1), f); | ||
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); | ||
}, | ||
a: function a(t) { | ||
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); | ||
}, | ||
p: function p(t) { | ||
return { | ||
M: f, | ||
y: c, | ||
w: o, | ||
d: a, | ||
D: d, | ||
h: u, | ||
m: s, | ||
s: i, | ||
ms: r, | ||
Q: h | ||
}[t] || String(t || "").toLowerCase().replace(/s$/, ""); | ||
}, | ||
u: function u(t) { | ||
return void 0 === t; | ||
} | ||
}, | ||
g = "en", | ||
D = {}; | ||
D[g] = M; | ||
var p = function p(t) { | ||
return t instanceof _; | ||
}, | ||
S = function t(e, n, r) { | ||
var i; | ||
if (!e) return g; | ||
if ("string" == typeof e) { | ||
var s = e.toLowerCase(); | ||
D[s] && (i = s), n && (D[s] = n, i = s); | ||
var u = e.split("-"); | ||
if (!i && u.length > 1) return t(u[0]); | ||
} else { | ||
var a = e.name; | ||
D[a] = e, i = a; | ||
} | ||
return !r && i && (g = i), i || !r && g; | ||
}, | ||
w = function w(t, e) { | ||
if (p(t)) return t.clone(); | ||
var n = "object" == _typeof(e) ? e : {}; | ||
return n.date = t, n.args = arguments, new _(n); | ||
}, | ||
O = v; | ||
O.l = S, O.i = p, O.w = function (t, e) { | ||
return w(t, { | ||
locale: e.$L, | ||
utc: e.$u, | ||
x: e.$x, | ||
$offset: e.$offset | ||
}); | ||
}; | ||
var _ = function () { | ||
function M(t) { | ||
this.$L = S(t.locale, null, !0), this.parse(t); | ||
} | ||
var m = M.prototype; | ||
return m.parse = function (t) { | ||
this.$d = function (t) { | ||
var e = t.date, | ||
n = t.utc; | ||
if (null === e) return new Date(NaN); | ||
if (O.u(e)) return new Date(); | ||
if (e instanceof Date) return new Date(e); | ||
if ("string" == typeof e && !/Z$/i.test(e)) { | ||
var r = e.match($); | ||
if (r) { | ||
var i = r[2] - 1 || 0, | ||
s = (r[7] || "0").substring(0, 3); | ||
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); | ||
} | ||
} | ||
return new Date(e); | ||
}(t), this.$x = t.x || {}, this.init(); | ||
}, m.init = function () { | ||
var t = this.$d; | ||
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); | ||
}, m.$utils = function () { | ||
return O; | ||
}, m.isValid = function () { | ||
return !(this.$d.toString() === l); | ||
}, m.isSame = function (t, e) { | ||
var n = w(t); | ||
return this.startOf(e) <= n && n <= this.endOf(e); | ||
}, m.isAfter = function (t, e) { | ||
return w(t) < this.startOf(e); | ||
}, m.isBefore = function (t, e) { | ||
return this.endOf(e) < w(t); | ||
}, m.$g = function (t, e, n) { | ||
return O.u(t) ? this[e] : this.set(n, t); | ||
}, m.unix = function () { | ||
return Math.floor(this.valueOf() / 1e3); | ||
}, m.valueOf = function () { | ||
return this.$d.getTime(); | ||
}, m.startOf = function (t, e) { | ||
var n = this, | ||
r = !!O.u(e) || e, | ||
h = O.p(t), | ||
l = function l(t, e) { | ||
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); | ||
return r ? i : i.endOf(a); | ||
}, | ||
$ = function $(t, e) { | ||
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); | ||
}, | ||
y = this.$W, | ||
M = this.$M, | ||
m = this.$D, | ||
v = "set" + (this.$u ? "UTC" : ""); | ||
switch (h) { | ||
case c: | ||
return r ? l(1, 0) : l(31, 11); | ||
case f: | ||
return r ? l(1, M) : l(0, M + 1); | ||
case o: | ||
var g = this.$locale().weekStart || 0, | ||
D = (y < g ? y + 7 : y) - g; | ||
return l(r ? m - D : m + (6 - D), M); | ||
case a: | ||
case d: | ||
return $(v + "Hours", 0); | ||
case u: | ||
return $(v + "Minutes", 1); | ||
case s: | ||
return $(v + "Seconds", 2); | ||
case i: | ||
return $(v + "Milliseconds", 3); | ||
default: | ||
return this.clone(); | ||
} | ||
}, m.endOf = function (t) { | ||
return this.startOf(t, !1); | ||
}, m.$set = function (t, e) { | ||
var n, | ||
o = O.p(t), | ||
h = "set" + (this.$u ? "UTC" : ""), | ||
l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], | ||
$ = o === a ? this.$D + (e - this.$W) : e; | ||
if (o === f || o === c) { | ||
var y = this.clone().set(d, 1); | ||
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; | ||
} else l && this.$d[l]($); | ||
return this.init(), this; | ||
}, m.set = function (t, e) { | ||
return this.clone().$set(t, e); | ||
}, m.get = function (t) { | ||
return this[O.p(t)](); | ||
}, m.add = function (r, h) { | ||
var d, | ||
l = this; | ||
r = Number(r); | ||
var $ = O.p(h), | ||
y = function y(t) { | ||
var e = w(l); | ||
return O.w(e.date(e.date() + Math.round(t * r)), l); | ||
}; | ||
if ($ === f) return this.set(f, this.$M + r); | ||
if ($ === c) return this.set(c, this.$y + r); | ||
if ($ === a) return y(1); | ||
if ($ === o) return y(7); | ||
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, | ||
m = this.$d.getTime() + r * M; | ||
return O.w(m, this); | ||
}, m.subtract = function (t, e) { | ||
return this.add(-1 * t, e); | ||
}, m.format = function (t) { | ||
var e = this, | ||
n = this.$locale(); | ||
if (!this.isValid()) return n.invalidDate || l; | ||
var r = t || "YYYY-MM-DDTHH:mm:ssZ", | ||
i = O.z(this), | ||
s = this.$H, | ||
u = this.$m, | ||
a = this.$M, | ||
o = n.weekdays, | ||
f = n.months, | ||
h = function h(t, n, i, s) { | ||
return t && (t[n] || t(e, r)) || i[n].slice(0, s); | ||
}, | ||
c = function c(t) { | ||
return O.s(s % 12 || 12, t, "0"); | ||
}, | ||
d = n.meridiem || function (t, e, n) { | ||
var r = t < 12 ? "AM" : "PM"; | ||
return n ? r.toLowerCase() : r; | ||
}, | ||
$ = { | ||
YY: String(this.$y).slice(-2), | ||
YYYY: this.$y, | ||
M: a + 1, | ||
MM: O.s(a + 1, 2, "0"), | ||
MMM: h(n.monthsShort, a, f, 3), | ||
MMMM: h(f, a), | ||
D: this.$D, | ||
DD: O.s(this.$D, 2, "0"), | ||
d: String(this.$W), | ||
dd: h(n.weekdaysMin, this.$W, o, 2), | ||
ddd: h(n.weekdaysShort, this.$W, o, 3), | ||
dddd: o[this.$W], | ||
H: String(s), | ||
HH: O.s(s, 2, "0"), | ||
h: c(1), | ||
hh: c(2), | ||
a: d(s, u, !0), | ||
A: d(s, u, !1), | ||
m: String(u), | ||
mm: O.s(u, 2, "0"), | ||
s: String(this.$s), | ||
ss: O.s(this.$s, 2, "0"), | ||
SSS: O.s(this.$ms, 3, "0"), | ||
Z: i | ||
}; | ||
return r.replace(y, function (t, e) { | ||
return e || $[t] || i.replace(":", ""); | ||
}); | ||
}, m.utcOffset = function () { | ||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); | ||
}, m.diff = function (r, d, l) { | ||
var $, | ||
y = O.p(d), | ||
M = w(r), | ||
m = (M.utcOffset() - this.utcOffset()) * e, | ||
v = this - M, | ||
g = O.m(this, M); | ||
return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g); | ||
}, m.daysInMonth = function () { | ||
return this.endOf(f).$D; | ||
}, m.$locale = function () { | ||
return D[this.$L]; | ||
}, m.locale = function (t, e) { | ||
if (!t) return this.$L; | ||
var n = this.clone(), | ||
r = S(t, e, !0); | ||
return r && (n.$L = r), n; | ||
}, m.clone = function () { | ||
return O.w(this.$d, this); | ||
}, m.toDate = function () { | ||
return new Date(this.valueOf()); | ||
}, m.toJSON = function () { | ||
return this.isValid() ? this.toISOString() : null; | ||
}, m.toISOString = function () { | ||
return this.$d.toISOString(); | ||
}, m.toString = function () { | ||
return this.$d.toUTCString(); | ||
}, M; | ||
}(), | ||
T = _.prototype; | ||
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { | ||
T[t[1]] = function (e) { | ||
return this.$g(e, t[0], t[1]); | ||
}; | ||
}), w.extend = function (t, e) { | ||
return t.$i || (t(e, _, w), t.$i = !0), w; | ||
}, w.locale = S, w.isDayjs = p, w.unix = function (t) { | ||
return w(1e3 * t); | ||
}, w.en = D[g], w.Ls = D, w.p = {}, w; | ||
}); | ||
})(dayjs_min); | ||
var _componentToTypeMap; | ||
(_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, componentTypes.reactiveList, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.dataSearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.categorySearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.searchBox, queryTypes.suggestion), _defineProperty(_componentToTypeMap, componentTypes.singleList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.tagCloud, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.toggleButton, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.reactiveChart, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.treeList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.numberBox, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.datePicker, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dateRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dynamicRangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.ratingsFilter, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeInput, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceDropdown, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceSlider, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.reactiveMap, queryTypes.geo), _componentToTypeMap); | ||
function updateStoreConfig(payload) { | ||
return function (dispatch) { | ||
dispatch({ | ||
type: UPDATE_CONFIG, | ||
config: payload | ||
}); | ||
}; | ||
} | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function setValue(component, value, label, showFilter, URLParams, componentType, category, meta, updateSource // valid values => 'URL' | ||
) { | ||
return function (dispatch, getState) { | ||
var _getState = getState(), | ||
urlValues = _getState.urlValues, | ||
selectedValues = _getState.selectedValues, | ||
watchMan = _getState.watchMan, | ||
props = _getState.props; | ||
// set the value reference | ||
var reference = updateSource; | ||
if (isEqual(urlValues[component], value)) { | ||
reference = 'URL'; | ||
} | ||
// Clear pagination state for result components | ||
// Only clear when value is not set by URL params | ||
var componentsToReset = {}; | ||
var isResultComponent = [componentTypes.reactiveList, componentTypes.reactiveMap].includes(props[component] && props[component].componentType); | ||
var previousValue = selectedValues[component] && selectedValues[component].value; | ||
if (!isEqual(previousValue, value) && props[component] && !isResultComponent) { | ||
var componentList = [component]; | ||
var watchList = watchMan[component] || []; | ||
componentList = [].concat(_toConsumableArray(componentList), _toConsumableArray(watchList)); | ||
componentList.forEach(function (comp) { | ||
// Clear pagination state for result components | ||
// Only clear when value is not set by URL params | ||
var componentProps = props[comp]; | ||
if (reference !== 'URL' && componentProps | ||
// eslint-disable-next-line max-len | ||
&& [componentTypes.reactiveList, componentTypes.reactiveMap].includes(componentProps.componentType)) { | ||
if (selectedValues[comp] !== null) { | ||
componentsToReset[comp] = null; | ||
} | ||
} | ||
}); | ||
} | ||
if (isResultComponent) { | ||
// reject default page requests | ||
if (value < 2 && (!previousValue || previousValue < 2)) { | ||
return; | ||
} | ||
} | ||
dispatch({ | ||
type: SET_VALUE, | ||
component: component, | ||
reference: reference, | ||
value: value, | ||
label: label, | ||
showFilter: showFilter, | ||
URLParams: URLParams, | ||
componentType: componentType, | ||
category: category, | ||
meta: meta, | ||
componentsToReset: componentsToReset | ||
}); | ||
}; | ||
} | ||
function resetValuesToDefault(clearAllBlacklistComponents) { | ||
return function (dispatch, getState) { | ||
var _getState2 = getState(), | ||
selectedValues = _getState2.selectedValues, | ||
componentProps = _getState2.props; | ||
var defaultValues = { | ||
// componentName: defaultValue, | ||
}; | ||
var valueToSet; | ||
Object.keys(selectedValues).forEach(function (component) { | ||
if (!(Array.isArray(clearAllBlacklistComponents) && clearAllBlacklistComponents.includes(component))) { | ||
if (!componentProps[component] || !componentProps[component].componentType || !componentProps[component].defaultValue) { | ||
valueToSet = null; | ||
} else if ([componentTypes.rangeSlider, componentTypes.rangeInput, componentTypes.ratingsFilter, componentTypes.dateRange].includes(componentProps[component].componentType)) { | ||
valueToSet = _typeof(componentProps[component].defaultValue) === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null; | ||
} else if ([componentTypes.multiDropdownList, componentTypes.multiDataList, componentTypes.multiList, componentTypes.singleDataList, componentTypes.singleDropdownList, componentTypes.singleList, componentTypes.tagCloud, componentTypes.toggleButton, componentTypes.multiDropdownRange, componentTypes.multiRange, componentTypes.singleDropdownRange, componentTypes.singleRange, componentTypes.dataSearch, componentTypes.datePicker, componentTypes.treeList].includes(componentProps[component].componentType)) { | ||
valueToSet = componentProps[component].defaultValue; | ||
} else if ([componentTypes.categorySearch].includes(componentProps[component].componentType)) { | ||
valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : ''; | ||
} | ||
if (!isEqual(selectedValues[component].value, valueToSet)) { | ||
defaultValues = _objectSpread(_objectSpread({}, defaultValues), {}, _defineProperty({}, component, _objectSpread(_objectSpread({}, selectedValues[component]), {}, { | ||
value: valueToSet | ||
}))); | ||
} | ||
} | ||
}); | ||
dispatch({ | ||
type: RESET_TO_DEFAULT, | ||
defaultValues: defaultValues | ||
}); | ||
}; | ||
} | ||
function setInternalValue(component, value, componentType, category, meta) { | ||
return { | ||
type: SET_INTERNAL_VALUE, | ||
component: component, | ||
value: value, | ||
componentType: componentType, | ||
category: category, | ||
meta: meta | ||
}; | ||
} | ||
/** | ||
* Patches the properties of the component | ||
* @param {String} component | ||
* @param {Object} payload | ||
*/ | ||
function patchValue(component, payload) { | ||
return { | ||
type: PATCH_VALUE, | ||
component: component, | ||
payload: payload | ||
}; | ||
} | ||
function clearValues() { | ||
var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var clearAllBlacklistComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; | ||
return { | ||
type: CLEAR_VALUES, | ||
resetValues: resetValues, | ||
clearAllBlacklistComponents: clearAllBlacklistComponents | ||
}; | ||
} | ||
function setValues(componentsValues) { | ||
return function (dispatch) { | ||
dispatch(updateStoreConfig({ | ||
queryLockConfig: { | ||
initialTimestamp: new Date().getTime(), | ||
lockTime: 300 | ||
} | ||
})); | ||
dispatch({ | ||
type: SET_VALUES, | ||
componentsValues: componentsValues | ||
}); | ||
}; | ||
} | ||
exports.clearValues = clearValues; | ||
exports.patchValue = patchValue; | ||
exports.resetValuesToDefault = resetValuesToDefault; | ||
exports.setInternalValue = setInternalValue; | ||
exports.setValue = setValue; | ||
exports.setValues = setValues; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setValue=setValue;exports.resetValuesToDefault=resetValuesToDefault;exports.setInternalValue=setInternalValue;exports.patchValue=patchValue;exports.clearValues=clearValues;exports.setValues=setValues;var _constants=require('../utils/constants');var _helper=require('../utils/helper');var _constants2=require('../constants');var _utils=require('./utils');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function setValue(component,value,label,showFilter,URLParams,componentType,category,meta,updateSource){return function(dispatch,getState){var _getState=getState(),urlValues=_getState.urlValues,selectedValues=_getState.selectedValues,watchMan=_getState.watchMan,props=_getState.props;var reference=updateSource;if((0,_helper.isEqual)(urlValues[component],value)){reference='URL';}var componentsToReset={};var isResultComponent=[_constants.componentTypes.reactiveList,_constants.componentTypes.reactiveMap].includes(props[component]&&props[component].componentType);var previousValue=selectedValues[component]&&selectedValues[component].value;if(!(0,_helper.isEqual)(previousValue,value)&&props[component]&&!isResultComponent){var componentList=[component];var watchList=watchMan[component]||[];componentList=[].concat(_toConsumableArray(componentList),_toConsumableArray(watchList));componentList.forEach(function(comp){var componentProps=props[comp];if(reference!=='URL'&&componentProps&&[_constants.componentTypes.reactiveList,_constants.componentTypes.reactiveMap].includes(componentProps.componentType)){if(selectedValues[comp]!==null){componentsToReset[comp]=null;}}});}if(isResultComponent){if(value<2&&(!previousValue||previousValue<2)){return;}}dispatch({type:_constants2.SET_VALUE,component:component,reference:reference,value:value,label:label,showFilter:showFilter,URLParams:URLParams,componentType:componentType,category:category,meta:meta,componentsToReset:componentsToReset});};}function resetValuesToDefault(clearAllBlacklistComponents){return function(dispatch,getState){var _getState2=getState(),selectedValues=_getState2.selectedValues,componentProps=_getState2.props;var defaultValues={};var valueToSet=void 0;Object.keys(selectedValues).forEach(function(component){if(!(Array.isArray(clearAllBlacklistComponents)&&clearAllBlacklistComponents.includes(component))){if(!componentProps[component]||!componentProps[component].componentType||!componentProps[component].defaultValue){valueToSet=null;}else if([_constants.componentTypes.rangeSlider,_constants.componentTypes.rangeInput,_constants.componentTypes.ratingsFilter,_constants.componentTypes.dateRange].includes(componentProps[component].componentType)){valueToSet=typeof componentProps[component].defaultValue==='object'?[componentProps[component].defaultValue.start,componentProps[component].defaultValue.end]:null;}else if([_constants.componentTypes.multiDropdownList,_constants.componentTypes.multiDataList,_constants.componentTypes.multiList,_constants.componentTypes.singleDataList,_constants.componentTypes.singleDropdownList,_constants.componentTypes.singleList,_constants.componentTypes.tagCloud,_constants.componentTypes.toggleButton,_constants.componentTypes.multiDropdownRange,_constants.componentTypes.multiRange,_constants.componentTypes.singleDropdownRange,_constants.componentTypes.singleRange,_constants.componentTypes.dataSearch,_constants.componentTypes.datePicker,_constants.componentTypes.treeList].includes(componentProps[component].componentType)){valueToSet=componentProps[component].defaultValue;}else if([_constants.componentTypes.categorySearch].includes(componentProps[component].componentType)){valueToSet=componentProps[component].defaultValue?componentProps[component].defaultValue.term:'';}if(!(0,_helper.isEqual)(selectedValues[component].value,valueToSet)){defaultValues=_extends({},defaultValues,_defineProperty({},component,_extends({},selectedValues[component],{value:valueToSet})));}}});dispatch({type:_constants2.RESET_TO_DEFAULT,defaultValues:defaultValues});};}function setInternalValue(component,value,componentType,category,meta){return{type:_constants2.SET_INTERNAL_VALUE,component:component,value:value,componentType:componentType,category:category,meta:meta};}function patchValue(component,payload){return{type:_constants2.PATCH_VALUE,component:component,payload:payload};}function clearValues(){var resetValues=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var clearAllBlacklistComponents=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return{type:_constants2.CLEAR_VALUES,resetValues:resetValues,clearAllBlacklistComponents:clearAllBlacklistComponents};}function setValues(componentsValues){return function(dispatch){dispatch((0,_utils.updateStoreConfig)({queryLockConfig:{initialTimestamp:new Date().getTime(),lockTime:300}}));dispatch({type:_constants2.SET_VALUES,componentsValues:componentsValues});};} |
@@ -1,113 +0,1 @@ | ||
'use strict'; | ||
var ADD_COMPONENT = 'ADD_COMPONENT'; | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var WATCH_COMPONENT = 'WATCH_COMPONENT'; | ||
var SET_QUERY = 'SET_QUERY'; | ||
var SET_APPBASE_QUERY = 'SET_APPBASE_QUERY'; | ||
var SET_QUERY_OPTIONS = 'SET_QUERY_OPTIONS'; | ||
var EXECUTE_QUERY = 'EXECUTE_QUERY'; | ||
var UPDATE_HITS = 'UPDATE_HITS'; | ||
var UPDATE_AGGS = 'UPDATE_AGGS'; | ||
var UPDATE_COMPOSITE_AGGS = 'UPDATE_COMPOSITE_AGGS'; | ||
var ADD_CONFIG = 'ADD_CONFIG'; | ||
var UPDATE_CONFIG = 'UPDATE_CONFIG'; | ||
var ADD_APPBASE_REF = 'ADD_APPBASE_REF'; | ||
var ADD_ANALYTICS_REF = 'ADD_ANALYTICS_REF'; | ||
var LOG_QUERY = 'LOG_QUERY'; | ||
var LOG_COMBINED_QUERY = 'LOG_COMBINED_QUERY'; | ||
var SET_INTERNAL_VALUE = 'SET_INTERNAL_VALUE'; | ||
var PATCH_VALUE = 'PATCH_VALUE'; | ||
var CLEAR_VALUES = 'CLEAR_VALUES'; | ||
var SET_LOADING = 'SET_LOADING'; | ||
var SET_ERROR = 'SET_ERROR'; | ||
var SET_TIMESTAMP = 'SET_TIMESTAMP'; | ||
var SET_HEADERS = 'SET_HEADERS'; | ||
var SET_MAP_DATA = 'SET_MAP_DATA'; | ||
var SET_MAP_RESULTS = 'SET_MAP_RESULTS'; | ||
var SET_QUERY_LISTENER = 'SET_QUERY_LISTENER'; | ||
var STORE_KEY = '__REACTIVESEARCH__'; | ||
var SET_SEARCH_ID = 'SET_SEARCH_ID'; | ||
var SET_PROMOTED_RESULTS = 'SET_PROMOTED_RESULTS'; | ||
var SET_DEFAULT_QUERY = 'SET_DEFAULT_QUERY'; | ||
var SET_CUSTOM_QUERY = 'SET_CUSTOM_QUERY'; | ||
var SET_CUSTOM_HIGHLIGHT_OPTIONS = 'SET_CUSTOM_HIGHLIGHT_OPTIONS'; | ||
var SET_CUSTOM_DATA = 'SET_CUSTOM_DATA'; | ||
var SET_APPLIED_SETTINGS = 'SET_APPLIED_SETTINGS'; | ||
var SET_PROPS = 'SET_PROPS'; | ||
var UPDATE_PROPS = 'UPDATE_PROPS'; | ||
var REMOVE_PROPS = 'REMOVE_PROPS'; | ||
var SET_SUGGESTIONS_SEARCH_VALUE = 'SET_SUGGESTIONS_SEARCH_VALUE'; | ||
var CLEAR_SUGGESTIONS_SEARCH_VALUE = 'CLEAR_SUGGESTIONS_SEARCH_VALUE'; | ||
var SET_SUGGESTIONS_SEARCH_ID = 'SET_SUGGESTIONS_SEARCH_ID'; | ||
var UPDATE_ANALYTICS_CONFIG = 'UPDATE_ANALYTICS_CONFIG'; | ||
var SET_RAW_DATA = 'SET_RAW_DATA'; | ||
var SET_POPULAR_SUGGESTIONS = 'SET_POPULAR_SUGGESTIONS'; | ||
var SET_DEFAULT_POPULAR_SUGGESTIONS = 'SET_DEFAULT_POPULAR_SUGGESTIONS'; | ||
var SET_QUERY_TO_HITS = 'SET_QUERY_TO_HITS'; | ||
var RECENT_SEARCHES_SUCCESS = 'RECENT_SEARCHES_SUCCESS'; | ||
var RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR'; | ||
var SET_VALUE = 'SET_VALUE'; | ||
var SET_VALUES = 'SET_VALUES'; | ||
var RESET_TO_DEFAULT = 'RESET_TO_DEFAULT'; | ||
var SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING'; | ||
var SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED'; | ||
var SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR'; | ||
var SET_REGISTERED_COMPONENT_TIMESTAMP = 'SET_REGISTERED_COMPONENT_TIMESTAMP'; | ||
var REMOVE_REGISTERED_COMPONENT_TIMESTAMP = 'REMOVE_REGISTERED_COMPONENT_TIMESTAMP'; | ||
exports.ADD_ANALYTICS_REF = ADD_ANALYTICS_REF; | ||
exports.ADD_APPBASE_REF = ADD_APPBASE_REF; | ||
exports.ADD_COMPONENT = ADD_COMPONENT; | ||
exports.ADD_CONFIG = ADD_CONFIG; | ||
exports.CLEAR_SUGGESTIONS_SEARCH_VALUE = CLEAR_SUGGESTIONS_SEARCH_VALUE; | ||
exports.CLEAR_VALUES = CLEAR_VALUES; | ||
exports.EXECUTE_QUERY = EXECUTE_QUERY; | ||
exports.LOG_COMBINED_QUERY = LOG_COMBINED_QUERY; | ||
exports.LOG_QUERY = LOG_QUERY; | ||
exports.PATCH_VALUE = PATCH_VALUE; | ||
exports.RECENT_SEARCHES_ERROR = RECENT_SEARCHES_ERROR; | ||
exports.RECENT_SEARCHES_SUCCESS = RECENT_SEARCHES_SUCCESS; | ||
exports.REMOVE_COMPONENT = REMOVE_COMPONENT; | ||
exports.REMOVE_PROPS = REMOVE_PROPS; | ||
exports.REMOVE_REGISTERED_COMPONENT_TIMESTAMP = REMOVE_REGISTERED_COMPONENT_TIMESTAMP; | ||
exports.RESET_TO_DEFAULT = RESET_TO_DEFAULT; | ||
exports.SET_APPBASE_QUERY = SET_APPBASE_QUERY; | ||
exports.SET_APPLIED_SETTINGS = SET_APPLIED_SETTINGS; | ||
exports.SET_CUSTOM_DATA = SET_CUSTOM_DATA; | ||
exports.SET_CUSTOM_HIGHLIGHT_OPTIONS = SET_CUSTOM_HIGHLIGHT_OPTIONS; | ||
exports.SET_CUSTOM_QUERY = SET_CUSTOM_QUERY; | ||
exports.SET_DEFAULT_POPULAR_SUGGESTIONS = SET_DEFAULT_POPULAR_SUGGESTIONS; | ||
exports.SET_DEFAULT_QUERY = SET_DEFAULT_QUERY; | ||
exports.SET_ERROR = SET_ERROR; | ||
exports.SET_GOOGLE_MAP_SCRIPT_ERROR = SET_GOOGLE_MAP_SCRIPT_ERROR; | ||
exports.SET_GOOGLE_MAP_SCRIPT_LOADED = SET_GOOGLE_MAP_SCRIPT_LOADED; | ||
exports.SET_GOOGLE_MAP_SCRIPT_LOADING = SET_GOOGLE_MAP_SCRIPT_LOADING; | ||
exports.SET_HEADERS = SET_HEADERS; | ||
exports.SET_INTERNAL_VALUE = SET_INTERNAL_VALUE; | ||
exports.SET_LOADING = SET_LOADING; | ||
exports.SET_MAP_DATA = SET_MAP_DATA; | ||
exports.SET_MAP_RESULTS = SET_MAP_RESULTS; | ||
exports.SET_POPULAR_SUGGESTIONS = SET_POPULAR_SUGGESTIONS; | ||
exports.SET_PROMOTED_RESULTS = SET_PROMOTED_RESULTS; | ||
exports.SET_PROPS = SET_PROPS; | ||
exports.SET_QUERY = SET_QUERY; | ||
exports.SET_QUERY_LISTENER = SET_QUERY_LISTENER; | ||
exports.SET_QUERY_OPTIONS = SET_QUERY_OPTIONS; | ||
exports.SET_QUERY_TO_HITS = SET_QUERY_TO_HITS; | ||
exports.SET_RAW_DATA = SET_RAW_DATA; | ||
exports.SET_REGISTERED_COMPONENT_TIMESTAMP = SET_REGISTERED_COMPONENT_TIMESTAMP; | ||
exports.SET_SEARCH_ID = SET_SEARCH_ID; | ||
exports.SET_SUGGESTIONS_SEARCH_ID = SET_SUGGESTIONS_SEARCH_ID; | ||
exports.SET_SUGGESTIONS_SEARCH_VALUE = SET_SUGGESTIONS_SEARCH_VALUE; | ||
exports.SET_TIMESTAMP = SET_TIMESTAMP; | ||
exports.SET_VALUE = SET_VALUE; | ||
exports.SET_VALUES = SET_VALUES; | ||
exports.STORE_KEY = STORE_KEY; | ||
exports.UPDATE_AGGS = UPDATE_AGGS; | ||
exports.UPDATE_ANALYTICS_CONFIG = UPDATE_ANALYTICS_CONFIG; | ||
exports.UPDATE_COMPOSITE_AGGS = UPDATE_COMPOSITE_AGGS; | ||
exports.UPDATE_CONFIG = UPDATE_CONFIG; | ||
exports.UPDATE_HITS = UPDATE_HITS; | ||
exports.UPDATE_PROPS = UPDATE_PROPS; | ||
exports.WATCH_COMPONENT = WATCH_COMPONENT; | ||
Object.defineProperty(exports,"__esModule",{value:true});var ADD_COMPONENT=exports.ADD_COMPONENT='ADD_COMPONENT';var REMOVE_COMPONENT=exports.REMOVE_COMPONENT='REMOVE_COMPONENT';var WATCH_COMPONENT=exports.WATCH_COMPONENT='WATCH_COMPONENT';var SET_QUERY=exports.SET_QUERY='SET_QUERY';var SET_APPBASE_QUERY=exports.SET_APPBASE_QUERY='SET_APPBASE_QUERY';var SET_QUERY_OPTIONS=exports.SET_QUERY_OPTIONS='SET_QUERY_OPTIONS';var EXECUTE_QUERY=exports.EXECUTE_QUERY='EXECUTE_QUERY';var UPDATE_HITS=exports.UPDATE_HITS='UPDATE_HITS';var UPDATE_AGGS=exports.UPDATE_AGGS='UPDATE_AGGS';var UPDATE_COMPOSITE_AGGS=exports.UPDATE_COMPOSITE_AGGS='UPDATE_COMPOSITE_AGGS';var ADD_CONFIG=exports.ADD_CONFIG='ADD_CONFIG';var UPDATE_CONFIG=exports.UPDATE_CONFIG='UPDATE_CONFIG';var ADD_APPBASE_REF=exports.ADD_APPBASE_REF='ADD_APPBASE_REF';var ADD_ANALYTICS_REF=exports.ADD_ANALYTICS_REF='ADD_ANALYTICS_REF';var LOG_QUERY=exports.LOG_QUERY='LOG_QUERY';var LOG_COMBINED_QUERY=exports.LOG_COMBINED_QUERY='LOG_COMBINED_QUERY';var SET_INTERNAL_VALUE=exports.SET_INTERNAL_VALUE='SET_INTERNAL_VALUE';var PATCH_VALUE=exports.PATCH_VALUE='PATCH_VALUE';var CLEAR_VALUES=exports.CLEAR_VALUES='CLEAR_VALUES';var SET_LOADING=exports.SET_LOADING='SET_LOADING';var SET_ERROR=exports.SET_ERROR='SET_ERROR';var SET_TIMESTAMP=exports.SET_TIMESTAMP='SET_TIMESTAMP';var SET_HEADERS=exports.SET_HEADERS='SET_HEADERS';var SET_MAP_DATA=exports.SET_MAP_DATA='SET_MAP_DATA';var SET_MAP_RESULTS=exports.SET_MAP_RESULTS='SET_MAP_RESULTS';var SET_QUERY_LISTENER=exports.SET_QUERY_LISTENER='SET_QUERY_LISTENER';var STORE_KEY=exports.STORE_KEY='__REACTIVESEARCH__';var SET_SEARCH_ID=exports.SET_SEARCH_ID='SET_SEARCH_ID';var SET_PROMOTED_RESULTS=exports.SET_PROMOTED_RESULTS='SET_PROMOTED_RESULTS';var SET_DEFAULT_QUERY=exports.SET_DEFAULT_QUERY='SET_DEFAULT_QUERY';var SET_CUSTOM_QUERY=exports.SET_CUSTOM_QUERY='SET_CUSTOM_QUERY';var SET_CUSTOM_HIGHLIGHT_OPTIONS=exports.SET_CUSTOM_HIGHLIGHT_OPTIONS='SET_CUSTOM_HIGHLIGHT_OPTIONS';var SET_CUSTOM_DATA=exports.SET_CUSTOM_DATA='SET_CUSTOM_DATA';var SET_APPLIED_SETTINGS=exports.SET_APPLIED_SETTINGS='SET_APPLIED_SETTINGS';var SET_PROPS=exports.SET_PROPS='SET_PROPS';var UPDATE_PROPS=exports.UPDATE_PROPS='UPDATE_PROPS';var REMOVE_PROPS=exports.REMOVE_PROPS='REMOVE_PROPS';var SET_SUGGESTIONS_SEARCH_VALUE=exports.SET_SUGGESTIONS_SEARCH_VALUE='SET_SUGGESTIONS_SEARCH_VALUE';var CLEAR_SUGGESTIONS_SEARCH_VALUE=exports.CLEAR_SUGGESTIONS_SEARCH_VALUE='CLEAR_SUGGESTIONS_SEARCH_VALUE';var SET_SUGGESTIONS_SEARCH_ID=exports.SET_SUGGESTIONS_SEARCH_ID='SET_SUGGESTIONS_SEARCH_ID';var UPDATE_ANALYTICS_CONFIG=exports.UPDATE_ANALYTICS_CONFIG='UPDATE_ANALYTICS_CONFIG';var SET_RAW_DATA=exports.SET_RAW_DATA='SET_RAW_DATA';var SET_POPULAR_SUGGESTIONS=exports.SET_POPULAR_SUGGESTIONS='SET_POPULAR_SUGGESTIONS';var SET_DEFAULT_POPULAR_SUGGESTIONS=exports.SET_DEFAULT_POPULAR_SUGGESTIONS='SET_DEFAULT_POPULAR_SUGGESTIONS';var SET_QUERY_TO_HITS=exports.SET_QUERY_TO_HITS='SET_QUERY_TO_HITS';var RECENT_SEARCHES_SUCCESS=exports.RECENT_SEARCHES_SUCCESS='RECENT_SEARCHES_SUCCESS';var RECENT_SEARCHES_ERROR=exports.RECENT_SEARCHES_ERROR='RECENT_SEARCHES_ERROR';var SET_VALUE=exports.SET_VALUE='SET_VALUE';var SET_VALUES=exports.SET_VALUES='SET_VALUES';var RESET_TO_DEFAULT=exports.RESET_TO_DEFAULT='RESET_TO_DEFAULT';var SET_GOOGLE_MAP_SCRIPT_LOADING=exports.SET_GOOGLE_MAP_SCRIPT_LOADING='SET_GOOGLE_MAP_SCRIPT_LOADING';var SET_GOOGLE_MAP_SCRIPT_LOADED=exports.SET_GOOGLE_MAP_SCRIPT_LOADED='SET_GOOGLE_MAP_SCRIPT_LOADED';var SET_GOOGLE_MAP_SCRIPT_ERROR=exports.SET_GOOGLE_MAP_SCRIPT_ERROR='SET_GOOGLE_MAP_SCRIPT_ERROR';var SET_REGISTERED_COMPONENT_TIMESTAMP=exports.SET_REGISTERED_COMPONENT_TIMESTAMP='SET_REGISTERED_COMPONENT_TIMESTAMP';var REMOVE_REGISTERED_COMPONENT_TIMESTAMP=exports.REMOVE_REGISTERED_COMPONENT_TIMESTAMP='REMOVE_REGISTERED_COMPONENT_TIMESTAMP';var SET_AI_RESPONSE=exports.SET_AI_RESPONSE='SET_AI_RESPONSE';var SET_AI_RESPONSE_DELAYED=exports.SET_AI_RESPONSE_DELAYED='SET_AI_RESPONSE_DELAYED';var REMOVE_AI_RESPONSE=exports.REMOVE_AI_RESPONSE='REMOVE_AI_RESPONSE';var SET_AI_RESPONSE_ERROR=exports.SET_AI_RESPONSE_ERROR='SET_AI_RESPONSE_ERROR';var SET_AI_RESPONSE_LOADING=exports.SET_AI_RESPONSE_LOADING='SET_AI_RESPONSE_LOADING'; |
@@ -1,138 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var UPDATE_AGGS = 'UPDATE_AGGS'; | ||
var _excluded = ["buckets"]; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function aggsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === UPDATE_AGGS) { | ||
if (action.append) { | ||
var field = Object.keys(state[action.component])[0]; | ||
var _action$aggregations$ = action.aggregations[field], | ||
newBuckets = _action$aggregations$.buckets, | ||
aggsData = _objectWithoutProperties(_action$aggregations$, _excluded); | ||
// console.log('received aggs', action.aggregations); | ||
// eslint-disable-next-line | ||
// debugger; | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, _defineProperty({}, field, _objectSpread({ | ||
buckets: [].concat(_toConsumableArray(state[action.component][field].buckets), _toConsumableArray(newBuckets)) | ||
}, aggsData)))); | ||
} | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.aggregations)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component2 = action.component; | ||
state[_action$component2]; | ||
var obj = _objectWithoutProperties(state, [_action$component2].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = aggsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=aggsReducer;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function aggsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.UPDATE_AGGS){if(action.append){var field=Object.keys(state[action.component])[0];var _action$aggregations$=action.aggregations[field],newBuckets=_action$aggregations$.buckets,aggsData=_objectWithoutProperties(_action$aggregations$,['buckets']);return _extends({},state,_defineProperty({},action.component,_defineProperty({},field,_extends({buckets:[].concat(_toConsumableArray(state[action.component][field].buckets),_toConsumableArray(newBuckets))},aggsData))));}return _extends({},state,_defineProperty({},action.component,action.aggregations));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,134 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_SEARCH_ID = 'SET_SEARCH_ID'; | ||
var SET_SUGGESTIONS_SEARCH_VALUE = 'SET_SUGGESTIONS_SEARCH_VALUE'; | ||
var CLEAR_SUGGESTIONS_SEARCH_VALUE = 'CLEAR_SUGGESTIONS_SEARCH_VALUE'; | ||
var SET_SUGGESTIONS_SEARCH_ID = 'SET_SUGGESTIONS_SEARCH_ID'; | ||
var SET_VALUE = 'SET_VALUE'; | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
var initialState = { | ||
searchValue: null, | ||
searchId: null, | ||
// Maintain the suggestions analytics separately | ||
suggestionsSearchId: null, | ||
suggestionsSearchValue: null | ||
}; | ||
var searchComponents = [componentTypes.dataSearch, componentTypes.categorySearch]; | ||
function analyticsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
switch (action.type) { | ||
case SET_VALUE: | ||
if (searchComponents.includes(action.componentType)) { | ||
return { | ||
searchValue: action.value, | ||
searchId: null | ||
}; | ||
} | ||
return state; | ||
case SET_SEARCH_ID: | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
searchId: action.searchId | ||
}); | ||
case SET_SUGGESTIONS_SEARCH_VALUE: | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
suggestionsSearchValue: action.value, | ||
suggestionsSearchId: null | ||
}); | ||
case SET_SUGGESTIONS_SEARCH_ID: | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
suggestionsSearchId: action.searchId | ||
}); | ||
case CLEAR_SUGGESTIONS_SEARCH_VALUE: | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
suggestionsSearchValue: null, | ||
suggestionsSearchId: null | ||
}); | ||
default: | ||
return state; | ||
} | ||
} | ||
module.exports = analyticsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=analyticsReducer;var _constants=require('../constants');var _constants2=require('../utils/constants');var initialState={searchValue:null,searchId:null,suggestionsSearchId:null,suggestionsSearchValue:null};var searchComponents=[_constants2.componentTypes.dataSearch,_constants2.componentTypes.categorySearch];function analyticsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:initialState;var action=arguments[1];switch(action.type){case _constants.SET_VALUE:if(searchComponents.includes(action.componentType)){return{searchValue:action.value,searchId:null};}return state;case _constants.SET_SEARCH_ID:return _extends({},state,{searchId:action.searchId});case _constants.SET_SUGGESTIONS_SEARCH_VALUE:return _extends({},state,{suggestionsSearchValue:action.value,suggestionsSearchId:null});case _constants.SET_SUGGESTIONS_SEARCH_ID:return _extends({},state,{suggestionsSearchId:action.searchId});case _constants.CLEAR_SUGGESTIONS_SEARCH_VALUE:return _extends({},state,{suggestionsSearchValue:null,suggestionsSearchId:null});default:return state;}} |
@@ -1,14 +0,1 @@ | ||
'use strict'; | ||
var ADD_ANALYTICS_REF = 'ADD_ANALYTICS_REF'; | ||
function analyticsRefReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === ADD_ANALYTICS_REF) { | ||
return action.analyticsRef; | ||
} | ||
return state; | ||
} | ||
module.exports = analyticsRefReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.default=analyticsRefReducer;var _constants=require('../constants');function analyticsRefReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.ADD_ANALYTICS_REF){return action.analyticsRef;}return state;} |
@@ -1,57 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_APPBASE_QUERY = 'SET_APPBASE_QUERY'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function appbaseQueryReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_APPBASE_QUERY) { | ||
return _objectSpread(_objectSpread({}, state), action.query); | ||
} | ||
return state; | ||
} | ||
module.exports = appbaseQueryReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=appbaseQueryReducer;var _constants=require('../constants');function appbaseQueryReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_APPBASE_QUERY){return _extends({},state,action.query);}return state;} |
@@ -1,14 +0,1 @@ | ||
'use strict'; | ||
var ADD_APPBASE_REF = 'ADD_APPBASE_REF'; | ||
function appbaseRefReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === ADD_APPBASE_REF) { | ||
return action.appbaseRef; | ||
} | ||
return state; | ||
} | ||
module.exports = appbaseRefReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.default=appbaseRefReducer;var _constants=require('../constants');function appbaseRefReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.ADD_APPBASE_REF){return action.appbaseRef;}return state;} |
@@ -1,57 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_APPLIED_SETTINGS = 'SET_APPLIED_SETTINGS'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function appliedSettingsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_APPLIED_SETTINGS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.data)); | ||
} | ||
return state; | ||
} | ||
module.exports = appliedSettingsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=appliedSettingsReducer;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function appliedSettingsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_APPLIED_SETTINGS){return _extends({},state,_defineProperty({},action.component,action.data));}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var LOG_COMBINED_QUERY = 'LOG_COMBINED_QUERY'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function combinedLogsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === LOG_COMBINED_QUERY) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.query)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = combinedLogsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=combinedLogsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function combinedLogsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.LOG_COMBINED_QUERY){return _extends({},state,_defineProperty({},action.component,action.query));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,50 +0,1 @@ | ||
'use strict'; | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
var ADD_COMPONENT = 'ADD_COMPONENT'; | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
function componentsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === ADD_COMPONENT) { | ||
return [].concat(_toConsumableArray(state), [action.component]); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
return state.filter(function (element) { | ||
return element !== action.component; | ||
}); | ||
} | ||
return state; | ||
} | ||
module.exports = componentsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.default=componentsReducer;var _constants=require('../constants');function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function componentsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var action=arguments[1];if(action.type===_constants.ADD_COMPONENT){return[].concat(_toConsumableArray(state),[action.component]);}else if(action.type===_constants.REMOVE_COMPONENT){return state.filter(function(element){return element!==action.component;});}return state;} |
@@ -1,143 +0,1 @@ | ||
'use strict'; | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
var UPDATE_COMPOSITE_AGGS = 'UPDATE_COMPOSITE_AGGS'; | ||
var _excluded = ["_source"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function compositeAggsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === UPDATE_COMPOSITE_AGGS) { | ||
var aggsResponse = Object.values(action.aggregations) && Object.values(action.aggregations)[0]; | ||
var fieldName = Object.keys(action.aggregations)[0]; | ||
if (!aggsResponse) return state; | ||
var buckets = []; | ||
if (aggsResponse.buckets && Array.isArray(aggsResponse.buckets)) { | ||
buckets = aggsResponse.buckets; | ||
} | ||
var parsedAggs = buckets.map(function (bucket) { | ||
// eslint-disable-next-line camelcase | ||
var doc_count = bucket.doc_count, | ||
key = bucket.key, | ||
hitsData = bucket[fieldName]; | ||
var flatData = {}; | ||
var _source = {}; | ||
if (hitsData && hitsData.hits) { | ||
var _hitsData$hits$hits$ = hitsData.hits.hits[0]; | ||
_source = _hitsData$hits$hits$._source; | ||
flatData = _objectWithoutProperties(_hitsData$hits$hits$, _excluded); | ||
} | ||
return _objectSpread(_objectSpread({ | ||
_doc_count: doc_count, | ||
_key: typeof key === 'string' ? key : key[fieldName], | ||
top_hits: hitsData | ||
}, flatData), _source); | ||
}); | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.append ? [].concat(_toConsumableArray(state[action.component]), _toConsumableArray(parsedAggs)) : parsedAggs)); | ||
} | ||
return state; | ||
} | ||
module.exports = compositeAggsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=compositeAggsReducer;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function compositeAggsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.UPDATE_COMPOSITE_AGGS){var aggsResponse=Object.values(action.aggregations)&&Object.values(action.aggregations)[0];var fieldName=Object.keys(action.aggregations)[0];if(!aggsResponse)return state;var buckets=[];if(aggsResponse.buckets&&Array.isArray(aggsResponse.buckets)){buckets=aggsResponse.buckets;}var parsedAggs=buckets.map(function(bucket){var doc_count=bucket.doc_count,key=bucket.key,hitsData=bucket[fieldName];var flatData={};var _source={};if(hitsData&&hitsData.hits){var _hitsData$hits$hits$=hitsData.hits.hits[0];_source=_hitsData$hits$hits$._source;flatData=_objectWithoutProperties(_hitsData$hits$hits$,['_source']);}return _extends({_doc_count:doc_count,_key:typeof key==='string'?key:key[fieldName],top_hits:hitsData},flatData,_source);});return _extends({},state,_defineProperty({},action.component,action.append?[].concat(_toConsumableArray(state[action.component]),_toConsumableArray(parsedAggs)):parsedAggs));}return state;} |
@@ -1,79 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var ADD_CONFIG = 'ADD_CONFIG'; | ||
var UPDATE_CONFIG = 'UPDATE_CONFIG'; | ||
var UPDATE_ANALYTICS_CONFIG = 'UPDATE_ANALYTICS_CONFIG'; | ||
// defaultAnalytics Config | ||
var defaultAnalyticsConfig = { | ||
emptyQuery: true, | ||
suggestionAnalytics: true, | ||
userId: null, | ||
customEvents: null, | ||
enableQueryRules: true | ||
}; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function configReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { | ||
analyticsConfig: defaultAnalyticsConfig, | ||
lock: false | ||
}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === ADD_CONFIG) { | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
analyticsConfig: _objectSpread(_objectSpread({}, defaultAnalyticsConfig), action.analyticsConfig) | ||
}); | ||
} else if (action.type === UPDATE_ANALYTICS_CONFIG) { | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
analyticsConfig: _objectSpread(_objectSpread({}, state.analyticsConfig), action.analyticsConfig) | ||
}); | ||
} else if (action.type === UPDATE_CONFIG) { | ||
return _objectSpread(_objectSpread({}, state), action.config); | ||
} | ||
return state; | ||
} | ||
module.exports = configReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=configReducer;var _constants=require('../constants');var _analytics=require('../utils/analytics');function configReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{analyticsConfig:_analytics.defaultAnalyticsConfig,lock:false};var action=arguments[1];if(action.type===_constants.ADD_CONFIG){return _extends({},state,{analyticsConfig:_extends({},_analytics.defaultAnalyticsConfig,action.analyticsConfig)});}else if(action.type===_constants.UPDATE_ANALYTICS_CONFIG){return _extends({},state,{analyticsConfig:_extends({},state.analyticsConfig,action.analyticsConfig)});}else if(action.type===_constants.UPDATE_CONFIG){return _extends({},state,action.config);}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_CUSTOM_DATA = 'SET_CUSTOM_DATA'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function customDataReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_CUSTOM_DATA) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.data)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = customDataReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=customDataReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function customDataReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_CUSTOM_DATA){return _extends({},state,_defineProperty({},action.component,action.data));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_CUSTOM_HIGHLIGHT_OPTIONS = 'SET_CUSTOM_HIGHLIGHT_OPTIONS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function customHighlightReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_CUSTOM_HIGHLIGHT_OPTIONS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.data)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = customHighlightReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=customHighlightReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function customHighlightReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_CUSTOM_HIGHLIGHT_OPTIONS){return _extends({},state,_defineProperty({},action.component,action.data));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_CUSTOM_QUERY = 'SET_CUSTOM_QUERY'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function customQueryReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_CUSTOM_QUERY) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.query)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = customQueryReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=customQueryReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function customQueryReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_CUSTOM_QUERY){return _extends({},state,_defineProperty({},action.component,action.query));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,57 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_DEFAULT_POPULAR_SUGGESTIONS = 'SET_DEFAULT_POPULAR_SUGGESTIONS'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function defaultPopularSuggestions() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_DEFAULT_POPULAR_SUGGESTIONS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.suggestions)); | ||
} | ||
return state; | ||
} | ||
module.exports = defaultPopularSuggestions; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=defaultPopularSuggestions;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function defaultPopularSuggestions(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_DEFAULT_POPULAR_SUGGESTIONS){return _extends({},state,_defineProperty({},action.component,action.suggestions));}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_DEFAULT_QUERY = 'SET_DEFAULT_QUERY'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function defaultQueryReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_DEFAULT_QUERY) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.query)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = defaultQueryReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=defaultQueryReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function defaultQueryReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_DEFAULT_QUERY){return _extends({},state,_defineProperty({},action.component,action.query));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var WATCH_COMPONENT = 'WATCH_COMPONENT'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function dependencyTreeReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === WATCH_COMPONENT) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.react)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = dependencyTreeReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=dependencyTreeReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function dependencyTreeReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.WATCH_COMPONENT){return _extends({},state,_defineProperty({},action.component,action.react));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_ERROR = 'SET_ERROR'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function errorReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_ERROR) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.error)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = errorReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=errorReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function errorReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_ERROR){return _extends({},state,_defineProperty({},action.component,action.error));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,78 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING'; | ||
var SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED'; | ||
var SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
var INITIAL_STATE = { | ||
loading: false, | ||
loaded: false, | ||
error: null | ||
}; | ||
function googleMapScriptReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
var type = action.type, | ||
loading = action.loading, | ||
loaded = action.loaded, | ||
error = action.error; | ||
if (type === SET_GOOGLE_MAP_SCRIPT_LOADING) { | ||
return _objectSpread(_objectSpread({}, INITIAL_STATE), {}, { | ||
loading: loading | ||
}); | ||
} else if (type === SET_GOOGLE_MAP_SCRIPT_LOADED) { | ||
return _objectSpread(_objectSpread({}, INITIAL_STATE), {}, { | ||
loaded: loaded | ||
}); | ||
} else if (type === SET_GOOGLE_MAP_SCRIPT_ERROR) { | ||
return _objectSpread(_objectSpread({}, INITIAL_STATE), {}, { | ||
error: error | ||
}); | ||
} | ||
return state; | ||
} | ||
module.exports = googleMapScriptReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=googleMapScriptReducer;var _constants=require('../constants');var INITIAL_STATE={loading:false,loaded:false,error:null};function googleMapScriptReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:INITIAL_STATE;var action=arguments[1];var type=action.type,loading=action.loading,loaded=action.loaded,error=action.error;if(type===_constants.SET_GOOGLE_MAP_SCRIPT_LOADING){return _extends({},INITIAL_STATE,{loading:loading});}else if(type===_constants.SET_GOOGLE_MAP_SCRIPT_LOADED){return _extends({},INITIAL_STATE,{loaded:loaded});}else if(type===_constants.SET_GOOGLE_MAP_SCRIPT_ERROR){return _extends({},INITIAL_STATE,{error:error});}return state;} |
@@ -1,14 +0,1 @@ | ||
'use strict'; | ||
var SET_HEADERS = 'SET_HEADERS'; | ||
function headersReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_HEADERS) { | ||
return action.headers; | ||
} | ||
return state; | ||
} | ||
module.exports = headersReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.default=headersReducer;var _constants=require('../constants');function headersReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_HEADERS){return action.headers;}return state;} |
@@ -1,138 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var UPDATE_HITS = 'UPDATE_HITS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function hitsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === UPDATE_HITS) { | ||
if (action.append) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, { | ||
hits: [].concat(_toConsumableArray(state[action.component].hits), _toConsumableArray(action.hits)), | ||
total: action.total, | ||
time: action.time, | ||
hidden: action.hidden || 0 | ||
})); | ||
} | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, { | ||
hits: action.hits, | ||
total: action.total, | ||
time: action.time, | ||
hidden: action.hidden || 0 | ||
})); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = hitsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=hitsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function hitsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.UPDATE_HITS){if(action.append){return _extends({},state,_defineProperty({},action.component,{hits:[].concat(_toConsumableArray(state[action.component].hits),_toConsumableArray(action.hits)),total:action.total,time:action.time,hidden:action.hidden||0}));}return _extends({},state,_defineProperty({},action.component,{hits:action.hits,total:action.total,time:action.time,hidden:action.hidden||0}));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,127 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_INTERNAL_VALUE = 'SET_INTERNAL_VALUE'; | ||
var CLEAR_VALUES = 'CLEAR_VALUES'; | ||
var RESET_TO_DEFAULT = 'RESET_TO_DEFAULT'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function valueReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
switch (action.type) { | ||
case SET_INTERNAL_VALUE: | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, { | ||
value: action.value, | ||
componentType: action.componentType, | ||
category: action.category, | ||
meta: action.meta | ||
})); | ||
case CLEAR_VALUES: | ||
{ | ||
var nextState = {}; | ||
if (action.resetValues) { | ||
Object.keys(action.resetValues).forEach(function (componentId) { | ||
nextState[componentId] = _objectSpread(_objectSpread({}, state[componentId]), {}, { | ||
value: action.resetValues[componentId] | ||
}); | ||
}); | ||
} | ||
// clearAllBlacklistComponents has more priority over reset values | ||
if (Array.isArray(action.clearAllBlacklistComponents)) { | ||
Object.keys(state).forEach(function (componentId) { | ||
if (action.clearAllBlacklistComponents.includes(componentId)) { | ||
nextState[componentId] = state[componentId]; | ||
} | ||
}); | ||
} | ||
return nextState; | ||
} | ||
case RESET_TO_DEFAULT: | ||
return _objectSpread(_objectSpread({}, state), action.defaultValues); | ||
case REMOVE_COMPONENT: | ||
{ | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
default: | ||
return state; | ||
} | ||
} | ||
module.exports = valueReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=valueReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function valueReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];switch(action.type){case _constants.SET_INTERNAL_VALUE:return _extends({},state,_defineProperty({},action.component,{value:action.value,componentType:action.componentType,category:action.category,meta:action.meta}));case _constants.CLEAR_VALUES:{var nextState={};if(action.resetValues){Object.keys(action.resetValues).forEach(function(componentId){nextState[componentId]=_extends({},state[componentId],{value:action.resetValues[componentId]});});}if(Array.isArray(action.clearAllBlacklistComponents)){Object.keys(state).forEach(function(componentId){if(action.clearAllBlacklistComponents.includes(componentId)){nextState[componentId]=state[componentId];}});}return nextState;}case _constants.RESET_TO_DEFAULT:return _extends({},state,action.defaultValues);case _constants.REMOVE_COMPONENT:{var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}default:return state;}} |
@@ -1,103 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_LOADING = 'SET_LOADING'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function loadingReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_LOADING) { | ||
var _objectSpread2; | ||
var requestCount = state["".concat(action.component, "_active")] || 0; | ||
if (action.isLoading) { | ||
requestCount += 1; | ||
} else if (requestCount) { | ||
requestCount -= 1; | ||
} | ||
return _objectSpread(_objectSpread({}, state), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, action.component, action.isLoading), _defineProperty(_objectSpread2, "".concat(action.component, "_active"), requestCount), _objectSpread2), action.isLoading ? _defineProperty({}, "".concat(action.component, "_timestamp"), new Date().getTime()) : null); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component, | ||
_ref2 = "".concat(action.component, "_active"); | ||
state[_action$component]; | ||
state[_ref2]; | ||
var obj = _objectWithoutProperties(state, [_action$component, _ref2].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = loadingReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=loadingReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function loadingReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_LOADING){var _extends2;var requestCount=state[action.component+'_active']||0;if(action.isLoading){requestCount+=1;}else if(requestCount){requestCount-=1;}return _extends({},state,(_extends2={},_defineProperty(_extends2,action.component,action.isLoading),_defineProperty(_extends2,action.component+'_active',requestCount),_extends2),action.isLoading?_defineProperty({},action.component+'_timestamp',new Date().getTime()):null);}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],del2=state[action.component+'_active'],obj=_objectWithoutProperties(state,[action.component,action.component+'_active']);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var LOG_QUERY = 'LOG_QUERY'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function logsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === LOG_QUERY) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.query)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = logsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=logsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function logsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.LOG_QUERY){return _extends({},state,_defineProperty({},action.component,action.query));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,100 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_MAP_DATA = 'SET_MAP_DATA'; | ||
var SET_MAP_RESULTS = 'SET_MAP_RESULTS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function mapDataReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_MAP_DATA) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.componentId, { | ||
query: action.query, | ||
persistMapQuery: action.persistMapQuery | ||
})); | ||
} else if (action.type === SET_MAP_RESULTS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.componentId, _objectSpread(_objectSpread({}, state[action.componentId]), action.payload))); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = mapDataReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=mapDataReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function mapDataReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_MAP_DATA){return _extends({},state,_defineProperty({},action.componentId,{query:action.query,persistMapQuery:action.persistMapQuery}));}else if(action.type===_constants.SET_MAP_RESULTS){return _extends({},state,_defineProperty({},action.componentId,_extends({},state[action.componentId],action.payload)));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,98 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_PROMOTED_RESULTS = 'SET_PROMOTED_RESULTS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function promotedResultsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_PROMOTED_RESULTS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.results.map(function (item) { | ||
return _objectSpread(_objectSpread({}, item), {}, { | ||
_promoted: true | ||
}); | ||
}))); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = promotedResultsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=promotedResultsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function promotedResultsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_PROMOTED_RESULTS){return _extends({},state,_defineProperty({},action.component,action.results.map(function(item){return _extends({},item,{_promoted:true});})));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,103 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_PROPS = 'SET_PROPS'; | ||
var UPDATE_PROPS = 'UPDATE_PROPS'; | ||
var REMOVE_PROPS = 'REMOVE_PROPS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function queryOptionsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
switch (action.type) { | ||
case SET_PROPS: | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.options)); | ||
case UPDATE_PROPS: | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, _objectSpread(_objectSpread({}, state[action.component]), action.options))); | ||
case REMOVE_PROPS: | ||
case REMOVE_COMPONENT: | ||
{ | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
default: | ||
return state; | ||
} | ||
} | ||
module.exports = queryOptionsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=queryOptionsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function queryOptionsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];switch(action.type){case _constants.SET_PROPS:return _extends({},state,_defineProperty({},action.component,action.options));case _constants.UPDATE_PROPS:return _extends({},state,_defineProperty({},action.component,_extends({},state[action.component],action.options)));case _constants.REMOVE_PROPS:case _constants.REMOVE_COMPONENT:{var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}default:return state;}} |
@@ -1,97 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_QUERY_LISTENER = 'SET_QUERY_LISTENER'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function queryListenerReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_QUERY_LISTENER) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, { | ||
onQueryChange: action.onQueryChange, | ||
onError: action.onError | ||
})); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = queryListenerReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=queryListenerReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function queryListenerReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_QUERY_LISTENER){return _extends({},state,_defineProperty({},action.component,{onQueryChange:action.onQueryChange,onError:action.onError}));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_QUERY_OPTIONS = 'SET_QUERY_OPTIONS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function queryOptionsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_QUERY_OPTIONS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.options)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = queryOptionsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=queryOptionsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function queryOptionsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_QUERY_OPTIONS){return _extends({},state,_defineProperty({},action.component,action.options));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_QUERY = 'SET_QUERY'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function queryReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_QUERY) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.query)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = queryReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=queryReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function queryReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_QUERY){return _extends({},state,_defineProperty({},action.component,action.query));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,57 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_POPULAR_SUGGESTIONS = 'SET_POPULAR_SUGGESTIONS'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function querySuggestionsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_POPULAR_SUGGESTIONS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.suggestions)); | ||
} | ||
return state; | ||
} | ||
module.exports = querySuggestionsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=querySuggestionsReducer;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function querySuggestionsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_POPULAR_SUGGESTIONS){return _extends({},state,_defineProperty({},action.component,action.suggestions));}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_QUERY_TO_HITS = 'SET_QUERY_TO_HITS'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function queryToHitsReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_QUERY_TO_HITS) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.query)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = queryToHitsReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=queryToHitsReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function queryToHitsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_QUERY_TO_HITS){return _extends({},state,_defineProperty({},action.component,action.query));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_RAW_DATA = 'SET_RAW_DATA'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function rawDataReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_RAW_DATA) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.response)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = rawDataReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=rawDataReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function rawDataReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_RAW_DATA){return _extends({},state,_defineProperty({},action.component,action.response));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,22 +0,1 @@ | ||
'use strict'; | ||
var RECENT_SEARCHES_SUCCESS = 'RECENT_SEARCHES_SUCCESS'; | ||
var RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR'; | ||
function recentSearchesReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === RECENT_SEARCHES_SUCCESS) { | ||
return { | ||
error: null, | ||
data: action.data | ||
}; | ||
} else if (action.type === RECENT_SEARCHES_ERROR) { | ||
return { | ||
error: action.error | ||
}; | ||
} | ||
return state; | ||
} | ||
module.exports = recentSearchesReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.default=recentSearchesReducer;var _constants=require('../constants');function recentSearchesReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.RECENT_SEARCHES_SUCCESS){return{error:null,data:action.data};}else if(action.type===_constants.RECENT_SEARCHES_ERROR){return{error:action.error};}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var SET_REGISTERED_COMPONENT_TIMESTAMP = 'SET_REGISTERED_COMPONENT_TIMESTAMP'; | ||
var REMOVE_REGISTERED_COMPONENT_TIMESTAMP = 'REMOVE_REGISTERED_COMPONENT_TIMESTAMP'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function timestampReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_REGISTERED_COMPONENT_TIMESTAMP) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.timestamp)); | ||
} else if (action.type === REMOVE_REGISTERED_COMPONENT_TIMESTAMP) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = timestampReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=timestampReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function timestampReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_REGISTERED_COMPONENT_TIMESTAMP){return _extends({},state,_defineProperty({},action.component,action.timestamp));}else if(action.type===_constants.REMOVE_REGISTERED_COMPONENT_TIMESTAMP){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,94 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var SET_TIMESTAMP = 'SET_TIMESTAMP'; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function timestampReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === SET_TIMESTAMP) { | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, action.timestamp)); | ||
} else if (action.type === REMOVE_COMPONENT) { | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
return state; | ||
} | ||
module.exports = timestampReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=timestampReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function timestampReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_TIMESTAMP){return _extends({},state,_defineProperty({},action.component,action.timestamp));}else if(action.type===_constants.REMOVE_COMPONENT){var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}return state;} |
@@ -1,161 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
function _toPrimitive$1(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey$1(arg) { | ||
var key = _toPrimitive$1(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey$1(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var REMOVE_COMPONENT = 'REMOVE_COMPONENT'; | ||
var PATCH_VALUE = 'PATCH_VALUE'; | ||
var CLEAR_VALUES = 'CLEAR_VALUES'; | ||
var SET_VALUE = 'SET_VALUE'; | ||
var SET_VALUES = 'SET_VALUES'; | ||
var RESET_TO_DEFAULT = 'RESET_TO_DEFAULT'; | ||
var _excluded = ["value"]; | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function valueReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
switch (action.type) { | ||
case SET_VALUE: | ||
{ | ||
var newState = {}; | ||
Object.keys(action.componentsToReset || {}).forEach(function (id) { | ||
newState[id] = _objectSpread(_objectSpread({}, state[id]), {}, { | ||
value: action.componentsToReset[id] | ||
}); | ||
}); | ||
return _objectSpread(_objectSpread(_objectSpread({}, state), newState), {}, _defineProperty({}, action.component, { | ||
value: action.value, | ||
label: action.label || action.component, | ||
showFilter: action.showFilter, | ||
URLParams: action.URLParams, | ||
componentType: action.componentType, | ||
category: action.category, | ||
meta: action.meta, | ||
reference: action.reference | ||
})); | ||
} | ||
case SET_VALUES: | ||
{ | ||
var componentKeys = action.componentsValues ? Object.keys(action.componentsValues) : []; | ||
if (componentKeys.length) { | ||
var _newState = {}; | ||
componentKeys.forEach(function (component) { | ||
var _action$componentsVal = action.componentsValues[component], | ||
value = _action$componentsVal.value, | ||
rest = _objectWithoutProperties(_action$componentsVal, _excluded); | ||
_newState[component] = _objectSpread(_objectSpread({}, state[component]), {}, { | ||
value: value | ||
}, rest); | ||
}); | ||
return _objectSpread(_objectSpread({}, state), _newState); | ||
} | ||
return state; | ||
} | ||
case PATCH_VALUE: | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.component, _objectSpread(_objectSpread({}, state[action.component]), action.payload))); | ||
case CLEAR_VALUES: | ||
{ | ||
var nextState = {}; | ||
if (action.resetValues) { | ||
Object.keys(action.resetValues).forEach(function (componentId) { | ||
nextState[componentId] = _objectSpread(_objectSpread({}, state[componentId]), {}, { | ||
value: action.resetValues[componentId] | ||
}); | ||
}); | ||
} | ||
// clearAllBlacklistComponents has more priority over reset values | ||
if (Array.isArray(action.clearAllBlacklistComponents)) { | ||
Object.keys(state).forEach(function (componentId) { | ||
if (action.clearAllBlacklistComponents.includes(componentId)) { | ||
nextState[componentId] = state[componentId]; | ||
} | ||
}); | ||
} | ||
return nextState; | ||
} | ||
case REMOVE_COMPONENT: | ||
{ | ||
var _action$component = action.component; | ||
state[_action$component]; | ||
var obj = _objectWithoutProperties(state, [_action$component].map(_toPropertyKey)); | ||
return obj; | ||
} | ||
case RESET_TO_DEFAULT: | ||
return _objectSpread(_objectSpread({}, state), action.defaultValues); | ||
default: | ||
return state; | ||
} | ||
} | ||
module.exports = valueReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=valueReducer;var _constants=require('../constants');function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function valueReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];switch(action.type){case _constants.SET_VALUE:{var newState={};Object.keys(action.componentsToReset||{}).forEach(function(id){newState[id]=_extends({},state[id],{value:action.componentsToReset[id]});});return _extends({},state,newState,_defineProperty({},action.component,{value:action.value,label:action.label||action.component,showFilter:action.showFilter,URLParams:action.URLParams,componentType:action.componentType,category:action.category,meta:action.meta,reference:action.reference}));}case _constants.SET_VALUES:{var componentKeys=action.componentsValues?Object.keys(action.componentsValues):[];if(componentKeys.length){var _newState={};componentKeys.forEach(function(component){var _action$componentsVal=action.componentsValues[component],value=_action$componentsVal.value,rest=_objectWithoutProperties(_action$componentsVal,['value']);_newState[component]=_extends({},state[component],{value:value},rest);});return _extends({},state,_newState);}return state;}case _constants.PATCH_VALUE:return _extends({},state,_defineProperty({},action.component,_extends({},state[action.component],action.payload)));case _constants.CLEAR_VALUES:{var nextState={};if(action.resetValues){Object.keys(action.resetValues).forEach(function(componentId){nextState[componentId]=_extends({},state[componentId],{value:action.resetValues[componentId]});});}if(Array.isArray(action.clearAllBlacklistComponents)){Object.keys(state).forEach(function(componentId){if(action.clearAllBlacklistComponents.includes(componentId)){nextState[componentId]=state[componentId];}});}return nextState;}case _constants.REMOVE_COMPONENT:{var del=state[action.component],obj=_objectWithoutProperties(state,[action.component]);return obj;}case _constants.RESET_TO_DEFAULT:return _extends({},state,action.defaultValues);default:return state;}} |
@@ -1,125 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
var WATCH_COMPONENT = 'WATCH_COMPONENT'; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function getWatchList(depTree) { | ||
var list = Object.values(depTree); | ||
var components = []; | ||
list.forEach(function (item) { | ||
if (typeof item === 'string') { | ||
components.push(item); | ||
} else if (Array.isArray(item)) { | ||
item.forEach(function (component) { | ||
if (typeof component === 'string') { | ||
components.push(component); | ||
} else { | ||
// in this case, we have { <conjunction>: <> } object inside the array | ||
components.push.apply(components, _toConsumableArray(getWatchList(component))); | ||
} | ||
}); | ||
} else if (_typeof(item) === 'object' && item !== null) { | ||
components.push.apply(components, _toConsumableArray(getWatchList(item))); | ||
} | ||
}); | ||
return components.filter(function (value, index, array) { | ||
return array.indexOf(value) === index; | ||
}); | ||
} | ||
function watchManReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
if (action.type === WATCH_COMPONENT) { | ||
var watchList = getWatchList(action.react); | ||
var newState = _objectSpread({}, state); | ||
Object.keys(newState).forEach(function (key) { | ||
newState[key] = newState[key].filter(function (value) { | ||
return value !== action.component; | ||
}); | ||
}); | ||
watchList.forEach(function (item) { | ||
if (Array.isArray(newState[item])) { | ||
newState[item] = [].concat(_toConsumableArray(newState[item]), [action.component]); | ||
} else { | ||
newState[item] = [action.component]; | ||
} | ||
}); | ||
return newState; | ||
} | ||
return state; | ||
} | ||
module.exports = watchManReducer; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=watchManReducer;var _constants=require('../constants');function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function getWatchList(depTree){var list=Object.values(depTree);var components=[];list.forEach(function(item){if(typeof item==='string'){components.push(item);}else if(Array.isArray(item)){item.forEach(function(component){if(typeof component==='string'){components.push(component);}else{components.push.apply(components,_toConsumableArray(getWatchList(component)));}});}else if(typeof item==='object'&&item!==null){components.push.apply(components,_toConsumableArray(getWatchList(item)));}});return components.filter(function(value,index,array){return array.indexOf(value)===index;});}function watchManReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.WATCH_COMPONENT){var watchList=getWatchList(action.react);var newState=_extends({},state);Object.keys(newState).forEach(function(key){newState[key]=newState[key].filter(function(value){return value!==action.component;});});watchList.forEach(function(item){if(Array.isArray(newState[item])){newState[item]=[].concat(_toConsumableArray(newState[item]),[action.component]);}else{newState[item]=[action.component];}});return newState;}return state;} |
@@ -1,206 +0,1 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; | ||
if (null != _i) { | ||
var _s, | ||
_e, | ||
_x, | ||
_r, | ||
_arr = [], | ||
_n = !0, | ||
_d = !1; | ||
try { | ||
if (_x = (_i = _i.call(arr)).next, 0 === i) { | ||
if (Object(_i) !== _i) return; | ||
_n = !1; | ||
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); | ||
} catch (err) { | ||
_d = !0, _e = err; | ||
} finally { | ||
try { | ||
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
} | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var filterComponents = [componentTypes.numberBox, componentTypes.tagCloud, componentTypes.toggleButton, componentTypes.datePicker, componentTypes.dateRange, componentTypes.multiDataList, componentTypes.multiDropdownList, componentTypes.multiList, componentTypes.singleDataList, componentTypes.singleDropdownList, componentTypes.singleList, componentTypes.dynamicRangeSlider, componentTypes.multiDropdownRange, componentTypes.multiRange, componentTypes.rangeSlider, componentTypes.ratingsFilter, componentTypes.singleDropdownRange, componentTypes.singleRange, componentTypes.treeList]; | ||
// components storing range as array | ||
var rangeComponents = [componentTypes.dateRange, componentTypes.dynamicRangeSlider, componentTypes.rangeSlider, componentTypes.rangeInput, componentTypes.ratingsFilter]; | ||
// components storing range as object | ||
var rangeObjectComponents = [componentTypes.singleRange, componentTypes.singleDropdownRange, componentTypes.multiRange, componentTypes.multiDropdownRange]; | ||
function parseRangeObject(filterKey, rangeObject) { | ||
return "".concat(filterKey, "=").concat(rangeObject.start, "~").concat(rangeObject.end); | ||
} | ||
function parseFilterValue(componentId, componentValues) { | ||
var label = componentValues.label, | ||
value = componentValues.value, | ||
componentType = componentValues.componentType; | ||
var filterKey = label || componentId; | ||
if (rangeComponents.includes(componentType)) { | ||
// range components store values as an array to depict start and end range | ||
return "".concat(filterKey, "=").concat(value[0], "~").concat(value[1]); | ||
} else if (rangeObjectComponents.includes(componentType)) { | ||
// for range components with values in the form { start, end } | ||
if (Array.isArray(value)) { | ||
return value.map(function (item) { | ||
return parseRangeObject(filterKey, item); | ||
}).join(); | ||
} | ||
return parseRangeObject(filterKey, value); | ||
} else if (Array.isArray(value)) { | ||
// for components having values in the form { label, value } | ||
var isObject = _typeof(value[0]) === 'object' && value[0] !== null; | ||
return isObject ? value.map(function (item) { | ||
return "".concat(filterKey, "=").concat(item.value); | ||
}).join() : value.map(function (item) { | ||
return "".concat(filterKey, "=").concat(item); | ||
}).join(); | ||
} | ||
return "".concat(filterKey, "=").concat(value); | ||
} | ||
// transforms the selectedValues from store into the X-Search-Filters string for analytics | ||
function getFilterString(selectedValues) { | ||
if (selectedValues && Object.keys(selectedValues).length) { | ||
return Object | ||
// take all selectedValues | ||
.entries(selectedValues) | ||
// filter out filter components having some value | ||
.filter(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
componentValues = _ref2[1]; | ||
return filterComponents.includes(componentValues.componentType) | ||
// in case of an array filter out empty array values as well | ||
&& (componentValues.value && componentValues.value.length | ||
// also consider range values in the shape { start, end } | ||
|| componentValues.value && componentValues.value.start || componentValues.value && componentValues.value.end); | ||
}) | ||
// parse each filter value | ||
.map(function (_ref3) { | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
componentId = _ref4[0], | ||
componentValues = _ref4[1]; | ||
return parseFilterValue(componentId, componentValues); | ||
}) | ||
// return as a string separated with comma | ||
.join(); | ||
} | ||
return null; | ||
} | ||
/** | ||
* Function to parse the custom analytics events | ||
*/ | ||
function parseCustomEvents(customEvents) { | ||
var finalStr = ''; | ||
Object.keys(customEvents).forEach(function (key, index) { | ||
finalStr += "".concat(key, "=").concat(customEvents[key]); | ||
if (index < Object.keys(customEvents).length - 1) { | ||
finalStr += ','; | ||
} | ||
}); | ||
return finalStr; | ||
} | ||
// defaultAnalytics Config | ||
var defaultAnalyticsConfig = { | ||
emptyQuery: true, | ||
suggestionAnalytics: true, | ||
userId: null, | ||
customEvents: null, | ||
enableQueryRules: true | ||
}; | ||
exports.default = getFilterString; | ||
exports.defaultAnalyticsConfig = defaultAnalyticsConfig; | ||
exports.filterComponents = filterComponents; | ||
exports.parseCustomEvents = parseCustomEvents; | ||
exports.parseFilterValue = parseFilterValue; | ||
exports.parseRangeObject = parseRangeObject; | ||
exports.rangeComponents = rangeComponents; | ||
exports.rangeObjectComponents = rangeObjectComponents; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.parseCustomEvents=exports.parseRangeObject=exports.parseFilterValue=exports.rangeObjectComponents=exports.rangeComponents=exports.filterComponents=exports.defaultAnalyticsConfig=undefined;var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[typeof Symbol==='function'?Symbol.iterator:'@@iterator'](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if((typeof Symbol==='function'?Symbol.iterator:'@@iterator')in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _constants=require('../utils/constants');var filterComponents=[_constants.componentTypes.numberBox,_constants.componentTypes.tagCloud,_constants.componentTypes.toggleButton,_constants.componentTypes.datePicker,_constants.componentTypes.dateRange,_constants.componentTypes.multiDataList,_constants.componentTypes.multiDropdownList,_constants.componentTypes.multiList,_constants.componentTypes.singleDataList,_constants.componentTypes.singleDropdownList,_constants.componentTypes.singleList,_constants.componentTypes.dynamicRangeSlider,_constants.componentTypes.multiDropdownRange,_constants.componentTypes.multiRange,_constants.componentTypes.rangeSlider,_constants.componentTypes.ratingsFilter,_constants.componentTypes.singleDropdownRange,_constants.componentTypes.singleRange,_constants.componentTypes.treeList];var rangeComponents=[_constants.componentTypes.dateRange,_constants.componentTypes.dynamicRangeSlider,_constants.componentTypes.rangeSlider,_constants.componentTypes.rangeInput,_constants.componentTypes.ratingsFilter];var rangeObjectComponents=[_constants.componentTypes.singleRange,_constants.componentTypes.singleDropdownRange,_constants.componentTypes.multiRange,_constants.componentTypes.multiDropdownRange];function parseRangeObject(filterKey,rangeObject){return filterKey+'='+rangeObject.start+'~'+rangeObject.end;}function parseFilterValue(componentId,componentValues){var label=componentValues.label,value=componentValues.value,componentType=componentValues.componentType;var filterKey=label||componentId;if(rangeComponents.includes(componentType)){return filterKey+'='+value[0]+'~'+value[1];}else if(rangeObjectComponents.includes(componentType)){if(Array.isArray(value)){return value.map(function(item){return parseRangeObject(filterKey,item);}).join();}return parseRangeObject(filterKey,value);}else if(Array.isArray(value)){var isObject=typeof value[0]==='object'&&value[0]!==null;return isObject?value.map(function(item){return filterKey+'='+item.value;}).join():value.map(function(item){return filterKey+'='+item;}).join();}return filterKey+'='+value;}function getFilterString(selectedValues){if(selectedValues&&Object.keys(selectedValues).length){return Object.entries(selectedValues).filter(function(_ref){var _ref2=_slicedToArray(_ref,2),componentValues=_ref2[1];return filterComponents.includes(componentValues.componentType)&&(componentValues.value&&componentValues.value.length||componentValues.value&&componentValues.value.start||componentValues.value&&componentValues.value.end);}).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),componentId=_ref4[0],componentValues=_ref4[1];return parseFilterValue(componentId,componentValues);}).join();}return null;}function parseCustomEvents(customEvents){var finalStr='';Object.keys(customEvents).forEach(function(key,index){finalStr+=key+'='+customEvents[key];if(index<Object.keys(customEvents).length-1){finalStr+=',';}});return finalStr;}var defaultAnalyticsConfig=exports.defaultAnalyticsConfig={emptyQuery:true,suggestionAnalytics:true,userId:null,customEvents:null,enableQueryRules:true};exports.filterComponents=filterComponents;exports.rangeComponents=rangeComponents;exports.rangeObjectComponents=rangeObjectComponents;exports.parseFilterValue=parseFilterValue;exports.parseRangeObject=parseRangeObject;exports.parseCustomEvents=parseCustomEvents;exports.default=getFilterString; |
@@ -1,16 +0,1 @@ | ||
'use strict'; | ||
// A map of causes leading to changes in components | ||
var ENTER_PRESS = 'ENTER_PRESS'; | ||
var SUGGESTION_SELECT = 'SUGGESTION_SELECT'; | ||
var CLEAR_VALUE = 'CLEAR_VALUE'; | ||
var SEARCH_ICON_CLICK = 'SEARCH_ICON_CLICK'; | ||
var causes = { | ||
ENTER_PRESS: ENTER_PRESS, | ||
SUGGESTION_SELECT: SUGGESTION_SELECT, | ||
CLEAR_VALUE: CLEAR_VALUE, | ||
SEARCH_ICON_CLICK: SEARCH_ICON_CLICK | ||
}; | ||
module.exports = causes; | ||
Object.defineProperty(exports,"__esModule",{value:true});var ENTER_PRESS='ENTER_PRESS';var SUGGESTION_SELECT='SUGGESTION_SELECT';var CLEAR_VALUE='CLEAR_VALUE';var SEARCH_ICON_CLICK='SEARCH_ICON_CLICK';var causes={ENTER_PRESS:ENTER_PRESS,SUGGESTION_SELECT:SUGGESTION_SELECT,CLEAR_VALUE:CLEAR_VALUE,SEARCH_ICON_CLICK:SEARCH_ICON_CLICK};exports.default=causes; |
@@ -1,96 +0,1 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var queryTypes = { | ||
search: 'search', | ||
term: 'term', | ||
range: 'range', | ||
geo: 'geo', | ||
suggestion: 'suggestion' | ||
}; | ||
var validProps = [ | ||
// common | ||
'type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', | ||
// Specific to ReactiveList | ||
'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', | ||
// Specific to DataSearch | ||
'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', | ||
// Specific to Category Search | ||
'categoryField', 'strictSelection', | ||
// Specific to List Components | ||
'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', | ||
// TagCloud and ToggleButton | ||
'multiSelect', | ||
// Range Components | ||
'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', | ||
// Map components | ||
'unit', | ||
// Specific to searchBox | ||
'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions']; | ||
var CLEAR_ALL = { | ||
NEVER: 'never', | ||
ALWAYS: 'always', | ||
DEFAULT: 'default' | ||
}; | ||
// search components modes | ||
var SEARCH_COMPONENTS_MODES = { | ||
SELECT: 'select', | ||
TAG: 'tag' | ||
}; | ||
var TREELIST_VALUES_PATH_SEPARATOR = '◐◑◒◓'; | ||
var constants = { | ||
componentTypes: componentTypes, | ||
queryTypes: queryTypes, | ||
validProps: validProps, | ||
CLEAR_ALL: CLEAR_ALL, | ||
SEARCH_COMPONENTS_MODES: SEARCH_COMPONENTS_MODES, | ||
TREELIST_VALUES_PATH_SEPARATOR: TREELIST_VALUES_PATH_SEPARATOR | ||
}; | ||
exports.CLEAR_ALL = CLEAR_ALL; | ||
exports.SEARCH_COMPONENTS_MODES = SEARCH_COMPONENTS_MODES; | ||
exports.TREELIST_VALUES_PATH_SEPARATOR = TREELIST_VALUES_PATH_SEPARATOR; | ||
exports.componentTypes = componentTypes; | ||
exports.default = constants; | ||
exports.queryTypes = queryTypes; | ||
exports.validProps = validProps; | ||
Object.defineProperty(exports,"__esModule",{value:true});var componentTypes=exports.componentTypes={reactiveList:'REACTIVELIST',dataSearch:'DATASEARCH',categorySearch:'CATEGORYSEARCH',searchBox:'SEARCHBOX',singleList:'SINGLELIST',multiList:'MULTILIST',singleDataList:'SINGLEDATALIST',tabDataList:'TABDATALIST',singleDropdownList:'SINGLEDROPDOWNLIST',multiDataList:'MULTIDATALIST',multiDropdownList:'MULTIDROPDOWNLIST',singleDropdownRange:'SINGLEDROPDOWNRANGE',treeList:'TREELIST',numberBox:'NUMBERBOX',tagCloud:'TAGCLOUD',toggleButton:'TOGGLEBUTTON',reactiveComponent:'REACTIVECOMPONENT',datePicker:'DATEPICKER',dateRange:'DATERANGE',dynamicRangeSlider:'DYNAMICRANGESLIDER',multiDropdownRange:'MULTIDROPDOWNRANGE',singleRange:'SINGLERANGE',multiRange:'MULTIRANGE',rangeSlider:'RANGESLIDER',ratingsFilter:'RATINGSFILTER',rangeInput:'RANGEINPUT',geoDistanceDropdown:'GEO_DISTANCE_DROPDOWN',geoDistanceSlider:'GEO_DISTANCE_SLIDER',reactiveMap:'REACTIVE_MAP',reactiveChart:'REACTIVE_CHART',AIAnswer:'AI_ANSWER'};var queryTypes=exports.queryTypes={search:'search',term:'term',range:'range',geo:'geo',suggestion:'suggestion'};var validProps=exports.validProps=['type','componentType','aggregationField','aggregationSize','distinctField','distinctFieldConfig','index','aggregations','dataField','includeFields','excludeFields','size','from','sortBy','sortOptions','pagination','autoFocus','autosuggest','debounce','defaultValue','defaultSuggestions','fieldWeights','filterLabel','fuzziness','highlight','highlightConfig','highlightField','nestedField','placeholder','queryFormat','searchOperators','enableSynonyms','enableQuerySuggestions','queryString','categoryField','strictSelection','selectAllLabel','showCheckbox','showFilter','showSearch','showCount','showLoadMore','loadMoreLabel','showMissing','missingLabel','data','showRadio','multiSelect','includeNullValues','interval','showHistogram','snap','stepValue','range','showSlider','parseDate','calendarInterval','unit','enablePopularSuggestions','enableRecentSuggestions','popularSuggestionsConfig','recentSuggestionsConfig','indexSuggestionsConfig','featuredSuggestionsConfig','enablePredictiveSuggestions','applyStopwords','customStopwords','enableIndexSuggestions','enableFeaturedSuggestions','searchboxId','endpoint','enableEndpointSuggestions','enableAI','AIConfig'];var CLEAR_ALL=exports.CLEAR_ALL={NEVER:'never',ALWAYS:'always',DEFAULT:'default'};var SEARCH_COMPONENTS_MODES=exports.SEARCH_COMPONENTS_MODES={SELECT:'select',TAG:'tag'};var TREELIST_VALUES_PATH_SEPARATOR=exports.TREELIST_VALUES_PATH_SEPARATOR='◐◑◒◓';var AI_ROLES=exports.AI_ROLES={USER:'user',SYSTEM:'system',ASSISTANT:'assistant'};var AI_LOCAL_CACHE_KEY=exports.AI_LOCAL_CACHE_KEY='AISessions'; |
@@ -1,15 +0,1 @@ | ||
'use strict'; | ||
var dateFormats = { | ||
date: 'YYYY-MM-DD', | ||
basic_date: 'YYYYMMDD', | ||
basic_date_time: 'YYYYMMDD[T]HHmmss.SSSZ', | ||
basic_date_time_no_millis: 'YYYYMMDD[T]HHmmssZ', | ||
date_time_no_millis: 'YYYY-MM-DD[T]HH:mm:ssZ', | ||
basic_time: 'HHmmss.SSSZ', | ||
basic_time_no_millis: 'HHmmssZ', | ||
epoch_millis: 'epoch_millis', | ||
epoch_second: 'epoch_second' | ||
}; | ||
module.exports = dateFormats; | ||
Object.defineProperty(exports,"__esModule",{value:true});var dateFormats={date:'YYYY-MM-DD',basic_date:'YYYYMMDD',basic_date_time:'YYYYMMDD[T]HHmmss.SSSZ',basic_date_time_no_millis:'YYYYMMDD[T]HHmmssZ',date_time_no_millis:'YYYY-MM-DD[T]HH:mm:ssZ',basic_time:'HHmmss.SSSZ',basic_time_no_millis:'HHmmssZ',epoch_millis:'epoch_millis',epoch_second:'epoch_second'};exports.default=dateFormats; |
@@ -1,1248 +0,1 @@ | ||
'use strict'; | ||
var diacritics = { | ||
'«': '"', | ||
'²': '2', | ||
'³': '3', | ||
'¹': '1', | ||
'»': '"', | ||
À: 'A', | ||
Á: 'A', | ||
Â: 'A', | ||
Ã: 'A', | ||
Ä: 'A', | ||
Å: 'A', | ||
Æ: 'AE', | ||
Ç: 'C', | ||
È: 'E', | ||
É: 'E', | ||
Ê: 'E', | ||
Ë: 'E', | ||
Ì: 'I', | ||
Í: 'I', | ||
Î: 'I', | ||
Ï: 'I', | ||
Ð: 'D', | ||
Ñ: 'N', | ||
Ò: 'O', | ||
Ó: 'O', | ||
Ô: 'O', | ||
Õ: 'O', | ||
Ö: 'O', | ||
Ø: 'O', | ||
Ù: 'U', | ||
Ú: 'U', | ||
Û: 'U', | ||
Ü: 'U', | ||
Ý: 'Y', | ||
Þ: 'TH', | ||
ß: 'ss', | ||
à: 'a', | ||
á: 'a', | ||
â: 'a', | ||
ã: 'a', | ||
ä: 'a', | ||
å: 'a', | ||
æ: 'ae', | ||
ç: 'c', | ||
è: 'e', | ||
é: 'e', | ||
ê: 'e', | ||
ë: 'e', | ||
ì: 'i', | ||
í: 'i', | ||
î: 'i', | ||
ï: 'i', | ||
ð: 'd', | ||
ñ: 'n', | ||
ò: 'o', | ||
ó: 'o', | ||
ô: 'o', | ||
õ: 'o', | ||
ö: 'o', | ||
ø: 'o', | ||
ù: 'u', | ||
ú: 'u', | ||
û: 'u', | ||
ü: 'u', | ||
ý: 'y', | ||
þ: 'th', | ||
ÿ: 'y', | ||
Ā: 'A', | ||
ā: 'a', | ||
Ă: 'A', | ||
ă: 'a', | ||
Ą: 'A', | ||
ą: 'a', | ||
Ć: 'C', | ||
ć: 'c', | ||
Ĉ: 'C', | ||
ĉ: 'c', | ||
Ċ: 'C', | ||
ċ: 'c', | ||
Č: 'C', | ||
č: 'c', | ||
Ď: 'D', | ||
ď: 'd', | ||
Đ: 'D', | ||
đ: 'd', | ||
Ē: 'E', | ||
ē: 'e', | ||
Ĕ: 'E', | ||
ĕ: 'e', | ||
Ė: 'E', | ||
ė: 'e', | ||
Ę: 'E', | ||
ę: 'e', | ||
Ě: 'E', | ||
ě: 'e', | ||
Ĝ: 'G', | ||
ĝ: 'g', | ||
Ğ: 'G', | ||
ğ: 'g', | ||
Ġ: 'G', | ||
ġ: 'g', | ||
Ģ: 'G', | ||
ģ: 'g', | ||
Ĥ: 'H', | ||
ĥ: 'h', | ||
Ħ: 'H', | ||
ħ: 'h', | ||
Ĩ: 'I', | ||
ĩ: 'i', | ||
Ī: 'I', | ||
ī: 'i', | ||
Ĭ: 'I', | ||
ĭ: 'i', | ||
Į: 'I', | ||
į: 'i', | ||
İ: 'I', | ||
ı: 'i', | ||
IJ: 'IJ', | ||
ij: 'ij', | ||
Ĵ: 'J', | ||
ĵ: 'j', | ||
Ķ: 'K', | ||
ķ: 'k', | ||
ĸ: 'q', | ||
Ĺ: 'L', | ||
ĺ: 'l', | ||
Ļ: 'L', | ||
ļ: 'l', | ||
Ľ: 'L', | ||
ľ: 'l', | ||
Ŀ: 'L', | ||
ŀ: 'l', | ||
Ł: 'L', | ||
ł: 'l', | ||
Ń: 'N', | ||
ń: 'n', | ||
Ņ: 'N', | ||
ņ: 'n', | ||
Ň: 'N', | ||
ň: 'n', | ||
ʼn: 'n', | ||
Ŋ: 'N', | ||
ŋ: 'n', | ||
Ō: 'O', | ||
ō: 'o', | ||
Ŏ: 'O', | ||
ŏ: 'o', | ||
Ő: 'O', | ||
ő: 'o', | ||
Œ: 'OE', | ||
œ: 'oe', | ||
Ŕ: 'R', | ||
ŕ: 'r', | ||
Ŗ: 'R', | ||
ŗ: 'r', | ||
Ř: 'R', | ||
ř: 'r', | ||
Ś: 'S', | ||
ś: 's', | ||
Ŝ: 'S', | ||
ŝ: 's', | ||
Ş: 'S', | ||
ş: 's', | ||
Š: 'S', | ||
š: 's', | ||
Ţ: 'T', | ||
ţ: 't', | ||
Ť: 'T', | ||
ť: 't', | ||
Ŧ: 'T', | ||
ŧ: 't', | ||
Ũ: 'U', | ||
ũ: 'u', | ||
Ū: 'U', | ||
ū: 'u', | ||
Ŭ: 'U', | ||
ŭ: 'u', | ||
Ů: 'U', | ||
ů: 'u', | ||
Ű: 'U', | ||
ű: 'u', | ||
Ų: 'U', | ||
ų: 'u', | ||
Ŵ: 'W', | ||
ŵ: 'w', | ||
Ŷ: 'Y', | ||
ŷ: 'y', | ||
Ÿ: 'Y', | ||
Ź: 'Z', | ||
ź: 'z', | ||
Ż: 'Z', | ||
ż: 'z', | ||
Ž: 'Z', | ||
ž: 'z', | ||
ſ: 's', | ||
ƀ: 'b', | ||
Ɓ: 'B', | ||
Ƃ: 'B', | ||
ƃ: 'b', | ||
Ɔ: 'O', | ||
Ƈ: 'C', | ||
ƈ: 'c', | ||
Ɖ: 'D', | ||
Ɗ: 'D', | ||
Ƌ: 'D', | ||
ƌ: 'd', | ||
Ǝ: 'E', | ||
Ə: 'A', | ||
Ɛ: 'E', | ||
Ƒ: 'F', | ||
ƒ: 'f', | ||
Ɠ: 'G', | ||
ƕ: 'hv', | ||
Ɩ: 'I', | ||
Ɨ: 'I', | ||
Ƙ: 'K', | ||
ƙ: 'k', | ||
ƚ: 'l', | ||
Ɯ: 'M', | ||
Ɲ: 'N', | ||
ƞ: 'n', | ||
Ɵ: 'O', | ||
Ơ: 'O', | ||
ơ: 'o', | ||
Ƥ: 'P', | ||
ƥ: 'p', | ||
ƫ: 't', | ||
Ƭ: 'T', | ||
ƭ: 't', | ||
Ʈ: 'T', | ||
Ư: 'U', | ||
ư: 'u', | ||
Ʋ: 'V', | ||
Ƴ: 'Y', | ||
ƴ: 'y', | ||
Ƶ: 'Z', | ||
ƶ: 'z', | ||
ƿ: 'w', | ||
DŽ: 'DZ', | ||
Dž: 'Dz', | ||
dž: 'dz', | ||
LJ: 'LJ', | ||
Lj: 'Lj', | ||
lj: 'lj', | ||
NJ: 'NJ', | ||
Nj: 'Nj', | ||
nj: 'nj', | ||
Ǎ: 'A', | ||
ǎ: 'a', | ||
Ǐ: 'I', | ||
ǐ: 'i', | ||
Ǒ: 'O', | ||
ǒ: 'o', | ||
Ǔ: 'U', | ||
ǔ: 'u', | ||
Ǖ: 'U', | ||
ǖ: 'u', | ||
Ǘ: 'U', | ||
ǘ: 'u', | ||
Ǚ: 'U', | ||
ǚ: 'u', | ||
Ǜ: 'U', | ||
ǜ: 'u', | ||
ǝ: 'e', | ||
Ǟ: 'A', | ||
ǟ: 'a', | ||
Ǡ: 'A', | ||
ǡ: 'a', | ||
Ǣ: 'AE', | ||
ǣ: 'ae', | ||
Ǥ: 'G', | ||
ǥ: 'G', | ||
Ǧ: 'G', | ||
ǧ: 'G', | ||
Ǩ: 'K', | ||
ǩ: 'k', | ||
Ǫ: 'O', | ||
ǫ: 'o', | ||
Ǭ: 'O', | ||
ǭ: 'o', | ||
ǰ: 'j', | ||
DZ: 'DZ', | ||
Dz: 'Dz', | ||
dz: 'dz', | ||
Ǵ: 'G', | ||
ǵ: 'g', | ||
Ƕ: 'HV', | ||
Ƿ: 'W', | ||
Ǹ: 'N', | ||
ǹ: 'n', | ||
Ǻ: 'A', | ||
ǻ: 'a', | ||
Ǽ: 'AE', | ||
ǽ: 'ae', | ||
Ǿ: 'O', | ||
ǿ: 'o', | ||
Ȁ: 'A', | ||
ȁ: 'a', | ||
Ȃ: 'A', | ||
ȃ: 'a', | ||
Ȅ: 'E', | ||
ȅ: 'e', | ||
Ȇ: 'E', | ||
ȇ: 'e', | ||
Ȉ: 'I', | ||
ȉ: 'i', | ||
Ȋ: 'I', | ||
ȋ: 'i', | ||
Ȍ: 'O', | ||
ȍ: 'o', | ||
Ȏ: 'O', | ||
ȏ: 'o', | ||
Ȑ: 'R', | ||
ȑ: 'r', | ||
Ȓ: 'R', | ||
ȓ: 'r', | ||
Ȕ: 'U', | ||
ȕ: 'u', | ||
Ȗ: 'U', | ||
ȗ: 'u', | ||
Ș: 'S', | ||
ș: 's', | ||
Ț: 'T', | ||
ț: 't', | ||
Ȝ: 'Z', | ||
ȝ: 'z', | ||
Ȟ: 'H', | ||
ȟ: 'h', | ||
Ƞ: 'N', | ||
ȡ: 'd', | ||
Ȣ: 'OU', | ||
ȣ: 'ou', | ||
Ȥ: 'Z', | ||
ȥ: 'z', | ||
Ȧ: 'A', | ||
ȧ: 'a', | ||
Ȩ: 'E', | ||
ȩ: 'e', | ||
Ȫ: 'O', | ||
ȫ: 'o', | ||
Ȭ: 'O', | ||
ȭ: 'o', | ||
Ȯ: 'O', | ||
ȯ: 'o', | ||
Ȱ: 'O', | ||
ȱ: 'o', | ||
Ȳ: 'Y', | ||
ȳ: 'y', | ||
ȴ: 'l', | ||
ȵ: 'n', | ||
ȶ: 't', | ||
ȷ: 'j', | ||
ȸ: 'db', | ||
ȹ: 'qp', | ||
Ⱥ: 'A', | ||
Ȼ: 'C', | ||
ȼ: 'c', | ||
Ƚ: 'L', | ||
Ⱦ: 'T', | ||
ȿ: 's', | ||
ɀ: 'z', | ||
Ƀ: 'B', | ||
Ʉ: 'U', | ||
Ʌ: 'V', | ||
Ɇ: 'E', | ||
ɇ: 'e', | ||
Ɉ: 'J', | ||
ɉ: 'j', | ||
Ɋ: 'Q', | ||
ɋ: 'q', | ||
Ɍ: 'R', | ||
ɍ: 'r', | ||
Ɏ: 'Y', | ||
ɏ: 'y', | ||
ɐ: 'a', | ||
ɓ: 'b', | ||
ɔ: 'o', | ||
ɕ: 'c', | ||
ɖ: 'd', | ||
ɗ: 'd', | ||
ɘ: 'e', | ||
ə: 'a', | ||
ɚ: 'a', | ||
ɛ: 'e', | ||
ɜ: 'e', | ||
ɝ: 'e', | ||
ɞ: 'e', | ||
ɟ: 'j', | ||
ɠ: 'g', | ||
ɡ: 'g', | ||
ɢ: 'G', | ||
ɥ: 'h', | ||
ɦ: 'h', | ||
ɨ: 'i', | ||
ɪ: 'I', | ||
ɫ: 'l', | ||
ɬ: 'l', | ||
ɭ: 'l', | ||
ɯ: 'm', | ||
ɰ: 'm', | ||
ɱ: 'm', | ||
ɲ: 'n', | ||
ɳ: 'n', | ||
ɴ: 'N', | ||
ɵ: 'o', | ||
ɶ: 'OE', | ||
ɼ: 'r', | ||
ɽ: 'r', | ||
ɾ: 'r', | ||
ɿ: 'r', | ||
ʀ: 'R', | ||
ʁ: 'R', | ||
ʂ: 's', | ||
ʄ: 'j', | ||
ʇ: 't', | ||
ʈ: 't', | ||
ʉ: 'u', | ||
ʋ: 'v', | ||
ʌ: 'v', | ||
ʍ: 'w', | ||
ʎ: 'y', | ||
ʏ: 'Y', | ||
ʐ: 'z', | ||
ʑ: 'z', | ||
ʗ: 'C', | ||
ʙ: 'B', | ||
ʚ: 'e', | ||
ʛ: 'G', | ||
ʜ: 'H', | ||
ʝ: 'j', | ||
ʞ: 'k', | ||
ʟ: 'L', | ||
ʠ: 'q', | ||
ʣ: 'dz', | ||
ʥ: 'dz', | ||
ʦ: 'ts', | ||
ʨ: 'tc', | ||
ʪ: 'ls', | ||
ʫ: 'lz', | ||
ʮ: 'h', | ||
ʯ: 'h', | ||
ᴀ: 'A', | ||
ᴁ: 'AE', | ||
ᴂ: 'ae', | ||
ᴃ: 'B', | ||
ᴄ: 'C', | ||
ᴅ: 'D', | ||
ᴆ: 'D', | ||
ᴇ: 'E', | ||
ᴈ: 'e', | ||
ᴉ: 'i', | ||
ᴊ: 'J', | ||
ᴋ: 'K', | ||
ᴌ: 'L', | ||
ᴍ: 'M', | ||
ᴎ: 'N', | ||
ᴏ: 'O', | ||
ᴐ: 'O', | ||
ᴔ: 'oe', | ||
ᴕ: 'OU', | ||
ᴖ: 'o', | ||
ᴗ: 'o', | ||
ᴘ: 'P', | ||
ᴙ: 'R', | ||
ᴚ: 'R', | ||
ᴛ: 'T', | ||
ᴜ: 'U', | ||
ᴠ: 'V', | ||
ᴡ: 'W', | ||
ᴢ: 'Z', | ||
ᵢ: 'i', | ||
ᵣ: 'r', | ||
ᵤ: 'u', | ||
ᵥ: 'v', | ||
ᵫ: 'ue', | ||
ᵬ: 'b', | ||
ᵭ: 'd', | ||
ᵮ: 'f', | ||
ᵯ: 'm', | ||
ᵰ: 'n', | ||
ᵱ: 'p', | ||
ᵲ: 'r', | ||
ᵳ: 'r', | ||
ᵴ: 's', | ||
ᵵ: 't', | ||
ᵶ: 'z', | ||
ᵷ: 'g', | ||
ᵹ: 'g', | ||
ᵺ: 'th', | ||
ᵻ: 'I', | ||
ᵼ: 'i', | ||
ᵽ: 'p', | ||
ᵾ: 'U', | ||
ᶀ: 'b', | ||
ᶁ: 'd', | ||
ᶂ: 'f', | ||
ᶃ: 'g', | ||
ᶄ: 'k', | ||
ᶅ: 'l', | ||
ᶆ: 'm', | ||
ᶇ: 'n', | ||
ᶈ: 'p', | ||
ᶉ: 'r', | ||
ᶊ: 's', | ||
ᶌ: 'v', | ||
ᶍ: 'x', | ||
ᶎ: 'z', | ||
ᶏ: 'a', | ||
ᶑ: 'd', | ||
ᶒ: 'e', | ||
ᶓ: 'e', | ||
ᶔ: 'e', | ||
ᶕ: 'a', | ||
ᶖ: 'i', | ||
ᶗ: 'o', | ||
ᶙ: 'u', | ||
Ḁ: 'A', | ||
ḁ: 'a', | ||
Ḃ: 'B', | ||
ḃ: 'b', | ||
Ḅ: 'B', | ||
ḅ: 'b', | ||
Ḇ: 'B', | ||
ḇ: 'b', | ||
Ḉ: 'C', | ||
ḉ: 'c', | ||
Ḋ: 'D', | ||
ḋ: 'd', | ||
Ḍ: 'D', | ||
ḍ: 'd', | ||
Ḏ: 'D', | ||
ḏ: 'd', | ||
Ḑ: 'D', | ||
ḑ: 'd', | ||
Ḓ: 'D', | ||
ḓ: 'd', | ||
Ḕ: 'E', | ||
ḕ: 'e', | ||
Ḗ: 'E', | ||
ḗ: 'e', | ||
Ḙ: 'E', | ||
ḙ: 'e', | ||
Ḛ: 'E', | ||
ḛ: 'e', | ||
Ḝ: 'E', | ||
ḝ: 'e', | ||
Ḟ: 'F', | ||
ḟ: 'f', | ||
Ḡ: 'G', | ||
ḡ: 'g', | ||
Ḣ: 'H', | ||
ḣ: 'h', | ||
Ḥ: 'H', | ||
ḥ: 'h', | ||
Ḧ: 'H', | ||
ḧ: 'h', | ||
Ḩ: 'H', | ||
ḩ: 'h', | ||
Ḫ: 'H', | ||
ḫ: 'h', | ||
Ḭ: 'I', | ||
ḭ: 'i', | ||
Ḯ: 'I', | ||
ḯ: 'i', | ||
Ḱ: 'K', | ||
ḱ: 'k', | ||
Ḳ: 'K', | ||
ḳ: 'k', | ||
Ḵ: 'K', | ||
ḵ: 'k', | ||
Ḷ: 'L', | ||
ḷ: 'l', | ||
Ḹ: 'L', | ||
ḹ: 'l', | ||
Ḻ: 'L', | ||
ḻ: 'l', | ||
Ḽ: 'L', | ||
ḽ: 'l', | ||
Ḿ: 'M', | ||
ḿ: 'm', | ||
Ṁ: 'M', | ||
ṁ: 'm', | ||
Ṃ: 'M', | ||
ṃ: 'm', | ||
Ṅ: 'N', | ||
ṅ: 'n', | ||
Ṇ: 'N', | ||
ṇ: 'n', | ||
Ṉ: 'N', | ||
ṉ: 'n', | ||
Ṋ: 'N', | ||
ṋ: 'n', | ||
Ṍ: 'O', | ||
ṍ: 'o', | ||
Ṏ: 'O', | ||
ṏ: 'o', | ||
Ṑ: 'O', | ||
ṑ: 'o', | ||
Ṓ: 'O', | ||
ṓ: 'o', | ||
Ṕ: 'P', | ||
ṕ: 'p', | ||
Ṗ: 'P', | ||
ṗ: 'p', | ||
Ṙ: 'R', | ||
ṙ: 'r', | ||
Ṛ: 'R', | ||
ṛ: 'r', | ||
Ṝ: 'R', | ||
ṝ: 'r', | ||
Ṟ: 'R', | ||
ṟ: 'r', | ||
Ṡ: 'S', | ||
ṡ: 's', | ||
Ṣ: 'S', | ||
ṣ: 's', | ||
Ṥ: 'S', | ||
ṥ: 's', | ||
Ṧ: 'S', | ||
ṧ: 's', | ||
Ṩ: 'S', | ||
ṩ: 's', | ||
Ṫ: 'T', | ||
ṫ: 't', | ||
Ṭ: 'T', | ||
ṭ: 't', | ||
Ṯ: 'T', | ||
ṯ: 't', | ||
Ṱ: 'T', | ||
ṱ: 't', | ||
Ṳ: 'U', | ||
ṳ: 'u', | ||
Ṵ: 'U', | ||
ṵ: 'u', | ||
Ṷ: 'U', | ||
ṷ: 'u', | ||
Ṹ: 'U', | ||
ṹ: 'u', | ||
Ṻ: 'U', | ||
ṻ: 'u', | ||
Ṽ: 'V', | ||
ṽ: 'v', | ||
Ṿ: 'V', | ||
ṿ: 'v', | ||
Ẁ: 'W', | ||
ẁ: 'w', | ||
Ẃ: 'W', | ||
ẃ: 'w', | ||
Ẅ: 'W', | ||
ẅ: 'w', | ||
Ẇ: 'W', | ||
ẇ: 'w', | ||
Ẉ: 'W', | ||
ẉ: 'w', | ||
Ẋ: 'X', | ||
ẋ: 'x', | ||
Ẍ: 'X', | ||
ẍ: 'x', | ||
Ẏ: 'Y', | ||
ẏ: 'y', | ||
Ẑ: 'Z', | ||
ẑ: 'z', | ||
Ẓ: 'Z', | ||
ẓ: 'z', | ||
Ẕ: 'Z', | ||
ẕ: 'z', | ||
ẖ: 'h', | ||
ẗ: 't', | ||
ẘ: 'w', | ||
ẙ: 'y', | ||
ẚ: 'a', | ||
ẛ: 'f', | ||
ẜ: 's', | ||
ẝ: 's', | ||
ẞ: 'SS', | ||
Ạ: 'A', | ||
ạ: 'a', | ||
Ả: 'A', | ||
ả: 'a', | ||
Ấ: 'A', | ||
ấ: 'a', | ||
Ầ: 'A', | ||
ầ: 'a', | ||
Ẩ: 'A', | ||
ẩ: 'a', | ||
Ẫ: 'A', | ||
ẫ: 'a', | ||
Ậ: 'A', | ||
ậ: 'a', | ||
Ắ: 'A', | ||
ắ: 'a', | ||
Ằ: 'A', | ||
ằ: 'a', | ||
Ẳ: 'A', | ||
ẳ: 'a', | ||
Ẵ: 'A', | ||
ẵ: 'a', | ||
Ặ: 'A', | ||
ặ: 'a', | ||
Ẹ: 'E', | ||
ẹ: 'e', | ||
Ẻ: 'E', | ||
ẻ: 'e', | ||
Ẽ: 'E', | ||
ẽ: 'e', | ||
Ế: 'E', | ||
ế: 'e', | ||
Ề: 'E', | ||
ề: 'e', | ||
Ể: 'E', | ||
ể: 'e', | ||
Ễ: 'E', | ||
ễ: 'e', | ||
Ệ: 'E', | ||
ệ: 'e', | ||
Ỉ: 'I', | ||
ỉ: 'i', | ||
Ị: 'I', | ||
ị: 'i', | ||
Ọ: 'O', | ||
ọ: 'o', | ||
Ỏ: 'O', | ||
ỏ: 'o', | ||
Ố: 'O', | ||
ố: 'o', | ||
Ồ: 'O', | ||
ồ: 'o', | ||
Ổ: 'O', | ||
ổ: 'o', | ||
Ỗ: 'O', | ||
ỗ: 'o', | ||
Ộ: 'O', | ||
ộ: 'o', | ||
Ớ: 'O', | ||
ớ: 'o', | ||
Ờ: 'O', | ||
ờ: 'o', | ||
Ở: 'O', | ||
ở: 'o', | ||
Ỡ: 'O', | ||
ỡ: 'o', | ||
Ợ: 'O', | ||
ợ: 'o', | ||
Ụ: 'U', | ||
ụ: 'u', | ||
Ủ: 'U', | ||
ủ: 'u', | ||
Ứ: 'U', | ||
ứ: 'u', | ||
Ừ: 'U', | ||
ừ: 'u', | ||
Ử: 'U', | ||
ử: 'u', | ||
Ữ: 'U', | ||
ữ: 'u', | ||
Ự: 'U', | ||
ự: 'u', | ||
Ỳ: 'Y', | ||
ỳ: 'y', | ||
Ỵ: 'Y', | ||
ỵ: 'y', | ||
Ỷ: 'Y', | ||
ỷ: 'y', | ||
Ỹ: 'Y', | ||
ỹ: 'y', | ||
Ỻ: 'LL', | ||
ỻ: 'll', | ||
Ỽ: 'V', | ||
Ỿ: 'Y', | ||
ỿ: 'y', | ||
'‐': '-', | ||
'‑': '-', | ||
'‒': '-', | ||
'–': '-', | ||
'—': '-', | ||
'‘': '"', | ||
'’': '"', | ||
'‚': '"', | ||
'‛': '"', | ||
'“': '"', | ||
'”': '"', | ||
'„': '"', | ||
'′': '"', | ||
'″': '"', | ||
'‵': '"', | ||
'‶': '"', | ||
'‸': '^', | ||
'‹': '"', | ||
'›': '"', | ||
'‼': '!!', | ||
'⁄': '/', | ||
'⁅': '[', | ||
'⁆': ']', | ||
'⁇': '??', | ||
'⁈': '?!', | ||
'⁉': '!?', | ||
'⁎': '*', | ||
'⁏': ';', | ||
'⁒': '%', | ||
'⁓': '~', | ||
'⁰': '0', | ||
ⁱ: 'i', | ||
'⁴': '4', | ||
'⁵': '5', | ||
'⁶': '6', | ||
'⁷': '7', | ||
'⁸': '8', | ||
'⁹': '9', | ||
'⁺': '+', | ||
'⁻': '-', | ||
'⁼': '=', | ||
'⁽': '(', | ||
'⁾': ')', | ||
ⁿ: 'n', | ||
'₀': '0', | ||
'₁': '1', | ||
'₂': '2', | ||
'₃': '3', | ||
'₄': '4', | ||
'₅': '5', | ||
'₆': '6', | ||
'₇': '7', | ||
'₈': '8', | ||
'₉': '9', | ||
'₊': '+', | ||
'₋': '-', | ||
'₌': '=', | ||
'₍': '(', | ||
'₎': ')', | ||
ₐ: 'a', | ||
ₑ: 'e', | ||
ₒ: 'o', | ||
ₓ: 'x', | ||
ₔ: 'a', | ||
ↄ: 'c', | ||
'①': '1', | ||
'②': '2', | ||
'③': '3', | ||
'④': '4', | ||
'⑤': '5', | ||
'⑥': '6', | ||
'⑦': '7', | ||
'⑧': '8', | ||
'⑨': '9', | ||
'⑩': '10', | ||
'⑪': '11', | ||
'⑫': '12', | ||
'⑬': '13', | ||
'⑭': '14', | ||
'⑮': '15', | ||
'⑯': '16', | ||
'⑰': '17', | ||
'⑱': '18', | ||
'⑲': '19', | ||
'⑳': '20', | ||
'⑴': '(1)', | ||
'⑵': '(2)', | ||
'⑶': '(3)', | ||
'⑷': '(4)', | ||
'⑸': '(5)', | ||
'⑹': '(6)', | ||
'⑺': '(7)', | ||
'⑻': '(8)', | ||
'⑼': '(9)', | ||
'⑽': '(10)', | ||
'⑾': '(11)', | ||
'⑿': '(12)', | ||
'⒀': '(13)', | ||
'⒁': '(14)', | ||
'⒂': '(15)', | ||
'⒃': '(16)', | ||
'⒄': '(17)', | ||
'⒅': '(18)', | ||
'⒆': '(19)', | ||
'⒇': '(20)', | ||
'⒈': '1.', | ||
'⒉': '2.', | ||
'⒊': '3.', | ||
'⒋': '4.', | ||
'⒌': '5.', | ||
'⒍': '6.', | ||
'⒎': '7.', | ||
'⒏': '8.', | ||
'⒐': '9.', | ||
'⒑': '10.', | ||
'⒒': '11.', | ||
'⒓': '12.', | ||
'⒔': '13.', | ||
'⒕': '14.', | ||
'⒖': '15.', | ||
'⒗': '16.', | ||
'⒘': '17.', | ||
'⒙': '18.', | ||
'⒚': '19.', | ||
'⒛': '20.', | ||
'⒜': '(a)', | ||
'⒝': '(b)', | ||
'⒞': '(c)', | ||
'⒟': '(d)', | ||
'⒠': '(e)', | ||
'⒡': '(f)', | ||
'⒢': '(g)', | ||
'⒣': '(h)', | ||
'⒤': '(i)', | ||
'⒥': '(j)', | ||
'⒦': '(k)', | ||
'⒧': '(l)', | ||
'⒨': '(m)', | ||
'⒩': '(n)', | ||
'⒪': '(o)', | ||
'⒫': '(p)', | ||
'⒬': '(q)', | ||
'⒭': '(r)', | ||
'⒮': '(s)', | ||
'⒯': '(t)', | ||
'⒰': '(u)', | ||
'⒱': '(v)', | ||
'⒲': '(w)', | ||
'⒳': '(x)', | ||
'⒴': '(y)', | ||
'⒵': '(z)', | ||
'Ⓐ': 'A', | ||
'Ⓑ': 'B', | ||
'Ⓒ': 'C', | ||
'Ⓓ': 'D', | ||
'Ⓔ': 'E', | ||
'Ⓕ': 'F', | ||
'Ⓖ': 'G', | ||
'Ⓗ': 'H', | ||
'Ⓘ': 'I', | ||
'Ⓙ': 'J', | ||
'Ⓚ': 'K', | ||
'Ⓛ': 'L', | ||
'Ⓜ': 'M', | ||
'Ⓝ': 'N', | ||
'Ⓞ': 'O', | ||
'Ⓟ': 'P', | ||
'Ⓠ': 'Q', | ||
'Ⓡ': 'R', | ||
'Ⓢ': 'S', | ||
'Ⓣ': 'T', | ||
'Ⓤ': 'U', | ||
'Ⓥ': 'V', | ||
'Ⓦ': 'W', | ||
'Ⓧ': 'X', | ||
'Ⓨ': 'Y', | ||
'Ⓩ': 'Z', | ||
'ⓐ': 'a', | ||
'ⓑ': 'b', | ||
'ⓒ': 'c', | ||
'ⓓ': 'd', | ||
'ⓔ': 'e', | ||
'ⓕ': 'f', | ||
'ⓖ': 'g', | ||
'ⓗ': 'h', | ||
'ⓘ': 'i', | ||
'ⓙ': 'j', | ||
'ⓚ': 'k', | ||
'ⓛ': 'l', | ||
'ⓜ': 'm', | ||
'ⓝ': 'n', | ||
'ⓞ': 'o', | ||
'ⓟ': 'p', | ||
'ⓠ': 'q', | ||
'ⓡ': 'r', | ||
'ⓢ': 's', | ||
'ⓣ': 't', | ||
'ⓤ': 'u', | ||
'ⓥ': 'v', | ||
'ⓦ': 'w', | ||
'ⓧ': 'x', | ||
'ⓨ': 'y', | ||
'ⓩ': 'z', | ||
'⓪': '0', | ||
'⓫': '11', | ||
'⓬': '12', | ||
'⓭': '13', | ||
'⓮': '14', | ||
'⓯': '15', | ||
'⓰': '16', | ||
'⓱': '17', | ||
'⓲': '18', | ||
'⓳': '19', | ||
'⓴': '20', | ||
'⓵': '1', | ||
'⓶': '2', | ||
'⓷': '3', | ||
'⓸': '4', | ||
'⓹': '5', | ||
'⓺': '6', | ||
'⓻': '7', | ||
'⓼': '8', | ||
'⓽': '9', | ||
'⓾': '10', | ||
'⓿': '0', | ||
'❛': '"', | ||
'❜': '"', | ||
'❝': '"', | ||
'❞': '"', | ||
'❨': '(', | ||
'❩': ')', | ||
'❪': '(', | ||
'❫': ')', | ||
'❬': '<', | ||
'❭': '>', | ||
'❮': '"', | ||
'❯': '"', | ||
'❰': '<', | ||
'❱': '>', | ||
'❲': '[', | ||
'❳': ']', | ||
'❴': '{', | ||
'❵': '}', | ||
'❶': '1', | ||
'❷': '2', | ||
'❸': '3', | ||
'❹': '4', | ||
'❺': '5', | ||
'❻': '6', | ||
'❼': '7', | ||
'❽': '8', | ||
'❾': '9', | ||
'❿': '10', | ||
'➀': '1', | ||
'➁': '2', | ||
'➂': '3', | ||
'➃': '4', | ||
'➄': '5', | ||
'➅': '6', | ||
'➆': '7', | ||
'➇': '8', | ||
'➈': '9', | ||
'➉': '10', | ||
'➊': '1', | ||
'➋': '2', | ||
'➌': '3', | ||
'➍': '4', | ||
'➎': '5', | ||
'➏': '6', | ||
'➐': '7', | ||
'➑': '8', | ||
'➒': '9', | ||
'➓': '10', | ||
Ⱡ: 'L', | ||
ⱡ: 'l', | ||
Ɫ: 'L', | ||
Ᵽ: 'P', | ||
Ɽ: 'R', | ||
ⱥ: 'a', | ||
ⱦ: 't', | ||
Ⱨ: 'H', | ||
ⱨ: 'h', | ||
Ⱪ: 'K', | ||
ⱪ: 'k', | ||
Ⱬ: 'Z', | ||
ⱬ: 'z', | ||
Ɱ: 'M', | ||
Ɐ: 'a', | ||
ⱱ: 'v', | ||
Ⱳ: 'W', | ||
ⱳ: 'w', | ||
ⱴ: 'v', | ||
Ⱶ: 'H', | ||
ⱶ: 'h', | ||
ⱸ: 'e', | ||
ⱺ: 'o', | ||
ⱻ: 'E', | ||
ⱼ: 'j', | ||
'⸨': '((', | ||
'⸩': '))', | ||
Ꜩ: 'TZ', | ||
ꜩ: 'tz', | ||
ꜰ: 'F', | ||
ꜱ: 'S', | ||
Ꜳ: 'AA', | ||
ꜳ: 'aa', | ||
Ꜵ: 'AO', | ||
ꜵ: 'ao', | ||
Ꜷ: 'AU', | ||
ꜷ: 'au', | ||
Ꜹ: 'AV', | ||
ꜹ: 'av', | ||
Ꜻ: 'AV', | ||
ꜻ: 'av', | ||
Ꜽ: 'AY', | ||
ꜽ: 'ay', | ||
Ꜿ: 'c', | ||
ꜿ: 'c', | ||
Ꝁ: 'K', | ||
ꝁ: 'k', | ||
Ꝃ: 'K', | ||
ꝃ: 'k', | ||
Ꝅ: 'K', | ||
ꝅ: 'k', | ||
Ꝇ: 'L', | ||
ꝇ: 'l', | ||
Ꝉ: 'L', | ||
ꝉ: 'l', | ||
Ꝋ: 'O', | ||
ꝋ: 'o', | ||
Ꝍ: 'O', | ||
ꝍ: 'o', | ||
Ꝏ: 'OO', | ||
ꝏ: 'oo', | ||
Ꝑ: 'P', | ||
ꝑ: 'p', | ||
Ꝓ: 'P', | ||
ꝓ: 'p', | ||
Ꝕ: 'P', | ||
ꝕ: 'p', | ||
Ꝗ: 'Q', | ||
ꝗ: 'q', | ||
Ꝙ: 'Q', | ||
ꝙ: 'q', | ||
Ꝛ: 'R', | ||
ꝛ: 'r', | ||
Ꝟ: 'V', | ||
ꝟ: 'v', | ||
Ꝡ: 'VY', | ||
ꝡ: 'vy', | ||
Ꝣ: 'Z', | ||
ꝣ: 'z', | ||
Ꝧ: 'TH', | ||
ꝧ: 'th', | ||
Ꝩ: 'V', | ||
Ꝺ: 'D', | ||
ꝺ: 'd', | ||
Ꝼ: 'F', | ||
ꝼ: 'f', | ||
Ᵹ: 'G', | ||
Ꝿ: 'G', | ||
ꝿ: 'g', | ||
Ꞁ: 'L', | ||
ꞁ: 'l', | ||
Ꞃ: 'R', | ||
ꞃ: 'r', | ||
Ꞅ: 's', | ||
ꞅ: 'S', | ||
Ꞇ: 'T', | ||
ꟻ: 'F', | ||
ꟼ: 'p', | ||
ꟽ: 'M', | ||
ꟾ: 'I', | ||
ꟿ: 'M', | ||
ff: 'ff', | ||
fi: 'fi', | ||
fl: 'fl', | ||
ffi: 'ffi', | ||
ffl: 'ffl', | ||
st: 'st', | ||
'!': '!', | ||
'"': '"', | ||
'#': '#', | ||
'$': '$', | ||
'%': '%', | ||
'&': '&', | ||
''': '"', | ||
'(': '(', | ||
')': ')', | ||
'*': '*', | ||
'+': '+', | ||
',': ',', | ||
'-': '-', | ||
'.': '.', | ||
'/': '/', | ||
'0': '0', | ||
'1': '1', | ||
'2': '2', | ||
'3': '3', | ||
'4': '4', | ||
'5': '5', | ||
'6': '6', | ||
'7': '7', | ||
'8': '8', | ||
'9': '9', | ||
':': ':', | ||
';': ';', | ||
'<': '<', | ||
'=': '=', | ||
'>': '>', | ||
'?': '?', | ||
'@': '@', | ||
A: 'A', | ||
B: 'B', | ||
C: 'C', | ||
D: 'D', | ||
E: 'E', | ||
F: 'F', | ||
G: 'G', | ||
H: 'H', | ||
I: 'I', | ||
J: 'J', | ||
K: 'K', | ||
L: 'L', | ||
M: 'M', | ||
N: 'N', | ||
O: 'O', | ||
P: 'P', | ||
Q: 'Q', | ||
R: 'R', | ||
S: 'S', | ||
T: 'T', | ||
U: 'U', | ||
V: 'V', | ||
W: 'W', | ||
X: 'X', | ||
Y: 'Y', | ||
Z: 'Z', | ||
'[': '[', | ||
'\': '\\', | ||
']': ']', | ||
'^': '^', | ||
'_': '_', | ||
a: 'a', | ||
b: 'b', | ||
c: 'c', | ||
d: 'd', | ||
e: 'e', | ||
f: 'f', | ||
g: 'g', | ||
h: 'h', | ||
i: 'i', | ||
j: 'j', | ||
k: 'k', | ||
l: 'l', | ||
m: 'm', | ||
n: 'n', | ||
o: 'o', | ||
p: 'p', | ||
q: 'q', | ||
r: 'r', | ||
s: 's', | ||
t: 't', | ||
u: 'u', | ||
v: 'v', | ||
w: 'w', | ||
x: 'x', | ||
y: 'y', | ||
z: 'z', | ||
'{': '{', | ||
'}': '}', | ||
'~': '~' | ||
}; | ||
module.exports = diacritics; | ||
Object.defineProperty(exports,"__esModule",{value:true});var diacritics={'«':'"','²':'2','³':'3','¹':'1','»':'"',À:'A',Á:'A',Â:'A',Ã:'A',Ä:'A',Å:'A',Æ:'AE',Ç:'C',È:'E',É:'E',Ê:'E',Ë:'E',Ì:'I',Í:'I',Î:'I',Ï:'I',Ð:'D',Ñ:'N',Ò:'O',Ó:'O',Ô:'O',Õ:'O',Ö:'O',Ø:'O',Ù:'U',Ú:'U',Û:'U',Ü:'U',Ý:'Y',Þ:'TH',ß:'ss',à:'a',á:'a',â:'a',ã:'a',ä:'a',å:'a',æ:'ae',ç:'c',è:'e',é:'e',ê:'e',ë:'e',ì:'i',í:'i',î:'i',ï:'i',ð:'d',ñ:'n',ò:'o',ó:'o',ô:'o',õ:'o',ö:'o',ø:'o',ù:'u',ú:'u',û:'u',ü:'u',ý:'y',þ:'th',ÿ:'y',Ā:'A',ā:'a',Ă:'A',ă:'a',Ą:'A',ą:'a',Ć:'C',ć:'c',Ĉ:'C',ĉ:'c',Ċ:'C',ċ:'c',Č:'C',č:'c',Ď:'D',ď:'d',Đ:'D',đ:'d',Ē:'E',ē:'e',Ĕ:'E',ĕ:'e',Ė:'E',ė:'e',Ę:'E',ę:'e',Ě:'E',ě:'e',Ĝ:'G',ĝ:'g',Ğ:'G',ğ:'g',Ġ:'G',ġ:'g',Ģ:'G',ģ:'g',Ĥ:'H',ĥ:'h',Ħ:'H',ħ:'h',Ĩ:'I',ĩ:'i',Ī:'I',ī:'i',Ĭ:'I',ĭ:'i',Į:'I',į:'i',İ:'I',ı:'i',IJ:'IJ',ij:'ij',Ĵ:'J',ĵ:'j',Ķ:'K',ķ:'k',ĸ:'q',Ĺ:'L',ĺ:'l',Ļ:'L',ļ:'l',Ľ:'L',ľ:'l',Ŀ:'L',ŀ:'l',Ł:'L',ł:'l',Ń:'N',ń:'n',Ņ:'N',ņ:'n',Ň:'N',ň:'n',ʼn:'n',Ŋ:'N',ŋ:'n',Ō:'O',ō:'o',Ŏ:'O',ŏ:'o',Ő:'O',ő:'o',Œ:'OE',œ:'oe',Ŕ:'R',ŕ:'r',Ŗ:'R',ŗ:'r',Ř:'R',ř:'r',Ś:'S',ś:'s',Ŝ:'S',ŝ:'s',Ş:'S',ş:'s',Š:'S',š:'s',Ţ:'T',ţ:'t',Ť:'T',ť:'t',Ŧ:'T',ŧ:'t',Ũ:'U',ũ:'u',Ū:'U',ū:'u',Ŭ:'U',ŭ:'u',Ů:'U',ů:'u',Ű:'U',ű:'u',Ų:'U',ų:'u',Ŵ:'W',ŵ:'w',Ŷ:'Y',ŷ:'y',Ÿ:'Y',Ź:'Z',ź:'z',Ż:'Z',ż:'z',Ž:'Z',ž:'z',ſ:'s',ƀ:'b',Ɓ:'B',Ƃ:'B',ƃ:'b',Ɔ:'O',Ƈ:'C',ƈ:'c',Ɖ:'D',Ɗ:'D',Ƌ:'D',ƌ:'d',Ǝ:'E',Ə:'A',Ɛ:'E',Ƒ:'F',ƒ:'f',Ɠ:'G',ƕ:'hv',Ɩ:'I',Ɨ:'I',Ƙ:'K',ƙ:'k',ƚ:'l',Ɯ:'M',Ɲ:'N',ƞ:'n',Ɵ:'O',Ơ:'O',ơ:'o',Ƥ:'P',ƥ:'p',ƫ:'t',Ƭ:'T',ƭ:'t',Ʈ:'T',Ư:'U',ư:'u',Ʋ:'V',Ƴ:'Y',ƴ:'y',Ƶ:'Z',ƶ:'z',ƿ:'w',DŽ:'DZ',Dž:'Dz',dž:'dz',LJ:'LJ',Lj:'Lj',lj:'lj',NJ:'NJ',Nj:'Nj',nj:'nj',Ǎ:'A',ǎ:'a',Ǐ:'I',ǐ:'i',Ǒ:'O',ǒ:'o',Ǔ:'U',ǔ:'u',Ǖ:'U',ǖ:'u',Ǘ:'U',ǘ:'u',Ǚ:'U',ǚ:'u',Ǜ:'U',ǜ:'u',ǝ:'e',Ǟ:'A',ǟ:'a',Ǡ:'A',ǡ:'a',Ǣ:'AE',ǣ:'ae',Ǥ:'G',ǥ:'G',Ǧ:'G',ǧ:'G',Ǩ:'K',ǩ:'k',Ǫ:'O',ǫ:'o',Ǭ:'O',ǭ:'o',ǰ:'j',DZ:'DZ',Dz:'Dz',dz:'dz',Ǵ:'G',ǵ:'g',Ƕ:'HV',Ƿ:'W',Ǹ:'N',ǹ:'n',Ǻ:'A',ǻ:'a',Ǽ:'AE',ǽ:'ae',Ǿ:'O',ǿ:'o',Ȁ:'A',ȁ:'a',Ȃ:'A',ȃ:'a',Ȅ:'E',ȅ:'e',Ȇ:'E',ȇ:'e',Ȉ:'I',ȉ:'i',Ȋ:'I',ȋ:'i',Ȍ:'O',ȍ:'o',Ȏ:'O',ȏ:'o',Ȑ:'R',ȑ:'r',Ȓ:'R',ȓ:'r',Ȕ:'U',ȕ:'u',Ȗ:'U',ȗ:'u',Ș:'S',ș:'s',Ț:'T',ț:'t',Ȝ:'Z',ȝ:'z',Ȟ:'H',ȟ:'h',Ƞ:'N',ȡ:'d',Ȣ:'OU',ȣ:'ou',Ȥ:'Z',ȥ:'z',Ȧ:'A',ȧ:'a',Ȩ:'E',ȩ:'e',Ȫ:'O',ȫ:'o',Ȭ:'O',ȭ:'o',Ȯ:'O',ȯ:'o',Ȱ:'O',ȱ:'o',Ȳ:'Y',ȳ:'y',ȴ:'l',ȵ:'n',ȶ:'t',ȷ:'j',ȸ:'db',ȹ:'qp',Ⱥ:'A',Ȼ:'C',ȼ:'c',Ƚ:'L',Ⱦ:'T',ȿ:'s',ɀ:'z',Ƀ:'B',Ʉ:'U',Ʌ:'V',Ɇ:'E',ɇ:'e',Ɉ:'J',ɉ:'j',Ɋ:'Q',ɋ:'q',Ɍ:'R',ɍ:'r',Ɏ:'Y',ɏ:'y',ɐ:'a',ɓ:'b',ɔ:'o',ɕ:'c',ɖ:'d',ɗ:'d',ɘ:'e',ə:'a',ɚ:'a',ɛ:'e',ɜ:'e',ɝ:'e',ɞ:'e',ɟ:'j',ɠ:'g',ɡ:'g',ɢ:'G',ɥ:'h',ɦ:'h',ɨ:'i',ɪ:'I',ɫ:'l',ɬ:'l',ɭ:'l',ɯ:'m',ɰ:'m',ɱ:'m',ɲ:'n',ɳ:'n',ɴ:'N',ɵ:'o',ɶ:'OE',ɼ:'r',ɽ:'r',ɾ:'r',ɿ:'r',ʀ:'R',ʁ:'R',ʂ:'s',ʄ:'j',ʇ:'t',ʈ:'t',ʉ:'u',ʋ:'v',ʌ:'v',ʍ:'w',ʎ:'y',ʏ:'Y',ʐ:'z',ʑ:'z',ʗ:'C',ʙ:'B',ʚ:'e',ʛ:'G',ʜ:'H',ʝ:'j',ʞ:'k',ʟ:'L',ʠ:'q',ʣ:'dz',ʥ:'dz',ʦ:'ts',ʨ:'tc',ʪ:'ls',ʫ:'lz',ʮ:'h',ʯ:'h',ᴀ:'A',ᴁ:'AE',ᴂ:'ae',ᴃ:'B',ᴄ:'C',ᴅ:'D',ᴆ:'D',ᴇ:'E',ᴈ:'e',ᴉ:'i',ᴊ:'J',ᴋ:'K',ᴌ:'L',ᴍ:'M',ᴎ:'N',ᴏ:'O',ᴐ:'O',ᴔ:'oe',ᴕ:'OU',ᴖ:'o',ᴗ:'o',ᴘ:'P',ᴙ:'R',ᴚ:'R',ᴛ:'T',ᴜ:'U',ᴠ:'V',ᴡ:'W',ᴢ:'Z',ᵢ:'i',ᵣ:'r',ᵤ:'u',ᵥ:'v',ᵫ:'ue',ᵬ:'b',ᵭ:'d',ᵮ:'f',ᵯ:'m',ᵰ:'n',ᵱ:'p',ᵲ:'r',ᵳ:'r',ᵴ:'s',ᵵ:'t',ᵶ:'z',ᵷ:'g',ᵹ:'g',ᵺ:'th',ᵻ:'I',ᵼ:'i',ᵽ:'p',ᵾ:'U',ᶀ:'b',ᶁ:'d',ᶂ:'f',ᶃ:'g',ᶄ:'k',ᶅ:'l',ᶆ:'m',ᶇ:'n',ᶈ:'p',ᶉ:'r',ᶊ:'s',ᶌ:'v',ᶍ:'x',ᶎ:'z',ᶏ:'a',ᶑ:'d',ᶒ:'e',ᶓ:'e',ᶔ:'e',ᶕ:'a',ᶖ:'i',ᶗ:'o',ᶙ:'u',Ḁ:'A',ḁ:'a',Ḃ:'B',ḃ:'b',Ḅ:'B',ḅ:'b',Ḇ:'B',ḇ:'b',Ḉ:'C',ḉ:'c',Ḋ:'D',ḋ:'d',Ḍ:'D',ḍ:'d',Ḏ:'D',ḏ:'d',Ḑ:'D',ḑ:'d',Ḓ:'D',ḓ:'d',Ḕ:'E',ḕ:'e',Ḗ:'E',ḗ:'e',Ḙ:'E',ḙ:'e',Ḛ:'E',ḛ:'e',Ḝ:'E',ḝ:'e',Ḟ:'F',ḟ:'f',Ḡ:'G',ḡ:'g',Ḣ:'H',ḣ:'h',Ḥ:'H',ḥ:'h',Ḧ:'H',ḧ:'h',Ḩ:'H',ḩ:'h',Ḫ:'H',ḫ:'h',Ḭ:'I',ḭ:'i',Ḯ:'I',ḯ:'i',Ḱ:'K',ḱ:'k',Ḳ:'K',ḳ:'k',Ḵ:'K',ḵ:'k',Ḷ:'L',ḷ:'l',Ḹ:'L',ḹ:'l',Ḻ:'L',ḻ:'l',Ḽ:'L',ḽ:'l',Ḿ:'M',ḿ:'m',Ṁ:'M',ṁ:'m',Ṃ:'M',ṃ:'m',Ṅ:'N',ṅ:'n',Ṇ:'N',ṇ:'n',Ṉ:'N',ṉ:'n',Ṋ:'N',ṋ:'n',Ṍ:'O',ṍ:'o',Ṏ:'O',ṏ:'o',Ṑ:'O',ṑ:'o',Ṓ:'O',ṓ:'o',Ṕ:'P',ṕ:'p',Ṗ:'P',ṗ:'p',Ṙ:'R',ṙ:'r',Ṛ:'R',ṛ:'r',Ṝ:'R',ṝ:'r',Ṟ:'R',ṟ:'r',Ṡ:'S',ṡ:'s',Ṣ:'S',ṣ:'s',Ṥ:'S',ṥ:'s',Ṧ:'S',ṧ:'s',Ṩ:'S',ṩ:'s',Ṫ:'T',ṫ:'t',Ṭ:'T',ṭ:'t',Ṯ:'T',ṯ:'t',Ṱ:'T',ṱ:'t',Ṳ:'U',ṳ:'u',Ṵ:'U',ṵ:'u',Ṷ:'U',ṷ:'u',Ṹ:'U',ṹ:'u',Ṻ:'U',ṻ:'u',Ṽ:'V',ṽ:'v',Ṿ:'V',ṿ:'v',Ẁ:'W',ẁ:'w',Ẃ:'W',ẃ:'w',Ẅ:'W',ẅ:'w',Ẇ:'W',ẇ:'w',Ẉ:'W',ẉ:'w',Ẋ:'X',ẋ:'x',Ẍ:'X',ẍ:'x',Ẏ:'Y',ẏ:'y',Ẑ:'Z',ẑ:'z',Ẓ:'Z',ẓ:'z',Ẕ:'Z',ẕ:'z',ẖ:'h',ẗ:'t',ẘ:'w',ẙ:'y',ẚ:'a',ẛ:'f',ẜ:'s',ẝ:'s',ẞ:'SS',Ạ:'A',ạ:'a',Ả:'A',ả:'a',Ấ:'A',ấ:'a',Ầ:'A',ầ:'a',Ẩ:'A',ẩ:'a',Ẫ:'A',ẫ:'a',Ậ:'A',ậ:'a',Ắ:'A',ắ:'a',Ằ:'A',ằ:'a',Ẳ:'A',ẳ:'a',Ẵ:'A',ẵ:'a',Ặ:'A',ặ:'a',Ẹ:'E',ẹ:'e',Ẻ:'E',ẻ:'e',Ẽ:'E',ẽ:'e',Ế:'E',ế:'e',Ề:'E',ề:'e',Ể:'E',ể:'e',Ễ:'E',ễ:'e',Ệ:'E',ệ:'e',Ỉ:'I',ỉ:'i',Ị:'I',ị:'i',Ọ:'O',ọ:'o',Ỏ:'O',ỏ:'o',Ố:'O',ố:'o',Ồ:'O',ồ:'o',Ổ:'O',ổ:'o',Ỗ:'O',ỗ:'o',Ộ:'O',ộ:'o',Ớ:'O',ớ:'o',Ờ:'O',ờ:'o',Ở:'O',ở:'o',Ỡ:'O',ỡ:'o',Ợ:'O',ợ:'o',Ụ:'U',ụ:'u',Ủ:'U',ủ:'u',Ứ:'U',ứ:'u',Ừ:'U',ừ:'u',Ử:'U',ử:'u',Ữ:'U',ữ:'u',Ự:'U',ự:'u',Ỳ:'Y',ỳ:'y',Ỵ:'Y',ỵ:'y',Ỷ:'Y',ỷ:'y',Ỹ:'Y',ỹ:'y',Ỻ:'LL',ỻ:'ll',Ỽ:'V',Ỿ:'Y',ỿ:'y','‐':'-','‑':'-','‒':'-','–':'-','—':'-','‘':'"','’':'"','‚':'"','‛':'"','“':'"','”':'"','„':'"','′':'"','″':'"','‵':'"','‶':'"','‸':'^','‹':'"','›':'"','‼':'!!','⁄':'/','⁅':'[','⁆':']','⁇':'??','⁈':'?!','⁉':'!?','⁎':'*','⁏':';','⁒':'%','⁓':'~','⁰':'0',ⁱ:'i','⁴':'4','⁵':'5','⁶':'6','⁷':'7','⁸':'8','⁹':'9','⁺':'+','⁻':'-','⁼':'=','⁽':'(','⁾':')',ⁿ:'n','₀':'0','₁':'1','₂':'2','₃':'3','₄':'4','₅':'5','₆':'6','₇':'7','₈':'8','₉':'9','₊':'+','₋':'-','₌':'=','₍':'(','₎':')',ₐ:'a',ₑ:'e',ₒ:'o',ₓ:'x',ₔ:'a',ↄ:'c','①':'1','②':'2','③':'3','④':'4','⑤':'5','⑥':'6','⑦':'7','⑧':'8','⑨':'9','⑩':'10','⑪':'11','⑫':'12','⑬':'13','⑭':'14','⑮':'15','⑯':'16','⑰':'17','⑱':'18','⑲':'19','⑳':'20','⑴':'(1)','⑵':'(2)','⑶':'(3)','⑷':'(4)','⑸':'(5)','⑹':'(6)','⑺':'(7)','⑻':'(8)','⑼':'(9)','⑽':'(10)','⑾':'(11)','⑿':'(12)','⒀':'(13)','⒁':'(14)','⒂':'(15)','⒃':'(16)','⒄':'(17)','⒅':'(18)','⒆':'(19)','⒇':'(20)','⒈':'1.','⒉':'2.','⒊':'3.','⒋':'4.','⒌':'5.','⒍':'6.','⒎':'7.','⒏':'8.','⒐':'9.','⒑':'10.','⒒':'11.','⒓':'12.','⒔':'13.','⒕':'14.','⒖':'15.','⒗':'16.','⒘':'17.','⒙':'18.','⒚':'19.','⒛':'20.','⒜':'(a)','⒝':'(b)','⒞':'(c)','⒟':'(d)','⒠':'(e)','⒡':'(f)','⒢':'(g)','⒣':'(h)','⒤':'(i)','⒥':'(j)','⒦':'(k)','⒧':'(l)','⒨':'(m)','⒩':'(n)','⒪':'(o)','⒫':'(p)','⒬':'(q)','⒭':'(r)','⒮':'(s)','⒯':'(t)','⒰':'(u)','⒱':'(v)','⒲':'(w)','⒳':'(x)','⒴':'(y)','⒵':'(z)','Ⓐ':'A','Ⓑ':'B','Ⓒ':'C','Ⓓ':'D','Ⓔ':'E','Ⓕ':'F','Ⓖ':'G','Ⓗ':'H','Ⓘ':'I','Ⓙ':'J','Ⓚ':'K','Ⓛ':'L','Ⓜ':'M','Ⓝ':'N','Ⓞ':'O','Ⓟ':'P','Ⓠ':'Q','Ⓡ':'R','Ⓢ':'S','Ⓣ':'T','Ⓤ':'U','Ⓥ':'V','Ⓦ':'W','Ⓧ':'X','Ⓨ':'Y','Ⓩ':'Z','ⓐ':'a','ⓑ':'b','ⓒ':'c','ⓓ':'d','ⓔ':'e','ⓕ':'f','ⓖ':'g','ⓗ':'h','ⓘ':'i','ⓙ':'j','ⓚ':'k','ⓛ':'l','ⓜ':'m','ⓝ':'n','ⓞ':'o','ⓟ':'p','ⓠ':'q','ⓡ':'r','ⓢ':'s','ⓣ':'t','ⓤ':'u','ⓥ':'v','ⓦ':'w','ⓧ':'x','ⓨ':'y','ⓩ':'z','⓪':'0','⓫':'11','⓬':'12','⓭':'13','⓮':'14','⓯':'15','⓰':'16','⓱':'17','⓲':'18','⓳':'19','⓴':'20','⓵':'1','⓶':'2','⓷':'3','⓸':'4','⓹':'5','⓺':'6','⓻':'7','⓼':'8','⓽':'9','⓾':'10','⓿':'0','❛':'"','❜':'"','❝':'"','❞':'"','❨':'(','❩':')','❪':'(','❫':')','❬':'<','❭':'>','❮':'"','❯':'"','❰':'<','❱':'>','❲':'[','❳':']','❴':'{','❵':'}','❶':'1','❷':'2','❸':'3','❹':'4','❺':'5','❻':'6','❼':'7','❽':'8','❾':'9','❿':'10','➀':'1','➁':'2','➂':'3','➃':'4','➄':'5','➅':'6','➆':'7','➇':'8','➈':'9','➉':'10','➊':'1','➋':'2','➌':'3','➍':'4','➎':'5','➏':'6','➐':'7','➑':'8','➒':'9','➓':'10',Ⱡ:'L',ⱡ:'l',Ɫ:'L',Ᵽ:'P',Ɽ:'R',ⱥ:'a',ⱦ:'t',Ⱨ:'H',ⱨ:'h',Ⱪ:'K',ⱪ:'k',Ⱬ:'Z',ⱬ:'z',Ɱ:'M',Ɐ:'a',ⱱ:'v',Ⱳ:'W',ⱳ:'w',ⱴ:'v',Ⱶ:'H',ⱶ:'h',ⱸ:'e',ⱺ:'o',ⱻ:'E',ⱼ:'j','⸨':'((','⸩':'))',Ꜩ:'TZ',ꜩ:'tz',ꜰ:'F',ꜱ:'S',Ꜳ:'AA',ꜳ:'aa',Ꜵ:'AO',ꜵ:'ao',Ꜷ:'AU',ꜷ:'au',Ꜹ:'AV',ꜹ:'av',Ꜻ:'AV',ꜻ:'av',Ꜽ:'AY',ꜽ:'ay',Ꜿ:'c',ꜿ:'c',Ꝁ:'K',ꝁ:'k',Ꝃ:'K',ꝃ:'k',Ꝅ:'K',ꝅ:'k',Ꝇ:'L',ꝇ:'l',Ꝉ:'L',ꝉ:'l',Ꝋ:'O',ꝋ:'o',Ꝍ:'O',ꝍ:'o',Ꝏ:'OO',ꝏ:'oo',Ꝑ:'P',ꝑ:'p',Ꝓ:'P',ꝓ:'p',Ꝕ:'P',ꝕ:'p',Ꝗ:'Q',ꝗ:'q',Ꝙ:'Q',ꝙ:'q',Ꝛ:'R',ꝛ:'r',Ꝟ:'V',ꝟ:'v',Ꝡ:'VY',ꝡ:'vy',Ꝣ:'Z',ꝣ:'z',Ꝧ:'TH',ꝧ:'th',Ꝩ:'V',Ꝺ:'D',ꝺ:'d',Ꝼ:'F',ꝼ:'f',Ᵹ:'G',Ꝿ:'G',ꝿ:'g',Ꞁ:'L',ꞁ:'l',Ꞃ:'R',ꞃ:'r',Ꞅ:'s',ꞅ:'S',Ꞇ:'T',ꟻ:'F',ꟼ:'p',ꟽ:'M',ꟾ:'I',ꟿ:'M',ff:'ff',fi:'fi',fl:'fl',ffi:'ffi',ffl:'ffl',st:'st','!':'!','"':'"','#':'#','$':'$','%':'%','&':'&',''':'"','(':'(',')':')','*':'*','+':'+',',':',','-':'-','.':'.','/':'/','0':'0','1':'1','2':'2','3':'3','4':'4','5':'5','6':'6','7':'7','8':'8','9':'9',':':':',';':';','<':'<','=':'=','>':'>','?':'?','@':'@',A:'A',B:'B',C:'C',D:'D',E:'E',F:'F',G:'G',H:'H',I:'I',J:'J',K:'K',L:'L',M:'M',N:'N',O:'O',P:'P',Q:'Q',R:'R',S:'S',T:'T',U:'U',V:'V',W:'W',X:'X',Y:'Y',Z:'Z','[':'[','\':'\\',']':']','^':'^','_':'_',a:'a',b:'b',c:'c',d:'d',e:'e',f:'f',g:'g',h:'h',i:'i',j:'j',k:'k',l:'l',m:'m',n:'n',o:'o',p:'p',q:'q',r:'r',s:'s',t:'t',u:'u',v:'v',w:'w',x:'x',y:'y',z:'z','{':'{','}':'}','~':'~'};exports.default=diacritics; |
@@ -1,69 +0,1 @@ | ||
'use strict'; | ||
/* eslint-disable */ | ||
// https://tc39.github.io/ecma262/#sec-array.prototype.find | ||
if (!Array.prototype.find) { | ||
Object.defineProperty(Array.prototype, 'find', { | ||
value: function value(predicate) { | ||
// 1. Let O be ? ToObject(this value). | ||
if (this == null) { | ||
throw new TypeError('"this" is null or not defined'); | ||
} | ||
var o = Object(this); | ||
// 2. Let len be ? ToLength(? Get(O, "length")). | ||
var len = o.length >>> 0; | ||
// 3. If IsCallable(predicate) is false, throw a TypeError exception. | ||
if (typeof predicate !== 'function') { | ||
throw new TypeError('predicate must be a function'); | ||
} | ||
// 4. If thisArg was supplied, let T be thisArg; else let T be undefined. | ||
var thisArg = arguments[1]; | ||
// 5. Let k be 0. | ||
var k = 0; | ||
// 6. Repeat, while k < len | ||
while (k < len) { | ||
// a. Let Pk be ! ToString(k). | ||
// b. Let kValue be ? Get(O, Pk). | ||
// c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). | ||
// d. If testResult is true, return kValue. | ||
var kValue = o[k]; | ||
if (predicate.call(thisArg, kValue, k, o)) { | ||
return kValue; | ||
} | ||
// e. Increase k by 1. | ||
k++; | ||
} | ||
// 7. Return undefined. | ||
return undefined; | ||
}, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} | ||
if (!String.prototype.endsWith) { | ||
String.prototype.endsWith = function (pattern) { | ||
var d = this.length - pattern.length; | ||
return d >= 0 && this.lastIndexOf(pattern) === d; | ||
}; | ||
} | ||
if (typeof Event !== 'function') { | ||
var _Event = function _Event(event) { | ||
var evt = document.createEvent('Event'); | ||
evt.initEvent(event, true, true); | ||
return evt; | ||
}; | ||
if (typeof window !== 'undefined') { | ||
window.Event = _Event; | ||
} | ||
} | ||
var polyfills = true; | ||
module.exports = polyfills; | ||
if(!Array.prototype.find){Object.defineProperty(Array.prototype,'find',{value:function value(predicate){if(this==null){throw new TypeError('"this" is null or not defined');}var o=Object(this);var len=o.length>>>0;if(typeof predicate!=='function'){throw new TypeError('predicate must be a function');}var thisArg=arguments[1];var k=0;while(k<len){var kValue=o[k];if(predicate.call(thisArg,kValue,k,o)){return kValue;}k++;}return undefined;},configurable:true,writable:true});}if(!String.prototype.endsWith){String.prototype.endsWith=function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;};}if(typeof Event!=='function'){function _Event(event){var evt=document.createEvent('Event');evt.initEvent(event,true,true);return evt;}if(typeof window!=='undefined'){window.Event=_Event;}} |
@@ -1,1576 +0,1 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
var diacritics = { | ||
'«': '"', | ||
'²': '2', | ||
'³': '3', | ||
'¹': '1', | ||
'»': '"', | ||
À: 'A', | ||
Á: 'A', | ||
Â: 'A', | ||
Ã: 'A', | ||
Ä: 'A', | ||
Å: 'A', | ||
Æ: 'AE', | ||
Ç: 'C', | ||
È: 'E', | ||
É: 'E', | ||
Ê: 'E', | ||
Ë: 'E', | ||
Ì: 'I', | ||
Í: 'I', | ||
Î: 'I', | ||
Ï: 'I', | ||
Ð: 'D', | ||
Ñ: 'N', | ||
Ò: 'O', | ||
Ó: 'O', | ||
Ô: 'O', | ||
Õ: 'O', | ||
Ö: 'O', | ||
Ø: 'O', | ||
Ù: 'U', | ||
Ú: 'U', | ||
Û: 'U', | ||
Ü: 'U', | ||
Ý: 'Y', | ||
Þ: 'TH', | ||
ß: 'ss', | ||
à: 'a', | ||
á: 'a', | ||
â: 'a', | ||
ã: 'a', | ||
ä: 'a', | ||
å: 'a', | ||
æ: 'ae', | ||
ç: 'c', | ||
è: 'e', | ||
é: 'e', | ||
ê: 'e', | ||
ë: 'e', | ||
ì: 'i', | ||
í: 'i', | ||
î: 'i', | ||
ï: 'i', | ||
ð: 'd', | ||
ñ: 'n', | ||
ò: 'o', | ||
ó: 'o', | ||
ô: 'o', | ||
õ: 'o', | ||
ö: 'o', | ||
ø: 'o', | ||
ù: 'u', | ||
ú: 'u', | ||
û: 'u', | ||
ü: 'u', | ||
ý: 'y', | ||
þ: 'th', | ||
ÿ: 'y', | ||
Ā: 'A', | ||
ā: 'a', | ||
Ă: 'A', | ||
ă: 'a', | ||
Ą: 'A', | ||
ą: 'a', | ||
Ć: 'C', | ||
ć: 'c', | ||
Ĉ: 'C', | ||
ĉ: 'c', | ||
Ċ: 'C', | ||
ċ: 'c', | ||
Č: 'C', | ||
č: 'c', | ||
Ď: 'D', | ||
ď: 'd', | ||
Đ: 'D', | ||
đ: 'd', | ||
Ē: 'E', | ||
ē: 'e', | ||
Ĕ: 'E', | ||
ĕ: 'e', | ||
Ė: 'E', | ||
ė: 'e', | ||
Ę: 'E', | ||
ę: 'e', | ||
Ě: 'E', | ||
ě: 'e', | ||
Ĝ: 'G', | ||
ĝ: 'g', | ||
Ğ: 'G', | ||
ğ: 'g', | ||
Ġ: 'G', | ||
ġ: 'g', | ||
Ģ: 'G', | ||
ģ: 'g', | ||
Ĥ: 'H', | ||
ĥ: 'h', | ||
Ħ: 'H', | ||
ħ: 'h', | ||
Ĩ: 'I', | ||
ĩ: 'i', | ||
Ī: 'I', | ||
ī: 'i', | ||
Ĭ: 'I', | ||
ĭ: 'i', | ||
Į: 'I', | ||
į: 'i', | ||
İ: 'I', | ||
ı: 'i', | ||
IJ: 'IJ', | ||
ij: 'ij', | ||
Ĵ: 'J', | ||
ĵ: 'j', | ||
Ķ: 'K', | ||
ķ: 'k', | ||
ĸ: 'q', | ||
Ĺ: 'L', | ||
ĺ: 'l', | ||
Ļ: 'L', | ||
ļ: 'l', | ||
Ľ: 'L', | ||
ľ: 'l', | ||
Ŀ: 'L', | ||
ŀ: 'l', | ||
Ł: 'L', | ||
ł: 'l', | ||
Ń: 'N', | ||
ń: 'n', | ||
Ņ: 'N', | ||
ņ: 'n', | ||
Ň: 'N', | ||
ň: 'n', | ||
ʼn: 'n', | ||
Ŋ: 'N', | ||
ŋ: 'n', | ||
Ō: 'O', | ||
ō: 'o', | ||
Ŏ: 'O', | ||
ŏ: 'o', | ||
Ő: 'O', | ||
ő: 'o', | ||
Œ: 'OE', | ||
œ: 'oe', | ||
Ŕ: 'R', | ||
ŕ: 'r', | ||
Ŗ: 'R', | ||
ŗ: 'r', | ||
Ř: 'R', | ||
ř: 'r', | ||
Ś: 'S', | ||
ś: 's', | ||
Ŝ: 'S', | ||
ŝ: 's', | ||
Ş: 'S', | ||
ş: 's', | ||
Š: 'S', | ||
š: 's', | ||
Ţ: 'T', | ||
ţ: 't', | ||
Ť: 'T', | ||
ť: 't', | ||
Ŧ: 'T', | ||
ŧ: 't', | ||
Ũ: 'U', | ||
ũ: 'u', | ||
Ū: 'U', | ||
ū: 'u', | ||
Ŭ: 'U', | ||
ŭ: 'u', | ||
Ů: 'U', | ||
ů: 'u', | ||
Ű: 'U', | ||
ű: 'u', | ||
Ų: 'U', | ||
ų: 'u', | ||
Ŵ: 'W', | ||
ŵ: 'w', | ||
Ŷ: 'Y', | ||
ŷ: 'y', | ||
Ÿ: 'Y', | ||
Ź: 'Z', | ||
ź: 'z', | ||
Ż: 'Z', | ||
ż: 'z', | ||
Ž: 'Z', | ||
ž: 'z', | ||
ſ: 's', | ||
ƀ: 'b', | ||
Ɓ: 'B', | ||
Ƃ: 'B', | ||
ƃ: 'b', | ||
Ɔ: 'O', | ||
Ƈ: 'C', | ||
ƈ: 'c', | ||
Ɖ: 'D', | ||
Ɗ: 'D', | ||
Ƌ: 'D', | ||
ƌ: 'd', | ||
Ǝ: 'E', | ||
Ə: 'A', | ||
Ɛ: 'E', | ||
Ƒ: 'F', | ||
ƒ: 'f', | ||
Ɠ: 'G', | ||
ƕ: 'hv', | ||
Ɩ: 'I', | ||
Ɨ: 'I', | ||
Ƙ: 'K', | ||
ƙ: 'k', | ||
ƚ: 'l', | ||
Ɯ: 'M', | ||
Ɲ: 'N', | ||
ƞ: 'n', | ||
Ɵ: 'O', | ||
Ơ: 'O', | ||
ơ: 'o', | ||
Ƥ: 'P', | ||
ƥ: 'p', | ||
ƫ: 't', | ||
Ƭ: 'T', | ||
ƭ: 't', | ||
Ʈ: 'T', | ||
Ư: 'U', | ||
ư: 'u', | ||
Ʋ: 'V', | ||
Ƴ: 'Y', | ||
ƴ: 'y', | ||
Ƶ: 'Z', | ||
ƶ: 'z', | ||
ƿ: 'w', | ||
DŽ: 'DZ', | ||
Dž: 'Dz', | ||
dž: 'dz', | ||
LJ: 'LJ', | ||
Lj: 'Lj', | ||
lj: 'lj', | ||
NJ: 'NJ', | ||
Nj: 'Nj', | ||
nj: 'nj', | ||
Ǎ: 'A', | ||
ǎ: 'a', | ||
Ǐ: 'I', | ||
ǐ: 'i', | ||
Ǒ: 'O', | ||
ǒ: 'o', | ||
Ǔ: 'U', | ||
ǔ: 'u', | ||
Ǖ: 'U', | ||
ǖ: 'u', | ||
Ǘ: 'U', | ||
ǘ: 'u', | ||
Ǚ: 'U', | ||
ǚ: 'u', | ||
Ǜ: 'U', | ||
ǜ: 'u', | ||
ǝ: 'e', | ||
Ǟ: 'A', | ||
ǟ: 'a', | ||
Ǡ: 'A', | ||
ǡ: 'a', | ||
Ǣ: 'AE', | ||
ǣ: 'ae', | ||
Ǥ: 'G', | ||
ǥ: 'G', | ||
Ǧ: 'G', | ||
ǧ: 'G', | ||
Ǩ: 'K', | ||
ǩ: 'k', | ||
Ǫ: 'O', | ||
ǫ: 'o', | ||
Ǭ: 'O', | ||
ǭ: 'o', | ||
ǰ: 'j', | ||
DZ: 'DZ', | ||
Dz: 'Dz', | ||
dz: 'dz', | ||
Ǵ: 'G', | ||
ǵ: 'g', | ||
Ƕ: 'HV', | ||
Ƿ: 'W', | ||
Ǹ: 'N', | ||
ǹ: 'n', | ||
Ǻ: 'A', | ||
ǻ: 'a', | ||
Ǽ: 'AE', | ||
ǽ: 'ae', | ||
Ǿ: 'O', | ||
ǿ: 'o', | ||
Ȁ: 'A', | ||
ȁ: 'a', | ||
Ȃ: 'A', | ||
ȃ: 'a', | ||
Ȅ: 'E', | ||
ȅ: 'e', | ||
Ȇ: 'E', | ||
ȇ: 'e', | ||
Ȉ: 'I', | ||
ȉ: 'i', | ||
Ȋ: 'I', | ||
ȋ: 'i', | ||
Ȍ: 'O', | ||
ȍ: 'o', | ||
Ȏ: 'O', | ||
ȏ: 'o', | ||
Ȑ: 'R', | ||
ȑ: 'r', | ||
Ȓ: 'R', | ||
ȓ: 'r', | ||
Ȕ: 'U', | ||
ȕ: 'u', | ||
Ȗ: 'U', | ||
ȗ: 'u', | ||
Ș: 'S', | ||
ș: 's', | ||
Ț: 'T', | ||
ț: 't', | ||
Ȝ: 'Z', | ||
ȝ: 'z', | ||
Ȟ: 'H', | ||
ȟ: 'h', | ||
Ƞ: 'N', | ||
ȡ: 'd', | ||
Ȣ: 'OU', | ||
ȣ: 'ou', | ||
Ȥ: 'Z', | ||
ȥ: 'z', | ||
Ȧ: 'A', | ||
ȧ: 'a', | ||
Ȩ: 'E', | ||
ȩ: 'e', | ||
Ȫ: 'O', | ||
ȫ: 'o', | ||
Ȭ: 'O', | ||
ȭ: 'o', | ||
Ȯ: 'O', | ||
ȯ: 'o', | ||
Ȱ: 'O', | ||
ȱ: 'o', | ||
Ȳ: 'Y', | ||
ȳ: 'y', | ||
ȴ: 'l', | ||
ȵ: 'n', | ||
ȶ: 't', | ||
ȷ: 'j', | ||
ȸ: 'db', | ||
ȹ: 'qp', | ||
Ⱥ: 'A', | ||
Ȼ: 'C', | ||
ȼ: 'c', | ||
Ƚ: 'L', | ||
Ⱦ: 'T', | ||
ȿ: 's', | ||
ɀ: 'z', | ||
Ƀ: 'B', | ||
Ʉ: 'U', | ||
Ʌ: 'V', | ||
Ɇ: 'E', | ||
ɇ: 'e', | ||
Ɉ: 'J', | ||
ɉ: 'j', | ||
Ɋ: 'Q', | ||
ɋ: 'q', | ||
Ɍ: 'R', | ||
ɍ: 'r', | ||
Ɏ: 'Y', | ||
ɏ: 'y', | ||
ɐ: 'a', | ||
ɓ: 'b', | ||
ɔ: 'o', | ||
ɕ: 'c', | ||
ɖ: 'd', | ||
ɗ: 'd', | ||
ɘ: 'e', | ||
ə: 'a', | ||
ɚ: 'a', | ||
ɛ: 'e', | ||
ɜ: 'e', | ||
ɝ: 'e', | ||
ɞ: 'e', | ||
ɟ: 'j', | ||
ɠ: 'g', | ||
ɡ: 'g', | ||
ɢ: 'G', | ||
ɥ: 'h', | ||
ɦ: 'h', | ||
ɨ: 'i', | ||
ɪ: 'I', | ||
ɫ: 'l', | ||
ɬ: 'l', | ||
ɭ: 'l', | ||
ɯ: 'm', | ||
ɰ: 'm', | ||
ɱ: 'm', | ||
ɲ: 'n', | ||
ɳ: 'n', | ||
ɴ: 'N', | ||
ɵ: 'o', | ||
ɶ: 'OE', | ||
ɼ: 'r', | ||
ɽ: 'r', | ||
ɾ: 'r', | ||
ɿ: 'r', | ||
ʀ: 'R', | ||
ʁ: 'R', | ||
ʂ: 's', | ||
ʄ: 'j', | ||
ʇ: 't', | ||
ʈ: 't', | ||
ʉ: 'u', | ||
ʋ: 'v', | ||
ʌ: 'v', | ||
ʍ: 'w', | ||
ʎ: 'y', | ||
ʏ: 'Y', | ||
ʐ: 'z', | ||
ʑ: 'z', | ||
ʗ: 'C', | ||
ʙ: 'B', | ||
ʚ: 'e', | ||
ʛ: 'G', | ||
ʜ: 'H', | ||
ʝ: 'j', | ||
ʞ: 'k', | ||
ʟ: 'L', | ||
ʠ: 'q', | ||
ʣ: 'dz', | ||
ʥ: 'dz', | ||
ʦ: 'ts', | ||
ʨ: 'tc', | ||
ʪ: 'ls', | ||
ʫ: 'lz', | ||
ʮ: 'h', | ||
ʯ: 'h', | ||
ᴀ: 'A', | ||
ᴁ: 'AE', | ||
ᴂ: 'ae', | ||
ᴃ: 'B', | ||
ᴄ: 'C', | ||
ᴅ: 'D', | ||
ᴆ: 'D', | ||
ᴇ: 'E', | ||
ᴈ: 'e', | ||
ᴉ: 'i', | ||
ᴊ: 'J', | ||
ᴋ: 'K', | ||
ᴌ: 'L', | ||
ᴍ: 'M', | ||
ᴎ: 'N', | ||
ᴏ: 'O', | ||
ᴐ: 'O', | ||
ᴔ: 'oe', | ||
ᴕ: 'OU', | ||
ᴖ: 'o', | ||
ᴗ: 'o', | ||
ᴘ: 'P', | ||
ᴙ: 'R', | ||
ᴚ: 'R', | ||
ᴛ: 'T', | ||
ᴜ: 'U', | ||
ᴠ: 'V', | ||
ᴡ: 'W', | ||
ᴢ: 'Z', | ||
ᵢ: 'i', | ||
ᵣ: 'r', | ||
ᵤ: 'u', | ||
ᵥ: 'v', | ||
ᵫ: 'ue', | ||
ᵬ: 'b', | ||
ᵭ: 'd', | ||
ᵮ: 'f', | ||
ᵯ: 'm', | ||
ᵰ: 'n', | ||
ᵱ: 'p', | ||
ᵲ: 'r', | ||
ᵳ: 'r', | ||
ᵴ: 's', | ||
ᵵ: 't', | ||
ᵶ: 'z', | ||
ᵷ: 'g', | ||
ᵹ: 'g', | ||
ᵺ: 'th', | ||
ᵻ: 'I', | ||
ᵼ: 'i', | ||
ᵽ: 'p', | ||
ᵾ: 'U', | ||
ᶀ: 'b', | ||
ᶁ: 'd', | ||
ᶂ: 'f', | ||
ᶃ: 'g', | ||
ᶄ: 'k', | ||
ᶅ: 'l', | ||
ᶆ: 'm', | ||
ᶇ: 'n', | ||
ᶈ: 'p', | ||
ᶉ: 'r', | ||
ᶊ: 's', | ||
ᶌ: 'v', | ||
ᶍ: 'x', | ||
ᶎ: 'z', | ||
ᶏ: 'a', | ||
ᶑ: 'd', | ||
ᶒ: 'e', | ||
ᶓ: 'e', | ||
ᶔ: 'e', | ||
ᶕ: 'a', | ||
ᶖ: 'i', | ||
ᶗ: 'o', | ||
ᶙ: 'u', | ||
Ḁ: 'A', | ||
ḁ: 'a', | ||
Ḃ: 'B', | ||
ḃ: 'b', | ||
Ḅ: 'B', | ||
ḅ: 'b', | ||
Ḇ: 'B', | ||
ḇ: 'b', | ||
Ḉ: 'C', | ||
ḉ: 'c', | ||
Ḋ: 'D', | ||
ḋ: 'd', | ||
Ḍ: 'D', | ||
ḍ: 'd', | ||
Ḏ: 'D', | ||
ḏ: 'd', | ||
Ḑ: 'D', | ||
ḑ: 'd', | ||
Ḓ: 'D', | ||
ḓ: 'd', | ||
Ḕ: 'E', | ||
ḕ: 'e', | ||
Ḗ: 'E', | ||
ḗ: 'e', | ||
Ḙ: 'E', | ||
ḙ: 'e', | ||
Ḛ: 'E', | ||
ḛ: 'e', | ||
Ḝ: 'E', | ||
ḝ: 'e', | ||
Ḟ: 'F', | ||
ḟ: 'f', | ||
Ḡ: 'G', | ||
ḡ: 'g', | ||
Ḣ: 'H', | ||
ḣ: 'h', | ||
Ḥ: 'H', | ||
ḥ: 'h', | ||
Ḧ: 'H', | ||
ḧ: 'h', | ||
Ḩ: 'H', | ||
ḩ: 'h', | ||
Ḫ: 'H', | ||
ḫ: 'h', | ||
Ḭ: 'I', | ||
ḭ: 'i', | ||
Ḯ: 'I', | ||
ḯ: 'i', | ||
Ḱ: 'K', | ||
ḱ: 'k', | ||
Ḳ: 'K', | ||
ḳ: 'k', | ||
Ḵ: 'K', | ||
ḵ: 'k', | ||
Ḷ: 'L', | ||
ḷ: 'l', | ||
Ḹ: 'L', | ||
ḹ: 'l', | ||
Ḻ: 'L', | ||
ḻ: 'l', | ||
Ḽ: 'L', | ||
ḽ: 'l', | ||
Ḿ: 'M', | ||
ḿ: 'm', | ||
Ṁ: 'M', | ||
ṁ: 'm', | ||
Ṃ: 'M', | ||
ṃ: 'm', | ||
Ṅ: 'N', | ||
ṅ: 'n', | ||
Ṇ: 'N', | ||
ṇ: 'n', | ||
Ṉ: 'N', | ||
ṉ: 'n', | ||
Ṋ: 'N', | ||
ṋ: 'n', | ||
Ṍ: 'O', | ||
ṍ: 'o', | ||
Ṏ: 'O', | ||
ṏ: 'o', | ||
Ṑ: 'O', | ||
ṑ: 'o', | ||
Ṓ: 'O', | ||
ṓ: 'o', | ||
Ṕ: 'P', | ||
ṕ: 'p', | ||
Ṗ: 'P', | ||
ṗ: 'p', | ||
Ṙ: 'R', | ||
ṙ: 'r', | ||
Ṛ: 'R', | ||
ṛ: 'r', | ||
Ṝ: 'R', | ||
ṝ: 'r', | ||
Ṟ: 'R', | ||
ṟ: 'r', | ||
Ṡ: 'S', | ||
ṡ: 's', | ||
Ṣ: 'S', | ||
ṣ: 's', | ||
Ṥ: 'S', | ||
ṥ: 's', | ||
Ṧ: 'S', | ||
ṧ: 's', | ||
Ṩ: 'S', | ||
ṩ: 's', | ||
Ṫ: 'T', | ||
ṫ: 't', | ||
Ṭ: 'T', | ||
ṭ: 't', | ||
Ṯ: 'T', | ||
ṯ: 't', | ||
Ṱ: 'T', | ||
ṱ: 't', | ||
Ṳ: 'U', | ||
ṳ: 'u', | ||
Ṵ: 'U', | ||
ṵ: 'u', | ||
Ṷ: 'U', | ||
ṷ: 'u', | ||
Ṹ: 'U', | ||
ṹ: 'u', | ||
Ṻ: 'U', | ||
ṻ: 'u', | ||
Ṽ: 'V', | ||
ṽ: 'v', | ||
Ṿ: 'V', | ||
ṿ: 'v', | ||
Ẁ: 'W', | ||
ẁ: 'w', | ||
Ẃ: 'W', | ||
ẃ: 'w', | ||
Ẅ: 'W', | ||
ẅ: 'w', | ||
Ẇ: 'W', | ||
ẇ: 'w', | ||
Ẉ: 'W', | ||
ẉ: 'w', | ||
Ẋ: 'X', | ||
ẋ: 'x', | ||
Ẍ: 'X', | ||
ẍ: 'x', | ||
Ẏ: 'Y', | ||
ẏ: 'y', | ||
Ẑ: 'Z', | ||
ẑ: 'z', | ||
Ẓ: 'Z', | ||
ẓ: 'z', | ||
Ẕ: 'Z', | ||
ẕ: 'z', | ||
ẖ: 'h', | ||
ẗ: 't', | ||
ẘ: 'w', | ||
ẙ: 'y', | ||
ẚ: 'a', | ||
ẛ: 'f', | ||
ẜ: 's', | ||
ẝ: 's', | ||
ẞ: 'SS', | ||
Ạ: 'A', | ||
ạ: 'a', | ||
Ả: 'A', | ||
ả: 'a', | ||
Ấ: 'A', | ||
ấ: 'a', | ||
Ầ: 'A', | ||
ầ: 'a', | ||
Ẩ: 'A', | ||
ẩ: 'a', | ||
Ẫ: 'A', | ||
ẫ: 'a', | ||
Ậ: 'A', | ||
ậ: 'a', | ||
Ắ: 'A', | ||
ắ: 'a', | ||
Ằ: 'A', | ||
ằ: 'a', | ||
Ẳ: 'A', | ||
ẳ: 'a', | ||
Ẵ: 'A', | ||
ẵ: 'a', | ||
Ặ: 'A', | ||
ặ: 'a', | ||
Ẹ: 'E', | ||
ẹ: 'e', | ||
Ẻ: 'E', | ||
ẻ: 'e', | ||
Ẽ: 'E', | ||
ẽ: 'e', | ||
Ế: 'E', | ||
ế: 'e', | ||
Ề: 'E', | ||
ề: 'e', | ||
Ể: 'E', | ||
ể: 'e', | ||
Ễ: 'E', | ||
ễ: 'e', | ||
Ệ: 'E', | ||
ệ: 'e', | ||
Ỉ: 'I', | ||
ỉ: 'i', | ||
Ị: 'I', | ||
ị: 'i', | ||
Ọ: 'O', | ||
ọ: 'o', | ||
Ỏ: 'O', | ||
ỏ: 'o', | ||
Ố: 'O', | ||
ố: 'o', | ||
Ồ: 'O', | ||
ồ: 'o', | ||
Ổ: 'O', | ||
ổ: 'o', | ||
Ỗ: 'O', | ||
ỗ: 'o', | ||
Ộ: 'O', | ||
ộ: 'o', | ||
Ớ: 'O', | ||
ớ: 'o', | ||
Ờ: 'O', | ||
ờ: 'o', | ||
Ở: 'O', | ||
ở: 'o', | ||
Ỡ: 'O', | ||
ỡ: 'o', | ||
Ợ: 'O', | ||
ợ: 'o', | ||
Ụ: 'U', | ||
ụ: 'u', | ||
Ủ: 'U', | ||
ủ: 'u', | ||
Ứ: 'U', | ||
ứ: 'u', | ||
Ừ: 'U', | ||
ừ: 'u', | ||
Ử: 'U', | ||
ử: 'u', | ||
Ữ: 'U', | ||
ữ: 'u', | ||
Ự: 'U', | ||
ự: 'u', | ||
Ỳ: 'Y', | ||
ỳ: 'y', | ||
Ỵ: 'Y', | ||
ỵ: 'y', | ||
Ỷ: 'Y', | ||
ỷ: 'y', | ||
Ỹ: 'Y', | ||
ỹ: 'y', | ||
Ỻ: 'LL', | ||
ỻ: 'll', | ||
Ỽ: 'V', | ||
Ỿ: 'Y', | ||
ỿ: 'y', | ||
'‐': '-', | ||
'‑': '-', | ||
'‒': '-', | ||
'–': '-', | ||
'—': '-', | ||
'‘': '"', | ||
'’': '"', | ||
'‚': '"', | ||
'‛': '"', | ||
'“': '"', | ||
'”': '"', | ||
'„': '"', | ||
'′': '"', | ||
'″': '"', | ||
'‵': '"', | ||
'‶': '"', | ||
'‸': '^', | ||
'‹': '"', | ||
'›': '"', | ||
'‼': '!!', | ||
'⁄': '/', | ||
'⁅': '[', | ||
'⁆': ']', | ||
'⁇': '??', | ||
'⁈': '?!', | ||
'⁉': '!?', | ||
'⁎': '*', | ||
'⁏': ';', | ||
'⁒': '%', | ||
'⁓': '~', | ||
'⁰': '0', | ||
ⁱ: 'i', | ||
'⁴': '4', | ||
'⁵': '5', | ||
'⁶': '6', | ||
'⁷': '7', | ||
'⁸': '8', | ||
'⁹': '9', | ||
'⁺': '+', | ||
'⁻': '-', | ||
'⁼': '=', | ||
'⁽': '(', | ||
'⁾': ')', | ||
ⁿ: 'n', | ||
'₀': '0', | ||
'₁': '1', | ||
'₂': '2', | ||
'₃': '3', | ||
'₄': '4', | ||
'₅': '5', | ||
'₆': '6', | ||
'₇': '7', | ||
'₈': '8', | ||
'₉': '9', | ||
'₊': '+', | ||
'₋': '-', | ||
'₌': '=', | ||
'₍': '(', | ||
'₎': ')', | ||
ₐ: 'a', | ||
ₑ: 'e', | ||
ₒ: 'o', | ||
ₓ: 'x', | ||
ₔ: 'a', | ||
ↄ: 'c', | ||
'①': '1', | ||
'②': '2', | ||
'③': '3', | ||
'④': '4', | ||
'⑤': '5', | ||
'⑥': '6', | ||
'⑦': '7', | ||
'⑧': '8', | ||
'⑨': '9', | ||
'⑩': '10', | ||
'⑪': '11', | ||
'⑫': '12', | ||
'⑬': '13', | ||
'⑭': '14', | ||
'⑮': '15', | ||
'⑯': '16', | ||
'⑰': '17', | ||
'⑱': '18', | ||
'⑲': '19', | ||
'⑳': '20', | ||
'⑴': '(1)', | ||
'⑵': '(2)', | ||
'⑶': '(3)', | ||
'⑷': '(4)', | ||
'⑸': '(5)', | ||
'⑹': '(6)', | ||
'⑺': '(7)', | ||
'⑻': '(8)', | ||
'⑼': '(9)', | ||
'⑽': '(10)', | ||
'⑾': '(11)', | ||
'⑿': '(12)', | ||
'⒀': '(13)', | ||
'⒁': '(14)', | ||
'⒂': '(15)', | ||
'⒃': '(16)', | ||
'⒄': '(17)', | ||
'⒅': '(18)', | ||
'⒆': '(19)', | ||
'⒇': '(20)', | ||
'⒈': '1.', | ||
'⒉': '2.', | ||
'⒊': '3.', | ||
'⒋': '4.', | ||
'⒌': '5.', | ||
'⒍': '6.', | ||
'⒎': '7.', | ||
'⒏': '8.', | ||
'⒐': '9.', | ||
'⒑': '10.', | ||
'⒒': '11.', | ||
'⒓': '12.', | ||
'⒔': '13.', | ||
'⒕': '14.', | ||
'⒖': '15.', | ||
'⒗': '16.', | ||
'⒘': '17.', | ||
'⒙': '18.', | ||
'⒚': '19.', | ||
'⒛': '20.', | ||
'⒜': '(a)', | ||
'⒝': '(b)', | ||
'⒞': '(c)', | ||
'⒟': '(d)', | ||
'⒠': '(e)', | ||
'⒡': '(f)', | ||
'⒢': '(g)', | ||
'⒣': '(h)', | ||
'⒤': '(i)', | ||
'⒥': '(j)', | ||
'⒦': '(k)', | ||
'⒧': '(l)', | ||
'⒨': '(m)', | ||
'⒩': '(n)', | ||
'⒪': '(o)', | ||
'⒫': '(p)', | ||
'⒬': '(q)', | ||
'⒭': '(r)', | ||
'⒮': '(s)', | ||
'⒯': '(t)', | ||
'⒰': '(u)', | ||
'⒱': '(v)', | ||
'⒲': '(w)', | ||
'⒳': '(x)', | ||
'⒴': '(y)', | ||
'⒵': '(z)', | ||
'Ⓐ': 'A', | ||
'Ⓑ': 'B', | ||
'Ⓒ': 'C', | ||
'Ⓓ': 'D', | ||
'Ⓔ': 'E', | ||
'Ⓕ': 'F', | ||
'Ⓖ': 'G', | ||
'Ⓗ': 'H', | ||
'Ⓘ': 'I', | ||
'Ⓙ': 'J', | ||
'Ⓚ': 'K', | ||
'Ⓛ': 'L', | ||
'Ⓜ': 'M', | ||
'Ⓝ': 'N', | ||
'Ⓞ': 'O', | ||
'Ⓟ': 'P', | ||
'Ⓠ': 'Q', | ||
'Ⓡ': 'R', | ||
'Ⓢ': 'S', | ||
'Ⓣ': 'T', | ||
'Ⓤ': 'U', | ||
'Ⓥ': 'V', | ||
'Ⓦ': 'W', | ||
'Ⓧ': 'X', | ||
'Ⓨ': 'Y', | ||
'Ⓩ': 'Z', | ||
'ⓐ': 'a', | ||
'ⓑ': 'b', | ||
'ⓒ': 'c', | ||
'ⓓ': 'd', | ||
'ⓔ': 'e', | ||
'ⓕ': 'f', | ||
'ⓖ': 'g', | ||
'ⓗ': 'h', | ||
'ⓘ': 'i', | ||
'ⓙ': 'j', | ||
'ⓚ': 'k', | ||
'ⓛ': 'l', | ||
'ⓜ': 'm', | ||
'ⓝ': 'n', | ||
'ⓞ': 'o', | ||
'ⓟ': 'p', | ||
'ⓠ': 'q', | ||
'ⓡ': 'r', | ||
'ⓢ': 's', | ||
'ⓣ': 't', | ||
'ⓤ': 'u', | ||
'ⓥ': 'v', | ||
'ⓦ': 'w', | ||
'ⓧ': 'x', | ||
'ⓨ': 'y', | ||
'ⓩ': 'z', | ||
'⓪': '0', | ||
'⓫': '11', | ||
'⓬': '12', | ||
'⓭': '13', | ||
'⓮': '14', | ||
'⓯': '15', | ||
'⓰': '16', | ||
'⓱': '17', | ||
'⓲': '18', | ||
'⓳': '19', | ||
'⓴': '20', | ||
'⓵': '1', | ||
'⓶': '2', | ||
'⓷': '3', | ||
'⓸': '4', | ||
'⓹': '5', | ||
'⓺': '6', | ||
'⓻': '7', | ||
'⓼': '8', | ||
'⓽': '9', | ||
'⓾': '10', | ||
'⓿': '0', | ||
'❛': '"', | ||
'❜': '"', | ||
'❝': '"', | ||
'❞': '"', | ||
'❨': '(', | ||
'❩': ')', | ||
'❪': '(', | ||
'❫': ')', | ||
'❬': '<', | ||
'❭': '>', | ||
'❮': '"', | ||
'❯': '"', | ||
'❰': '<', | ||
'❱': '>', | ||
'❲': '[', | ||
'❳': ']', | ||
'❴': '{', | ||
'❵': '}', | ||
'❶': '1', | ||
'❷': '2', | ||
'❸': '3', | ||
'❹': '4', | ||
'❺': '5', | ||
'❻': '6', | ||
'❼': '7', | ||
'❽': '8', | ||
'❾': '9', | ||
'❿': '10', | ||
'➀': '1', | ||
'➁': '2', | ||
'➂': '3', | ||
'➃': '4', | ||
'➄': '5', | ||
'➅': '6', | ||
'➆': '7', | ||
'➇': '8', | ||
'➈': '9', | ||
'➉': '10', | ||
'➊': '1', | ||
'➋': '2', | ||
'➌': '3', | ||
'➍': '4', | ||
'➎': '5', | ||
'➏': '6', | ||
'➐': '7', | ||
'➑': '8', | ||
'➒': '9', | ||
'➓': '10', | ||
Ⱡ: 'L', | ||
ⱡ: 'l', | ||
Ɫ: 'L', | ||
Ᵽ: 'P', | ||
Ɽ: 'R', | ||
ⱥ: 'a', | ||
ⱦ: 't', | ||
Ⱨ: 'H', | ||
ⱨ: 'h', | ||
Ⱪ: 'K', | ||
ⱪ: 'k', | ||
Ⱬ: 'Z', | ||
ⱬ: 'z', | ||
Ɱ: 'M', | ||
Ɐ: 'a', | ||
ⱱ: 'v', | ||
Ⱳ: 'W', | ||
ⱳ: 'w', | ||
ⱴ: 'v', | ||
Ⱶ: 'H', | ||
ⱶ: 'h', | ||
ⱸ: 'e', | ||
ⱺ: 'o', | ||
ⱻ: 'E', | ||
ⱼ: 'j', | ||
'⸨': '((', | ||
'⸩': '))', | ||
Ꜩ: 'TZ', | ||
ꜩ: 'tz', | ||
ꜰ: 'F', | ||
ꜱ: 'S', | ||
Ꜳ: 'AA', | ||
ꜳ: 'aa', | ||
Ꜵ: 'AO', | ||
ꜵ: 'ao', | ||
Ꜷ: 'AU', | ||
ꜷ: 'au', | ||
Ꜹ: 'AV', | ||
ꜹ: 'av', | ||
Ꜻ: 'AV', | ||
ꜻ: 'av', | ||
Ꜽ: 'AY', | ||
ꜽ: 'ay', | ||
Ꜿ: 'c', | ||
ꜿ: 'c', | ||
Ꝁ: 'K', | ||
ꝁ: 'k', | ||
Ꝃ: 'K', | ||
ꝃ: 'k', | ||
Ꝅ: 'K', | ||
ꝅ: 'k', | ||
Ꝇ: 'L', | ||
ꝇ: 'l', | ||
Ꝉ: 'L', | ||
ꝉ: 'l', | ||
Ꝋ: 'O', | ||
ꝋ: 'o', | ||
Ꝍ: 'O', | ||
ꝍ: 'o', | ||
Ꝏ: 'OO', | ||
ꝏ: 'oo', | ||
Ꝑ: 'P', | ||
ꝑ: 'p', | ||
Ꝓ: 'P', | ||
ꝓ: 'p', | ||
Ꝕ: 'P', | ||
ꝕ: 'p', | ||
Ꝗ: 'Q', | ||
ꝗ: 'q', | ||
Ꝙ: 'Q', | ||
ꝙ: 'q', | ||
Ꝛ: 'R', | ||
ꝛ: 'r', | ||
Ꝟ: 'V', | ||
ꝟ: 'v', | ||
Ꝡ: 'VY', | ||
ꝡ: 'vy', | ||
Ꝣ: 'Z', | ||
ꝣ: 'z', | ||
Ꝧ: 'TH', | ||
ꝧ: 'th', | ||
Ꝩ: 'V', | ||
Ꝺ: 'D', | ||
ꝺ: 'd', | ||
Ꝼ: 'F', | ||
ꝼ: 'f', | ||
Ᵹ: 'G', | ||
Ꝿ: 'G', | ||
ꝿ: 'g', | ||
Ꞁ: 'L', | ||
ꞁ: 'l', | ||
Ꞃ: 'R', | ||
ꞃ: 'r', | ||
Ꞅ: 's', | ||
ꞅ: 'S', | ||
Ꞇ: 'T', | ||
ꟻ: 'F', | ||
ꟼ: 'p', | ||
ꟽ: 'M', | ||
ꟾ: 'I', | ||
ꟿ: 'M', | ||
ff: 'ff', | ||
fi: 'fi', | ||
fl: 'fl', | ||
ffi: 'ffi', | ||
ffl: 'ffl', | ||
st: 'st', | ||
'!': '!', | ||
'"': '"', | ||
'#': '#', | ||
'$': '$', | ||
'%': '%', | ||
'&': '&', | ||
''': '"', | ||
'(': '(', | ||
')': ')', | ||
'*': '*', | ||
'+': '+', | ||
',': ',', | ||
'-': '-', | ||
'.': '.', | ||
'/': '/', | ||
'0': '0', | ||
'1': '1', | ||
'2': '2', | ||
'3': '3', | ||
'4': '4', | ||
'5': '5', | ||
'6': '6', | ||
'7': '7', | ||
'8': '8', | ||
'9': '9', | ||
':': ':', | ||
';': ';', | ||
'<': '<', | ||
'=': '=', | ||
'>': '>', | ||
'?': '?', | ||
'@': '@', | ||
A: 'A', | ||
B: 'B', | ||
C: 'C', | ||
D: 'D', | ||
E: 'E', | ||
F: 'F', | ||
G: 'G', | ||
H: 'H', | ||
I: 'I', | ||
J: 'J', | ||
K: 'K', | ||
L: 'L', | ||
M: 'M', | ||
N: 'N', | ||
O: 'O', | ||
P: 'P', | ||
Q: 'Q', | ||
R: 'R', | ||
S: 'S', | ||
T: 'T', | ||
U: 'U', | ||
V: 'V', | ||
W: 'W', | ||
X: 'X', | ||
Y: 'Y', | ||
Z: 'Z', | ||
'[': '[', | ||
'\': '\\', | ||
']': ']', | ||
'^': '^', | ||
'_': '_', | ||
a: 'a', | ||
b: 'b', | ||
c: 'c', | ||
d: 'd', | ||
e: 'e', | ||
f: 'f', | ||
g: 'g', | ||
h: 'h', | ||
i: 'i', | ||
j: 'j', | ||
k: 'k', | ||
l: 'l', | ||
m: 'm', | ||
n: 'n', | ||
o: 'o', | ||
p: 'p', | ||
q: 'q', | ||
r: 'r', | ||
s: 's', | ||
t: 't', | ||
u: 'u', | ||
v: 'v', | ||
w: 'w', | ||
x: 'x', | ||
y: 'y', | ||
z: 'z', | ||
'{': '{', | ||
'}': '}', | ||
'~': '~' | ||
}; | ||
var _excluded = ["label"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
// flattens a nested array | ||
var flatten = function flatten(arr) { | ||
return arr.reduce(function (flat, toFlatten) { | ||
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten); | ||
}, []); | ||
}; | ||
var extractSuggestion = function extractSuggestion(val) { | ||
switch (_typeof(val)) { | ||
case 'string': | ||
return val; | ||
case 'object': | ||
if (Array.isArray(val)) { | ||
return flatten(val); | ||
} | ||
return null; | ||
default: | ||
return val; | ||
} | ||
}; | ||
function replaceDiacritics(s) { | ||
var str = s ? String(s) : ''; | ||
for (var i = 0; i < str.length; i++) { | ||
var currentChar = str.charAt(i); | ||
if (diacritics[currentChar]) { | ||
str = str.replaceAll(currentChar, diacritics[currentChar]); | ||
} | ||
} | ||
return str; | ||
} | ||
function escapeRegExp() { | ||
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string | ||
} | ||
var getPredictiveSuggestions = function getPredictiveSuggestions(_ref) { | ||
var suggestions = _ref.suggestions, | ||
currentValue = _ref.currentValue, | ||
wordsToShowAfterHighlight = _ref.wordsToShowAfterHighlight; | ||
var suggestionMap = {}; | ||
if (currentValue) { | ||
var currentValueTrimmed = currentValue.trim(); | ||
var parsedSuggestion = suggestions.reduce(function (agg, _ref2) { | ||
var label = _ref2.label, | ||
rest = _objectWithoutProperties(_ref2, _excluded); | ||
// to handle special strings with pattern '<mark>xyz</mark> <a href="test' | ||
var parsedContent = new DOMParser().parseFromString(label, 'text/html').documentElement.textContent; | ||
// to match the partial start of word. | ||
// example if searchTerm is `select` and string contains `selected` | ||
var regexString = "^(".concat(escapeRegExp(currentValueTrimmed), ")\\w+"); | ||
var regex = new RegExp(regexString, 'i'); | ||
var regexExecution = regex.exec(parsedContent); | ||
// if execution value is null it means either there is no match or there are chances | ||
// that exact word is present | ||
if (!regexExecution) { | ||
// regex to match exact word | ||
regexString = "^(".concat(escapeRegExp(currentValueTrimmed), ")"); | ||
regex = new RegExp(regexString, 'i'); | ||
regexExecution = regex.exec(parsedContent); | ||
} | ||
if (regexExecution) { | ||
var matchedString = parsedContent.slice(regexExecution.index, parsedContent.length); | ||
var highlightedWord = matchedString.slice(currentValueTrimmed.length).split(' ').slice(0, wordsToShowAfterHighlight + 1).join(' '); | ||
var suggestionPhrase = "".concat(currentValueTrimmed, "<mark class=\"highlight\">").concat(highlightedWord, "</mark>"); | ||
var suggestionValue = "".concat(currentValueTrimmed).concat(highlightedWord); | ||
// to show unique results only | ||
if (!suggestionMap[suggestionPhrase]) { | ||
suggestionMap[suggestionPhrase] = 1; | ||
return [].concat(_toConsumableArray(agg), [_objectSpread(_objectSpread({}, rest), {}, { | ||
label: suggestionPhrase, | ||
value: suggestionValue, | ||
isPredictiveSuggestion: true | ||
})]); | ||
} | ||
return agg; | ||
} | ||
return agg; | ||
}, []); | ||
return parsedSuggestion; | ||
} | ||
return []; | ||
}; | ||
var getSuggestions = function getSuggestions(_ref3) { | ||
var fields = _ref3.fields, | ||
suggestions = _ref3.suggestions, | ||
currentValue = _ref3.currentValue, | ||
_ref3$suggestionPrope = _ref3.suggestionProperties, | ||
suggestionProperties = _ref3$suggestionPrope === void 0 ? [] : _ref3$suggestionPrope, | ||
_ref3$showDistinctSug = _ref3.showDistinctSuggestions, | ||
showDistinctSuggestions = _ref3$showDistinctSug === void 0 ? false : _ref3$showDistinctSug, | ||
_ref3$enablePredictiv = _ref3.enablePredictiveSuggestions, | ||
enablePredictiveSuggestions = _ref3$enablePredictiv === void 0 ? false : _ref3$enablePredictiv, | ||
_ref3$wordsToShowAfte = _ref3.wordsToShowAfterHighlight, | ||
wordsToShowAfterHighlight = _ref3$wordsToShowAfte === void 0 ? 2 : _ref3$wordsToShowAfte, | ||
enableSynonyms = _ref3.enableSynonyms; | ||
/* | ||
fields: DataFields passed on Search Components | ||
suggestions: Raw Suggestions received from ES | ||
currentValue: Search Term | ||
skipWordMatch: Use to skip the word match logic, important for synonym | ||
showDistinctSuggestions: When set to true will only return 1 suggestion per document | ||
*/ | ||
var suggestionsList = []; | ||
var labelsList = []; | ||
var skipWordMatch = false; | ||
var populateSuggestionsList = function populateSuggestionsList(val, parsedSource, source) { | ||
// check if the suggestion includes the current value | ||
// and not already included in other suggestions | ||
var isWordMatch = skipWordMatch || currentValue.trim().split(' ').some(function (term) { | ||
return replaceDiacritics(val).toLowerCase().includes(replaceDiacritics(term)); | ||
}); | ||
// promoted results should always include in suggestions even there is no match | ||
if (isWordMatch && !labelsList.includes(val) || source._promoted) { | ||
var defaultOption = { | ||
label: val, | ||
value: val, | ||
source: source | ||
}; | ||
var additionalKeys = {}; | ||
if (Array.isArray(suggestionProperties) && suggestionProperties.length > 0) { | ||
suggestionProperties.forEach(function (prop) { | ||
if (parsedSource.hasOwnProperty(prop)) { | ||
additionalKeys = _objectSpread(_objectSpread({}, additionalKeys), {}, _defineProperty({}, prop, parsedSource[prop])); | ||
} | ||
}); | ||
} | ||
var option = _objectSpread(_objectSpread({}, defaultOption), additionalKeys); | ||
labelsList = [].concat(_toConsumableArray(labelsList), [val]); | ||
suggestionsList = [].concat(_toConsumableArray(suggestionsList), [option]); | ||
if (showDistinctSuggestions) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
var parseField = function parseField(parsedSource) { | ||
var field = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : parsedSource; | ||
if (_typeof(parsedSource) === 'object') { | ||
var fieldNodes = field.split('.'); | ||
var label = parsedSource[fieldNodes[0]]; | ||
// To handle field names with dots | ||
// For example, if source has a top level field name is `user.name` | ||
// then it would extract the suggestion from parsed source | ||
if (parsedSource[field]) { | ||
var topLabel = parsedSource[field]; | ||
var val = extractSuggestion(topLabel); | ||
if (val && typeof val === 'string') { | ||
return populateSuggestionsList(val, parsedSource, source); | ||
} | ||
} | ||
// if they type of field is array of strings | ||
// then we need to pick first matching value as the label | ||
if (Array.isArray(label)) { | ||
if (label.length > 1) { | ||
label = label.filter(function (i) { | ||
return i && i.toString().toLowerCase().includes(currentValue.toString().toLowerCase()); | ||
}); | ||
} | ||
label = label[0]; | ||
} | ||
if (label) { | ||
if (fieldNodes.length > 1) { | ||
// nested fields of the 'foo.bar.zoo' variety | ||
var children = field.substring(fieldNodes[0].length + 1); | ||
parseField(label, children, source); | ||
} else { | ||
var _val = extractSuggestion(label); | ||
if (_val) { | ||
return populateSuggestionsList(_val, parsedSource, source); | ||
} | ||
} | ||
} | ||
} | ||
return false; | ||
}; | ||
var traverseSuggestions = function traverseSuggestions() { | ||
suggestions.forEach(function (item) { | ||
fields.forEach(function (field) { | ||
parseField(item, field); | ||
}); | ||
}); | ||
}; | ||
traverseSuggestions(); | ||
if (suggestionsList.length < suggestions.length && !skipWordMatch && enableSynonyms) { | ||
/* | ||
When we have synonym we set skipWordMatch to false as it may discard | ||
the suggestion if word doesnt match term. | ||
For eg: iphone, ios are synonyms and on searching iphone isWordMatch | ||
in populateSuggestionList may discard ios source which decreases no. | ||
of items in suggestionsList | ||
*/ | ||
skipWordMatch = true; | ||
traverseSuggestions(); | ||
} | ||
if (enablePredictiveSuggestions) { | ||
var predictiveSuggestions = getPredictiveSuggestions({ | ||
suggestions: suggestionsList, | ||
currentValue: currentValue, | ||
wordsToShowAfterHighlight: wordsToShowAfterHighlight | ||
}); | ||
suggestionsList = predictiveSuggestions; | ||
} | ||
if (showDistinctSuggestions) { | ||
var idMap = {}; | ||
var filteredSuggestions = []; | ||
suggestionsList.forEach(function (suggestion) { | ||
if (suggestion.source && suggestion.source._id) { | ||
if (!idMap[suggestion.source._id]) { | ||
filteredSuggestions.push(suggestion); | ||
idMap[suggestion.source._id] = true; | ||
} | ||
} | ||
}); | ||
return filteredSuggestions; | ||
} | ||
return suggestionsList; | ||
}; | ||
exports.default = getSuggestions; | ||
exports.replaceDiacritics = replaceDiacritics; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.replaceDiacritics=replaceDiacritics;var _diacritics=require('./diacritics');var _diacritics2=_interopRequireDefault(_diacritics);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}var flatten=function flatten(arr){return arr.reduce(function(flat,toFlatten){return flat.concat(Array.isArray(toFlatten)?flatten(toFlatten):toFlatten);},[]);};var extractSuggestion=function extractSuggestion(val){switch(typeof val){case'string':return val;case'object':if(Array.isArray(val)){return flatten(val);}return null;default:return val;}};function replaceDiacritics(s){var str=s?String(s):'';for(var i=0;i<str.length;i++){var currentChar=str.charAt(i);if(_diacritics2.default[currentChar]){str=str.replaceAll(currentChar,_diacritics2.default[currentChar]);}}return str;}function escapeRegExp(){var string=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return string.replace(/[.*+?^${}()|[\]\\]/g,'\\$&');}var getPredictiveSuggestions=function getPredictiveSuggestions(_ref){var suggestions=_ref.suggestions,currentValue=_ref.currentValue,wordsToShowAfterHighlight=_ref.wordsToShowAfterHighlight;var suggestionMap={};if(currentValue){var currentValueTrimmed=currentValue.trim();var parsedSuggestion=suggestions.reduce(function(agg,_ref2){var label=_ref2.label,rest=_objectWithoutProperties(_ref2,['label']);var parsedContent=new DOMParser().parseFromString(label,'text/html').documentElement.textContent;var regexString='^('+escapeRegExp(currentValueTrimmed)+')\\w+';var regex=new RegExp(regexString,'i');var regexExecution=regex.exec(parsedContent);if(!regexExecution){regexString='^('+escapeRegExp(currentValueTrimmed)+')';regex=new RegExp(regexString,'i');regexExecution=regex.exec(parsedContent);}if(regexExecution){var matchedString=parsedContent.slice(regexExecution.index,parsedContent.length);var highlightedWord=matchedString.slice(currentValueTrimmed.length).split(' ').slice(0,wordsToShowAfterHighlight+1).join(' ');var suggestionPhrase=currentValueTrimmed+'<mark class="highlight">'+highlightedWord+'</mark>';var suggestionValue=''+currentValueTrimmed+highlightedWord;if(!suggestionMap[suggestionPhrase]){suggestionMap[suggestionPhrase]=1;return[].concat(_toConsumableArray(agg),[_extends({},rest,{label:suggestionPhrase,value:suggestionValue,isPredictiveSuggestion:true})]);}return agg;}return agg;},[]);return parsedSuggestion;}return[];};var getSuggestions=function getSuggestions(_ref3){var fields=_ref3.fields,suggestions=_ref3.suggestions,currentValue=_ref3.currentValue,_ref3$suggestionPrope=_ref3.suggestionProperties,suggestionProperties=_ref3$suggestionPrope===undefined?[]:_ref3$suggestionPrope,_ref3$showDistinctSug=_ref3.showDistinctSuggestions,showDistinctSuggestions=_ref3$showDistinctSug===undefined?false:_ref3$showDistinctSug,_ref3$enablePredictiv=_ref3.enablePredictiveSuggestions,enablePredictiveSuggestions=_ref3$enablePredictiv===undefined?false:_ref3$enablePredictiv,_ref3$wordsToShowAfte=_ref3.wordsToShowAfterHighlight,wordsToShowAfterHighlight=_ref3$wordsToShowAfte===undefined?2:_ref3$wordsToShowAfte,enableSynonyms=_ref3.enableSynonyms;var suggestionsList=[];var labelsList=[];var skipWordMatch=false;var populateSuggestionsList=function populateSuggestionsList(val,parsedSource,source){var isWordMatch=skipWordMatch||currentValue.trim().split(' ').some(function(term){return replaceDiacritics(val).toLowerCase().includes(replaceDiacritics(term));});if(isWordMatch&&!labelsList.includes(val)||source._promoted){var defaultOption={label:val,value:val,source:source};var additionalKeys={};if(Array.isArray(suggestionProperties)&&suggestionProperties.length>0){suggestionProperties.forEach(function(prop){if(parsedSource.hasOwnProperty(prop)){additionalKeys=_extends({},additionalKeys,_defineProperty({},prop,parsedSource[prop]));}});}var option=_extends({},defaultOption,additionalKeys);labelsList=[].concat(_toConsumableArray(labelsList),[val]);suggestionsList=[].concat(_toConsumableArray(suggestionsList),[option]);if(showDistinctSuggestions){return true;}}return false;};var parseField=function parseField(parsedSource){var field=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var source=arguments.length>2&&arguments[2]!==undefined?arguments[2]:parsedSource;if(typeof parsedSource==='object'){var fieldNodes=field.split('.');var label=parsedSource[fieldNodes[0]];if(parsedSource[field]){var topLabel=parsedSource[field];var val=extractSuggestion(topLabel);if(val&&typeof val==='string'){return populateSuggestionsList(val,parsedSource,source);}}if(Array.isArray(label)){if(label.length>1){label=label.filter(function(i){return i&&i.toString().toLowerCase().includes(currentValue.toString().toLowerCase());});}label=label[0];}if(label){if(fieldNodes.length>1){var children=field.substring(fieldNodes[0].length+1);parseField(label,children,source);}else{var _val=extractSuggestion(label);if(_val){return populateSuggestionsList(_val,parsedSource,source);}}}}return false;};var traverseSuggestions=function traverseSuggestions(){suggestions.forEach(function(item){fields.forEach(function(field){parseField(item,field);});});};traverseSuggestions();if(suggestionsList.length<suggestions.length&&!skipWordMatch&&enableSynonyms){skipWordMatch=true;traverseSuggestions();}if(enablePredictiveSuggestions){var predictiveSuggestions=getPredictiveSuggestions({suggestions:suggestionsList,currentValue:currentValue,wordsToShowAfterHighlight:wordsToShowAfterHighlight});suggestionsList=predictiveSuggestions;}if(showDistinctSuggestions){var idMap={};var filteredSuggestions=[];suggestionsList.forEach(function(suggestion){if(suggestion.source&&suggestion.source._id){if(!idMap[suggestion.source._id]){filteredSuggestions.push(suggestion);idMap[suggestion.source._id]=true;}}});return filteredSuggestions;}return suggestionsList;};exports.default=getSuggestions; |
@@ -1,1144 +0,1 @@ | ||
'use strict'; | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
function getDefaultExportFromCjs (x) { | ||
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; | ||
} | ||
var dayjs_min = {exports: {}}; | ||
(function (module, exports) { | ||
!function (t, e) { | ||
module.exports = e() ; | ||
}(commonjsGlobal, function () { | ||
var t = 1e3, | ||
e = 6e4, | ||
n = 36e5, | ||
r = "millisecond", | ||
i = "second", | ||
s = "minute", | ||
u = "hour", | ||
a = "day", | ||
o = "week", | ||
f = "month", | ||
h = "quarter", | ||
c = "year", | ||
d = "date", | ||
l = "Invalid Date", | ||
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, | ||
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, | ||
M = { | ||
name: "en", | ||
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), | ||
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), | ||
ordinal: function ordinal(t) { | ||
var e = ["th", "st", "nd", "rd"], | ||
n = t % 100; | ||
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; | ||
} | ||
}, | ||
m = function m(t, e, n) { | ||
var r = String(t); | ||
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; | ||
}, | ||
v = { | ||
s: m, | ||
z: function z(t) { | ||
var e = -t.utcOffset(), | ||
n = Math.abs(e), | ||
r = Math.floor(n / 60), | ||
i = n % 60; | ||
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); | ||
}, | ||
m: function t(e, n) { | ||
if (e.date() < n.date()) return -t(n, e); | ||
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), | ||
i = e.clone().add(r, f), | ||
s = n - i < 0, | ||
u = e.clone().add(r + (s ? -1 : 1), f); | ||
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); | ||
}, | ||
a: function a(t) { | ||
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); | ||
}, | ||
p: function p(t) { | ||
return { | ||
M: f, | ||
y: c, | ||
w: o, | ||
d: a, | ||
D: d, | ||
h: u, | ||
m: s, | ||
s: i, | ||
ms: r, | ||
Q: h | ||
}[t] || String(t || "").toLowerCase().replace(/s$/, ""); | ||
}, | ||
u: function u(t) { | ||
return void 0 === t; | ||
} | ||
}, | ||
g = "en", | ||
D = {}; | ||
D[g] = M; | ||
var p = function p(t) { | ||
return t instanceof _; | ||
}, | ||
S = function t(e, n, r) { | ||
var i; | ||
if (!e) return g; | ||
if ("string" == typeof e) { | ||
var s = e.toLowerCase(); | ||
D[s] && (i = s), n && (D[s] = n, i = s); | ||
var u = e.split("-"); | ||
if (!i && u.length > 1) return t(u[0]); | ||
} else { | ||
var a = e.name; | ||
D[a] = e, i = a; | ||
} | ||
return !r && i && (g = i), i || !r && g; | ||
}, | ||
w = function w(t, e) { | ||
if (p(t)) return t.clone(); | ||
var n = "object" == _typeof(e) ? e : {}; | ||
return n.date = t, n.args = arguments, new _(n); | ||
}, | ||
O = v; | ||
O.l = S, O.i = p, O.w = function (t, e) { | ||
return w(t, { | ||
locale: e.$L, | ||
utc: e.$u, | ||
x: e.$x, | ||
$offset: e.$offset | ||
}); | ||
}; | ||
var _ = function () { | ||
function M(t) { | ||
this.$L = S(t.locale, null, !0), this.parse(t); | ||
} | ||
var m = M.prototype; | ||
return m.parse = function (t) { | ||
this.$d = function (t) { | ||
var e = t.date, | ||
n = t.utc; | ||
if (null === e) return new Date(NaN); | ||
if (O.u(e)) return new Date(); | ||
if (e instanceof Date) return new Date(e); | ||
if ("string" == typeof e && !/Z$/i.test(e)) { | ||
var r = e.match($); | ||
if (r) { | ||
var i = r[2] - 1 || 0, | ||
s = (r[7] || "0").substring(0, 3); | ||
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); | ||
} | ||
} | ||
return new Date(e); | ||
}(t), this.$x = t.x || {}, this.init(); | ||
}, m.init = function () { | ||
var t = this.$d; | ||
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); | ||
}, m.$utils = function () { | ||
return O; | ||
}, m.isValid = function () { | ||
return !(this.$d.toString() === l); | ||
}, m.isSame = function (t, e) { | ||
var n = w(t); | ||
return this.startOf(e) <= n && n <= this.endOf(e); | ||
}, m.isAfter = function (t, e) { | ||
return w(t) < this.startOf(e); | ||
}, m.isBefore = function (t, e) { | ||
return this.endOf(e) < w(t); | ||
}, m.$g = function (t, e, n) { | ||
return O.u(t) ? this[e] : this.set(n, t); | ||
}, m.unix = function () { | ||
return Math.floor(this.valueOf() / 1e3); | ||
}, m.valueOf = function () { | ||
return this.$d.getTime(); | ||
}, m.startOf = function (t, e) { | ||
var n = this, | ||
r = !!O.u(e) || e, | ||
h = O.p(t), | ||
l = function l(t, e) { | ||
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); | ||
return r ? i : i.endOf(a); | ||
}, | ||
$ = function $(t, e) { | ||
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); | ||
}, | ||
y = this.$W, | ||
M = this.$M, | ||
m = this.$D, | ||
v = "set" + (this.$u ? "UTC" : ""); | ||
switch (h) { | ||
case c: | ||
return r ? l(1, 0) : l(31, 11); | ||
case f: | ||
return r ? l(1, M) : l(0, M + 1); | ||
case o: | ||
var g = this.$locale().weekStart || 0, | ||
D = (y < g ? y + 7 : y) - g; | ||
return l(r ? m - D : m + (6 - D), M); | ||
case a: | ||
case d: | ||
return $(v + "Hours", 0); | ||
case u: | ||
return $(v + "Minutes", 1); | ||
case s: | ||
return $(v + "Seconds", 2); | ||
case i: | ||
return $(v + "Milliseconds", 3); | ||
default: | ||
return this.clone(); | ||
} | ||
}, m.endOf = function (t) { | ||
return this.startOf(t, !1); | ||
}, m.$set = function (t, e) { | ||
var n, | ||
o = O.p(t), | ||
h = "set" + (this.$u ? "UTC" : ""), | ||
l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], | ||
$ = o === a ? this.$D + (e - this.$W) : e; | ||
if (o === f || o === c) { | ||
var y = this.clone().set(d, 1); | ||
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; | ||
} else l && this.$d[l]($); | ||
return this.init(), this; | ||
}, m.set = function (t, e) { | ||
return this.clone().$set(t, e); | ||
}, m.get = function (t) { | ||
return this[O.p(t)](); | ||
}, m.add = function (r, h) { | ||
var d, | ||
l = this; | ||
r = Number(r); | ||
var $ = O.p(h), | ||
y = function y(t) { | ||
var e = w(l); | ||
return O.w(e.date(e.date() + Math.round(t * r)), l); | ||
}; | ||
if ($ === f) return this.set(f, this.$M + r); | ||
if ($ === c) return this.set(c, this.$y + r); | ||
if ($ === a) return y(1); | ||
if ($ === o) return y(7); | ||
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, | ||
m = this.$d.getTime() + r * M; | ||
return O.w(m, this); | ||
}, m.subtract = function (t, e) { | ||
return this.add(-1 * t, e); | ||
}, m.format = function (t) { | ||
var e = this, | ||
n = this.$locale(); | ||
if (!this.isValid()) return n.invalidDate || l; | ||
var r = t || "YYYY-MM-DDTHH:mm:ssZ", | ||
i = O.z(this), | ||
s = this.$H, | ||
u = this.$m, | ||
a = this.$M, | ||
o = n.weekdays, | ||
f = n.months, | ||
h = function h(t, n, i, s) { | ||
return t && (t[n] || t(e, r)) || i[n].slice(0, s); | ||
}, | ||
c = function c(t) { | ||
return O.s(s % 12 || 12, t, "0"); | ||
}, | ||
d = n.meridiem || function (t, e, n) { | ||
var r = t < 12 ? "AM" : "PM"; | ||
return n ? r.toLowerCase() : r; | ||
}, | ||
$ = { | ||
YY: String(this.$y).slice(-2), | ||
YYYY: this.$y, | ||
M: a + 1, | ||
MM: O.s(a + 1, 2, "0"), | ||
MMM: h(n.monthsShort, a, f, 3), | ||
MMMM: h(f, a), | ||
D: this.$D, | ||
DD: O.s(this.$D, 2, "0"), | ||
d: String(this.$W), | ||
dd: h(n.weekdaysMin, this.$W, o, 2), | ||
ddd: h(n.weekdaysShort, this.$W, o, 3), | ||
dddd: o[this.$W], | ||
H: String(s), | ||
HH: O.s(s, 2, "0"), | ||
h: c(1), | ||
hh: c(2), | ||
a: d(s, u, !0), | ||
A: d(s, u, !1), | ||
m: String(u), | ||
mm: O.s(u, 2, "0"), | ||
s: String(this.$s), | ||
ss: O.s(this.$s, 2, "0"), | ||
SSS: O.s(this.$ms, 3, "0"), | ||
Z: i | ||
}; | ||
return r.replace(y, function (t, e) { | ||
return e || $[t] || i.replace(":", ""); | ||
}); | ||
}, m.utcOffset = function () { | ||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); | ||
}, m.diff = function (r, d, l) { | ||
var $, | ||
y = O.p(d), | ||
M = w(r), | ||
m = (M.utcOffset() - this.utcOffset()) * e, | ||
v = this - M, | ||
g = O.m(this, M); | ||
return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g); | ||
}, m.daysInMonth = function () { | ||
return this.endOf(f).$D; | ||
}, m.$locale = function () { | ||
return D[this.$L]; | ||
}, m.locale = function (t, e) { | ||
if (!t) return this.$L; | ||
var n = this.clone(), | ||
r = S(t, e, !0); | ||
return r && (n.$L = r), n; | ||
}, m.clone = function () { | ||
return O.w(this.$d, this); | ||
}, m.toDate = function () { | ||
return new Date(this.valueOf()); | ||
}, m.toJSON = function () { | ||
return this.isValid() ? this.toISOString() : null; | ||
}, m.toISOString = function () { | ||
return this.$d.toISOString(); | ||
}, m.toString = function () { | ||
return this.$d.toUTCString(); | ||
}, M; | ||
}(), | ||
T = _.prototype; | ||
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { | ||
T[t[1]] = function (e) { | ||
return this.$g(e, t[0], t[1]); | ||
}; | ||
}), w.extend = function (t, e) { | ||
return t.$i || (t(e, _, w), t.$i = !0), w; | ||
}, w.locale = S, w.isDayjs = p, w.unix = function (t) { | ||
return w(1e3 * t); | ||
}, w.en = D[g], w.Ls = D, w.p = {}, w; | ||
}); | ||
})(dayjs_min); | ||
var dayjs_minExports = dayjs_min.exports; | ||
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports); | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var queryTypes = { | ||
search: 'search', | ||
term: 'term', | ||
range: 'range', | ||
geo: 'geo', | ||
suggestion: 'suggestion' | ||
}; | ||
var dateFormats = { | ||
date: 'YYYY-MM-DD', | ||
basic_date: 'YYYYMMDD', | ||
basic_date_time: 'YYYYMMDD[T]HHmmss.SSSZ', | ||
basic_date_time_no_millis: 'YYYYMMDD[T]HHmmssZ', | ||
date_time_no_millis: 'YYYY-MM-DD[T]HH:mm:ssZ', | ||
basic_time: 'HHmmss.SSSZ', | ||
basic_time_no_millis: 'HHmmssZ', | ||
epoch_millis: 'epoch_millis', | ||
epoch_second: 'epoch_second' | ||
}; | ||
var _componentTypeToDefau; | ||
function formatDate(date, props) { | ||
if (props.parseDate) { | ||
// We would be passing an instance of dayjs instead of xdate below. Users need to know. | ||
return props.parseDate(date, props); | ||
} | ||
switch (props.queryFormat) { | ||
case 'epoch_millis': | ||
return date.valueOf(); | ||
case 'epoch_second': | ||
return Math.floor(date.valueOf() / 1000); | ||
default: | ||
{ | ||
if (dateFormats[props.queryFormat]) { | ||
return date.format(dateFormats[props.queryFormat]); | ||
} | ||
return date.valueOf(); | ||
} | ||
} | ||
} | ||
(_componentTypeToDefau = {}, _defineProperty(_componentTypeToDefau, componentTypes.singleList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiList, []), _defineProperty(_componentTypeToDefau, componentTypes.singleDataList, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownList, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDataList, []), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownList, []), _defineProperty(_componentTypeToDefau, componentTypes.tagCloud, ''), _defineProperty(_componentTypeToDefau, componentTypes.toggleButton, ''), _defineProperty(_componentTypeToDefau, componentTypes.singleDropdownRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiDropdownRange, []), _defineProperty(_componentTypeToDefau, componentTypes.singleRange, ''), _defineProperty(_componentTypeToDefau, componentTypes.multiRange, []), _componentTypeToDefau); | ||
/* isValidDateRangeQueryFormat() checks if the queryFormat is one of the dateFormats | ||
accepted by the elasticsearch or not. */ | ||
function isValidDateRangeQueryFormat(queryFormat) { | ||
return Object.keys(dateFormats).includes(queryFormat); | ||
} | ||
var _componentToTypeMap; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
var componentToTypeMap = (_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, componentTypes.reactiveList, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.dataSearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.categorySearch, queryTypes.search), _defineProperty(_componentToTypeMap, componentTypes.searchBox, queryTypes.suggestion), _defineProperty(_componentToTypeMap, componentTypes.singleList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDataList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.tagCloud, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.toggleButton, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.reactiveChart, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.treeList, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.numberBox, queryTypes.term), _defineProperty(_componentToTypeMap, componentTypes.datePicker, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dateRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.dynamicRangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiDropdownRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.singleRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.multiRange, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeSlider, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.ratingsFilter, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.rangeInput, queryTypes.range), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceDropdown, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.geoDistanceSlider, queryTypes.geo), _defineProperty(_componentToTypeMap, componentTypes.reactiveMap, queryTypes.geo), _componentToTypeMap); | ||
var multiRangeComponents = [componentTypes.multiRange, componentTypes.multiDropdownRange]; | ||
var dateRangeComponents = [componentTypes.dateRange, componentTypes.datePicker]; | ||
var searchComponents = [componentTypes.categorySearch, componentTypes.dataSearch, componentTypes.searchBox]; | ||
var listComponentsWithPagination = [componentTypes.singleList, componentTypes.multiList, componentTypes.singleDropdownList, componentTypes.multiDropdownList]; | ||
var getNormalizedField = function getNormalizedField(field) { | ||
if (field && !Array.isArray(field)) { | ||
return [field]; | ||
} | ||
return field; | ||
}; | ||
var isInternalComponent = function isInternalComponent() { | ||
var componentID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return componentID.endsWith('__internal'); | ||
}; | ||
var getInternalComponentID = function getInternalComponentID() { | ||
var componentID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return "".concat(componentID, "__internal"); | ||
}; | ||
var getHistogramComponentID = function getHistogramComponentID() { | ||
var componentID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return "".concat(componentID, "__histogram__internal"); | ||
}; | ||
var isDRSRangeComponent = function isDRSRangeComponent() { | ||
var componentID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return componentID.endsWith('__range__internal'); | ||
}; | ||
var isSearchComponent = function isSearchComponent() { | ||
var componentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return searchComponents.includes(componentType); | ||
}; | ||
var isComponentUsesLabelAsValue = function isComponentUsesLabelAsValue() { | ||
var componentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return componentType === componentTypes.multiDataList || componentType === componentTypes.singleDataList || componentType === componentTypes.tabDataList; | ||
}; | ||
var hasPaginationSupport = function hasPaginationSupport() { | ||
var componentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return listComponentsWithPagination.includes(componentType); | ||
}; | ||
var getRSQuery = function getRSQuery(componentId, props) { | ||
var execute = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
if (props && componentId) { | ||
var queryType = props.type ? props.type : componentToTypeMap[props.componentType]; | ||
// dataField is a required field for components other than search | ||
// TODO: Revisit this logic based on the Appbase version | ||
// dataField is no longer a required field in RS API | ||
if (!isSearchComponent(props.componentType) && !props.dataField) { | ||
return null; | ||
} | ||
var endpoint; | ||
if (props.endpoint instanceof Object) { | ||
endpoint = props.endpoint; | ||
} | ||
return _objectSpread(_objectSpread({ | ||
id: componentId, | ||
type: queryType || queryTypes.search, | ||
dataField: getNormalizedField(props.dataField), | ||
execute: execute, | ||
react: props.react, | ||
highlight: props.highlight, | ||
highlightField: getNormalizedField(props.highlightField), | ||
fuzziness: props.fuzziness, | ||
searchOperators: props.searchOperators, | ||
includeFields: props.includeFields, | ||
excludeFields: props.excludeFields, | ||
size: props.size, | ||
aggregationSize: props.aggregationSize, | ||
from: props.from || undefined, | ||
// Need to maintain for RL | ||
queryFormat: props.queryFormat, | ||
sortBy: props.sortBy, | ||
fieldWeights: getNormalizedField(props.fieldWeights), | ||
includeNullValues: props.includeNullValues, | ||
aggregationField: props.aggregationField || undefined, | ||
categoryField: props.categoryField || undefined, | ||
missingLabel: props.missingLabel || undefined, | ||
showMissing: props.showMissing, | ||
nestedField: props.nestedField || undefined, | ||
interval: props.interval, | ||
highlightConfig: props.customHighlight || props.highlightConfig, | ||
customQuery: props.customQuery, | ||
defaultQuery: props.defaultQuery, | ||
value: props.value, | ||
categoryValue: props.categoryValue || undefined, | ||
after: props.after || undefined, | ||
aggregations: props.aggregations || undefined, | ||
enableSynonyms: props.enableSynonyms, | ||
selectAllLabel: props.selectAllLabel, | ||
pagination: props.pagination, | ||
queryString: props.queryString, | ||
distinctField: props.distinctField, | ||
distinctFieldConfig: props.distinctFieldConfig, | ||
index: props.index | ||
}, queryType === queryTypes.suggestion ? _objectSpread({ | ||
enablePopularSuggestions: props.enablePopularSuggestions, | ||
enableEndpointSuggestions: props.enableEndpointSuggestions, | ||
enableRecentSuggestions: props.enableRecentSuggestions, | ||
popularSuggestionsConfig: props.popularSuggestionsConfig, | ||
recentSuggestionsConfig: props.recentSuggestionsConfig, | ||
applyStopwords: props.applyStopwords, | ||
customStopwords: props.customStopwords, | ||
enablePredictiveSuggestions: props.enablePredictiveSuggestions, | ||
featuredSuggestionsConfig: props.featuredSuggestionsConfig, | ||
indexSuggestionsConfig: props.indexSuggestionsConfig, | ||
enableFeaturedSuggestions: props.enableFeaturedSuggestions, | ||
enableIndexSuggestions: props.enableIndexSuggestions | ||
}, props.searchboxId ? { | ||
searchboxId: props.searchboxId | ||
} : {}) : {}), {}, { | ||
calendarInterval: props.calendarInterval, | ||
endpoint: endpoint, | ||
range: props.range | ||
}); | ||
} | ||
return null; | ||
}; | ||
var getValidInterval = function getValidInterval(interval) { | ||
var range = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var min = Math.ceil((range.end - range.start) / 100) || 1; | ||
if (!interval) { | ||
return min; | ||
} else if (interval < min) { | ||
return min; | ||
} | ||
return interval; | ||
}; | ||
var extractPropsFromState = function extractPropsFromState(store, component, customOptions) { | ||
var componentProps = store.props[component]; | ||
if (!componentProps) { | ||
return null; | ||
} | ||
var queryType = componentProps.type ? componentProps.type : componentToTypeMap[componentProps.componentType]; | ||
var calcValues = store.selectedValues[component]; | ||
var value = calcValues !== undefined && calcValues !== null ? calcValues.value : undefined; | ||
var queryFormat = componentProps.queryFormat; | ||
// calendarInterval only supported when using date types | ||
var calendarInterval; | ||
var interval = componentProps.interval; | ||
var type = queryType; | ||
var dataField = componentProps.dataField; | ||
var aggregations = componentProps.aggregations; | ||
var pagination; // pagination for `term` type of queries | ||
var from = componentProps.from; // offset for RL | ||
var range; // applicable for range components supporting histogram | ||
// For term queries i.e list component `dataField` will be treated as aggregationField | ||
if (queryType === queryTypes.term) { | ||
// Only apply pagination prop for the components which supports it otherwise it can break the UI | ||
if (componentProps.showLoadMore && hasPaginationSupport(componentProps.componentType)) { | ||
pagination = true; | ||
} | ||
// Extract values from components that are type of objects | ||
// This code handles the controlled behavior in list components for e.g ToggleButton | ||
if (value != null && _typeof(value) === 'object' && value.value) { | ||
value = value.value; | ||
} else if (Array.isArray(value)) { | ||
var parsedValue = []; | ||
value.forEach(function (val) { | ||
if (val != null && _typeof(val) === 'object' && val.value) { | ||
parsedValue.push(val.value); | ||
} else { | ||
parsedValue.push(val); | ||
} | ||
}); | ||
value = parsedValue; | ||
} | ||
} | ||
if (queryType === queryTypes.range) { | ||
if (Array.isArray(value)) { | ||
if (multiRangeComponents.includes(componentProps.componentType)) { | ||
value = value.map(function (_ref) { | ||
var start = _ref.start, | ||
end = _ref.end; | ||
return { | ||
start: start, | ||
end: end | ||
}; | ||
}); | ||
} else { | ||
value = { | ||
start: value[0], | ||
end: value[1] | ||
}; | ||
} | ||
} else if (componentProps.showHistogram) { | ||
var internalComponentID = getInternalComponentID(component); | ||
var internalComponentValue = store.internalValues[internalComponentID]; | ||
if (!internalComponentValue) { | ||
// Handle dynamic range slider | ||
var histogramComponentID = getHistogramComponentID(component); | ||
internalComponentValue = store.internalValues[histogramComponentID]; | ||
} | ||
if (internalComponentValue && Array.isArray(internalComponentValue.value)) { | ||
value = { | ||
start: internalComponentValue.value[0], | ||
end: internalComponentValue.value[1] | ||
}; | ||
} | ||
} | ||
if (isDRSRangeComponent(component)) { | ||
aggregations = ['min', 'max']; | ||
} else if (componentProps.showHistogram) { | ||
aggregations = ['histogram']; | ||
} | ||
// handle number box, number box query changes based on the `queryFormat` value | ||
if (componentProps.componentType === componentTypes.dynamicRangeSlider || componentProps.componentType === componentTypes.rangeSlider) { | ||
calendarInterval = Object.keys(dateFormats).includes(queryFormat) ? componentProps.calendarInterval : undefined; | ||
// Set value | ||
if (value) { | ||
if (isValidDateRangeQueryFormat(componentProps.queryFormat)) { | ||
// check if date types are dealt with | ||
value = { | ||
start: formatDate(dayjs(new Date(value.start)), componentProps), | ||
end: formatDate(dayjs(new Date(value.end)), componentProps) | ||
}; | ||
} else { | ||
value = { | ||
start: parseFloat(value.start), | ||
end: parseFloat(value.end) | ||
}; | ||
} | ||
} | ||
var rangeValue; | ||
if (componentProps.componentType === componentTypes.dynamicRangeSlider) { | ||
rangeValue = store.aggregations["".concat(component, "__range__internal")]; | ||
if (componentProps.nestedField) { | ||
rangeValue = rangeValue && store.aggregations["".concat(component, "__range__internal")][componentProps.nestedField].min ? { | ||
start: store.aggregations["".concat(component, "__range__internal")][componentProps.nestedField].min.value, | ||
end: store.aggregations["".concat(component, "__range__internal")][componentProps.nestedField].max.value | ||
} // prettier-ignore | ||
: null; | ||
} else { | ||
rangeValue = rangeValue && store.aggregations["".concat(component, "__range__internal")].min && store.aggregations["".concat(component, "__range__internal")].min.value ? { | ||
start: store.aggregations["".concat(component, "__range__internal")].min.value, | ||
end: store.aggregations["".concat(component, "__range__internal")].max.value | ||
} // prettier-ignore | ||
: null; | ||
} | ||
} else { | ||
rangeValue = componentProps.range; | ||
} | ||
if (rangeValue) { | ||
if (isValidDateRangeQueryFormat(componentProps.queryFormat)) { | ||
// check if date types are dealt with | ||
range = { | ||
start: formatDate(dayjs(rangeValue.start), componentProps), | ||
end: formatDate(dayjs(rangeValue.end), componentProps) | ||
}; | ||
} else { | ||
range = { | ||
start: parseFloat(rangeValue.start), | ||
end: parseFloat(rangeValue.end) | ||
}; | ||
} | ||
} | ||
} | ||
// handle date components | ||
if (dateRangeComponents.includes(componentProps.componentType)) { | ||
// Set value | ||
if (value) { | ||
if (isValidDateRangeQueryFormat(componentProps.queryFormat)) { | ||
if (typeof value === 'string') { | ||
value = { | ||
// value would be an ISO Date string | ||
start: formatDate(dayjs(value).subtract(24, 'hour'), componentProps), | ||
end: formatDate(dayjs(value), componentProps) | ||
}; | ||
} else if (Array.isArray(value)) { | ||
value = value.map(function (val) { | ||
return { | ||
// value would be one of ISO Date string, number, native date | ||
start: formatDate(dayjs(val).subtract(24, 'hour'), componentProps), | ||
end: formatDate(dayjs(val), componentProps) | ||
}; | ||
}); | ||
} else { | ||
value = { | ||
start: formatDate(dayjs(value.start).subtract(24, 'hour'), componentProps), | ||
end: formatDate(dayjs(value.end), componentProps) | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
if (queryType === queryTypes.geo) { | ||
// override the value extracted from selectedValues reducer | ||
value = undefined; | ||
var geoCalcValues = store.selectedValues[component] || store.internalValues[component] || store.internalValues[getInternalComponentID(component)]; | ||
if (geoCalcValues && geoCalcValues.meta) { | ||
if (geoCalcValues.meta.distance && geoCalcValues.meta.coordinates) { | ||
value = { | ||
distance: geoCalcValues.meta.distance, | ||
location: geoCalcValues.meta.coordinates | ||
}; | ||
if (componentProps.unit) { | ||
value.unit = componentProps.unit; | ||
} | ||
} | ||
if (geoCalcValues.meta.mapBoxBounds && geoCalcValues.meta.mapBoxBounds.top_left && geoCalcValues.meta.mapBoxBounds.bottom_right) { | ||
value = { | ||
// Note: format will be reverse of what we're using now | ||
geoBoundingBox: { | ||
topLeft: "".concat(geoCalcValues.meta.mapBoxBounds.top_left[1], ", ").concat(geoCalcValues.meta.mapBoxBounds.top_left[0]), | ||
bottomRight: "".concat(geoCalcValues.meta.mapBoxBounds.bottom_right[1], ", ").concat(geoCalcValues.meta.mapBoxBounds.bottom_right[0]) | ||
} | ||
}; | ||
} | ||
} | ||
} | ||
// handle number box, number box query changes based on the `queryFormat` value | ||
if (componentProps.componentType === componentTypes.numberBox) { | ||
if (queryFormat === 'exact') { | ||
type = 'term'; | ||
} else { | ||
type = 'range'; | ||
if (queryFormat === 'lte') { | ||
value = { | ||
end: value, | ||
boost: 2.0 | ||
}; | ||
} else { | ||
value = { | ||
start: value, | ||
boost: 2.0 | ||
}; | ||
} | ||
} | ||
// Remove query format | ||
queryFormat = 'or'; | ||
} | ||
// Fake dataField for ReactiveComponent | ||
// TODO: Remove it after some time. The `dataField` is no longer required | ||
if (componentProps.componentType === componentTypes.reactiveComponent) { | ||
// Set the type to `term` | ||
type = 'term'; | ||
dataField = 'reactive_component_field'; | ||
// Don't set value property for ReactiveComponent | ||
// since it is driven by `defaultQuery` and `customQuery` | ||
value = undefined; | ||
} | ||
// Assign default value as an empty string for search components so search relevancy can work | ||
if (isSearchComponent(componentProps.componentType) && !value) { | ||
value = ''; | ||
} | ||
// Handle components which uses label instead of value as the selected value | ||
if (isComponentUsesLabelAsValue(componentProps.componentType)) { | ||
var data = componentProps.data, | ||
selectAllLabel = componentProps.selectAllLabel; | ||
var absValue = []; | ||
if (value && Array.isArray(value)) { | ||
absValue = value; | ||
} else if (value && typeof value === 'string') { | ||
absValue = [value]; | ||
} | ||
var normalizedValue = []; | ||
if (absValue.length) { | ||
if (data && Array.isArray(data)) { | ||
absValue.forEach(function (val) { | ||
var dataItem = data.find(function (o) { | ||
return o.label === val; | ||
}); | ||
if (dataItem && dataItem.value) { | ||
normalizedValue.push(dataItem.value); | ||
} | ||
}); | ||
} | ||
} | ||
if (selectAllLabel && absValue.length && absValue.includes(selectAllLabel)) { | ||
normalizedValue = absValue; | ||
} | ||
if (normalizedValue.length) { | ||
value = normalizedValue; | ||
} else { | ||
value = undefined; | ||
} | ||
} | ||
if (componentProps.componentType === componentTypes.reactiveList) { | ||
// We set selected page as the value in the redux store for RL. | ||
// It's complex to change this logic in the component so changed it here. | ||
if (value > 0) { | ||
from = (value - 1) * (componentProps.size || 10); | ||
} | ||
value = undefined; | ||
} | ||
var queryValue = value || undefined; | ||
if (componentProps.componentType === componentTypes.searchBox) { | ||
if (Array.isArray(queryValue)) { | ||
queryValue = undefined; | ||
} | ||
} | ||
var endpoint; | ||
if (componentProps.endpoint instanceof Object) { | ||
endpoint = _objectSpread(_objectSpread({}, endpoint || {}), componentProps.endpoint); | ||
} | ||
return _objectSpread(_objectSpread({}, componentProps), {}, { | ||
endpoint: endpoint, | ||
calendarInterval: calendarInterval, | ||
dataField: dataField, | ||
queryFormat: queryFormat, | ||
type: type, | ||
aggregations: aggregations, | ||
interval: interval, | ||
react: store.dependencyTree ? store.dependencyTree[component] : undefined, | ||
customQuery: store.customQueries ? store.customQueries[component] : undefined, | ||
defaultQuery: store.defaultQueries ? store.defaultQueries[component] : undefined, | ||
customHighlight: store.customHighlightOptions ? store.customHighlightOptions[component] : undefined, | ||
categoryValue: store.internalValues[component] ? store.internalValues[component].category : undefined, | ||
value: queryValue, | ||
pagination: pagination, | ||
from: from, | ||
range: range | ||
}, customOptions); | ||
}; | ||
function flatReactProp(reactProp, componentID) { | ||
var flattenReact = []; | ||
var flatReact = function flatReact(react) { | ||
if (react && Object.keys(react)) { | ||
Object.keys(react).forEach(function (r) { | ||
if (react[r]) { | ||
if (typeof react[r] === 'string') { | ||
flattenReact = [].concat(_toConsumableArray(flattenReact), [react[r]]); | ||
} else if (Array.isArray(react[r])) { | ||
flattenReact = [].concat(_toConsumableArray(flattenReact), _toConsumableArray(react[r])); | ||
} else if (_typeof(react[r]) === 'object') { | ||
flatReact(react[r]); | ||
} | ||
} | ||
}); | ||
} | ||
}; | ||
flatReact(reactProp); | ||
// Remove cyclic dependencies | ||
flattenReact = flattenReact.filter(function (react) { | ||
return react !== componentID; | ||
}); | ||
return flattenReact; | ||
} | ||
var getDependentQueries = function getDependentQueries(store, componentID) { | ||
var orderOfQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | ||
var finalQuery = {}; | ||
var react = flatReactProp(store.dependencyTree[componentID], componentID); | ||
react.forEach(function (componentObject) { | ||
var component = componentObject; | ||
var customQuery = store.customQueries[component]; | ||
if (!isInternalComponent(component)) { | ||
var calcValues = store.selectedValues[component] || store.internalValues[component]; | ||
// Only include queries for that component that has `customQuery` or `value` defined | ||
if ((calcValues && calcValues.value || customQuery) && !finalQuery[component]) { | ||
var execute = false; | ||
if (Array.isArray(orderOfQueries) && orderOfQueries.includes(component)) { | ||
execute = true; | ||
} | ||
var componentProps = store.props[component]; | ||
// build query | ||
var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _objectSpread({}, componentProps && _objectSpread(_objectSpread({}, componentProps.componentType === componentTypes.searchBox ? _objectSpread(_objectSpread(_objectSpread({}, execute === false ? { | ||
type: queryTypes.search | ||
} : {}), calcValues.category ? { | ||
categoryValue: calcValues.category | ||
} : { | ||
categoryValue: undefined | ||
}), calcValues.value ? { | ||
value: calcValues.value | ||
} : {}) : {}), componentProps.componentType === componentTypes.categorySearch ? _objectSpread({}, calcValues.category ? { | ||
categoryValue: calcValues.category | ||
} : { | ||
categoryValue: undefined | ||
}) : {}))), execute); | ||
if (dependentQuery) { | ||
finalQuery[component] = dependentQuery; | ||
} | ||
} | ||
} | ||
}); | ||
return finalQuery; | ||
}; | ||
var transformValueToComponentStateFormat = function transformValueToComponentStateFormat(value, componentProps) { | ||
var componentType = componentProps.componentType, | ||
data = componentProps.data, | ||
queryFormat = componentProps.queryFormat; | ||
var transformedValue = value; | ||
var meta = {}; | ||
if (value) { | ||
switch (componentType) { | ||
case componentTypes.singleDataList: | ||
case componentTypes.tabDataList: | ||
transformedValue = ''; | ||
if (Array.isArray(value) && typeof value[0] === 'string') { | ||
transformedValue = value[0]; | ||
} else if (_typeof(value) === 'object' && value.label) { | ||
transformedValue = value.label; | ||
} else { | ||
transformedValue = value; | ||
} | ||
break; | ||
case componentTypes.multiDataList: | ||
transformedValue = []; | ||
if (Array.isArray(value)) { | ||
value.forEach(function (valObj) { | ||
if (_typeof(valObj) === 'object' && (valObj.label || valObj.value)) { | ||
transformedValue.push(valObj.label || valObj.value); | ||
} else if (typeof valObj === 'string') { | ||
transformedValue.push(valObj); | ||
} | ||
}); | ||
} | ||
break; | ||
case componentTypes.toggleButton: | ||
transformedValue = []; // array of objects | ||
if (Array.isArray(value)) { | ||
value.forEach(function (valObj) { | ||
if (_typeof(valObj) === 'object' && valObj.label && valObj.value) { | ||
transformedValue.push(valObj); | ||
} else if (typeof valObj === 'string') { | ||
var findDataObj = data.find(function (item) { | ||
return item.label.trim() === valObj.trim() || item.value.trim() === valObj.trim(); | ||
}); | ||
transformedValue.push(findDataObj); | ||
} | ||
}); | ||
} else if (_typeof(value) === 'object' && value.label && value.value) { | ||
transformedValue = value.value; | ||
} else if (typeof value === 'string') { | ||
var findDataObj = data.find(function (item) { | ||
return item.label.trim() === value.trim() || item.value.trim() === value.trim(); | ||
}); | ||
transformedValue = findDataObj.value; | ||
} | ||
break; | ||
case componentTypes.singleRange: | ||
case componentTypes.singleDropdownRange: | ||
transformedValue = {}; | ||
if (!Array.isArray(value) && _typeof(value) === 'object') { | ||
transformedValue = _objectSpread({}, value); | ||
} else if (typeof value === 'string') { | ||
var _findDataObj = data.find(function (item) { | ||
return item.label.trim() === value.trim(); | ||
}); | ||
transformedValue = _objectSpread({}, _findDataObj); | ||
} | ||
break; | ||
case componentTypes.multiDropdownRange: | ||
case componentTypes.multiRange: | ||
transformedValue = []; // array of objects | ||
if (Array.isArray(value)) { | ||
value.forEach(function (valObj) { | ||
if (_typeof(valObj) === 'object' && typeof valObj.start === 'number' && typeof valObj.end === 'number') { | ||
var _findDataObj2 = _objectSpread({}, valObj); | ||
if (!_findDataObj2.label) { | ||
_findDataObj2 = data.find(function (item) { | ||
return item.start === valObj.start && item.end === valObj.end; | ||
}); | ||
} | ||
transformedValue.push(_findDataObj2); | ||
} else if (typeof valObj === 'string') { | ||
var _findDataObj3 = data.find(function (item) { | ||
return item.label.trim() === valObj.trim(); | ||
}); | ||
transformedValue.push(_findDataObj3); | ||
} | ||
}); | ||
} else if (typeof value === 'string') { | ||
var _findDataObj4 = data.find(function (item) { | ||
return item.label.trim() === value.trim(); | ||
}); | ||
transformedValue.push(_findDataObj4); | ||
} | ||
break; | ||
case componentTypes.rangeSlider: | ||
case componentTypes.ratingsFilter: | ||
case componentTypes.dynamicRangeSlider: | ||
case componentTypes.reactiveChart: | ||
transformedValue = []; | ||
if (queryFormat) { | ||
if (Array.isArray(value)) { | ||
transformedValue = value.map(function (item) { | ||
return formatDate(dayjs(item), componentProps); | ||
}); | ||
} else if (_typeof(value) === 'object') { | ||
transformedValue = [formatDate(dayjs(value.start), componentProps), formatDate(dayjs(value.end), componentProps)]; | ||
} | ||
} else if (Array.isArray(value)) { | ||
transformedValue = _toConsumableArray(value); | ||
} else if (_typeof(value) === 'object') { | ||
transformedValue = [value.start, value.end]; | ||
} else { | ||
transformedValue = value; | ||
} | ||
break; | ||
case componentTypes.numberBox: | ||
transformedValue = []; | ||
if (!Array.isArray(value) && _typeof(value) === 'object') { | ||
transformedValue = value.start; | ||
} else if (typeof value === 'number') { | ||
transformedValue = value; | ||
} | ||
break; | ||
case componentTypes.datePicker: | ||
transformedValue = ''; | ||
if (_typeof(value) !== 'object') { | ||
transformedValue = dayjs(value).format('YYYY-MM-DD'); | ||
} else if (value.end) { | ||
transformedValue = dayjs(value.end).format('YYYY-MM-DD'); | ||
} else if (value.start) { | ||
transformedValue = dayjs(value.start).add(24, 'hour').format('YYYY-MM-DD'); | ||
} | ||
break; | ||
case componentTypes.dateRange: | ||
transformedValue = []; // array of strings | ||
if (Array.isArray(value)) { | ||
transformedValue = value.map(function (t) { | ||
return dayjs(t).format('YYYY-MM-DD'); | ||
}); | ||
} else if (_typeof(value) === 'object') { | ||
transformedValue = [dayjs(value.start).format('YYYY-MM-DD'), dayjs(value.end).format('YYYY-MM-DD')]; | ||
} | ||
break; | ||
case componentTypes.categorySearch: | ||
transformedValue = ''; | ||
if (_typeof(value) === 'object') { | ||
transformedValue = value.value; | ||
if (value.category !== undefined) { | ||
meta.category = value.category; | ||
} | ||
} else if (typeof value === 'string') { | ||
transformedValue = value; | ||
} | ||
break; | ||
} | ||
} | ||
return { | ||
value: transformedValue, | ||
meta: meta | ||
}; | ||
}; | ||
exports.componentToTypeMap = componentToTypeMap; | ||
exports.extractPropsFromState = extractPropsFromState; | ||
exports.flatReactProp = flatReactProp; | ||
exports.getDependentQueries = getDependentQueries; | ||
exports.getHistogramComponentID = getHistogramComponentID; | ||
exports.getInternalComponentID = getInternalComponentID; | ||
exports.getNormalizedField = getNormalizedField; | ||
exports.getRSQuery = getRSQuery; | ||
exports.getValidInterval = getValidInterval; | ||
exports.hasPaginationSupport = hasPaginationSupport; | ||
exports.isComponentUsesLabelAsValue = isComponentUsesLabelAsValue; | ||
exports.isDRSRangeComponent = isDRSRangeComponent; | ||
exports.isInternalComponent = isInternalComponent; | ||
exports.isSearchComponent = isSearchComponent; | ||
exports.transformValueToComponentStateFormat = transformValueToComponentStateFormat; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.transformValueToComponentStateFormat=exports.getDependentQueries=exports.extractPropsFromState=exports.getValidInterval=exports.getRSQuery=exports.hasPaginationSupport=exports.isComponentUsesLabelAsValue=exports.isSearchComponent=exports.isDRSRangeComponent=exports.getHistogramComponentID=exports.getInternalComponentID=exports.isInternalComponent=exports.getNormalizedField=exports.componentToTypeMap=undefined;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _componentToTypeMap;exports.flatReactProp=flatReactProp;var _dayjs=require('dayjs');var _dayjs2=_interopRequireDefault(_dayjs);var _constants=require('./constants');var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);var _helper=require('./helper');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var componentToTypeMap=exports.componentToTypeMap=(_componentToTypeMap={},_defineProperty(_componentToTypeMap,_constants.componentTypes.reactiveList,_constants.queryTypes.search),_defineProperty(_componentToTypeMap,_constants.componentTypes.dataSearch,_constants.queryTypes.search),_defineProperty(_componentToTypeMap,_constants.componentTypes.categorySearch,_constants.queryTypes.search),_defineProperty(_componentToTypeMap,_constants.componentTypes.searchBox,_constants.queryTypes.suggestion),_defineProperty(_componentToTypeMap,_constants.componentTypes.AIAnswer,_constants.queryTypes.search),_defineProperty(_componentToTypeMap,_constants.componentTypes.singleList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.multiList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.singleDataList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.singleDropdownList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.multiDataList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.multiDropdownList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.tagCloud,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.toggleButton,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.reactiveChart,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.treeList,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.numberBox,_constants.queryTypes.term),_defineProperty(_componentToTypeMap,_constants.componentTypes.datePicker,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.dateRange,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.dynamicRangeSlider,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.singleDropdownRange,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.multiDropdownRange,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.singleRange,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.multiRange,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.rangeSlider,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.ratingsFilter,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.rangeInput,_constants.queryTypes.range),_defineProperty(_componentToTypeMap,_constants.componentTypes.geoDistanceDropdown,_constants.queryTypes.geo),_defineProperty(_componentToTypeMap,_constants.componentTypes.geoDistanceSlider,_constants.queryTypes.geo),_defineProperty(_componentToTypeMap,_constants.componentTypes.reactiveMap,_constants.queryTypes.geo),_componentToTypeMap);var multiRangeComponents=[_constants.componentTypes.multiRange,_constants.componentTypes.multiDropdownRange];var dateRangeComponents=[_constants.componentTypes.dateRange,_constants.componentTypes.datePicker];var searchComponents=[_constants.componentTypes.categorySearch,_constants.componentTypes.dataSearch,_constants.componentTypes.searchBox];var listComponentsWithPagination=[_constants.componentTypes.singleList,_constants.componentTypes.multiList,_constants.componentTypes.singleDropdownList,_constants.componentTypes.multiDropdownList];var getNormalizedField=exports.getNormalizedField=function getNormalizedField(field){if(field&&!Array.isArray(field)){return[field];}return field;};var isInternalComponent=exports.isInternalComponent=function isInternalComponent(){var componentID=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return componentID.endsWith('__internal');};var getInternalComponentID=exports.getInternalComponentID=function getInternalComponentID(){var componentID=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return componentID+'__internal';};var getHistogramComponentID=exports.getHistogramComponentID=function getHistogramComponentID(){var componentID=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return componentID+'__histogram__internal';};var isDRSRangeComponent=exports.isDRSRangeComponent=function isDRSRangeComponent(){var componentID=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return componentID.endsWith('__range__internal');};var isSearchComponent=exports.isSearchComponent=function isSearchComponent(){var componentType=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return searchComponents.includes(componentType);};var isComponentUsesLabelAsValue=exports.isComponentUsesLabelAsValue=function isComponentUsesLabelAsValue(){var componentType=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return componentType===_constants.componentTypes.multiDataList||componentType===_constants.componentTypes.singleDataList||componentType===_constants.componentTypes.tabDataList;};var hasPaginationSupport=exports.hasPaginationSupport=function hasPaginationSupport(){var componentType=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';return listComponentsWithPagination.includes(componentType);};var getRSQuery=exports.getRSQuery=function getRSQuery(componentId,props){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(props&&componentId){var queryType=props.type?props.type:componentToTypeMap[props.componentType];if(props.componentType!==_constants.componentTypes.AIAnswer&&!isSearchComponent(props.componentType)&&!props.dataField){return null;}var endpoint=void 0;if(props.endpoint instanceof Object){endpoint=props.endpoint;}return _extends({id:componentId,type:queryType||_constants.queryTypes.search,dataField:getNormalizedField(props.dataField),execute:execute,react:props.react,highlight:props.highlight,highlightField:getNormalizedField(props.highlightField),fuzziness:props.fuzziness,searchOperators:props.searchOperators,includeFields:props.includeFields,excludeFields:props.excludeFields,size:props.size,aggregationSize:props.aggregationSize,from:props.from||undefined,queryFormat:props.queryFormat,sortBy:props.sortBy,fieldWeights:getNormalizedField(props.fieldWeights),includeNullValues:props.includeNullValues,aggregationField:props.aggregationField||undefined,categoryField:props.categoryField||undefined,missingLabel:props.missingLabel||undefined,showMissing:props.showMissing,nestedField:props.nestedField||undefined,interval:props.interval,highlightConfig:props.customHighlight||props.highlightConfig,customQuery:props.customQuery,defaultQuery:props.defaultQuery,value:props.value,categoryValue:props.categoryValue||undefined,after:props.after||undefined,aggregations:props.aggregations||undefined,enableSynonyms:props.enableSynonyms,selectAllLabel:props.selectAllLabel,pagination:props.pagination,queryString:props.queryString,distinctField:props.distinctField,distinctFieldConfig:props.distinctFieldConfig,index:props.index},queryType===_constants.queryTypes.suggestion?_extends({enablePopularSuggestions:props.enablePopularSuggestions,enableEndpointSuggestions:props.enableEndpointSuggestions,enableRecentSuggestions:props.enableRecentSuggestions,popularSuggestionsConfig:props.popularSuggestionsConfig,recentSuggestionsConfig:props.recentSuggestionsConfig,applyStopwords:props.applyStopwords,customStopwords:props.customStopwords,enablePredictiveSuggestions:props.enablePredictiveSuggestions,featuredSuggestionsConfig:props.featuredSuggestionsConfig,indexSuggestionsConfig:props.indexSuggestionsConfig,enableFeaturedSuggestions:props.enableFeaturedSuggestions,enableIndexSuggestions:props.enableIndexSuggestions},props.searchboxId?{searchboxId:props.searchboxId}:{}):{},{calendarInterval:props.calendarInterval,endpoint:endpoint,range:props.range},queryType!==_constants.queryTypes.suggestion&&props.enableAI&&execute?_extends({enableAI:true},props.AIConfig?{AIConfig:props.AIConfig}:{},{execute:true}):{});}return null;};var getValidInterval=exports.getValidInterval=function getValidInterval(interval){var range=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var min=Math.ceil((range.end-range.start)/100)||1;if(!interval){return min;}else if(interval<min){return min;}return interval;};var extractPropsFromState=exports.extractPropsFromState=function extractPropsFromState(store,component,customOptions){var componentProps=store.props[component];if(!componentProps){return null;}var queryType=componentProps.type?componentProps.type:componentToTypeMap[componentProps.componentType];var calcValues=store.selectedValues[component];var value=calcValues!==undefined&&calcValues!==null?calcValues.value:undefined;var queryFormat=componentProps.queryFormat;var calendarInterval=void 0;var interval=componentProps.interval;var type=queryType;var dataField=componentProps.dataField;var aggregations=componentProps.aggregations;var pagination=void 0;var from=componentProps.from;var range=void 0;if(queryType===_constants.queryTypes.term){if(componentProps.showLoadMore&&hasPaginationSupport(componentProps.componentType)){pagination=true;}if(value!=null&&typeof value==='object'&&value.value){value=value.value;}else if(Array.isArray(value)){var parsedValue=[];value.forEach(function(val){if(val!=null&&typeof val==='object'&&val.value){parsedValue.push(val.value);}else{parsedValue.push(val);}});value=parsedValue;}}if(queryType===_constants.queryTypes.range){if(Array.isArray(value)){if(multiRangeComponents.includes(componentProps.componentType)){value=value.map(function(_ref){var start=_ref.start,end=_ref.end;return{start:start,end:end};});}else{value={start:value[0],end:value[1]};}}else if(componentProps.showHistogram){var internalComponentID=getInternalComponentID(component);var internalComponentValue=store.internalValues[internalComponentID];if(!internalComponentValue){var histogramComponentID=getHistogramComponentID(component);internalComponentValue=store.internalValues[histogramComponentID];}if(internalComponentValue&&Array.isArray(internalComponentValue.value)){value={start:internalComponentValue.value[0],end:internalComponentValue.value[1]};}}if(isDRSRangeComponent(component)){aggregations=['min','max'];}else if(componentProps.showHistogram){aggregations=['histogram'];}if(componentProps.componentType===_constants.componentTypes.dynamicRangeSlider||componentProps.componentType===_constants.componentTypes.rangeSlider){calendarInterval=Object.keys(_dateFormats2.default).includes(queryFormat)?componentProps.calendarInterval:undefined;if(value){if((0,_helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)){value={start:(0,_helper.formatDate)((0,_dayjs2.default)(new Date(value.start)),componentProps),end:(0,_helper.formatDate)((0,_dayjs2.default)(new Date(value.end)),componentProps)};}else{value={start:parseFloat(value.start),end:parseFloat(value.end)};}}var rangeValue=void 0;if(componentProps.componentType===_constants.componentTypes.dynamicRangeSlider){rangeValue=store.aggregations[component+'__range__internal'];if(componentProps.nestedField){rangeValue=rangeValue&&store.aggregations[component+'__range__internal'][componentProps.nestedField].min?{start:store.aggregations[component+'__range__internal'][componentProps.nestedField].min.value,end:store.aggregations[component+'__range__internal'][componentProps.nestedField].max.value}:null;}else{rangeValue=rangeValue&&store.aggregations[component+'__range__internal'].min&&store.aggregations[component+'__range__internal'].min.value?{start:store.aggregations[component+'__range__internal'].min.value,end:store.aggregations[component+'__range__internal'].max.value}:null;}}else{rangeValue=componentProps.range;}if(rangeValue){if((0,_helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)){range={start:(0,_helper.formatDate)((0,_dayjs2.default)(rangeValue.start),componentProps),end:(0,_helper.formatDate)((0,_dayjs2.default)(rangeValue.end),componentProps)};}else{range={start:parseFloat(rangeValue.start),end:parseFloat(rangeValue.end)};}}}if(dateRangeComponents.includes(componentProps.componentType)){if(value){if((0,_helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)){if(typeof value==='string'){value={start:(0,_helper.formatDate)((0,_dayjs2.default)(value).subtract(24,'hour'),componentProps),end:(0,_helper.formatDate)((0,_dayjs2.default)(value),componentProps)};}else if(Array.isArray(value)){value=value.map(function(val){return{start:(0,_helper.formatDate)((0,_dayjs2.default)(val).subtract(24,'hour'),componentProps),end:(0,_helper.formatDate)((0,_dayjs2.default)(val),componentProps)};});}else{value={start:(0,_helper.formatDate)((0,_dayjs2.default)(value.start).subtract(24,'hour'),componentProps),end:(0,_helper.formatDate)((0,_dayjs2.default)(value.end),componentProps)};}}}}}if(queryType===_constants.queryTypes.geo){value=undefined;var geoCalcValues=store.selectedValues[component]||store.internalValues[component]||store.internalValues[getInternalComponentID(component)];if(geoCalcValues&&geoCalcValues.meta){if(geoCalcValues.meta.distance&&geoCalcValues.meta.coordinates){value={distance:geoCalcValues.meta.distance,location:geoCalcValues.meta.coordinates};if(componentProps.unit){value.unit=componentProps.unit;}}if(geoCalcValues.meta.mapBoxBounds&&geoCalcValues.meta.mapBoxBounds.top_left&&geoCalcValues.meta.mapBoxBounds.bottom_right){value={geoBoundingBox:{topLeft:geoCalcValues.meta.mapBoxBounds.top_left[1]+', '+geoCalcValues.meta.mapBoxBounds.top_left[0],bottomRight:geoCalcValues.meta.mapBoxBounds.bottom_right[1]+', '+geoCalcValues.meta.mapBoxBounds.bottom_right[0]}};}}}if(componentProps.componentType===_constants.componentTypes.numberBox){if(queryFormat==='exact'){type='term';}else{type='range';if(queryFormat==='lte'){value={end:value,boost:2.0};}else{value={start:value,boost:2.0};}}queryFormat='or';}if(componentProps.componentType===_constants.componentTypes.reactiveComponent){type='term';dataField='reactive_component_field';value=undefined;}if(isSearchComponent(componentProps.componentType)&&!value){value='';}if(isComponentUsesLabelAsValue(componentProps.componentType)){var data=componentProps.data,selectAllLabel=componentProps.selectAllLabel;var absValue=[];if(value&&Array.isArray(value)){absValue=value;}else if(value&&typeof value==='string'){absValue=[value];}var normalizedValue=[];if(absValue.length){if(data&&Array.isArray(data)){absValue.forEach(function(val){var dataItem=data.find(function(o){return o.label===val;});if(dataItem&&dataItem.value){normalizedValue.push(dataItem.value);}});}}if(selectAllLabel&&absValue.length&&absValue.includes(selectAllLabel)){normalizedValue=absValue;}if(normalizedValue.length){value=normalizedValue;}else{value=undefined;}}if(componentProps.componentType===_constants.componentTypes.reactiveList){if(value>0){from=(value-1)*(componentProps.size||10);}value=undefined;}var queryValue=value||undefined;if(componentProps.componentType===_constants.componentTypes.searchBox){if(Array.isArray(queryValue)){queryValue=undefined;}}var endpoint=void 0;if(componentProps.endpoint instanceof Object){endpoint=_extends({},endpoint||{},componentProps.endpoint);}return _extends({},componentProps,{endpoint:endpoint,calendarInterval:calendarInterval,dataField:dataField,queryFormat:queryFormat,type:type,aggregations:aggregations,interval:interval,react:store.dependencyTree?store.dependencyTree[component]:undefined,customQuery:store.customQueries?store.customQueries[component]:undefined,defaultQuery:store.defaultQueries?store.defaultQueries[component]:undefined,customHighlight:store.customHighlightOptions?store.customHighlightOptions[component]:undefined,categoryValue:store.internalValues[component]?store.internalValues[component].category:undefined,value:queryValue,pagination:pagination,from:from,range:range},customOptions);};function flatReactProp(reactProp,componentID){var flattenReact=[];var flatReact=function flatReact(react){if(react&&Object.keys(react)){Object.keys(react).forEach(function(r){if(react[r]){if(typeof react[r]==='string'){flattenReact=[].concat(_toConsumableArray(flattenReact),[react[r]]);}else if(Array.isArray(react[r])){flattenReact=[].concat(_toConsumableArray(flattenReact),_toConsumableArray(react[r]));}else if(typeof react[r]==='object'){flatReact(react[r]);}}});}};flatReact(reactProp);flattenReact=flattenReact.filter(function(react){return react!==componentID;});return flattenReact;}var getDependentQueries=exports.getDependentQueries=function getDependentQueries(store,componentID){var orderOfQueries=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var finalQuery={};var react=flatReactProp(store.dependencyTree[componentID],componentID);react.forEach(function(componentObject){var component=componentObject;var customQuery=store.customQueries[component];if(!isInternalComponent(component)){var calcValues=store.selectedValues[component]||store.internalValues[component];if((calcValues&&calcValues.value||customQuery)&&!finalQuery[component]){var execute=false;var componentProps=store.props[component];if(Array.isArray(orderOfQueries)&&orderOfQueries.includes(component)&&!(componentProps.componentType===_constants.componentTypes.searchBox&&componentProps.enableAI)){execute=true;}var dependentQuery=getRSQuery(component,extractPropsFromState(store,component,_extends({},componentProps&&_extends({},componentProps.componentType===_constants.componentTypes.searchBox?_extends({},execute===false?{type:_constants.queryTypes.search}:{},calcValues.category?{categoryValue:calcValues.category}:{categoryValue:undefined},calcValues.value?{value:calcValues.value}:{}):{},componentProps.componentType===_constants.componentTypes.categorySearch?_extends({},calcValues.category?{categoryValue:calcValues.category}:{categoryValue:undefined}):{}))),execute);if(dependentQuery){finalQuery[component]=dependentQuery;}}}});return finalQuery;};var transformValueToComponentStateFormat=exports.transformValueToComponentStateFormat=function transformValueToComponentStateFormat(value,componentProps){var componentType=componentProps.componentType,data=componentProps.data,queryFormat=componentProps.queryFormat;var transformedValue=value;var meta={};if(value){switch(componentType){case _constants.componentTypes.singleDataList:case _constants.componentTypes.tabDataList:transformedValue='';if(Array.isArray(value)&&typeof value[0]==='string'){transformedValue=value[0];}else if(typeof value==='object'&&value.label){transformedValue=value.label;}else{transformedValue=value;}break;case _constants.componentTypes.multiDataList:transformedValue=[];if(Array.isArray(value)){value.forEach(function(valObj){if(typeof valObj==='object'&&(valObj.label||valObj.value)){transformedValue.push(valObj.label||valObj.value);}else if(typeof valObj==='string'){transformedValue.push(valObj);}});}break;case _constants.componentTypes.toggleButton:transformedValue=[];if(Array.isArray(value)){value.forEach(function(valObj){if(typeof valObj==='object'&&valObj.label&&valObj.value){transformedValue.push(valObj);}else if(typeof valObj==='string'){var findDataObj=data.find(function(item){return item.label.trim()===valObj.trim()||item.value.trim()===valObj.trim();});transformedValue.push(findDataObj);}});}else if(typeof value==='object'&&value.label&&value.value){transformedValue=value.value;}else if(typeof value==='string'){var findDataObj=data.find(function(item){return item.label.trim()===value.trim()||item.value.trim()===value.trim();});transformedValue=findDataObj.value;}break;case _constants.componentTypes.singleRange:case _constants.componentTypes.singleDropdownRange:transformedValue={};if(!Array.isArray(value)&&typeof value==='object'){transformedValue=_extends({},value);}else if(typeof value==='string'){var _findDataObj=data.find(function(item){return item.label.trim()===value.trim();});transformedValue=_extends({},_findDataObj);}break;case _constants.componentTypes.multiDropdownRange:case _constants.componentTypes.multiRange:transformedValue=[];if(Array.isArray(value)){value.forEach(function(valObj){if(typeof valObj==='object'&&typeof valObj.start==='number'&&typeof valObj.end==='number'){var _findDataObj2=_extends({},valObj);if(!_findDataObj2.label){_findDataObj2=data.find(function(item){return item.start===valObj.start&&item.end===valObj.end;});}transformedValue.push(_findDataObj2);}else if(typeof valObj==='string'){var _findDataObj3=data.find(function(item){return item.label.trim()===valObj.trim();});transformedValue.push(_findDataObj3);}});}else if(typeof value==='string'){var _findDataObj4=data.find(function(item){return item.label.trim()===value.trim();});transformedValue.push(_findDataObj4);}break;case _constants.componentTypes.rangeSlider:case _constants.componentTypes.ratingsFilter:case _constants.componentTypes.dynamicRangeSlider:case _constants.componentTypes.reactiveChart:transformedValue=[];if(queryFormat){if(Array.isArray(value)){transformedValue=value.map(function(item){return(0,_helper.formatDate)((0,_dayjs2.default)(item),componentProps);});}else if(typeof value==='object'){transformedValue=[(0,_helper.formatDate)((0,_dayjs2.default)(value.start),componentProps),(0,_helper.formatDate)((0,_dayjs2.default)(value.end),componentProps)];}}else if(Array.isArray(value)){transformedValue=[].concat(_toConsumableArray(value));}else if(typeof value==='object'){transformedValue=[value.start,value.end];}else{transformedValue=value;}break;case _constants.componentTypes.numberBox:transformedValue=[];if(!Array.isArray(value)&&typeof value==='object'){transformedValue=value.start;}else if(typeof value==='number'){transformedValue=value;}break;case _constants.componentTypes.datePicker:transformedValue='';if(typeof value!=='object'){transformedValue=(0,_dayjs2.default)(value).format('YYYY-MM-DD');}else if(value.end){transformedValue=(0,_dayjs2.default)(value.end).format('YYYY-MM-DD');}else if(value.start){transformedValue=(0,_dayjs2.default)(value.start).add(24,'hour').format('YYYY-MM-DD');}break;case _constants.componentTypes.dateRange:transformedValue=[];if(Array.isArray(value)){transformedValue=value.map(function(t){return(0,_dayjs2.default)(t).format('YYYY-MM-DD');});}else if(typeof value==='object'){transformedValue=[(0,_dayjs2.default)(value.start).format('YYYY-MM-DD'),(0,_dayjs2.default)(value.end).format('YYYY-MM-DD')];}break;case _constants.componentTypes.categorySearch:transformedValue='';if(typeof value==='object'){transformedValue=value.value;if(value.category!==undefined){meta.category=value.category;}}else if(typeof value==='string'){transformedValue=value;}break;default:break;}}return{value:transformedValue,meta:meta};}; |
@@ -1,1332 +0,1 @@ | ||
'use strict'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}, _typeof(obj); | ||
} | ||
var propTypes = {exports: {}}; | ||
var reactIs = {exports: {}}; | ||
var reactIs_production_min = {}; | ||
var hasRequiredReactIs_production_min; | ||
function requireReactIs_production_min() { | ||
if (hasRequiredReactIs_production_min) return reactIs_production_min; | ||
hasRequiredReactIs_production_min = 1; | ||
var b = "function" === typeof Symbol && Symbol["for"], | ||
c = b ? Symbol["for"]("react.element") : 60103, | ||
d = b ? Symbol["for"]("react.portal") : 60106, | ||
e = b ? Symbol["for"]("react.fragment") : 60107, | ||
f = b ? Symbol["for"]("react.strict_mode") : 60108, | ||
g = b ? Symbol["for"]("react.profiler") : 60114, | ||
h = b ? Symbol["for"]("react.provider") : 60109, | ||
k = b ? Symbol["for"]("react.context") : 60110, | ||
l = b ? Symbol["for"]("react.async_mode") : 60111, | ||
m = b ? Symbol["for"]("react.concurrent_mode") : 60111, | ||
n = b ? Symbol["for"]("react.forward_ref") : 60112, | ||
p = b ? Symbol["for"]("react.suspense") : 60113, | ||
q = b ? Symbol["for"]("react.suspense_list") : 60120, | ||
r = b ? Symbol["for"]("react.memo") : 60115, | ||
t = b ? Symbol["for"]("react.lazy") : 60116, | ||
v = b ? Symbol["for"]("react.block") : 60121, | ||
w = b ? Symbol["for"]("react.fundamental") : 60117, | ||
x = b ? Symbol["for"]("react.responder") : 60118, | ||
y = b ? Symbol["for"]("react.scope") : 60119; | ||
function z(a) { | ||
if ("object" === _typeof(a) && null !== a) { | ||
var u = a.$$typeof; | ||
switch (u) { | ||
case c: | ||
switch (a = a.type, a) { | ||
case l: | ||
case m: | ||
case e: | ||
case g: | ||
case f: | ||
case p: | ||
return a; | ||
default: | ||
switch (a = a && a.$$typeof, a) { | ||
case k: | ||
case n: | ||
case t: | ||
case r: | ||
case h: | ||
return a; | ||
default: | ||
return u; | ||
} | ||
} | ||
case d: | ||
return u; | ||
} | ||
} | ||
} | ||
function A(a) { | ||
return z(a) === m; | ||
} | ||
reactIs_production_min.AsyncMode = l; | ||
reactIs_production_min.ConcurrentMode = m; | ||
reactIs_production_min.ContextConsumer = k; | ||
reactIs_production_min.ContextProvider = h; | ||
reactIs_production_min.Element = c; | ||
reactIs_production_min.ForwardRef = n; | ||
reactIs_production_min.Fragment = e; | ||
reactIs_production_min.Lazy = t; | ||
reactIs_production_min.Memo = r; | ||
reactIs_production_min.Portal = d; | ||
reactIs_production_min.Profiler = g; | ||
reactIs_production_min.StrictMode = f; | ||
reactIs_production_min.Suspense = p; | ||
reactIs_production_min.isAsyncMode = function (a) { | ||
return A(a) || z(a) === l; | ||
}; | ||
reactIs_production_min.isConcurrentMode = A; | ||
reactIs_production_min.isContextConsumer = function (a) { | ||
return z(a) === k; | ||
}; | ||
reactIs_production_min.isContextProvider = function (a) { | ||
return z(a) === h; | ||
}; | ||
reactIs_production_min.isElement = function (a) { | ||
return "object" === _typeof(a) && null !== a && a.$$typeof === c; | ||
}; | ||
reactIs_production_min.isForwardRef = function (a) { | ||
return z(a) === n; | ||
}; | ||
reactIs_production_min.isFragment = function (a) { | ||
return z(a) === e; | ||
}; | ||
reactIs_production_min.isLazy = function (a) { | ||
return z(a) === t; | ||
}; | ||
reactIs_production_min.isMemo = function (a) { | ||
return z(a) === r; | ||
}; | ||
reactIs_production_min.isPortal = function (a) { | ||
return z(a) === d; | ||
}; | ||
reactIs_production_min.isProfiler = function (a) { | ||
return z(a) === g; | ||
}; | ||
reactIs_production_min.isStrictMode = function (a) { | ||
return z(a) === f; | ||
}; | ||
reactIs_production_min.isSuspense = function (a) { | ||
return z(a) === p; | ||
}; | ||
reactIs_production_min.isValidElementType = function (a) { | ||
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === _typeof(a) && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); | ||
}; | ||
reactIs_production_min.typeOf = z; | ||
return reactIs_production_min; | ||
} | ||
var reactIs_development = {}; | ||
var hasRequiredReactIs_development; | ||
function requireReactIs_development() { | ||
if (hasRequiredReactIs_development) return reactIs_development; | ||
hasRequiredReactIs_development = 1; | ||
if (process.env.NODE_ENV !== "production") { | ||
(function () { | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
var hasSymbol = typeof Symbol === 'function' && Symbol["for"]; | ||
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7; | ||
var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca; | ||
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol["for"]('react.fragment') : 0xeacb; | ||
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.strict_mode') : 0xeacc; | ||
var REACT_PROFILER_TYPE = hasSymbol ? Symbol["for"]('react.profiler') : 0xead2; | ||
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol["for"]('react.provider') : 0xeacd; | ||
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol["for"]('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol["for"]('react.async_mode') : 0xeacf; | ||
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.concurrent_mode') : 0xeacf; | ||
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0; | ||
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol["for"]('react.suspense') : 0xead1; | ||
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol["for"]('react.suspense_list') : 0xead8; | ||
var REACT_MEMO_TYPE = hasSymbol ? Symbol["for"]('react.memo') : 0xead3; | ||
var REACT_LAZY_TYPE = hasSymbol ? Symbol["for"]('react.lazy') : 0xead4; | ||
var REACT_BLOCK_TYPE = hasSymbol ? Symbol["for"]('react.block') : 0xead9; | ||
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5; | ||
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6; | ||
var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7; | ||
function isValidElementType(type) { | ||
return typeof type === 'string' || typeof type === 'function' || | ||
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || _typeof(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | ||
} | ||
function typeOf(object) { | ||
if (_typeof(object) === 'object' && object !== null) { | ||
var $$typeof = object.$$typeof; | ||
switch ($$typeof) { | ||
case REACT_ELEMENT_TYPE: | ||
var type = object.type; | ||
switch (type) { | ||
case REACT_ASYNC_MODE_TYPE: | ||
case REACT_CONCURRENT_MODE_TYPE: | ||
case REACT_FRAGMENT_TYPE: | ||
case REACT_PROFILER_TYPE: | ||
case REACT_STRICT_MODE_TYPE: | ||
case REACT_SUSPENSE_TYPE: | ||
return type; | ||
default: | ||
var $$typeofType = type && type.$$typeof; | ||
switch ($$typeofType) { | ||
case REACT_CONTEXT_TYPE: | ||
case REACT_FORWARD_REF_TYPE: | ||
case REACT_LAZY_TYPE: | ||
case REACT_MEMO_TYPE: | ||
case REACT_PROVIDER_TYPE: | ||
return $$typeofType; | ||
default: | ||
return $$typeof; | ||
} | ||
} | ||
case REACT_PORTAL_TYPE: | ||
return $$typeof; | ||
} | ||
} | ||
return undefined; | ||
} // AsyncMode is deprecated along with isAsyncMode | ||
var AsyncMode = REACT_ASYNC_MODE_TYPE; | ||
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | ||
var ContextConsumer = REACT_CONTEXT_TYPE; | ||
var ContextProvider = REACT_PROVIDER_TYPE; | ||
var Element = REACT_ELEMENT_TYPE; | ||
var ForwardRef = REACT_FORWARD_REF_TYPE; | ||
var Fragment = REACT_FRAGMENT_TYPE; | ||
var Lazy = REACT_LAZY_TYPE; | ||
var Memo = REACT_MEMO_TYPE; | ||
var Portal = REACT_PORTAL_TYPE; | ||
var Profiler = REACT_PROFILER_TYPE; | ||
var StrictMode = REACT_STRICT_MODE_TYPE; | ||
var Suspense = REACT_SUSPENSE_TYPE; | ||
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated | ||
function isAsyncMode(object) { | ||
{ | ||
if (!hasWarnedAboutDeprecatedIsAsyncMode) { | ||
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint | ||
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | ||
} | ||
} | ||
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | ||
} | ||
function isConcurrentMode(object) { | ||
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | ||
} | ||
function isContextConsumer(object) { | ||
return typeOf(object) === REACT_CONTEXT_TYPE; | ||
} | ||
function isContextProvider(object) { | ||
return typeOf(object) === REACT_PROVIDER_TYPE; | ||
} | ||
function isElement(object) { | ||
return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | ||
} | ||
function isForwardRef(object) { | ||
return typeOf(object) === REACT_FORWARD_REF_TYPE; | ||
} | ||
function isFragment(object) { | ||
return typeOf(object) === REACT_FRAGMENT_TYPE; | ||
} | ||
function isLazy(object) { | ||
return typeOf(object) === REACT_LAZY_TYPE; | ||
} | ||
function isMemo(object) { | ||
return typeOf(object) === REACT_MEMO_TYPE; | ||
} | ||
function isPortal(object) { | ||
return typeOf(object) === REACT_PORTAL_TYPE; | ||
} | ||
function isProfiler(object) { | ||
return typeOf(object) === REACT_PROFILER_TYPE; | ||
} | ||
function isStrictMode(object) { | ||
return typeOf(object) === REACT_STRICT_MODE_TYPE; | ||
} | ||
function isSuspense(object) { | ||
return typeOf(object) === REACT_SUSPENSE_TYPE; | ||
} | ||
reactIs_development.AsyncMode = AsyncMode; | ||
reactIs_development.ConcurrentMode = ConcurrentMode; | ||
reactIs_development.ContextConsumer = ContextConsumer; | ||
reactIs_development.ContextProvider = ContextProvider; | ||
reactIs_development.Element = Element; | ||
reactIs_development.ForwardRef = ForwardRef; | ||
reactIs_development.Fragment = Fragment; | ||
reactIs_development.Lazy = Lazy; | ||
reactIs_development.Memo = Memo; | ||
reactIs_development.Portal = Portal; | ||
reactIs_development.Profiler = Profiler; | ||
reactIs_development.StrictMode = StrictMode; | ||
reactIs_development.Suspense = Suspense; | ||
reactIs_development.isAsyncMode = isAsyncMode; | ||
reactIs_development.isConcurrentMode = isConcurrentMode; | ||
reactIs_development.isContextConsumer = isContextConsumer; | ||
reactIs_development.isContextProvider = isContextProvider; | ||
reactIs_development.isElement = isElement; | ||
reactIs_development.isForwardRef = isForwardRef; | ||
reactIs_development.isFragment = isFragment; | ||
reactIs_development.isLazy = isLazy; | ||
reactIs_development.isMemo = isMemo; | ||
reactIs_development.isPortal = isPortal; | ||
reactIs_development.isProfiler = isProfiler; | ||
reactIs_development.isStrictMode = isStrictMode; | ||
reactIs_development.isSuspense = isSuspense; | ||
reactIs_development.isValidElementType = isValidElementType; | ||
reactIs_development.typeOf = typeOf; | ||
})(); | ||
} | ||
return reactIs_development; | ||
} | ||
var hasRequiredReactIs; | ||
function requireReactIs() { | ||
if (hasRequiredReactIs) return reactIs.exports; | ||
hasRequiredReactIs = 1; | ||
if (process.env.NODE_ENV === 'production') { | ||
reactIs.exports = requireReactIs_production_min(); | ||
} else { | ||
reactIs.exports = requireReactIs_development(); | ||
} | ||
return reactIs.exports; | ||
} | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
var objectAssign; | ||
var hasRequiredObjectAssign; | ||
function requireObjectAssign() { | ||
if (hasRequiredObjectAssign) return objectAssign; | ||
hasRequiredObjectAssign = 1; | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
if (val === null || val === undefined) { | ||
throw new TypeError('Object.assign cannot be called with null or undefined'); | ||
} | ||
return Object(val); | ||
} | ||
function shouldUseNative() { | ||
try { | ||
if (!Object.assign) { | ||
return false; | ||
} | ||
// Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | ||
test1[5] = 'de'; | ||
if (Object.getOwnPropertyNames(test1)[0] === '5') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test2 = {}; | ||
for (var i = 0; i < 10; i++) { | ||
test2['_' + String.fromCharCode(i)] = i; | ||
} | ||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | ||
return test2[n]; | ||
}); | ||
if (order2.join('') !== '0123456789') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
test3[letter] = letter; | ||
}); | ||
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { | ||
return false; | ||
} | ||
return true; | ||
} catch (err) { | ||
// We don't expect any of the above to throw, but better to be safe. | ||
return false; | ||
} | ||
} | ||
objectAssign = shouldUseNative() ? Object.assign : function (target, source) { | ||
var from; | ||
var to = toObject(target); | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
if (propIsEnumerable.call(from, symbols[i])) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
} | ||
return to; | ||
}; | ||
return objectAssign; | ||
} | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
var ReactPropTypesSecret_1; | ||
var hasRequiredReactPropTypesSecret; | ||
function requireReactPropTypesSecret() { | ||
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1; | ||
hasRequiredReactPropTypesSecret = 1; | ||
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | ||
ReactPropTypesSecret_1 = ReactPropTypesSecret; | ||
return ReactPropTypesSecret_1; | ||
} | ||
var has; | ||
var hasRequiredHas; | ||
function requireHas() { | ||
if (hasRequiredHas) return has; | ||
hasRequiredHas = 1; | ||
has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
return has; | ||
} | ||
var checkPropTypes_1; | ||
var hasRequiredCheckPropTypes; | ||
function requireCheckPropTypes() { | ||
if (hasRequiredCheckPropTypes) return checkPropTypes_1; | ||
hasRequiredCheckPropTypes = 1; | ||
var printWarning = function printWarning() {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactPropTypesSecret = requireReactPropTypesSecret(); | ||
var loggedTypeFailures = {}; | ||
var has = requireHas(); | ||
printWarning = function printWarning(text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {/**/} | ||
}; | ||
} | ||
/** | ||
* Assert that the values match with the type specs. | ||
* Error messages are memorized and will only be shown once. | ||
* | ||
* @param {object} typeSpecs Map of name to a ReactPropType | ||
* @param {object} values Runtime values that need to be type-checked | ||
* @param {string} location e.g. "prop", "context", "child context" | ||
* @param {string} componentName Name of the component for error messages. | ||
* @param {?Function} getStack Returns the component stack. | ||
* @private | ||
*/ | ||
function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
for (var typeSpecName in typeSpecs) { | ||
if (has(typeSpecs, typeSpecName)) { | ||
var error; | ||
// Prop type validation may throw. In case they do, we don't want to | ||
// fail the render phase where it didn't fail before. So we log it. | ||
// After these have been cleaned up, we'll let them throw. | ||
try { | ||
// This is intentionally an invariant that gets caught. It's the same | ||
// behavior as without this statement except with a better message. | ||
if (typeof typeSpecs[typeSpecName] !== 'function') { | ||
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + _typeof(typeSpecs[typeSpecName]) + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} | ||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | ||
} catch (ex) { | ||
error = ex; | ||
} | ||
if (error && !(error instanceof Error)) { | ||
printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + _typeof(error) + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).'); | ||
} | ||
if (error instanceof Error && !(error.message in loggedTypeFailures)) { | ||
// Only monitor this failure once because there tends to be a lot of the | ||
// same error. | ||
loggedTypeFailures[error.message] = true; | ||
var stack = getStack ? getStack() : ''; | ||
printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
/** | ||
* Resets warning cache when testing. | ||
* | ||
* @private | ||
*/ | ||
checkPropTypes.resetWarningCache = function () { | ||
if (process.env.NODE_ENV !== 'production') { | ||
loggedTypeFailures = {}; | ||
} | ||
}; | ||
checkPropTypes_1 = checkPropTypes; | ||
return checkPropTypes_1; | ||
} | ||
var factoryWithTypeCheckers; | ||
var hasRequiredFactoryWithTypeCheckers; | ||
function requireFactoryWithTypeCheckers() { | ||
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers; | ||
hasRequiredFactoryWithTypeCheckers = 1; | ||
var ReactIs = requireReactIs(); | ||
var assign = requireObjectAssign(); | ||
var ReactPropTypesSecret = requireReactPropTypesSecret(); | ||
var has = requireHas(); | ||
var checkPropTypes = requireCheckPropTypes(); | ||
var printWarning = function printWarning() {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
printWarning = function printWarning(text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
} | ||
function emptyFunctionThatReturnsNull() { | ||
return null; | ||
} | ||
factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) { | ||
/* global Symbol */ | ||
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | ||
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. | ||
/** | ||
* Returns the iterator method function contained on the iterable object. | ||
* | ||
* Be sure to invoke the function with the iterable as context: | ||
* | ||
* var iteratorFn = getIteratorFn(myIterable); | ||
* if (iteratorFn) { | ||
* var iterator = iteratorFn.call(myIterable); | ||
* ... | ||
* } | ||
* | ||
* @param {?object} maybeIterable | ||
* @return {?function} | ||
*/ | ||
function getIteratorFn(maybeIterable) { | ||
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | ||
if (typeof iteratorFn === 'function') { | ||
return iteratorFn; | ||
} | ||
} | ||
/** | ||
* Collection of methods that allow declaration and validation of props that are | ||
* supplied to React components. Example usage: | ||
* | ||
* var Props = require('ReactPropTypes'); | ||
* var MyArticle = React.createClass({ | ||
* propTypes: { | ||
* // An optional string prop named "description". | ||
* description: Props.string, | ||
* | ||
* // A required enum prop named "category". | ||
* category: Props.oneOf(['News','Photos']).isRequired, | ||
* | ||
* // A prop named "dialog" that requires an instance of Dialog. | ||
* dialog: Props.instanceOf(Dialog).isRequired | ||
* }, | ||
* render: function() { ... } | ||
* }); | ||
* | ||
* A more formal specification of how these methods are used: | ||
* | ||
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | ||
* decl := ReactPropTypes.{type}(.isRequired)? | ||
* | ||
* Each and every declaration produces a function with the same signature. This | ||
* allows the creation of custom validation functions. For example: | ||
* | ||
* var MyLink = React.createClass({ | ||
* propTypes: { | ||
* // An optional string or URI prop named "href". | ||
* href: function(props, propName, componentName) { | ||
* var propValue = props[propName]; | ||
* if (propValue != null && typeof propValue !== 'string' && | ||
* !(propValue instanceof URI)) { | ||
* return new Error( | ||
* 'Expected a string or an URI for ' + propName + ' in ' + | ||
* componentName | ||
* ); | ||
* } | ||
* } | ||
* }, | ||
* render: function() {...} | ||
* }); | ||
* | ||
* @internal | ||
*/ | ||
var ANONYMOUS = '<<anonymous>>'; | ||
// Important! | ||
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | ||
var ReactPropTypes = { | ||
array: createPrimitiveTypeChecker('array'), | ||
bigint: createPrimitiveTypeChecker('bigint'), | ||
bool: createPrimitiveTypeChecker('boolean'), | ||
func: createPrimitiveTypeChecker('function'), | ||
number: createPrimitiveTypeChecker('number'), | ||
object: createPrimitiveTypeChecker('object'), | ||
string: createPrimitiveTypeChecker('string'), | ||
symbol: createPrimitiveTypeChecker('symbol'), | ||
any: createAnyTypeChecker(), | ||
arrayOf: createArrayOfTypeChecker, | ||
element: createElementTypeChecker(), | ||
elementType: createElementTypeTypeChecker(), | ||
instanceOf: createInstanceTypeChecker, | ||
node: createNodeChecker(), | ||
objectOf: createObjectOfTypeChecker, | ||
oneOf: createEnumTypeChecker, | ||
oneOfType: createUnionTypeChecker, | ||
shape: createShapeTypeChecker, | ||
exact: createStrictShapeTypeChecker | ||
}; | ||
/** | ||
* inlined Object.is polyfill to avoid requiring consumers ship their own | ||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | ||
*/ | ||
/*eslint-disable no-self-compare*/ | ||
function is(x, y) { | ||
// SameValue algorithm | ||
if (x === y) { | ||
// Steps 1-5, 7-10 | ||
// Steps 6.b-6.e: +0 != -0 | ||
return x !== 0 || 1 / x === 1 / y; | ||
} else { | ||
// Step 6.a: NaN == NaN | ||
return x !== x && y !== y; | ||
} | ||
} | ||
/*eslint-enable no-self-compare*/ | ||
/** | ||
* We use an Error-like object for backward compatibility as people may call | ||
* PropTypes directly and inspect their output. However, we don't use real | ||
* Errors anymore. We don't inspect their stack anyway, and creating them | ||
* is prohibitively expensive if they are created too often, such as what | ||
* happens in oneOfType() for any type before the one that matched. | ||
*/ | ||
function PropTypeError(message, data) { | ||
this.message = message; | ||
this.data = data && _typeof(data) === 'object' ? data : {}; | ||
this.stack = ''; | ||
} | ||
// Make `instanceof Error` still work for returned errors. | ||
PropTypeError.prototype = Error.prototype; | ||
function createChainableTypeChecker(validate) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
var manualPropTypeCallCache = {}; | ||
var manualPropTypeWarningCount = 0; | ||
} | ||
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | ||
componentName = componentName || ANONYMOUS; | ||
propFullName = propFullName || propName; | ||
if (secret !== ReactPropTypesSecret) { | ||
if (throwOnDirectAccess) { | ||
// New behavior only for users of `prop-types` package | ||
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types'); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { | ||
// Old behavior for people using React.PropTypes | ||
var cacheKey = componentName + ':' + propName; | ||
if (!manualPropTypeCallCache[cacheKey] && | ||
// Avoid spamming the console because they are often not actionable except for lib authors | ||
manualPropTypeWarningCount < 3) { | ||
printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'); | ||
manualPropTypeCallCache[cacheKey] = true; | ||
manualPropTypeWarningCount++; | ||
} | ||
} | ||
} | ||
if (props[propName] == null) { | ||
if (isRequired) { | ||
if (props[propName] === null) { | ||
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); | ||
} | ||
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | ||
} | ||
return null; | ||
} else { | ||
return validate(props, propName, componentName, location, propFullName); | ||
} | ||
} | ||
var chainedCheckType = checkType.bind(null, false); | ||
chainedCheckType.isRequired = checkType.bind(null, true); | ||
return chainedCheckType; | ||
} | ||
function createPrimitiveTypeChecker(expectedType) { | ||
function validate(props, propName, componentName, location, propFullName, secret) { | ||
var propValue = props[propName]; | ||
var propType = getPropType(propValue); | ||
if (propType !== expectedType) { | ||
// `propValue` being instance of, say, date/regexp, pass the 'object' | ||
// check, but we can offer a more precise error message here rather than | ||
// 'of type `object`'. | ||
var preciseType = getPreciseType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), { | ||
expectedType: expectedType | ||
}); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createAnyTypeChecker() { | ||
return createChainableTypeChecker(emptyFunctionThatReturnsNull); | ||
} | ||
function createArrayOfTypeChecker(typeChecker) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
if (typeof typeChecker !== 'function') { | ||
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); | ||
} | ||
var propValue = props[propName]; | ||
if (!Array.isArray(propValue)) { | ||
var propType = getPropType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); | ||
} | ||
for (var i = 0; i < propValue.length; i++) { | ||
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); | ||
if (error instanceof Error) { | ||
return error; | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createElementTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!isValidElement(propValue)) { | ||
var propType = getPropType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createElementTypeTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!ReactIs.isValidElementType(propValue)) { | ||
var propType = getPropType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createInstanceTypeChecker(expectedClass) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
if (!(props[propName] instanceof expectedClass)) { | ||
var expectedClassName = expectedClass.name || ANONYMOUS; | ||
var actualClassName = getClassName(props[propName]); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createEnumTypeChecker(expectedValues) { | ||
if (!Array.isArray(expectedValues)) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (arguments.length > 1) { | ||
printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'); | ||
} else { | ||
printWarning('Invalid argument supplied to oneOf, expected an array.'); | ||
} | ||
} | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
for (var i = 0; i < expectedValues.length; i++) { | ||
if (is(propValue, expectedValues[i])) { | ||
return null; | ||
} | ||
} | ||
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | ||
var type = getPreciseType(value); | ||
if (type === 'symbol') { | ||
return String(value); | ||
} | ||
return value; | ||
}); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createObjectOfTypeChecker(typeChecker) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
if (typeof typeChecker !== 'function') { | ||
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); | ||
} | ||
var propValue = props[propName]; | ||
var propType = getPropType(propValue); | ||
if (propType !== 'object') { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); | ||
} | ||
for (var key in propValue) { | ||
if (has(propValue, key)) { | ||
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | ||
if (error instanceof Error) { | ||
return error; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createUnionTypeChecker(arrayOfTypeCheckers) { | ||
if (!Array.isArray(arrayOfTypeCheckers)) { | ||
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (typeof checker !== 'function') { | ||
printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'); | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var expectedTypes = []; | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | ||
if (checkerResult == null) { | ||
return null; | ||
} | ||
if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | ||
expectedTypes.push(checkerResult.data.expectedType); | ||
} | ||
} | ||
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : ''; | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createNodeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
if (!isNode(props[propName])) { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function invalidValidatorError(componentName, location, propFullName, key, type) { | ||
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'); | ||
} | ||
function createShapeTypeChecker(shapeTypes) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
var propType = getPropType(propValue); | ||
if (propType !== 'object') { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | ||
} | ||
for (var key in shapeTypes) { | ||
var checker = shapeTypes[key]; | ||
if (typeof checker !== 'function') { | ||
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | ||
} | ||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | ||
if (error) { | ||
return error; | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createStrictShapeTypeChecker(shapeTypes) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
var propType = getPropType(propValue); | ||
if (propType !== 'object') { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | ||
} | ||
// We need to check all keys in case some are required but missing from props. | ||
var allKeys = assign({}, props[propName], shapeTypes); | ||
for (var key in allKeys) { | ||
var checker = shapeTypes[key]; | ||
if (has(shapeTypes, key) && typeof checker !== 'function') { | ||
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | ||
} | ||
if (!checker) { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')); | ||
} | ||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | ||
if (error) { | ||
return error; | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function isNode(propValue) { | ||
switch (_typeof(propValue)) { | ||
case 'number': | ||
case 'string': | ||
case 'undefined': | ||
return true; | ||
case 'boolean': | ||
return !propValue; | ||
case 'object': | ||
if (Array.isArray(propValue)) { | ||
return propValue.every(isNode); | ||
} | ||
if (propValue === null || isValidElement(propValue)) { | ||
return true; | ||
} | ||
var iteratorFn = getIteratorFn(propValue); | ||
if (iteratorFn) { | ||
var iterator = iteratorFn.call(propValue); | ||
var step; | ||
if (iteratorFn !== propValue.entries) { | ||
while (!(step = iterator.next()).done) { | ||
if (!isNode(step.value)) { | ||
return false; | ||
} | ||
} | ||
} else { | ||
// Iterator will provide entry [k,v] tuples rather than values. | ||
while (!(step = iterator.next()).done) { | ||
var entry = step.value; | ||
if (entry) { | ||
if (!isNode(entry[1])) { | ||
return false; | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
return false; | ||
} | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
function isSymbol(propType, propValue) { | ||
// Native Symbol. | ||
if (propType === 'symbol') { | ||
return true; | ||
} | ||
// falsy value can't be a Symbol | ||
if (!propValue) { | ||
return false; | ||
} | ||
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | ||
if (propValue['@@toStringTag'] === 'Symbol') { | ||
return true; | ||
} | ||
// Fallback for non-spec compliant Symbols which are polyfilled. | ||
if (typeof Symbol === 'function' && propValue instanceof Symbol) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
// Equivalent of `typeof` but with special handling for array and regexp. | ||
function getPropType(propValue) { | ||
var propType = _typeof(propValue); | ||
if (Array.isArray(propValue)) { | ||
return 'array'; | ||
} | ||
if (propValue instanceof RegExp) { | ||
// Old webkits (at least until Android 4.0) return 'function' rather than | ||
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/ | ||
// passes PropTypes.object. | ||
return 'object'; | ||
} | ||
if (isSymbol(propType, propValue)) { | ||
return 'symbol'; | ||
} | ||
return propType; | ||
} | ||
// This handles more types than `getPropType`. Only used for error messages. | ||
// See `createPrimitiveTypeChecker`. | ||
function getPreciseType(propValue) { | ||
if (typeof propValue === 'undefined' || propValue === null) { | ||
return '' + propValue; | ||
} | ||
var propType = getPropType(propValue); | ||
if (propType === 'object') { | ||
if (propValue instanceof Date) { | ||
return 'date'; | ||
} else if (propValue instanceof RegExp) { | ||
return 'regexp'; | ||
} | ||
} | ||
return propType; | ||
} | ||
// Returns a string that is postfixed to a warning about an invalid type. | ||
// For example, "undefined" or "of type array" | ||
function getPostfixForTypeWarning(value) { | ||
var type = getPreciseType(value); | ||
switch (type) { | ||
case 'array': | ||
case 'object': | ||
return 'an ' + type; | ||
case 'boolean': | ||
case 'date': | ||
case 'regexp': | ||
return 'a ' + type; | ||
default: | ||
return type; | ||
} | ||
} | ||
// Returns class name of the object, if any. | ||
function getClassName(propValue) { | ||
if (!propValue.constructor || !propValue.constructor.name) { | ||
return ANONYMOUS; | ||
} | ||
return propValue.constructor.name; | ||
} | ||
ReactPropTypes.checkPropTypes = checkPropTypes; | ||
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | ||
ReactPropTypes.PropTypes = ReactPropTypes; | ||
return ReactPropTypes; | ||
}; | ||
return factoryWithTypeCheckers; | ||
} | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
var factoryWithThrowingShims; | ||
var hasRequiredFactoryWithThrowingShims; | ||
function requireFactoryWithThrowingShims() { | ||
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims; | ||
hasRequiredFactoryWithThrowingShims = 1; | ||
var ReactPropTypesSecret = requireReactPropTypesSecret(); | ||
function emptyFunction() {} | ||
function emptyFunctionWithReset() {} | ||
emptyFunctionWithReset.resetWarningCache = emptyFunction; | ||
factoryWithThrowingShims = function factoryWithThrowingShims() { | ||
function shim(props, propName, componentName, location, propFullName, secret) { | ||
if (secret === ReactPropTypesSecret) { | ||
// It is still safe when called from React. | ||
return; | ||
} | ||
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types'); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} | ||
shim.isRequired = shim; | ||
function getShim() { | ||
return shim; | ||
} | ||
// Important! | ||
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. | ||
var ReactPropTypes = { | ||
array: shim, | ||
bigint: shim, | ||
bool: shim, | ||
func: shim, | ||
number: shim, | ||
object: shim, | ||
string: shim, | ||
symbol: shim, | ||
any: shim, | ||
arrayOf: getShim, | ||
element: shim, | ||
elementType: shim, | ||
instanceOf: getShim, | ||
node: shim, | ||
objectOf: getShim, | ||
oneOf: getShim, | ||
oneOfType: getShim, | ||
shape: getShim, | ||
exact: getShim, | ||
checkPropTypes: emptyFunctionWithReset, | ||
resetWarningCache: emptyFunction | ||
}; | ||
ReactPropTypes.PropTypes = ReactPropTypes; | ||
return ReactPropTypes; | ||
}; | ||
return factoryWithThrowingShims; | ||
} | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactIs = requireReactIs(); | ||
// By explicitly using `prop-types` you are opting into new development behavior. | ||
// http://fb.me/prop-types-in-prod | ||
var throwOnDirectAccess = true; | ||
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); | ||
} else { | ||
// By explicitly using `prop-types` you are opting into new production behavior. | ||
// http://fb.me/prop-types-in-prod | ||
propTypes.exports = requireFactoryWithThrowingShims()(); | ||
} | ||
var propTypesExports = propTypes.exports; | ||
var dateFormats = { | ||
date: 'YYYY-MM-DD', | ||
basic_date: 'YYYYMMDD', | ||
basic_date_time: 'YYYYMMDD[T]HHmmss.SSSZ', | ||
basic_date_time_no_millis: 'YYYYMMDD[T]HHmmssZ', | ||
date_time_no_millis: 'YYYY-MM-DD[T]HH:mm:ssZ', | ||
basic_time: 'HHmmss.SSSZ', | ||
basic_time_no_millis: 'HHmmssZ', | ||
epoch_millis: 'epoch_millis', | ||
epoch_second: 'epoch_second' | ||
}; | ||
var componentTypes = { | ||
reactiveList: 'REACTIVELIST', | ||
// search components | ||
dataSearch: 'DATASEARCH', | ||
categorySearch: 'CATEGORYSEARCH', | ||
searchBox: 'SEARCHBOX', | ||
// list components | ||
singleList: 'SINGLELIST', | ||
multiList: 'MULTILIST', | ||
singleDataList: 'SINGLEDATALIST', | ||
tabDataList: 'TABDATALIST', | ||
singleDropdownList: 'SINGLEDROPDOWNLIST', | ||
multiDataList: 'MULTIDATALIST', | ||
multiDropdownList: 'MULTIDROPDOWNLIST', | ||
singleDropdownRange: 'SINGLEDROPDOWNRANGE', | ||
treeList: 'TREELIST', | ||
// basic components | ||
numberBox: 'NUMBERBOX', | ||
tagCloud: 'TAGCLOUD', | ||
toggleButton: 'TOGGLEBUTTON', | ||
reactiveComponent: 'REACTIVECOMPONENT', | ||
// range components | ||
datePicker: 'DATEPICKER', | ||
dateRange: 'DATERANGE', | ||
dynamicRangeSlider: 'DYNAMICRANGESLIDER', | ||
multiDropdownRange: 'MULTIDROPDOWNRANGE', | ||
singleRange: 'SINGLERANGE', | ||
multiRange: 'MULTIRANGE', | ||
rangeSlider: 'RANGESLIDER', | ||
ratingsFilter: 'RATINGSFILTER', | ||
rangeInput: 'RANGEINPUT', | ||
// map components | ||
geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN', | ||
geoDistanceSlider: 'GEO_DISTANCE_SLIDER', | ||
reactiveMap: 'REACTIVE_MAP', | ||
// chart components | ||
reactiveChart: 'REACTIVE_CHART' | ||
}; | ||
var CLEAR_ALL = { | ||
NEVER: 'never', | ||
ALWAYS: 'always', | ||
DEFAULT: 'default' | ||
}; | ||
var reactKeyType = propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string), propTypesExports.object, propTypesExports.arrayOf(propTypesExports.object)]); | ||
function validateLocation(props, propName) { | ||
// eslint-disable-next-line | ||
if (isNaN(props[propName])) { | ||
return new Error("".concat(propName, " value must be a number")); | ||
} | ||
if (propName === 'lat' && (props[propName] < -90 || props[propName] > 90)) { | ||
return new Error("".concat(propName, " value should be between -90 and 90.")); | ||
} else if (propName === 'lng' && (props[propName] < -180 || props[propName] > 180)) { | ||
return new Error("".concat(propName, " value should be between -180 and 180.")); | ||
} | ||
return null; | ||
} | ||
// eslint-disable-next-line consistent-return | ||
var dataFieldValidator = function dataFieldValidator(props, propName, componentName) { | ||
var requiredError = new Error("".concat(propName, " supplied to ").concat(componentName, " is required. Validation failed.")); | ||
var propValue = props[propName]; | ||
if (!propValue) return requiredError; | ||
if (typeof propValue !== 'string' && _typeof(propValue) !== 'object' && !Array.isArray(propValue)) { | ||
return new Error("Invalid ".concat(propName, " supplied to ").concat(componentName, ". Validation failed.")); | ||
} | ||
if (Array.isArray(propValue) && propValue.length === 0) return requiredError; | ||
}; | ||
var types = { | ||
any: propTypesExports.any, | ||
analyticsConfig: propTypesExports.shape({ | ||
emptyQuery: propTypesExports.bool, | ||
suggestionAnalytics: propTypesExports.bool, | ||
userId: propTypesExports.string, | ||
customEvents: propTypesExports.object // eslint-disable-line | ||
}), | ||
appbaseConfig: propTypesExports.shape({ | ||
enableQueryRules: propTypesExports.bool, | ||
enableSearchRelevancy: propTypesExports.bool, | ||
recordAnalytics: propTypesExports.bool, | ||
emptyQuery: propTypesExports.bool, | ||
suggestionAnalytics: propTypesExports.bool, | ||
userId: propTypesExports.string, | ||
useCache: propTypesExports.bool, | ||
customEvents: propTypesExports.object, | ||
// eslint-disable-line | ||
enableTelemetry: propTypesExports.bool, | ||
queryString: propTypesExports.object // eslint-disable-line | ||
}), | ||
bool: propTypesExports.bool, | ||
boolRequired: propTypesExports.bool.isRequired, | ||
components: propTypesExports.arrayOf(propTypesExports.string), | ||
children: propTypesExports.any, | ||
data: propTypesExports.arrayOf(propTypesExports.object), | ||
dataFieldArray: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string)]).isRequired, | ||
dataNumberBox: propTypesExports.shape({ | ||
label: propTypesExports.string, | ||
start: propTypesExports.number.isRequired, | ||
end: propTypesExports.number.isRequired | ||
}).isRequired, | ||
date: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string)]), | ||
dateObject: propTypesExports.object, | ||
excludeFields: propTypesExports.arrayOf(propTypesExports.string), | ||
fieldWeights: propTypesExports.arrayOf(propTypesExports.number), | ||
filterLabel: propTypesExports.string, | ||
func: propTypesExports.func, | ||
funcRequired: propTypesExports.func.isRequired, | ||
fuzziness: propTypesExports.oneOf([0, 1, 2, 'AUTO']), | ||
headers: propTypesExports.object, | ||
hits: propTypesExports.arrayOf(propTypesExports.object), | ||
rawData: propTypesExports.object, | ||
iconPosition: propTypesExports.oneOf(['left', 'right']), | ||
includeFields: propTypesExports.arrayOf(propTypesExports.string), | ||
labelPosition: propTypesExports.oneOf(['left', 'right', 'top', 'bottom']), | ||
number: propTypesExports.number, | ||
options: propTypesExports.oneOfType([propTypesExports.arrayOf(propTypesExports.object), propTypesExports.object]), | ||
paginationAt: propTypesExports.oneOf(['top', 'bottom', 'both']), | ||
range: propTypesExports.shape({ | ||
start: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.object]).isRequired, | ||
end: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.object]).isRequired | ||
}), | ||
rangeLabels: propTypesExports.shape({ | ||
start: propTypesExports.string.isRequired, | ||
end: propTypesExports.string.isRequired | ||
}), | ||
react: propTypesExports.shape({ | ||
and: reactKeyType, | ||
or: reactKeyType, | ||
not: reactKeyType | ||
}), | ||
categorySearchValue: propTypesExports.shape({ | ||
term: propTypesExports.string, | ||
category: propTypesExports.string | ||
}), | ||
selectedValues: propTypesExports.object, | ||
selectedValue: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string), propTypesExports.arrayOf(propTypesExports.object), propTypesExports.object, propTypesExports.number, propTypesExports.arrayOf(propTypesExports.number)]), | ||
suggestions: propTypesExports.arrayOf(propTypesExports.object), | ||
supportedOrientations: propTypesExports.oneOf(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']), | ||
tooltipTrigger: propTypesExports.oneOf(['hover', 'none', 'focus', 'always']), | ||
sortBy: propTypesExports.oneOf(['asc', 'desc']), | ||
sortOptions: propTypesExports.arrayOf(propTypesExports.shape({ | ||
label: propTypesExports.string, | ||
dataField: propTypesExports.string, | ||
sortBy: propTypesExports.string | ||
})), | ||
sortByWithCount: propTypesExports.oneOf(['asc', 'desc', 'count']), | ||
stats: propTypesExports.arrayOf(propTypesExports.object), | ||
string: propTypesExports.string, | ||
stringArray: propTypesExports.arrayOf(propTypesExports.string), | ||
stringOrArray: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string)]), | ||
stringRequired: propTypesExports.string.isRequired, | ||
style: propTypesExports.object, | ||
themePreset: propTypesExports.oneOf(['light', 'dark']), | ||
queryFormatDate: propTypesExports.oneOf(Object.keys(dateFormats)), | ||
queryFormatSearch: propTypesExports.oneOf(['and', 'or']), | ||
queryFormatNumberBox: propTypesExports.oneOf(['exact', 'lte', 'gte']), | ||
params: propTypesExports.object.isRequired, | ||
props: propTypesExports.object, | ||
rangeLabelsAlign: propTypesExports.oneOf(['left', 'right']), | ||
title: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.any]), | ||
location: propTypesExports.shape({ | ||
lat: validateLocation, | ||
lng: validateLocation | ||
}), | ||
unit: propTypesExports.oneOf(['mi', 'miles', 'yd', 'yards', 'ft', 'feet', 'in', 'inch', 'km', 'kilometers', 'm', 'meters', 'cm', 'centimeters', 'mm', 'millimeters', 'NM', 'nmi', 'nauticalmiles']), | ||
aggregationData: propTypesExports.array, | ||
showClearAll: propTypesExports.oneOf([CLEAR_ALL.NEVER, CLEAR_ALL.ALWAYS, CLEAR_ALL.DEFAULT, true, false]), | ||
componentType: propTypesExports.oneOf(Object.values(componentTypes)), | ||
componentObject: propTypesExports.object, | ||
dataFieldValidator: dataFieldValidator, | ||
focusShortcuts: propTypesExports.oneOfType([propTypesExports.arrayOf(propTypesExports.string), propTypesExports.arrayOf(propTypesExports.number)]), | ||
mongodb: propTypesExports.shape({ | ||
db: propTypesExports.string, | ||
collection: propTypesExports.string | ||
}), | ||
calendarInterval: propTypesExports.oneOf(['month', 'day', 'year', 'week', 'quarter', 'hour', 'minute']), | ||
preferences: propTypesExports.object, | ||
endpoint: propTypesExports.shape({ | ||
url: propTypesExports.string.isRequired, | ||
method: propTypesExports.string, | ||
/* eslint-disable react/forbid-prop-types */ | ||
headers: propTypesExports.object, | ||
body: propTypesExports.object | ||
/* eslint-enable react/forbid-prop-types */ | ||
}) | ||
}; | ||
module.exports = types; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _propTypes=require('prop-types');var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);var _constants=require('./constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var reactKeyType=(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),_propTypes.object,(0,_propTypes.arrayOf)(_propTypes.object)]);function validateLocation(props,propName){if(isNaN(props[propName])){return new Error(propName+' value must be a number');}if(propName==='lat'&&(props[propName]<-90||props[propName]>90)){return new Error(propName+' value should be between -90 and 90.');}else if(propName==='lng'&&(props[propName]<-180||props[propName]>180)){return new Error(propName+' value should be between -180 and 180.');}return null;}var dataFieldValidator=function dataFieldValidator(props,propName,componentName){var requiredError=new Error(propName+' supplied to '+componentName+' is required. Validation failed.');var propValue=props[propName];if(!propValue)return requiredError;if(typeof propValue!=='string'&&typeof propValue!=='object'&&!Array.isArray(propValue)){return new Error('Invalid '+propName+' supplied to '+componentName+'. Validation failed.');}if(Array.isArray(propValue)&&propValue.length===0)return requiredError;};var types={any:_propTypes.any,analyticsConfig:(0,_propTypes.shape)({emptyQuery:_propTypes.bool,suggestionAnalytics:_propTypes.bool,userId:_propTypes.string,customEvents:_propTypes.object}),appbaseConfig:(0,_propTypes.shape)({enableQueryRules:_propTypes.bool,enableSearchRelevancy:_propTypes.bool,recordAnalytics:_propTypes.bool,emptyQuery:_propTypes.bool,suggestionAnalytics:_propTypes.bool,userId:_propTypes.string,useCache:_propTypes.bool,customEvents:_propTypes.object,enableTelemetry:_propTypes.bool,queryString:_propTypes.object}),bool:_propTypes.bool,boolRequired:_propTypes.bool.isRequired,components:(0,_propTypes.arrayOf)(_propTypes.string),children:_propTypes.any,data:(0,_propTypes.arrayOf)(_propTypes.object),dataFieldArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]).isRequired,dataNumberBox:(0,_propTypes.shape)({label:_propTypes.string,start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}).isRequired,date:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),dateObject:_propTypes.object,excludeFields:(0,_propTypes.arrayOf)(_propTypes.string),fieldWeights:(0,_propTypes.arrayOf)(_propTypes.number),filterLabel:_propTypes.string,func:_propTypes.func,funcRequired:_propTypes.func.isRequired,fuzziness:(0,_propTypes.oneOf)([0,1,2,'AUTO']),headers:_propTypes.object,hits:(0,_propTypes.arrayOf)(_propTypes.object),rawData:_propTypes.object,iconPosition:(0,_propTypes.oneOf)(['left','right']),includeFields:(0,_propTypes.arrayOf)(_propTypes.string),labelPosition:(0,_propTypes.oneOf)(['left','right','top','bottom']),number:_propTypes.number,options:(0,_propTypes.oneOfType)([(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object]),paginationAt:(0,_propTypes.oneOf)(['top','bottom','both']),range:(0,_propTypes.shape)({start:(0,_propTypes.oneOfType)([_propTypes.number,_propTypes.string,_propTypes.object]).isRequired,end:(0,_propTypes.oneOfType)([_propTypes.number,_propTypes.string,_propTypes.object]).isRequired}),rangeLabels:(0,_propTypes.shape)({start:_propTypes.string.isRequired,end:_propTypes.string.isRequired}),react:(0,_propTypes.shape)({and:reactKeyType,or:reactKeyType,not:reactKeyType}),categorySearchValue:(0,_propTypes.shape)({term:_propTypes.string,category:_propTypes.string}),selectedValues:_propTypes.object,selectedValue:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object,_propTypes.number,(0,_propTypes.arrayOf)(_propTypes.number)]),suggestions:(0,_propTypes.arrayOf)(_propTypes.object),supportedOrientations:(0,_propTypes.oneOf)(['portrait','portrait-upside-down','landscape','landscape-left','landscape-right']),tooltipTrigger:(0,_propTypes.oneOf)(['hover','none','focus','always']),sortBy:(0,_propTypes.oneOf)(['asc','desc']),sortOptions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({label:_propTypes.string,dataField:_propTypes.string,sortBy:_propTypes.string})),sortByWithCount:(0,_propTypes.oneOf)(['asc','desc','count']),stats:(0,_propTypes.arrayOf)(_propTypes.object),string:_propTypes.string,stringArray:(0,_propTypes.arrayOf)(_propTypes.string),stringOrArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),stringRequired:_propTypes.string.isRequired,style:_propTypes.object,themePreset:(0,_propTypes.oneOf)(['light','dark']),queryFormatDate:(0,_propTypes.oneOf)(Object.keys(_dateFormats2.default)),queryFormatSearch:(0,_propTypes.oneOf)(['and','or']),queryFormatNumberBox:(0,_propTypes.oneOf)(['exact','lte','gte']),params:_propTypes.object.isRequired,props:_propTypes.object,rangeLabelsAlign:(0,_propTypes.oneOf)(['left','right']),title:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.any]),location:(0,_propTypes.shape)({lat:validateLocation,lng:validateLocation}),unit:(0,_propTypes.oneOf)(['mi','miles','yd','yards','ft','feet','in','inch','km','kilometers','m','meters','cm','centimeters','mm','millimeters','NM','nmi','nauticalmiles']),aggregationData:_propTypes.array,showClearAll:(0,_propTypes.oneOf)([_constants.CLEAR_ALL.NEVER,_constants.CLEAR_ALL.ALWAYS,_constants.CLEAR_ALL.DEFAULT,true,false]),componentType:(0,_propTypes.oneOf)(Object.values(_constants.componentTypes)),componentObject:_propTypes.object,dataFieldValidator:dataFieldValidator,focusShortcuts:(0,_propTypes.oneOfType)([(0,_propTypes.arrayOf)(_propTypes.string),(0,_propTypes.arrayOf)(_propTypes.number)]),mongodb:(0,_propTypes.shape)({db:_propTypes.string,collection:_propTypes.string}),calendarInterval:(0,_propTypes.oneOf)(['month','day','year','week','quarter','hour','minute']),preferences:_propTypes.object,endpoint:(0,_propTypes.shape)({url:_propTypes.string.isRequired,method:_propTypes.string,headers:_propTypes.object,body:_propTypes.object}),AIConfig:(0,_propTypes.shape)({docTemplate:_propTypes.string,queryTemplate:_propTypes.string,maxTokens:_propTypes.number,systemPrompt:_propTypes.string,temperature:_propTypes.number,topDocsForContext:_propTypes.number})};exports.default=types; |
{ | ||
"name": "@appbaseio/reactivecore", | ||
"version": "10.0.0-alpha.22.1", | ||
"version": "10.0.0-alpha.23", | ||
"description": "Core architecture of reactive UI libraries", | ||
"main": "lib/index.js", | ||
"module": "lib/index.mjs", | ||
"files": [ | ||
@@ -12,7 +11,8 @@ "lib/" | ||
"lint": "eslint .", | ||
"start": "rollup -c -w", | ||
"build": "rollup -c", | ||
"start": "yarn run build -w", | ||
"build": "babel --ignore __tests__ src --out-dir lib", | ||
"precommit": "eslint .", | ||
"prepublishOnly": "yarn run build", | ||
"version-upgrade": "nps upgrade-core -c ../../package-scripts.js", | ||
"postpublish": "yarn run version-upgrade", | ||
"test": "../../node_modules/jest/bin/jest.js --watch --env node" | ||
@@ -38,6 +38,3 @@ }, | ||
"devDependencies": { | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-commonjs": "^24.1.0", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@rollup/plugin-node-resolve": "^15.0.2", | ||
"babel-cli": "^6.24.1", | ||
"babel-eslint": "^7.2.3", | ||
@@ -52,9 +49,5 @@ "babel-preset-react-native": "^4.0.0", | ||
"eslint-plugin-react": "^7.5.1", | ||
"glob": "^10.2.1", | ||
"husky": "^0.14.3", | ||
"jest": "^22.4.2", | ||
"nps": "^5.9.5", | ||
"rollup": "^3.20.7", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-terser": "^7.0.2" | ||
"nps": "^5.9.5" | ||
}, | ||
@@ -61,0 +54,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 6 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
13
5203
7
231070
68
0
59