Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contentstack

Package Overview
Dependencies
Maintainers
5
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentstack - npm Package Compare versions

Comparing version 3.18.1 to 3.19.0

5

CHANGELOG.md
## Change log
### Version: 3.19.0
#### Date: February-02-2024
##### New Features:
- live preview support both 1.0 and 2.0
- fix for `ESM module cannot use module.exports` issue react-native and nativescript builds
### Version: 3.18.1

@@ -4,0 +9,0 @@ #### Date: January-30-2024

2

config.js

@@ -16,3 +16,3 @@ const config = {

enable: false,
host: 'api.contentstack.io'
host: 'rest-preview.contentstack.com'
}

@@ -19,0 +19,0 @@ };

/*! For license information please see contentstack.js.LICENSE.txt */
(()=>{"use strict";var e={310:(e,t,r)=>{r.r(t);const n={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"api.contentstack.io"}},i=fetch;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s="3.18.1";function u(e,t){var r=e.requestParams;return new Promise((function(n,i){var u;return r.headers["Content-Type"]="application/json; charset=UTF-8",r.headers["X-User-Agent"]="contentstack-delivery-javascript-react-native/"+s,r.body&&"object"===o(r.body)&&(delete r.body._method,"object"===o(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,u=function e(t,r){var n=[];if("object"===o(t)&&void 0!==t.length)for(var i=0,s=t.length;i<s;i++)n.push(r+"[]="+t[i]);else for(var u in t){var a=r?r+"["+u+"]":u,c=t[u];n.push(null!==c&&"object"===o(c)&&"query"!==u?e(c,a):a+"="+encodeURIComponent("query"!==u?c:JSON.stringify(c)))}return n.join("&")}(r.body)),a(e,u,t,n,i,t.retryDelay,t.retryLimit)}))}function a(e,t,r,n,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,c=e.requestParams,l=c.url+"?"+t,f=b({method:"GET",headers:c.headers,timeout:3e4},r);r.debug&&r.logHandler("info",{url:l,option:f});var y={url:l,option:f},h=e.plugins;if(h&&void 0!==h)for(var p=0;p<h.length;p++)"function"==typeof h[p].onRequest&&(y=h[p].onRequest(e,y));i(y.url,y.option).then((function(i){r.debug&&r.logHandler("info",i);var c=i.json();if(i.ok&&200===i.status)c.then((function(t){for(var r=0;r<h.length&&"function"==typeof h[r].onResponse;r++)t=h[r].onResponse(e,y,i,t);n(t)}));else{var l=i.status,f=i.statusText;c.then((function(c){var y={error_message:c.error_message,error_code:c.error_code,errors:c.errors,status:l,statusText:f};r.retryCondition&&r.retryCondition(i)?function(i){if(0===u)r.debug&&r.logHandler("error",i),o(i);else{var c=s;u-=1;var l=r.retryLimit-u;r.retryDelayOptions&&(r.retryDelayOptions.base?c=r.retryDelayOptions.base*l:r.retryDelayOptions.customBackoff&&(c=r.retryDelayOptions.customBackoff(l,i))),function(e){return new Promise((function(t){setTimeout(t,e)}))}(c).then((function(){return a(e,t,r,n,o,s,u)})).catch((function(){return a(e,t,r,n,o,s,u)}))}}(y):(r.debug&&r.logHandler("error",y),o(y))})).catch((function(){r.debug&&r.logHandler("error",{status:l,statusText:f}),o({status:l,statusText:f})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),o(e)}))}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==c(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===c(i)?i:String(i)),n)}var i}var f=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.object=function(){return t}),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.object()?b(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e)return e.split(".").reduce((function(e,t){return e[t]}),this.object())}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null;return t?t+"?disposition="+(e&&"string"==typeof e?e:"attachment"):null}}}])&&l(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,u=[],a=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e,t)||function(){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 h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(){p=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,s=Object.create(o.prototype),u=new C(n||[]);return i(s,"_invoke",{value:x(e,r,u)}),s}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var y="suspendedStart",h="suspendedYield",d="executing",v="completed",m={};function b(){}function _(){}function q(){}var O={};c(O,s,(function(){return this}));var w=Object.getPrototypeOf,k=w&&w(w(H([])));k&&k!==r&&n.call(k,s)&&(O=k);var P=q.prototype=b.prototype=Object.create(O);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(i,o,s,u){var a=f(e[i],e,o);if("throw"!==a.type){var c=a.arg,l=c.value;return l&&"object"==g(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(a.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function x(t,r,n){var i=y;return function(o,s){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:e,done:!0}}for(n.method=o,n.arg=s;;){var u=n.delegate;if(u){var a=E(u,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=f(t,r,n);if("normal"===c.type){if(i=n.done?v:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function E(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var s=o.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(g(t)+" is not iterable")}return _.prototype=q,i(P,"constructor",{value:q,configurable:!0}),i(q,"constructor",{value:_,configurable:!0}),_.displayName=c(q,a,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,q):(e.__proto__=q,c(e,a,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},S(j.prototype),c(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new j(l(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},S(P),c(P,a,"Generator"),c(P,s,(function(){return this})),c(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return u.type="throw",u.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],u=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var a=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(a&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function d(e,t,r,n,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void r(e)}u.done?t(a):Promise.resolve(a).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){d(o,n,i,s,u,"next",e)}function u(e){d(o,n,i,s,u,"throw",e)}s(void 0)}))}}function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function m(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}}function b(e,t){var r=this;return function e(t,n){for(var i in n)"object"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?e(t[i],n[i]):"array"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?t[i]=t[i].concat(n[i]):t[i]=n[i]}(e,t),e}function _(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function q(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=f(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,i=e.assets.length;n<i;n++)e.assets[n]=f(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=f(e.entry):e&&void 0!==e.asset?e.asset=f(e.asset):e&&void 0!==e.items&&(e.items=f(e.items).toJSON());return e}function O(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}function w(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var n=e,i=void 0!==n.queryCachePolicy?n.queryCachePolicy:n.cachePolicy,o=void 0!==n.tojson&&n.tojson,s=!!(n.entry_uid||n.singleEntry||n.asset_uid),a=function(e){try{var t=function(e){var t,r,n=0;if(0===e.length)return n;for(t=0,r=e.length;t<r;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n<-1?-1*n:n}(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}(function(e,t,r){if(e&&e.requestParams){var n=_({},e.requestParams.body&&e.requestParams.body.query||{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}(n,s,o));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var c=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==g(c)&&(c=JSON.parse(c)),delete e.requestParams.body.query,e.requestParams.body=_(e.requestParams.body,c),e.live_preview&&!0===e.live_preview.enable&&e.live_preview.live_preview&&"init"!==e.live_preview.live_preview&&(e.live_preview.content_type_uid===e.content_type_uid?(e.requestParams.body=_(e.requestParams.body,{live_preview:e.live_preview.live_preview||"init"}),i=2,e.requestParams.body.environment&&delete e.requestParams.body.environment,e.requestParams.headers.access_token&&delete e.requestParams.headers.access_token,e.requestParams.headers.authorization=e.live_preview.management_token):e.live_preview.live_preview&&(i=1))}var l=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),o||(t=q(t)),r(O(t))}catch(e){n(e)}}))}},f=function(r,s,c){r&&u(e,t).then(function(t){try{n.entry_uid=n.asset_uid=n.tojson=n.queryCachePolicy=void 0;var r={},u={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2===i&&null!==n.provider?void n.provider.get(a,l()):c({error_code:141,error_message:"The requested entry doesn't exist."});r.assets=t.assets[0]}else t.items?u={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==i&&null!==n.provider?(n.provider.set(a,r,(function(e){try{return e&&c(e),o||(r=q(r)),s(O(r))}catch(e){return c(e)}})),s(O(r))):Object.keys(u).length?s(u):(o||(r=q(r)),s(O(r)))}catch(e){return c({message:e.message})}}.bind(n)).catch((function(e){if(2!==i||null===n.provider)return c(e);n.provider.get(a,l())}))};switch(i){case 1:return new Promise(function(){var r=v(p().mark((function r(i,u){return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===n.provider){r.next=5;break}return r.next=3,n.provider.get(a,function(){var r=v(p().mark((function r(n,a){var c,l;return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!n&&a){r.next=5;break}f(!0,i,u),r.next=29;break;case 5:if(r.prev=5,!(e._query&&Array.isArray(e._query.include)&&e._query.include.length>0)){r.next=17;break}if(c=e._query.include,l=k(c),!s){r.next=15;break}return r.next=13,P(l,a.entry,e,t);case 13:r.next=17;break;case 15:return r.next=17,Promise.all(a.entries.map(function(){var r=v(p().mark((function r(n){return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,P(l,n,e,t);case 2:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()));case 17:r.next=21;break;case 19:r.prev=19,r.t0=r.catch(5);case 21:return r.prev=21,o||(a=q(a)),r.abrupt("return",i(O(a)));case 26:return r.prev=26,r.t1=r.catch(21),r.abrupt("return",u(r.t1));case 29:r.next=34;break;case 31:return r.prev=31,r.t2=r.catch(0),r.abrupt("return",u(r.t2));case 34:case"end":return r.stop()}}),r,null,[[0,31],[5,19],[21,26]])})));return function(e,t){return r.apply(this,arguments)}}());case 3:r.next=6;break;case 5:f(!0,i,u);case 6:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}());case 2:case 0:case void 0:case-1:return new Promise((function(e,t){f(!0,e,t)}))}if(3===i)return new Promise((function(e,t){null!==n.provider&&n.provider.get(a,(function(r,n){try{r||!n?t(r):(o||(n=q(n)),e(O(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){f(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){f(!0,e,t)}))}))}function k(e){var t={};return e.forEach((function(e){!function(e){var r=(e=e.replace(/[\[]/gm,".").replace(/[\]]/gm,"")).split("."),n=r.pop();r.reduce((function(e,t){return e[t]=e[t]||{}}),t)[n]={}}(e)})),t}function P(e,t,r,n,i){return S.apply(this,arguments)}function S(){return S=v(p().mark((function e(t,r,n,i,o){var s,a,c,l,f,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h=function(){return h=v(p().mark((function e(t,r,o){var h,d,g,m,b,_;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==r){e.next=2;break}return e.abrupt("return");case 2:if(!Array.isArray(r)){e.next=7;break}return e.next=5,Promise.all(r.map((function(e,n){return f(t,e,(function(e){r[n]=e}))})));case 5:e.next=37;break;case 7:if(r._content_type_uid!==c){e.next=35;break}return e.prev=8,n.requestParams=JSON.parse(JSON.stringify(a)),h=j(t),n.requestParams.body.include=h,n.requestParams.body.live_preview=s.live_preview,n.requestParams.body.content_type_uid=c,d=s.host.match(/^((http[s]?):(\/\/)?)?(.+)$/),g=(d[1]||"https://")+d[4],m=r.uid,b="".concat(g,"/v3/content_types/").concat(r._content_type_uid,"/entries/").concat(m),n.requestParams.url=b,n.requestParams.method="GET",delete n.requestParams.headers.access_token,n.requestParams.headers.authorization=l,e.next=24,u(n,i);case 24:(_=e.sent).entry._content_type_uid=c,_.entry.uid=m,o(_.entry),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(8),console.log("errror",e.t0);case 33:e.next=37;break;case 35:return e.next=37,Promise.all(Object.entries(t).map(function(){var e=v(p().mark((function e(t){var n,i,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=y(t,2),i=n[0],o=n[1],e.next=4,f(o,r[i],(function(){}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 37:case"end":return e.stop()}}),e,null,[[8,30]])}))),h.apply(this,arguments)},f=function(e,t,r){return h.apply(this,arguments)},s=n.live_preview,a=n.requestParams,c=s.content_type_uid,l=s.management_token,e.next=6,f(t,r,(function(){}));case 6:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}function j(e){var t=[];return function e(r,n){0===Object.keys(r).length?t.push(n.substring(1)):Object.entries(r).forEach((function(t){var r=y(t,2),i=r[0];e(r[1],[n,i].join("."))}))}(e,""),t.filter((function(e){return""!==e}))}function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==x(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===x(i)?i:String(i)),n)}var i}Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then((function(t){return e.apply(e,t)})).catch((function(e){t(e)}))});var T=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=m("only"),this.except=m("except"),this}var t,r;return t=e,r=[{key:"setCacheProvider",value:function(e){return e&&"object"===x(e)&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","First argument should be a String.")}},{key:"includeEmbeddedItems",value:function(){return this._query.include_embedded_items=["BASE"],this}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeBranch",value:function(){return this._query.include_branch=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return console.warn("The includeOwner function is deprecated."),this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"fetch",value:function(e){var t=this.config.host+":"+this.config.port;if(this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(t=this.live_preview.host),this.entry_uid){this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+t+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var r=b(this.fetchOptions,e);return w(b({},this),r)}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide an entry uid. e.g. .Entry('asset_uid')")}}],r&&E(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==A(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===A(i)?i:String(i)),n)}var i}var H=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=m("only"),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide a valid parameters.")}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=b(this.fetchOptions,e);return w(b({},this),t)}e.debug&&e.logHandler("error","Kindly provide an asset uid. e.g. .Assets('asset_uid')")}}])&&C(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==K(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===K(i)?i:String(i)),n)}var i}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}var G=function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},I=function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},$=function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},B=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof F&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===K(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},J=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a string.")}},U=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a number.")}};function D(e,t,r,n){var i;switch(e){case"asset":i=n+t.urls.assets;break;case"taxonomy":i=n+t.urls.taxonomies;break;default:i=n+t.urls.content_types+r+t.urls.entries}return i}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(s,e);var t,r,n,i,o=(n=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=L(n);if(i){var r=L(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===K(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this))._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=G("$lt"),e.lessThanOrEqualTo=G("$lte"),e.greaterThan=G("$gt"),e.greaterThanOrEqualTo=G("$gte"),e.notEqualTo=G("$ne"),e.containedIn=I(!0),e.notContainedIn=I(!1),e.exists=$(!0),e.notExists=$(!1),e.ascending=J("asc"),e.descending=J("desc"),e.beforeUid=J("before_uid"),e.afterUid=J("after_uid"),e.skip=U("skip"),e.limit=U("limit"),e.or=B("$or"),e.and=B("$and"),e}return t=s,(r=[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=D(this.type,this.config,this.content_type_uid,e);return this._query.count=!0,this.requestParams={method:"POST",headers:b({},this.headers),url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===K(e))return this._query.query=b(this._query.query,e),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,t){var r={};return t instanceof s&&t._query.query?r.$in_query=t._query.query:"object"===K(t)&&(r.$in_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"referenceNotIn",value:function(e,t){var r={};return t instanceof s&&t._query.query?r.$nin_query=t._query.query:"object"===K(t)&&(r.$nin_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.host+":"+this.config.port;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(t=this.live_preview.host);var r=this.config.protocol+"://"+t+"/"+this.config.version,n=D(this.type,this.config,this.content_type_uid,r);this.requestParams={method:"POST",headers:b({},this.headers),url:n,body:{_method:"GET",query:this._query}};var i=b(this.fetchOptions,e);return w(b({},this),i)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(e=this.config.protocol+"://"+this.live_preview.host+"/"+this.config.version);var t=D(this.type,this.config,this.content_type_uid,e);this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:b({},this.headers),url:t,body:{_method:"GET",query:this._query}};var r=b({},this.fetchOptions);return w(b({},this),r)}}])&&N(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(T);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Q(e,t)}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},z(e)}var W=function(e){return function(t,r,n){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,n&&"number"==typeof n&&(this._query.query[t].levels=n),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q(e,t)}(o,e);var t,r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=z(r);if(n){var i=z(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).above=W("$above"),e.equalAndAbove=W("$eq_above"),e.below=W("$below"),e.equalAndBelow=W("$eq_below"),e}return t=o,Object.defineProperty(t,"prototype",{writable:!1}),t}(F);const Z=require("localStorage"),X=r.n(Z)();function V(e){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(e)}function ee(){return X||null}function te(){return X?Object.keys(X):[]}var re={};function ne(e,t){!t&&e&&e.length&&e.push("");var r,n=te(),i=ee();if(e&&e.length){r=e.join(".");for(var o=0,s=n.length;o<s;o++)n[o]&&0===n[o].indexOf(r)&&delete i[n[o]]}else for(var u=0,a=n.length;u<a;u++)delete i[n[u]]}re.get=function(e,t){try{t(null,function(e){var t=X.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null}(e))}catch(e){t(e)}},re.set=function(e,t,r){try{e&&t&&function(e,t){try{"object"===V(t)?X.setItem(e,JSON.stringify(t)):X.setItem(e,t)}catch(e){}}(e,t),r()}catch(e){r(e)}},re.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),ne(r),t()}}catch(e){callback(e)}},re.clearByQuery=function(e,t){try{for(var r=te(),n=ee(),i=0,o=r.length;i<o;i++)r[i]&&~r[i].indexOf(e)&&delete n[r[i]];t()}catch(e){t(e)}},re.clearAll=function(e){try{ne(),e()}catch(t){e(t)}};const ie=re;const oe={providers:function(e){if(e)return ie;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};function se(e){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},se(e)}function ue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==se(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===se(i)?i:String(i)),n)}var i}var ae=[408,429],ce=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!ae.includes(e.status)},debug:!1,logHandler:function(e,t){"error"===e&&t?console.error("[error] ".concat(t)):"warning"===e&&t?console.warn("[warning] ".concat(t)):"info"===e&&t&&console.info("[info] ".concat(t))}},this.config=JSON.parse(JSON.stringify(n)),this.plugins=[];for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];switch(i[0].region&&void 0!==i[0].region&&"us"!==i[0].region&&(this.config.host=i[0].region+"-cdn.contentstack.com"),i[0].fetchOptions&&void 0!==i[0].fetchOptions&&(this.fetchOptions=b(this.fetchOptions,i[0].fetchOptions)),i[0].plugins&&void 0!==i[0].plugins&&i[0].plugins.forEach((function(e){t.plugins.push(e)})),this.cachePolicy=oe.policies.IGNORE_CACHE,this.provider=oe.providers("localstorage"),i.length){case 1:if("object"===se(i[0])&&"string"==typeof i[0].api_key&&"string"==typeof i[0].delivery_token&&"string"==typeof i[0].environment)return this.headers={api_key:i[0].api_key,access_token:i[0].delivery_token},"object"==se(i[0].live_preview)&&(this.live_preview=b(this.config.live_preview,i[0].live_preview)),"string"==typeof i[0].branch&&void 0!==i[0].branch&&(this.headers.branch=i[0].branch),"object"==se(i[0].early_access)&&Array.isArray(i[0].early_access)&&i[0].early_access.length>0&&(this.headers["x-header-ea"]=i[0].early_access.join(",")),this.environment=i[0].environment,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if(this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2])return this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2],this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters.");case 4:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2]?(this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),i[3]&&("string"==typeof i[3]&&void 0!==i[3]&&"us"!==i[3]?this.config.host=i[3]+"-cdn.contentstack.com":"object"===se(i[3])&&(this.fetchOptions=b(this.fetchOptions,i[3]))),this;case 5:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2]?(this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),i[3]&&("string"==typeof i[3]&&void 0!==i[3]&&"us"!==i[3]?this.config.host=i[3]+"-cdn.contentstack.com":"object"===se(i[3])&&(this.fetchOptions=b(this.fetchOptions,i[3]))),i[4]&&"object"===se(i[4])&&(this.fetchOptions=b(this.fetchOptions,i[4])),this;default:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}var t,r;return t=e,r=[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"livePreviewQuery",value:function(e){this.live_preview&&(this.live_preview.live_preview=e.live_preview||"init",this.live_preview.content_type_uid=e.content_type_uid,this.live_preview.entry_uid=e.entry_uid)}},{key:"setCacheProvider",value:function(e){return e&&"object"===se(e)&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Taxonomies",value:function(){return this.type="taxonomy",_(new Y,this)}},{key:"Entry",value:function(e){var t=new T;return e&&"string"==typeof e&&(t.entry_uid=e),_(t,this)}},{key:"fetch",value:function(e){return this.requestParams={method:"POST",headers:b({},this.headers),plugins:this.plugins,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}},u(this,b(this.fetchOptions,e))}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new H;return t.asset_uid=e,_(t,this)}return this}},{key:"Query",value:function(){return _("contentType"===this.type?new Y:new F,this)}},{key:"getLastActivities",value:function(){return this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}},u(this,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}},e)for(var t in e)this.requestParams.body[t]=e[t];return u(this,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=b(this._query,e),this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=b(this.fetchOptions,t);return w(b({},this),r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===se(t)&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}],r&&ue(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const le={EU:"eu",US:"us",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na"};function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function ye(e,t,r){return ye=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&he(i,r.prototype),i},ye.apply(null,arguments)}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},he(e,t)}function pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==fe(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===fe(i)?i:String(i)),n)}var i}e=r.hmd(e);var de=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=oe.policies,this.Region=le,this.Utils=r(464)}var t,n;return t=e,n=[{key:"Stack",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ye(ce,t)}}],n&&pe(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=new de},464:e=>{e.exports=require("@contentstack/utils")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n](o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=r(310);module.exports=n})();
(()=>{"use strict";var e={259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"rest-preview.contentstack.com"}}},29:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(280))&&n.__esModule?n:{default:n},o={providers:function(e){if(e)return i.default;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};t.default=o},280:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(187));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}var u={};function s(e,t){!t&&e&&e.length&&e.push("");var r,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var u=0,s=n.length;u<s;u++)n[u]&&0===n[u].indexOf(r)&&delete o[n[u]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}u.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},u.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},u.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),s(r),t()}}catch(e){callback(e)}},u.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,u=r.length;o<u;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},u.clearAll=function(e){try{s(),e()}catch(t){e(t)}},t.default=u},187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e){var t=i.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null},t.getKeys=function(){return i.default?Object.keys(i.default):[]},t.getStorage=function(){return i.default||null},t.set=function(e,t){try{"object"===o(t)?i.default.setItem(e,JSON.stringify(t)):i.default.setItem(e,t)}catch(e){}};var n,i=(n=r(944))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}},28:(e,t,r)=>{var n=u(r(88)),i=u(r(29)),o=u(r(871));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t,r){return a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i},a.apply(null,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===s(i)?i:String(i)),n)}var i}var f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=i.default.policies,this.Region=o.default,this.Utils=r(464)}var t,u;return t=e,u=[{key:"Stack",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(n.default,t)}}],u&&l(t.prototype,u),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=new f},871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={EU:"eu",US:"us",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na"}},517:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=e.requestParams;return new Promise((function(n,i){var o;return r.headers["Content-Type"]="application/json; charset=UTF-8",r.headers["X-User-Agent"]="contentstack-delivery-javascript-react-native/"+a,r.body&&"object"===s(r.body)&&(delete r.body._method,"object"===s(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,o=function e(t,r){var n=[];if("object"===s(t)&&void 0!==t.length)for(var i=0,o=t.length;i<o;i++)n.push(r+"[]="+t[i]);else for(var u in t){var a=r?r+"["+u+"]":u,c=t[u];n.push(null!==c&&"object"===s(c)&&"query"!==u?e(c,a):a+"="+encodeURIComponent("query"!==u?c:JSON.stringify(c)))}return n.join("&")}(r.body)),c(e,o,t,n,i,t.retryDelay,t.retryLimit)}))};var n,i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=s(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=(n=r(179))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var a="3.19.0";function c(e,t,r,n,u){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,l=e.requestParams,f=l.url+"?"+t,y=l.headers,p=i.mergeDeep({method:"GET",headers:y,timeout:3e4},r);r.debug&&r.logHandler("info",{url:f,option:p});var h={url:f,option:p},d=e.plugins;if(d&&void 0!==d)for(var v=0;v<d.length;v++)"function"==typeof d[v].onRequest&&(h=d[v].onRequest(e,h));(0,o.default)(h.url,h.option).then((function(i){r.debug&&r.logHandler("info",i);var o=i.json();if(i.ok&&200===i.status)o.then((function(t){for(var r=0;r<d.length&&"function"==typeof d[r].onResponse;r++)t=d[r].onResponse(e,h,i,t);n(t)}));else{var l=i.status,f=i.statusText;o.then((function(o){var y={error_message:o.error_message,error_code:o.error_code,errors:o.errors,status:l,statusText:f};r.retryCondition&&r.retryCondition(i)?function(i){if(0===a)r.debug&&r.logHandler("error",i),u(i);else{var o=s;a-=1;var l=r.retryLimit-a;r.retryDelayOptions&&(r.retryDelayOptions.base?o=r.retryDelayOptions.base*l:r.retryDelayOptions.customBackoff&&(o=r.retryDelayOptions.customBackoff(l,i))),function(e){return new Promise((function(t){setTimeout(t,e)}))}(o).then((function(){return c(e,t,r,n,u,s,a)})).catch((function(){return c(e,t,r,n,u,s,a)}))}}(y):(r.debug&&r.logHandler("error",y),u(y))})).catch((function(){r.debug&&r.logHandler("error",{status:l,statusText:f}),u({status:l,statusText:f})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),u(e)}))}},5:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._type=function(e){var t=c(e);return"object"===t&&Array.isArray(e)&&(t="array"),t},t.generateHash=p,t.getHash=y,t.isBrowser=function(){return"undefined"!=typeof window&&"object"===("undefined"==typeof process?"undefined":c(process))&&"browser"===process.title},t.merge=l,t.mergeDeep=function(e,t){var r=this;return function e(t,n){for(var i in n)"object"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?e(t[i],n[i]):"array"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?t[i]=t[i].concat(n[i]):t[i]=n[i]}(e,t),e},t.parseQueryFromParams=f,t.resultWrapper=h,t.sendRequest=function(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var i=e,o=void 0!==i.queryCachePolicy?i.queryCachePolicy:i.cachePolicy,s=void 0!==i.tojson&&i.tojson,p=!!(i.entry_uid||i.singleEntry||i.asset_uid),v=y(f(i,p,s));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var g=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==c(g)&&(g=JSON.parse(g)),delete e.requestParams.body.query,e.requestParams.body=l(e.requestParams.body,g),e.live_preview&&!0===e.live_preview.enable&&e.live_preview.live_preview&&"init"!==e.live_preview.live_preview&&(e.requestParams.body=l(e.requestParams.body,{live_preview:e.live_preview.live_preview||"init"}),o=2,e.requestParams.body.environment&&delete e.requestParams.body.environment,e.requestParams.headers.access_token&&delete e.requestParams.headers.access_token,delete e.requestParams.headers.authorization,delete e.requestParams.headers.preview_token,e.live_preview.preview_token?(e.requestParams.headers.preview_token=e.live_preview.preview_token,e.requestParams.headers.live_preview=e.live_preview.live_preview):e.live_preview.management_token&&(e.requestParams.headers.authorization=e.live_preview.management_token))}var _=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),s||(t=h(t)),r(d(t))}catch(e){n(e)}}))}},b=function(r,u,a){r&&(0,n.default)(e,t).then(function(t){try{i.entry_uid=i.asset_uid=i.tojson=i.queryCachePolicy=void 0;var r={},n={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2===o&&null!==i.provider?void i.provider.get(v,_()):a({error_code:141,error_message:"The requested entry doesn't exist."});r.assets=t.assets[0]}else t.items?n={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==o&&null!==i.provider?(i.provider.set(v,r,(function(e){try{return e&&a(e),s||(r=h(r)),u(d(r))}catch(e){return a(e)}})),u(d(r))):Object.keys(n).length?u(n):(s||(r=h(r)),u(d(r)))}catch(e){return a({message:e.message})}}.bind(i)).catch((function(e){if(2!==o||null===i.provider)return a(e);i.provider.get(v,_())}))};switch(o){case 1:return new Promise(function(){var e=a(u().mark((function e(t,r){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===i.provider){e.next=5;break}return e.next=3,i.provider.get(v,function(){var e=a(u().mark((function e(n,i){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!n&&i){e.next=5;break}b(!0,t,r),e.next=7;break;case 5:return s||(i=h(i)),e.abrupt("return",t(d(i)));case 7:e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",r(e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t,r){return e.apply(this,arguments)}}());case 3:e.next=6;break;case 5:b(!0,t,r);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 2:case 0:case void 0:case-1:return new Promise((function(e,t){b(!0,e,t)}))}if(3===o)return new Promise((function(e,t){null!==i.provider&&i.provider.get(v,(function(r,n){try{r||!n?t(r):(s||(n=h(n)),e(d(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){b(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){b(!0,e,t)}))}))},t.spreadResult=d,t.transform=function(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}};var n=o(r(517)),i=o(r(484));function o(e){return e&&e.__esModule?e:{default:e}}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function y(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,u=Object.create(o.prototype),s=new M(n||[]);return i(u,"_invoke",{value:E(e,r,s)}),u}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=y;var h="suspendedStart",d="suspendedYield",v="executing",g="completed",_={};function b(){}function m(){}function O(){}var w={};f(w,s,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(A([])));k&&k!==r&&n.call(k,s)&&(w=k);var P=O.prototype=b.prototype=Object.create(w);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,o,u,s){var a=p(e[i],e,o);if("throw"!==a.type){var l=a.arg,f=l.value;return f&&"object"==c(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return r("throw",e,u,s)}))}s(a.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function E(t,r,n){var i=h;return function(o,u){if(i===v)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw u;return{value:e,done:!0}}for(n.method=o,n.arg=u;;){var s=n.delegate;if(s){var a=T(s,n);if(a){if(a===_)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?g:d,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function T(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,_;var u=o.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,_):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(c(t)+" is not iterable")}return m.prototype=O,i(P,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:m,configurable:!0}),m.displayName=f(O,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,f(e,l,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},j(S.prototype),f(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new S(y(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(P),f(P,l,"Generator"),f(P,s,(function(){return this})),f(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var a=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),_}},t}function s(e,t,r,n,i,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function u(e){s(o,n,i,u,a,"next",e)}function a(e){s(o,n,i,u,a,"throw",e)}u(void 0)}))}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function f(e,t,r){if(e&&e.requestParams){var n=l({},e.requestParams.body&&e.requestParams.body.query||{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function y(e){try{var t=p(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function p(e){var t,r,n=0;if(0===e.length)return n;for(t=0,r=e.length;t<r;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n<-1?-1*n:n}function h(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,i.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,i.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,i.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,i.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,i.default)(e.items).toJSON());return e}function d(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then((function(t){return e.apply(e,t)})).catch((function(e){t(e)}))})},876:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===o(i)?i:String(i)),n)}var i}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide a valid parameters.")}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),t)}e.debug&&e.logHandler("error","Kindly provide an asset uid. e.g. .Assets('asset_uid')")}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},441:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===o(i)?i:String(i)),n)}var i}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this.except=n.transform("except"),this}var t,r;return t=e,r=[{key:"setCacheProvider",value:function(e){return e&&"object"===o(e)&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","First argument should be a String.")}},{key:"includeEmbeddedItems",value:function(){return this._query.include_embedded_items=["BASE"],this}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeBranch",value:function(){return this._query.include_branch=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return console.warn("The includeOwner function is deprecated."),this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"fetch",value:function(e){var t=this.config.host+":"+this.config.port;if(this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(t=this.live_preview.host),this.entry_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+t+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var r=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),r)}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide an entry uid. e.g. .Entry('asset_uid')")}}],r&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},525:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=l(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=(n=r(441))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==l(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===l(i)?i:String(i)),n)}var i}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var f=function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},y=function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},p=function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},h=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof _&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===l(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},d=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a string.")}},v=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a number.")}};function g(e,t,r,n){var i;switch(e){case"asset":i=n+t.urls.assets;break;case"taxonomy":i=n+t.urls.taxonomies;break;default:i=n+t.urls.content_types+r+t.urls.entries}return i}var _=t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(_,e);var t,r,n,o,u=(n=_,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(n);if(o){var r=c(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function _(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_),(e=u.call(this))._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=f("$lt"),e.lessThanOrEqualTo=f("$lte"),e.greaterThan=f("$gt"),e.greaterThanOrEqualTo=f("$gte"),e.notEqualTo=f("$ne"),e.containedIn=y(!0),e.notContainedIn=y(!1),e.exists=p(!0),e.notExists=p(!1),e.ascending=d("asc"),e.descending=d("desc"),e.beforeUid=d("before_uid"),e.afterUid=d("after_uid"),e.skip=v("skip"),e.limit=v("limit"),e.or=h("$or"),e.and=h("$and"),e}return t=_,(r=[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=g(this.type,this.config,this.content_type_uid,e);return this._query.count=!0,this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===l(e))return this._query.query=i.mergeDeep(this._query.query,e),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,t){var r={};return t instanceof _&&t._query.query?r.$in_query=t._query.query:"object"===l(t)&&(r.$in_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"referenceNotIn",value:function(e,t){var r={};return t instanceof _&&t._query.query?r.$nin_query=t._query.query:"object"===l(t)&&(r.$nin_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.host+":"+this.config.port;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(t=this.live_preview.host);var r=this.config.protocol+"://"+t+"/"+this.config.version,n=g(this.type,this.config,this.content_type_uid,r);this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:n,body:{_method:"GET",query:this._query}};var o=i.mergeDeep(this.fetchOptions,e);return i.sendRequest(i.mergeDeep({},this),o)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(e=this.config.protocol+"://"+this.live_preview.host+"/"+this.config.version);var t=g(this.type,this.config,this.content_type_uid,e);this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}};var r=i.mergeDeep({},this.fetchOptions);return i.sendRequest(i.mergeDeep({},this),r)}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),_}(o.default)},484:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===o(i)?i:String(i)),n)}var i}t.default=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.object=function(){return t}),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.object()?n.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e)return e.split(".").reduce((function(e,t){return e[t]}),this.object())}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null;return t?t+"?disposition="+(e&&"string"==typeof e?e:"attachment"):null}}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},987:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=r(525))&&i.__esModule?i:{default:i};function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var a=function(e){return function(t,r,n){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,n&&"number"==typeof n&&(this._query.query[t].levels=n),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}};t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(c,e);var t,r,i,o=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=s(r);if(i){var o=s(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(e=o.call(this)).above=a("$above"),e.equalAndAbove=a("$eq_above"),e.below=a("$below"),e.equalAndBelow=a("$eq_below"),e}return t=c,Object.defineProperty(t,"prototype",{writable:!1}),t}(o.default)},88:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=y(r(259)),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=p(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=y(r(441)),u=y(r(876)),s=y(r(525)),a=y(r(987)),c=y(r(517)),l=y(r(29));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function y(e){return e&&e.__esModule?e:{default:e}}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===p(i)?i:String(i)),n)}var i}var d=[408,429];t.default=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!d.includes(e.status)},debug:!1,logHandler:function(e,t){"error"===e&&t?console.error("[error] ".concat(t)):"warning"===e&&t?console.warn("[warning] ".concat(t)):"info"===e&&t&&console.info("[info] ".concat(t))}},this.config=JSON.parse(JSON.stringify(n.default)),this.plugins=[];for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];switch(o[0].live_preview&&!0===o[0].live_preview.enable&&null!==o[0].live_preview.management_token&&o[0].live_preview.management_token&&(this.config.live_preview.host="api.contentstack.io"),o[0].region&&void 0!==o[0].region&&"us"!==o[0].region&&(this.config.host=o[0].region+"-cdn.contentstack.com",o[0].live_preview&&!0===o[0].live_preview.enable&&(o[0].live_preview.management_token?this.config.live_preview.host=o[0].region+"-api.contentstack.com":this.config.live_preview.host=o[0].region+"-rest-preview.contentstack.com")),o[0].fetchOptions&&void 0!==o[0].fetchOptions&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[0].fetchOptions)),o[0].plugins&&void 0!==o[0].plugins&&o[0].plugins.forEach((function(e){t.plugins.push(e)})),this.cachePolicy=l.default.policies.IGNORE_CACHE,this.provider=l.default.providers("localstorage"),o.length){case 1:if("object"===p(o[0])&&"string"==typeof o[0].api_key&&"string"==typeof o[0].delivery_token&&"string"==typeof o[0].environment)return this.headers={api_key:o[0].api_key,access_token:o[0].delivery_token},"object"==p(o[0].live_preview)&&(this.live_preview=i.mergeDeep(this.config.live_preview,o[0].live_preview)),"string"==typeof o[0].branch&&void 0!==o[0].branch&&(this.headers.branch=o[0].branch),"object"==p(o[0].early_access)&&Array.isArray(o[0].early_access)&&o[0].early_access.length>0&&(this.headers["x-header-ea"]=o[0].early_access.join(",")),this.environment=o[0].environment,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if(this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2])return this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2],this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters.");case 4:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2]?(this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),o[3]&&("string"==typeof o[3]&&void 0!==o[3]&&"us"!==o[3]?this.config.host=o[3]+"-cdn.contentstack.com":"object"===p(o[3])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[3]))),this;case 5:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2]?(this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),o[3]&&("string"==typeof o[3]&&void 0!==o[3]&&"us"!==o[3]?this.config.host=o[3]+"-cdn.contentstack.com":"object"===p(o[3])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[3]))),o[4]&&"object"===p(o[4])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[4])),this;default:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}var t,r;return t=e,r=[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"livePreviewQuery",value:function(e){this.live_preview&&(this.live_preview.live_preview=e.live_preview||"init",this.live_preview.content_type_uid=e.content_type_uid,this.live_preview.entry_uid=e.entry_uid)}},{key:"setCacheProvider",value:function(e){return e&&"object"===p(e)&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Taxonomies",value:function(){return this.type="taxonomy",i.merge(new a.default,this)}},{key:"Entry",value:function(e){var t=new o.default;return e&&"string"==typeof e&&(t.entry_uid=e),i.merge(t,this)}},{key:"fetch",value:function(e){this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),plugins:this.plugins,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}};var t=i.mergeDeep(this.fetchOptions,e);return(0,c.default)(this,t)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new u.default;return t.asset_uid=e,i.merge(t,this)}return this}},{key:"Query",value:function(){var e="contentType"===this.type?new a.default:new s.default;return i.merge(e,this)}},{key:"getLastActivities",value:function(){return this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}},(0,c.default)(this,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}},e)for(var t in e)this.requestParams.body[t]=e[t];return(0,c.default)(this,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=i.mergeDeep(this._query,e),this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=i.mergeDeep(this.fetchOptions,t);return i.sendRequest(i.mergeDeep({},this),r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===p(t)&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}],r&&h(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},179:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=fetch},944:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(118))&&n.__esModule?n:{default:n};t.default=i.default},464:e=>{e.exports=require("@contentstack/utils")},118:e=>{e.exports=require("localStorage")}},t={},r=function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(28);module.exports=r})();
/*! For license information please see contentstack.js.LICENSE.txt */
(()=>{"use strict";var e={259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"api.contentstack.io"}}},29:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(280))&&n.__esModule?n:{default:n},i={providers:function(e){if(e)return o.default;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};t.default=i},280:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(o,s,a):o[s]=e[s]}return o.default=e,r&&r.set(e,o),o}(r(187));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}var u={};function s(e,t){!t&&e&&e.length&&e.push("");var r,n=o.getKeys(),i=o.getStorage();if(e&&e.length){r=e.join(".");for(var u=0,s=n.length;u<s;u++)n[u]&&0===n[u].indexOf(r)&&delete i[n[u]]}else for(var a=0,c=n.length;a<c;a++)delete i[n[a]]}u.get=function(e,t){try{t(null,o.get(e))}catch(e){t(e)}},u.set=function(e,t,r){try{e&&t&&o.set(e,t),r()}catch(e){r(e)}},u.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),s(r),t()}}catch(e){callback(e)}},u.clearByQuery=function(e,t){try{for(var r=o.getKeys(),n=o.getStorage(),i=0,u=r.length;i<u;i++)r[i]&&~r[i].indexOf(e)&&delete n[r[i]];t()}catch(e){t(e)}},u.clearAll=function(e){try{s(),e()}catch(t){e(t)}},t.default=u},187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e){var t=o.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null},t.getKeys=function(){return o.default?Object.keys(o.default):[]},t.getStorage=function(){return o.default||null},t.set=function(e,t){try{"object"===i(t)?o.default.setItem(e,JSON.stringify(t)):o.default.setItem(e,t)}catch(e){}};var n,o=(n=r(830))&&n.__esModule?n:{default:n};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}},28:(e,t,r)=>{var n=u(r(88)),o=u(r(29)),i=u(r(871));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t,r){return a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o},a.apply(null,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===s(o)?o:String(o)),n)}var o}var f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=o.default.policies,this.Region=i.default,this.Utils=r(464)}var t,u;return t=e,u=[{key:"Stack",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(n.default,t)}}],u&&l(t.prototype,u),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=new f},871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={EU:"eu",US:"us",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na"}},517:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=e.requestParams;return new Promise((function(n,o){var i;return r.headers["Content-Type"]="application/json; charset=UTF-8",r.headers["X-User-Agent"]="contentstack-delivery-javascript-nodejs/"+a,r.body&&"object"===s(r.body)&&(delete r.body._method,"object"===s(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,i=function e(t,r){var n=[];if("object"===s(t)&&void 0!==t.length)for(var o=0,i=t.length;o<i;o++)n.push(r+"[]="+t[o]);else for(var u in t){var a=r?r+"["+u+"]":u,c=t[u];n.push(null!==c&&"object"===s(c)&&"query"!==u?e(c,a):a+"="+encodeURIComponent("query"!==u?c:JSON.stringify(c)))}return n.join("&")}(r.body)),c(e,i,t,n,o,t.retryDelay,t.retryLimit)}))};var n,o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=s(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(5)),i=(n=r(319))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var a="3.18.1";function c(e,t,r,n,u){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,l=e.requestParams,f=l.url+"?"+t,y=l.headers,p=o.mergeDeep({method:"GET",headers:y,timeout:3e4},r);r.debug&&r.logHandler("info",{url:f,option:p});var h={url:f,option:p},d=e.plugins;if(d&&void 0!==d)for(var v=0;v<d.length;v++)"function"==typeof d[v].onRequest&&(h=d[v].onRequest(e,h));(0,i.default)(h.url,h.option).then((function(o){r.debug&&r.logHandler("info",o);var i=o.json();if(o.ok&&200===o.status)i.then((function(t){for(var r=0;r<d.length&&"function"==typeof d[r].onResponse;r++)t=d[r].onResponse(e,h,o,t);n(t)}));else{var l=o.status,f=o.statusText;i.then((function(i){var y={error_message:i.error_message,error_code:i.error_code,errors:i.errors,status:l,statusText:f};r.retryCondition&&r.retryCondition(o)?function(o){if(0===a)r.debug&&r.logHandler("error",o),u(o);else{var i=s;a-=1;var l=r.retryLimit-a;r.retryDelayOptions&&(r.retryDelayOptions.base?i=r.retryDelayOptions.base*l:r.retryDelayOptions.customBackoff&&(i=r.retryDelayOptions.customBackoff(l,o))),function(e){return new Promise((function(t){setTimeout(t,e)}))}(i).then((function(){return c(e,t,r,n,u,s,a)})).catch((function(){return c(e,t,r,n,u,s,a)}))}}(y):(r.debug&&r.logHandler("error",y),u(y))})).catch((function(){r.debug&&r.logHandler("error",{status:l,statusText:f}),u({status:l,statusText:f})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),u(e)}))}},5:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._type=function(e){var t=f(e);return"object"===t&&Array.isArray(e)&&(t="array"),t},t.generateHash=d,t.getHash=h,t.isBrowser=function(){return"undefined"!=typeof window&&"object"===("undefined"==typeof process?"undefined":f(process))&&"browser"===process.title},t.merge=y,t.mergeDeep=function(e,t){var r=this;return function e(t,n){for(var o in n)"object"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?e(t[o],n[o]):"array"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?t[o]=t[o].concat(n[o]):t[o]=n[o]}(e,t),e},t.parseQueryFromParams=p,t.resultWrapper=v,t.sendRequest=function(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var o=e,i=void 0!==o.queryCachePolicy?o.queryCachePolicy:o.cachePolicy,u=void 0!==o.tojson&&o.tojson,s=!!(o.entry_uid||o.singleEntry||o.asset_uid),c=h(p(o,s,u));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var d=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==f(d)&&(d=JSON.parse(d)),delete e.requestParams.body.query,e.requestParams.body=y(e.requestParams.body,d),e.live_preview&&!0===e.live_preview.enable&&e.live_preview.live_preview&&"init"!==e.live_preview.live_preview&&(e.live_preview.content_type_uid===e.content_type_uid?(e.requestParams.body=y(e.requestParams.body,{live_preview:e.live_preview.live_preview||"init"}),i=2,e.requestParams.body.environment&&delete e.requestParams.body.environment,e.requestParams.headers.access_token&&delete e.requestParams.headers.access_token,e.requestParams.headers.authorization=e.live_preview.management_token):e.live_preview.live_preview&&(i=1))}var m=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),u||(t=v(t)),r(g(t))}catch(e){n(e)}}))}},O=function(r,s,a){r&&(0,n.default)(e,t).then(function(t){try{o.entry_uid=o.asset_uid=o.tojson=o.queryCachePolicy=void 0;var r={},n={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2===i&&null!==o.provider?void o.provider.get(c,m()):a({error_code:141,error_message:"The requested entry doesn't exist."});r.assets=t.assets[0]}else t.items?n={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==i&&null!==o.provider?(o.provider.set(c,r,(function(e){try{return e&&a(e),u||(r=v(r)),s(g(r))}catch(e){return a(e)}})),s(g(r))):Object.keys(n).length?s(n):(u||(r=v(r)),s(g(r)))}catch(e){return a({message:e.message})}}.bind(o)).catch((function(e){if(2!==i||null===o.provider)return a(e);o.provider.get(c,m())}))};switch(i){case 1:return new Promise(function(){var r=l(a().mark((function r(n,i){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===o.provider){r.next=5;break}return r.next=3,o.provider.get(c,function(){var r=l(a().mark((function r(o,c){var f,y;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!o&&c){r.next=5;break}O(!0,n,i),r.next=29;break;case 5:if(r.prev=5,!(e._query&&Array.isArray(e._query.include)&&e._query.include.length>0)){r.next=17;break}if(f=e._query.include,y=_(f),!s){r.next=15;break}return r.next=13,b(y,c.entry,e,t);case 13:r.next=17;break;case 15:return r.next=17,Promise.all(c.entries.map(function(){var r=l(a().mark((function r(n){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,b(y,n,e,t);case 2:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()));case 17:r.next=21;break;case 19:r.prev=19,r.t0=r.catch(5);case 21:return r.prev=21,u||(c=v(c)),r.abrupt("return",n(g(c)));case 26:return r.prev=26,r.t1=r.catch(21),r.abrupt("return",i(r.t1));case 29:r.next=34;break;case 31:return r.prev=31,r.t2=r.catch(0),r.abrupt("return",i(r.t2));case 34:case"end":return r.stop()}}),r,null,[[0,31],[5,19],[21,26]])})));return function(e,t){return r.apply(this,arguments)}}());case 3:r.next=6;break;case 5:O(!0,n,i);case 6:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}());case 2:case 0:case void 0:case-1:return new Promise((function(e,t){O(!0,e,t)}))}if(3===i)return new Promise((function(e,t){null!==o.provider&&o.provider.get(c,(function(r,n){try{r||!n?t(r):(u||(n=v(n)),e(g(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){O(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){O(!0,e,t)}))}))},t.spreadResult=g,t.transform=function(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}};var n=i(r(517)),o=i(r(484));function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,u,s=[],a=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e,t)||function(){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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(){a=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function y(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,u=Object.create(i.prototype),s=new D(n||[]);return o(u,"_invoke",{value:x(e,r,s)}),u}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=y;var h="suspendedStart",d="suspendedYield",v="executing",g="completed",_={};function b(){}function m(){}function O(){}var w={};l(w,u,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(M([])));k&&k!==r&&n.call(k,u)&&(w=k);var P=O.prototype=b.prototype=Object.create(w);function j(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,i,u,s){var a=p(e[o],e,i);if("throw"!==a.type){var c=a.arg,l=c.value;return l&&"object"==f(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(l).then((function(e){c.value=e,u(c)}),(function(e){return r("throw",e,u,s)}))}s(a.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(t,r,n){var o=h;return function(i,u){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw u;return{value:e,done:!0}}for(n.method=i,n.arg=u;;){var s=n.delegate;if(s){var a=E(s,n);if(a){if(a===_)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=p(t,r,n);if("normal"===c.type){if(o=n.done?g:d,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var u=i.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,_):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(f(t)+" is not iterable")}return m.prototype=O,o(P,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:m,configurable:!0}),m.displayName=l(O,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,l(e,c,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},j(S.prototype),l(S.prototype,s,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var u=new S(y(e,r,n,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(P),l(P,c,"Generator"),l(P,u,(function(){return this})),l(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=M,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],s=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var a=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=e,u.arg=t,i?(this.method="next",this.next=i.finallyLoc,_):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),_}},t}function c(e,t,r,n,o,i,u){try{var s=e[i](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){c(i,n,o,u,s,"next",e)}function s(e){c(i,n,o,u,s,"throw",e)}u(void 0)}))}}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function y(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function p(e,t,r){if(e&&e.requestParams){var n=y({},e.requestParams.body&&e.requestParams.body.query||{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function h(e){try{var t=d(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function d(e){var t,r,n=0;if(0===e.length)return n;for(t=0,r=e.length;t<r;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n<-1?-1*n:n}function v(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,o.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,i=e.assets.length;n<i;n++)e.assets[n]=(0,o.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,o.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,o.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,o.default)(e.items).toJSON());return e}function g(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}function _(e){var t={};return e.forEach((function(e){!function(e){var r=(e=e.replace(/[\[]/gm,".").replace(/[\]]/gm,"")).split("."),n=r.pop();r.reduce((function(e,t){return e[t]=e[t]||{}}),t)[n]={}}(e)})),t}function b(e,t,r,n,o){return m.apply(this,arguments)}function m(){return m=l(a().mark((function e(t,r,o,i,s){var c,f,y,p,h,d;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=function(){return d=l(a().mark((function e(t,r,s){var d,v,g,_,b,m;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==r){e.next=2;break}return e.abrupt("return");case 2:if(!Array.isArray(r)){e.next=7;break}return e.next=5,Promise.all(r.map((function(e,n){return h(t,e,(function(e){r[n]=e}))})));case 5:e.next=37;break;case 7:if(r._content_type_uid!==y){e.next=35;break}return e.prev=8,o.requestParams=JSON.parse(JSON.stringify(f)),d=O(t),o.requestParams.body.include=d,o.requestParams.body.live_preview=c.live_preview,o.requestParams.body.content_type_uid=y,v=c.host.match(/^((http[s]?):(\/\/)?)?(.+)$/),g=(v[1]||"https://")+v[4],_=r.uid,b="".concat(g,"/v3/content_types/").concat(r._content_type_uid,"/entries/").concat(_),o.requestParams.url=b,o.requestParams.method="GET",delete o.requestParams.headers.access_token,o.requestParams.headers.authorization=p,e.next=24,(0,n.default)(o,i);case 24:(m=e.sent).entry._content_type_uid=y,m.entry.uid=_,s(m.entry),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(8),console.log("errror",e.t0);case 33:e.next=37;break;case 35:return e.next=37,Promise.all(Object.entries(t).map(function(){var e=l(a().mark((function e(t){var n,o,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u(t,2),o=n[0],i=n[1],e.next=4,h(i,r[o],(function(){}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 37:case"end":return e.stop()}}),e,null,[[8,30]])}))),d.apply(this,arguments)},h=function(e,t,r){return d.apply(this,arguments)},c=o.live_preview,f=o.requestParams,y=c.content_type_uid,p=c.management_token,e.next=6,h(t,r,(function(){}));case 6:case"end":return e.stop()}}),e)}))),m.apply(this,arguments)}function O(e){var t=[];return function e(r,n){0===Object.keys(r).length?t.push(n.substring(1)):Object.entries(r).forEach((function(t){var r=u(t,2),o=r[0];e(r[1],[n,o].join("."))}))}(e,""),t.filter((function(e){return""!==e}))}Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then((function(t){return e.apply(e,t)})).catch((function(e){t(e)}))})},876:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=i(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===i(o)?o:String(o)),n)}var o}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide a valid parameters.")}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),t)}e.debug&&e.logHandler("error","Kindly provide an asset uid. e.g. .Assets('asset_uid')")}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},441:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=i(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===i(o)?o:String(o)),n)}var o}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this.except=n.transform("except"),this}var t,r;return t=e,r=[{key:"setCacheProvider",value:function(e){return e&&"object"===i(e)&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","First argument should be a String.")}},{key:"includeEmbeddedItems",value:function(){return this._query.include_embedded_items=["BASE"],this}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeBranch",value:function(){return this._query.include_branch=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return console.warn("The includeOwner function is deprecated."),this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"fetch",value:function(e){var t=this.config.host+":"+this.config.port;if(this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(t=this.live_preview.host),this.entry_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+t+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var r=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),r)}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide an entry uid. e.g. .Entry('asset_uid')")}}],r&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},525:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=l(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(5)),i=(n=r(441))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==l(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===l(o)?o:String(o)),n)}var o}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var f=function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},y=function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},p=function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},h=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof _&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===l(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},d=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a string.")}},v=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a number.")}};function g(e,t,r,n){var o;switch(e){case"asset":o=n+t.urls.assets;break;case"taxonomy":o=n+t.urls.taxonomies;break;default:o=n+t.urls.content_types+r+t.urls.entries}return o}var _=t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(_,e);var t,r,n,i,u=(n=_,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(n);if(i){var r=c(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function _(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_),(e=u.call(this))._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=f("$lt"),e.lessThanOrEqualTo=f("$lte"),e.greaterThan=f("$gt"),e.greaterThanOrEqualTo=f("$gte"),e.notEqualTo=f("$ne"),e.containedIn=y(!0),e.notContainedIn=y(!1),e.exists=p(!0),e.notExists=p(!1),e.ascending=d("asc"),e.descending=d("desc"),e.beforeUid=d("before_uid"),e.afterUid=d("after_uid"),e.skip=v("skip"),e.limit=v("limit"),e.or=h("$or"),e.and=h("$and"),e}return t=_,(r=[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=g(this.type,this.config,this.content_type_uid,e);return this._query.count=!0,this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===l(e))return this._query.query=o.mergeDeep(this._query.query,e),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,t){var r={};return t instanceof _&&t._query.query?r.$in_query=t._query.query:"object"===l(t)&&(r.$in_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"referenceNotIn",value:function(e,t){var r={};return t instanceof _&&t._query.query?r.$nin_query=t._query.query:"object"===l(t)&&(r.$nin_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.host+":"+this.config.port;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(t=this.live_preview.host);var r=this.config.protocol+"://"+t+"/"+this.config.version,n=g(this.type,this.config,this.content_type_uid,r);this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),url:n,body:{_method:"GET",query:this._query}};var i=o.mergeDeep(this.fetchOptions,e);return o.sendRequest(o.mergeDeep({},this),i)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(e=this.config.protocol+"://"+this.live_preview.host+"/"+this.config.version);var t=g(this.type,this.config,this.content_type_uid,e);this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}};var r=o.mergeDeep({},this.fetchOptions);return o.sendRequest(o.mergeDeep({},this),r)}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),_}(i.default)},484:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=i(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===i(o)?o:String(o)),n)}var o}t.default=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.object=function(){return t}),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.object()?n.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e)return e.split(".").reduce((function(e,t){return e[t]}),this.object())}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null;return t?t+"?disposition="+(e&&"string"==typeof e?e:"attachment"):null}}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},987:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,i=(o=r(525))&&o.__esModule?o:{default:o};function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var a=function(e){return function(t,r,n){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,n&&"number"==typeof n&&(this._query.query[t].levels=n),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}};t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(c,e);var t,r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=s(r);if(o){var i=s(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(e=i.call(this)).above=a("$above"),e.equalAndAbove=a("$eq_above"),e.below=a("$below"),e.equalAndBelow=a("$eq_below"),e}return t=c,Object.defineProperty(t,"prototype",{writable:!1}),t}(i.default)},88:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=y(r(259)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=p(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(5)),i=y(r(441)),u=y(r(876)),s=y(r(525)),a=y(r(987)),c=y(r(517)),l=y(r(29));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function y(e){return e&&e.__esModule?e:{default:e}}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===p(o)?o:String(o)),n)}var o}var d=[408,429];t.default=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!d.includes(e.status)},debug:!1,logHandler:function(e,t){"error"===e&&t?console.error("[error] ".concat(t)):"warning"===e&&t?console.warn("[warning] ".concat(t)):"info"===e&&t&&console.info("[info] ".concat(t))}},this.config=JSON.parse(JSON.stringify(n.default)),this.plugins=[];for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];switch(i[0].region&&void 0!==i[0].region&&"us"!==i[0].region&&(this.config.host=i[0].region+"-cdn.contentstack.com"),i[0].fetchOptions&&void 0!==i[0].fetchOptions&&(this.fetchOptions=o.mergeDeep(this.fetchOptions,i[0].fetchOptions)),i[0].plugins&&void 0!==i[0].plugins&&i[0].plugins.forEach((function(e){t.plugins.push(e)})),this.cachePolicy=l.default.policies.IGNORE_CACHE,this.provider=l.default.providers("localstorage"),i.length){case 1:if("object"===p(i[0])&&"string"==typeof i[0].api_key&&"string"==typeof i[0].delivery_token&&"string"==typeof i[0].environment)return this.headers={api_key:i[0].api_key,access_token:i[0].delivery_token},"object"==p(i[0].live_preview)&&(this.live_preview=o.mergeDeep(this.config.live_preview,i[0].live_preview)),"string"==typeof i[0].branch&&void 0!==i[0].branch&&(this.headers.branch=i[0].branch),"object"==p(i[0].early_access)&&Array.isArray(i[0].early_access)&&i[0].early_access.length>0&&(this.headers["x-header-ea"]=i[0].early_access.join(",")),this.environment=i[0].environment,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if(this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2])return this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2],this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters.");case 4:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2]?(this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),i[3]&&("string"==typeof i[3]&&void 0!==i[3]&&"us"!==i[3]?this.config.host=i[3]+"-cdn.contentstack.com":"object"===p(i[3])&&(this.fetchOptions=o.mergeDeep(this.fetchOptions,i[3]))),this;case 5:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2]?(this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),i[3]&&("string"==typeof i[3]&&void 0!==i[3]&&"us"!==i[3]?this.config.host=i[3]+"-cdn.contentstack.com":"object"===p(i[3])&&(this.fetchOptions=o.mergeDeep(this.fetchOptions,i[3]))),i[4]&&"object"===p(i[4])&&(this.fetchOptions=o.mergeDeep(this.fetchOptions,i[4])),this;default:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}var t,r;return t=e,r=[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"livePreviewQuery",value:function(e){this.live_preview&&(this.live_preview.live_preview=e.live_preview||"init",this.live_preview.content_type_uid=e.content_type_uid,this.live_preview.entry_uid=e.entry_uid)}},{key:"setCacheProvider",value:function(e){return e&&"object"===p(e)&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Taxonomies",value:function(){return this.type="taxonomy",o.merge(new a.default,this)}},{key:"Entry",value:function(e){var t=new i.default;return e&&"string"==typeof e&&(t.entry_uid=e),o.merge(t,this)}},{key:"fetch",value:function(e){this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),plugins:this.plugins,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}};var t=o.mergeDeep(this.fetchOptions,e);return(0,c.default)(this,t)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new u.default;return t.asset_uid=e,o.merge(t,this)}return this}},{key:"Query",value:function(){var e="contentType"===this.type?new a.default:new s.default;return o.merge(e,this)}},{key:"getLastActivities",value:function(){return this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}},(0,c.default)(this,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}},e)for(var t in e)this.requestParams.body[t]=e[t];return(0,c.default)(this,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=o.mergeDeep(this._query,e),this.requestParams={method:"POST",headers:o.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=o.mergeDeep(this.fetchOptions,t);return o.sendRequest(o.mergeDeep({},this),r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===p(t)&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}],r&&h(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},319:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(858)),o=i(r(809));function i(e){return e&&e.__esModule?e:{default:e}}n.default.polyfill(),t.default=o.default},830:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(118))&&n.__esModule?n:{default:n};t.default=o.default},464:e=>{e.exports=require("@contentstack/utils")},858:e=>{e.exports=require("es6-promise")},118:e=>{e.exports=require("localStorage")},809:e=>{e.exports=require("node-fetch")}},t={},r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(28);module.exports=r})();
(()=>{"use strict";var e={259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"rest-preview.contentstack.com"}}},29:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(280))&&n.__esModule?n:{default:n},o={providers:function(e){if(e)return i.default;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};t.default=o},280:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(187));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}var u={};function s(e,t){!t&&e&&e.length&&e.push("");var r,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var u=0,s=n.length;u<s;u++)n[u]&&0===n[u].indexOf(r)&&delete o[n[u]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}u.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},u.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},u.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),s(r),t()}}catch(e){callback(e)}},u.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,u=r.length;o<u;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},u.clearAll=function(e){try{s(),e()}catch(t){e(t)}},t.default=u},187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e){var t=i.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null},t.getKeys=function(){return i.default?Object.keys(i.default):[]},t.getStorage=function(){return i.default||null},t.set=function(e,t){try{"object"===o(t)?i.default.setItem(e,JSON.stringify(t)):i.default.setItem(e,t)}catch(e){}};var n,i=(n=r(830))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}},28:(e,t,r)=>{var n=u(r(88)),i=u(r(29)),o=u(r(871));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t,r){return a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i},a.apply(null,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===s(i)?i:String(i)),n)}var i}var f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=i.default.policies,this.Region=o.default,this.Utils=r(464)}var t,u;return t=e,u=[{key:"Stack",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(n.default,t)}}],u&&l(t.prototype,u),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=new f},871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={EU:"eu",US:"us",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na"}},517:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=e.requestParams;return new Promise((function(n,i){var o;return r.headers["Content-Type"]="application/json; charset=UTF-8",r.headers["X-User-Agent"]="contentstack-delivery-javascript-nodejs/"+a,r.body&&"object"===s(r.body)&&(delete r.body._method,"object"===s(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,o=function e(t,r){var n=[];if("object"===s(t)&&void 0!==t.length)for(var i=0,o=t.length;i<o;i++)n.push(r+"[]="+t[i]);else for(var u in t){var a=r?r+"["+u+"]":u,c=t[u];n.push(null!==c&&"object"===s(c)&&"query"!==u?e(c,a):a+"="+encodeURIComponent("query"!==u?c:JSON.stringify(c)))}return n.join("&")}(r.body)),c(e,o,t,n,i,t.retryDelay,t.retryLimit)}))};var n,i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=s(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=(n=r(319))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var a="3.19.0";function c(e,t,r,n,u){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,l=e.requestParams,f=l.url+"?"+t,y=l.headers,p=i.mergeDeep({method:"GET",headers:y,timeout:3e4},r);r.debug&&r.logHandler("info",{url:f,option:p});var h={url:f,option:p},d=e.plugins;if(d&&void 0!==d)for(var v=0;v<d.length;v++)"function"==typeof d[v].onRequest&&(h=d[v].onRequest(e,h));(0,o.default)(h.url,h.option).then((function(i){r.debug&&r.logHandler("info",i);var o=i.json();if(i.ok&&200===i.status)o.then((function(t){for(var r=0;r<d.length&&"function"==typeof d[r].onResponse;r++)t=d[r].onResponse(e,h,i,t);n(t)}));else{var l=i.status,f=i.statusText;o.then((function(o){var y={error_message:o.error_message,error_code:o.error_code,errors:o.errors,status:l,statusText:f};r.retryCondition&&r.retryCondition(i)?function(i){if(0===a)r.debug&&r.logHandler("error",i),u(i);else{var o=s;a-=1;var l=r.retryLimit-a;r.retryDelayOptions&&(r.retryDelayOptions.base?o=r.retryDelayOptions.base*l:r.retryDelayOptions.customBackoff&&(o=r.retryDelayOptions.customBackoff(l,i))),function(e){return new Promise((function(t){setTimeout(t,e)}))}(o).then((function(){return c(e,t,r,n,u,s,a)})).catch((function(){return c(e,t,r,n,u,s,a)}))}}(y):(r.debug&&r.logHandler("error",y),u(y))})).catch((function(){r.debug&&r.logHandler("error",{status:l,statusText:f}),u({status:l,statusText:f})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),u(e)}))}},5:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._type=function(e){var t=c(e);return"object"===t&&Array.isArray(e)&&(t="array"),t},t.generateHash=p,t.getHash=y,t.isBrowser=function(){return"undefined"!=typeof window&&"object"===("undefined"==typeof process?"undefined":c(process))&&"browser"===process.title},t.merge=l,t.mergeDeep=function(e,t){var r=this;return function e(t,n){for(var i in n)"object"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?e(t[i],n[i]):"array"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?t[i]=t[i].concat(n[i]):t[i]=n[i]}(e,t),e},t.parseQueryFromParams=f,t.resultWrapper=h,t.sendRequest=function(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var i=e,o=void 0!==i.queryCachePolicy?i.queryCachePolicy:i.cachePolicy,s=void 0!==i.tojson&&i.tojson,p=!!(i.entry_uid||i.singleEntry||i.asset_uid),v=y(f(i,p,s));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var g=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==c(g)&&(g=JSON.parse(g)),delete e.requestParams.body.query,e.requestParams.body=l(e.requestParams.body,g),e.live_preview&&!0===e.live_preview.enable&&e.live_preview.live_preview&&"init"!==e.live_preview.live_preview&&(e.requestParams.body=l(e.requestParams.body,{live_preview:e.live_preview.live_preview||"init"}),o=2,e.requestParams.body.environment&&delete e.requestParams.body.environment,e.requestParams.headers.access_token&&delete e.requestParams.headers.access_token,delete e.requestParams.headers.authorization,delete e.requestParams.headers.preview_token,e.live_preview.preview_token?(e.requestParams.headers.preview_token=e.live_preview.preview_token,e.requestParams.headers.live_preview=e.live_preview.live_preview):e.live_preview.management_token&&(e.requestParams.headers.authorization=e.live_preview.management_token))}var _=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),s||(t=h(t)),r(d(t))}catch(e){n(e)}}))}},b=function(r,u,a){r&&(0,n.default)(e,t).then(function(t){try{i.entry_uid=i.asset_uid=i.tojson=i.queryCachePolicy=void 0;var r={},n={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2===o&&null!==i.provider?void i.provider.get(v,_()):a({error_code:141,error_message:"The requested entry doesn't exist."});r.assets=t.assets[0]}else t.items?n={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==o&&null!==i.provider?(i.provider.set(v,r,(function(e){try{return e&&a(e),s||(r=h(r)),u(d(r))}catch(e){return a(e)}})),u(d(r))):Object.keys(n).length?u(n):(s||(r=h(r)),u(d(r)))}catch(e){return a({message:e.message})}}.bind(i)).catch((function(e){if(2!==o||null===i.provider)return a(e);i.provider.get(v,_())}))};switch(o){case 1:return new Promise(function(){var e=a(u().mark((function e(t,r){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===i.provider){e.next=5;break}return e.next=3,i.provider.get(v,function(){var e=a(u().mark((function e(n,i){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!n&&i){e.next=5;break}b(!0,t,r),e.next=7;break;case 5:return s||(i=h(i)),e.abrupt("return",t(d(i)));case 7:e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",r(e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t,r){return e.apply(this,arguments)}}());case 3:e.next=6;break;case 5:b(!0,t,r);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 2:case 0:case void 0:case-1:return new Promise((function(e,t){b(!0,e,t)}))}if(3===o)return new Promise((function(e,t){null!==i.provider&&i.provider.get(v,(function(r,n){try{r||!n?t(r):(s||(n=h(n)),e(d(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){b(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){b(!0,e,t)}))}))},t.spreadResult=d,t.transform=function(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}};var n=o(r(517)),i=o(r(484));function o(e){return e&&e.__esModule?e:{default:e}}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function y(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,u=Object.create(o.prototype),s=new M(n||[]);return i(u,"_invoke",{value:E(e,r,s)}),u}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=y;var h="suspendedStart",d="suspendedYield",v="executing",g="completed",_={};function b(){}function m(){}function O(){}var w={};f(w,s,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(A([])));k&&k!==r&&n.call(k,s)&&(w=k);var P=O.prototype=b.prototype=Object.create(w);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,o,u,s){var a=p(e[i],e,o);if("throw"!==a.type){var l=a.arg,f=l.value;return f&&"object"==c(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return r("throw",e,u,s)}))}s(a.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function E(t,r,n){var i=h;return function(o,u){if(i===v)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw u;return{value:e,done:!0}}for(n.method=o,n.arg=u;;){var s=n.delegate;if(s){var a=T(s,n);if(a){if(a===_)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?g:d,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function T(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,_;var u=o.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,_):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(c(t)+" is not iterable")}return m.prototype=O,i(P,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:m,configurable:!0}),m.displayName=f(O,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,f(e,l,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},j(S.prototype),f(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new S(y(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(P),f(P,l,"Generator"),f(P,s,(function(){return this})),f(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var a=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),_}},t}function s(e,t,r,n,i,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function u(e){s(o,n,i,u,a,"next",e)}function a(e){s(o,n,i,u,a,"throw",e)}u(void 0)}))}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function f(e,t,r){if(e&&e.requestParams){var n=l({},e.requestParams.body&&e.requestParams.body.query||{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function y(e){try{var t=p(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function p(e){var t,r,n=0;if(0===e.length)return n;for(t=0,r=e.length;t<r;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n<-1?-1*n:n}function h(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,i.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,i.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,i.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,i.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,i.default)(e.items).toJSON());return e}function d(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then((function(t){return e.apply(e,t)})).catch((function(e){t(e)}))})},876:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===o(i)?i:String(i)),n)}var i}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide a valid parameters.")}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),t)}e.debug&&e.logHandler("error","Kindly provide an asset uid. e.g. .Assets('asset_uid')")}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},441:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===o(i)?i:String(i)),n)}var i}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this.except=n.transform("except"),this}var t,r;return t=e,r=[{key:"setCacheProvider",value:function(e){return e&&"object"===o(e)&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","First argument should be a String.")}},{key:"includeEmbeddedItems",value:function(){return this._query.include_embedded_items=["BASE"],this}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeBranch",value:function(){return this._query.include_branch=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return console.warn("The includeOwner function is deprecated."),this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"fetch",value:function(e){var t=this.config.host+":"+this.config.port;if(this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(t=this.live_preview.host),this.entry_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+t+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var r=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),r)}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide an entry uid. e.g. .Entry('asset_uid')")}}],r&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},525:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=l(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=(n=r(441))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==l(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===l(i)?i:String(i)),n)}var i}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var f=function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},y=function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},p=function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},h=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof _&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===l(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},d=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a string.")}},v=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a number.")}};function g(e,t,r,n){var i;switch(e){case"asset":i=n+t.urls.assets;break;case"taxonomy":i=n+t.urls.taxonomies;break;default:i=n+t.urls.content_types+r+t.urls.entries}return i}var _=t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(_,e);var t,r,n,o,u=(n=_,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(n);if(o){var r=c(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function _(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_),(e=u.call(this))._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=f("$lt"),e.lessThanOrEqualTo=f("$lte"),e.greaterThan=f("$gt"),e.greaterThanOrEqualTo=f("$gte"),e.notEqualTo=f("$ne"),e.containedIn=y(!0),e.notContainedIn=y(!1),e.exists=p(!0),e.notExists=p(!1),e.ascending=d("asc"),e.descending=d("desc"),e.beforeUid=d("before_uid"),e.afterUid=d("after_uid"),e.skip=v("skip"),e.limit=v("limit"),e.or=h("$or"),e.and=h("$and"),e}return t=_,(r=[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=g(this.type,this.config,this.content_type_uid,e);return this._query.count=!0,this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===l(e))return this._query.query=i.mergeDeep(this._query.query,e),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,t){var r={};return t instanceof _&&t._query.query?r.$in_query=t._query.query:"object"===l(t)&&(r.$in_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"referenceNotIn",value:function(e,t){var r={};return t instanceof _&&t._query.query?r.$nin_query=t._query.query:"object"===l(t)&&(r.$nin_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.host+":"+this.config.port;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(t=this.live_preview.host);var r=this.config.protocol+"://"+t+"/"+this.config.version,n=g(this.type,this.config,this.content_type_uid,r);this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:n,body:{_method:"GET",query:this._query}};var o=i.mergeDeep(this.fetchOptions,e);return i.sendRequest(i.mergeDeep({},this),o)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(e=this.config.protocol+"://"+this.live_preview.host+"/"+this.config.version);var t=g(this.type,this.config,this.content_type_uid,e);this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}};var r=i.mergeDeep({},this.fetchOptions);return i.sendRequest(i.mergeDeep({},this),r)}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),_}(o.default)},484:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===o(i)?i:String(i)),n)}var i}t.default=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.object=function(){return t}),this}var t,r;return t=e,(r=[{key:"toJSON",value:function(){return this.object()?n.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e)return e.split(".").reduce((function(e,t){return e[t]}),this.object())}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null;return t?t+"?disposition="+(e&&"string"==typeof e?e:"attachment"):null}}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},987:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=r(525))&&i.__esModule?i:{default:i};function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var a=function(e){return function(t,r,n){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,n&&"number"==typeof n&&(this._query.query[t].levels=n),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}};t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(c,e);var t,r,i,o=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=s(r);if(i){var o=s(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function c(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(e=o.call(this)).above=a("$above"),e.equalAndAbove=a("$eq_above"),e.below=a("$below"),e.equalAndBelow=a("$eq_below"),e}return t=c,Object.defineProperty(t,"prototype",{writable:!1}),t}(o.default)},88:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=y(r(259)),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=p(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=y(r(441)),u=y(r(876)),s=y(r(525)),a=y(r(987)),c=y(r(517)),l=y(r(29));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function y(e){return e&&e.__esModule?e:{default:e}}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===p(i)?i:String(i)),n)}var i}var d=[408,429];t.default=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!d.includes(e.status)},debug:!1,logHandler:function(e,t){"error"===e&&t?console.error("[error] ".concat(t)):"warning"===e&&t?console.warn("[warning] ".concat(t)):"info"===e&&t&&console.info("[info] ".concat(t))}},this.config=JSON.parse(JSON.stringify(n.default)),this.plugins=[];for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];switch(o[0].live_preview&&!0===o[0].live_preview.enable&&null!==o[0].live_preview.management_token&&o[0].live_preview.management_token&&(this.config.live_preview.host="api.contentstack.io"),o[0].region&&void 0!==o[0].region&&"us"!==o[0].region&&(this.config.host=o[0].region+"-cdn.contentstack.com",o[0].live_preview&&!0===o[0].live_preview.enable&&(o[0].live_preview.management_token?this.config.live_preview.host=o[0].region+"-api.contentstack.com":this.config.live_preview.host=o[0].region+"-rest-preview.contentstack.com")),o[0].fetchOptions&&void 0!==o[0].fetchOptions&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[0].fetchOptions)),o[0].plugins&&void 0!==o[0].plugins&&o[0].plugins.forEach((function(e){t.plugins.push(e)})),this.cachePolicy=l.default.policies.IGNORE_CACHE,this.provider=l.default.providers("localstorage"),o.length){case 1:if("object"===p(o[0])&&"string"==typeof o[0].api_key&&"string"==typeof o[0].delivery_token&&"string"==typeof o[0].environment)return this.headers={api_key:o[0].api_key,access_token:o[0].delivery_token},"object"==p(o[0].live_preview)&&(this.live_preview=i.mergeDeep(this.config.live_preview,o[0].live_preview)),"string"==typeof o[0].branch&&void 0!==o[0].branch&&(this.headers.branch=o[0].branch),"object"==p(o[0].early_access)&&Array.isArray(o[0].early_access)&&o[0].early_access.length>0&&(this.headers["x-header-ea"]=o[0].early_access.join(",")),this.environment=o[0].environment,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if(this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2])return this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2],this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters.");case 4:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2]?(this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),o[3]&&("string"==typeof o[3]&&void 0!==o[3]&&"us"!==o[3]?this.config.host=o[3]+"-cdn.contentstack.com":"object"===p(o[3])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[3]))),this;case 5:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2]?(this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),o[3]&&("string"==typeof o[3]&&void 0!==o[3]&&"us"!==o[3]?this.config.host=o[3]+"-cdn.contentstack.com":"object"===p(o[3])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[3]))),o[4]&&"object"===p(o[4])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[4])),this;default:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}var t,r;return t=e,r=[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"livePreviewQuery",value:function(e){this.live_preview&&(this.live_preview.live_preview=e.live_preview||"init",this.live_preview.content_type_uid=e.content_type_uid,this.live_preview.entry_uid=e.entry_uid)}},{key:"setCacheProvider",value:function(e){return e&&"object"===p(e)&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Taxonomies",value:function(){return this.type="taxonomy",i.merge(new a.default,this)}},{key:"Entry",value:function(e){var t=new o.default;return e&&"string"==typeof e&&(t.entry_uid=e),i.merge(t,this)}},{key:"fetch",value:function(e){this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),plugins:this.plugins,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}};var t=i.mergeDeep(this.fetchOptions,e);return(0,c.default)(this,t)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new u.default;return t.asset_uid=e,i.merge(t,this)}return this}},{key:"Query",value:function(){var e="contentType"===this.type?new a.default:new s.default;return i.merge(e,this)}},{key:"getLastActivities",value:function(){return this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}},(0,c.default)(this,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}},e)for(var t in e)this.requestParams.body[t]=e[t];return(0,c.default)(this,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=i.mergeDeep(this._query,e),this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=i.mergeDeep(this.fetchOptions,t);return i.sendRequest(i.mergeDeep({},this),r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===p(t)&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}],r&&h(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},319:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(858)),i=o(r(809));function o(e){return e&&e.__esModule?e:{default:e}}n.default.polyfill(),t.default=i.default},830:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(118))&&n.__esModule?n:{default:n};t.default=i.default},464:e=>{e.exports=require("@contentstack/utils")},858:e=>{e.exports=require("es6-promise")},118:e=>{e.exports=require("localStorage")},809:e=>{e.exports=require("node-fetch")}},t={},r=function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(28);module.exports=r})();
/*! For license information please see contentstack.js.LICENSE.txt */
(()=>{"use strict";var e={367:(e,t,r)=>{r.r(t);const n={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"api.contentstack.io"}},i=fetch;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s="3.18.1";function u(e,t){var r=e.requestParams;return new Promise((function(n,i){var u;return r.headers["Content-Type"]="application/json; charset=UTF-8",r.headers["X-User-Agent"]="contentstack-delivery-javascript-react-native/"+s,r.body&&"object"===o(r.body)&&(delete r.body._method,"object"===o(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,u=function e(t,r){var n=[];if("object"===o(t)&&void 0!==t.length)for(var i=0,s=t.length;i<s;i++)n.push(r+"[]="+t[i]);else for(var u in t){var a=r?r+"["+u+"]":u,c=t[u];n.push(null!==c&&"object"===o(c)&&"query"!==u?e(c,a):a+"="+encodeURIComponent("query"!==u?c:JSON.stringify(c)))}return n.join("&")}(r.body)),a(e,u,t,n,i,t.retryDelay,t.retryLimit)}))}function a(e,t,r,n,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,c=e.requestParams,l=c.url+"?"+t,f=b({method:"GET",headers:c.headers,timeout:3e4},r);function y(i){if(0===u)r.debug&&r.logHandler("error",i),o(i);else{var c=s;u-=1;var l=r.retryLimit-u;r.retryDelayOptions&&(r.retryDelayOptions.base?c=r.retryDelayOptions.base*l:r.retryDelayOptions.customBackoff&&(c=r.retryDelayOptions.customBackoff(l,i))),function(e){return new Promise((function(t){setTimeout(t,e)}))}(c).then((function(){return a(e,t,r,n,o,s,u)})).catch((function(){return a(e,t,r,n,o,s,u)}))}}r.debug&&r.logHandler("info",{url:l,option:f});var h={url:l,option:f},p=e.plugins;if(p&&void 0!==p)for(var d=0;d<p.length;d++)"function"==typeof p[d].onRequest&&(h=p[d].onRequest(e,h));i(h.url,h.option).then((function(t){r.debug&&r.logHandler("info",t);var i=t.json();if(t.ok&&200===t.status)i.then((function(r){for(var i=0;i<p.length&&"function"==typeof p[i].onResponse;i++)r=p[i].onResponse(e,h,t,r);n(r)}));else{var s=t.status,u=t.statusText;i.then((function(e){var n={error_message:e.error_message,error_code:e.error_code,errors:e.errors,status:s,statusText:u};r.retryCondition&&r.retryCondition(t)?y(n):(r.debug&&r.logHandler("error",n),o(n))})).catch((function(){r.debug&&r.logHandler("error",{status:s,statusText:u}),o({status:s,statusText:u})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),o(e)}))}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==c(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===c(o)?o:String(o)),n)}var i,o}var f=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.object=function(){return t}),this}var t,r,n;return t=e,(r=[{key:"toJSON",value:function(){return this.object()?b(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e)return e.split(".").reduce((function(e,t){return e[t]}),this.object())}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null;return t?t+"?disposition="+(e&&"string"==typeof e?e:"attachment"):null}}}])&&l(t.prototype,r),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,u=[],a=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){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 h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(){p=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,s=Object.create(o.prototype),u=new C(n||[]);return i(s,"_invoke",{value:x(e,r,u)}),s}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var y="suspendedStart",h="suspendedYield",d="executing",v="completed",g={};function b(){}function _(){}function q(){}var O={};c(O,s,(function(){return this}));var w=Object.getPrototypeOf,k=w&&w(w(N([])));k&&k!==r&&n.call(k,s)&&(O=k);var P=q.prototype=b.prototype=Object.create(O);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(i,o,s,u){var a=f(e[i],e,o);if("throw"!==a.type){var c=a.arg,l=c.value;return l&&"object"==m(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(a.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function x(t,r,n){var i=y;return function(o,s){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:e,done:!0}}for(n.method=o,n.arg=s;;){var u=n.delegate;if(u){var a=E(u,n);if(a){if(a===g)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=f(t,r,n);if("normal"===c.type){if(i=n.done?v:h,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function E(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(m(t)+" is not iterable")}return _.prototype=q,i(P,"constructor",{value:q,configurable:!0}),i(q,"constructor",{value:_,configurable:!0}),_.displayName=c(q,a,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,q):(e.__proto__=q,c(e,a,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},S(j.prototype),c(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new j(l(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},S(P),c(P,a,"Generator"),c(P,s,(function(){return this})),c(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return u.type="throw",u.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],u=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var a=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(a&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function d(e,t,r,n,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void r(e)}u.done?t(a):Promise.resolve(a).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){d(o,n,i,s,u,"next",e)}function u(e){d(o,n,i,s,u,"throw",e)}s(void 0)}))}}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function g(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}}function b(e,t){var r=this;return function e(t,n){for(var i in n)"object"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?e(t[i],n[i]):"array"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?t[i]=t[i].concat(n[i]):t[i]=n[i]}(e,t),e}function _(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function q(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=f(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,i=e.assets.length;n<i;n++)e.assets[n]=f(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=f(e.entry):e&&void 0!==e.asset?e.asset=f(e.asset):e&&void 0!==e.items&&(e.items=f(e.items).toJSON());return e}function O(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}function w(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var n=e,i=void 0!==n.queryCachePolicy?n.queryCachePolicy:n.cachePolicy,o=void 0!==n.tojson&&n.tojson,s=!!(n.entry_uid||n.singleEntry||n.asset_uid),a=function(e){try{var t=function(e){var t,r,n=0;if(0===e.length)return n;for(t=0,r=e.length;t<r;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n<-1?-1*n:n}(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}(function(e,t,r){if(e&&e.requestParams){var n=_({},e.requestParams.body&&e.requestParams.body.query||{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}(n,s,o));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var c=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==m(c)&&(c=JSON.parse(c)),delete e.requestParams.body.query,e.requestParams.body=_(e.requestParams.body,c),e.live_preview&&!0===e.live_preview.enable&&e.live_preview.live_preview&&"init"!==e.live_preview.live_preview&&(e.live_preview.content_type_uid===e.content_type_uid?(e.requestParams.body=_(e.requestParams.body,{live_preview:e.live_preview.live_preview||"init"}),i=2,e.requestParams.body.environment&&delete e.requestParams.body.environment,e.requestParams.headers.access_token&&delete e.requestParams.headers.access_token,e.requestParams.headers.authorization=e.live_preview.management_token):e.live_preview.live_preview&&(i=1))}var l=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),o||(t=q(t)),r(O(t))}catch(e){n(e)}}))}},f=function(r,s,c){r&&u(e,t).then(function(t){try{n.entry_uid=n.asset_uid=n.tojson=n.queryCachePolicy=void 0;var r={},u={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2===i&&null!==n.provider?void n.provider.get(a,l()):c({error_code:141,error_message:"The requested entry doesn't exist."});r.assets=t.assets[0]}else t.items?u={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==i&&null!==n.provider?(n.provider.set(a,r,(function(e){try{return e&&c(e),o||(r=q(r)),s(O(r))}catch(e){return c(e)}})),s(O(r))):Object.keys(u).length?s(u):(o||(r=q(r)),s(O(r)))}catch(e){return c({message:e.message})}}.bind(n)).catch((function(e){if(2!==i||null===n.provider)return c(e);n.provider.get(a,l())}))};switch(i){case 1:return new Promise(function(){var r=v(p().mark((function r(i,u){return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===n.provider){r.next=5;break}return r.next=3,n.provider.get(a,function(){var r=v(p().mark((function r(n,a){var c,l;return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!n&&a){r.next=5;break}f(!0,i,u),r.next=29;break;case 5:if(r.prev=5,!(e._query&&Array.isArray(e._query.include)&&e._query.include.length>0)){r.next=17;break}if(c=e._query.include,l=k(c),!s){r.next=15;break}return r.next=13,P(l,a.entry,e,t);case 13:r.next=17;break;case 15:return r.next=17,Promise.all(a.entries.map(function(){var r=v(p().mark((function r(n){return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,P(l,n,e,t);case 2:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()));case 17:r.next=21;break;case 19:r.prev=19,r.t0=r.catch(5);case 21:return r.prev=21,o||(a=q(a)),r.abrupt("return",i(O(a)));case 26:return r.prev=26,r.t1=r.catch(21),r.abrupt("return",u(r.t1));case 29:r.next=34;break;case 31:return r.prev=31,r.t2=r.catch(0),r.abrupt("return",u(r.t2));case 34:case"end":return r.stop()}}),r,null,[[0,31],[5,19],[21,26]])})));return function(e,t){return r.apply(this,arguments)}}());case 3:r.next=6;break;case 5:f(!0,i,u);case 6:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}());case 2:case 0:case void 0:case-1:return new Promise((function(e,t){f(!0,e,t)}))}if(3===i)return new Promise((function(e,t){null!==n.provider&&n.provider.get(a,(function(r,n){try{r||!n?t(r):(o||(n=q(n)),e(O(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){f(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){f(!0,e,t)}))}))}function k(e){var t={};return e.forEach((function(e){!function(e){var r=(e=e.replace(/[\[]/gm,".").replace(/[\]]/gm,"")).split("."),n=r.pop();r.reduce((function(e,t){return e[t]=e[t]||{}}),t)[n]={}}(e)})),t}function P(e,t,r,n,i){return S.apply(this,arguments)}function S(){return S=v(p().mark((function e(t,r,n,i,o){var s,a,c,l,f,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h=function(){return h=v(p().mark((function e(t,r,o){var h,d,m,g,b,_;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==r){e.next=2;break}return e.abrupt("return");case 2:if(!Array.isArray(r)){e.next=7;break}return e.next=5,Promise.all(r.map((function(e,n){return f(t,e,(function(e){r[n]=e}))})));case 5:e.next=37;break;case 7:if(r._content_type_uid!==c){e.next=35;break}return e.prev=8,n.requestParams=JSON.parse(JSON.stringify(a)),h=j(t),n.requestParams.body.include=h,n.requestParams.body.live_preview=s.live_preview,n.requestParams.body.content_type_uid=c,d=s.host.match(/^((http[s]?):(\/\/)?)?(.+)$/),m=(d[1]||"https://")+d[4],g=r.uid,b="".concat(m,"/v3/content_types/").concat(r._content_type_uid,"/entries/").concat(g),n.requestParams.url=b,n.requestParams.method="GET",delete n.requestParams.headers.access_token,n.requestParams.headers.authorization=l,e.next=24,u(n,i);case 24:(_=e.sent).entry._content_type_uid=c,_.entry.uid=g,o(_.entry),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(8),console.log("errror",e.t0);case 33:e.next=37;break;case 35:return e.next=37,Promise.all(Object.entries(t).map(function(){var e=v(p().mark((function e(t){var n,i,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=y(t,2),i=n[0],o=n[1],function(e){r[i]=e},e.next=4,f(o,r[i],(function(){}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 37:case"end":return e.stop()}}),e,null,[[8,30]])}))),h.apply(this,arguments)},f=function(e,t,r){return h.apply(this,arguments)},s=n.live_preview,a=n.requestParams,c=s.content_type_uid,l=s.management_token,e.next=6,f(t,r,(function(){}));case 6:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}function j(e){var t=[];return function e(r,n){0===Object.keys(r).length?t.push(n.substring(1)):Object.entries(r).forEach((function(t){var r=y(t,2),i=r[0];e(r[1],[n,i].join("."))}))}(e,""),t.filter((function(e){return""!==e}))}function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==x(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===x(o)?o:String(o)),n)}var i,o}Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then((function(t){return e.apply(e,t)})).catch((function(e){t(e)}))});var T=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=g("only"),this.except=g("except"),this}var t,r,n;return t=e,r=[{key:"setCacheProvider",value:function(e){return e&&"object"===x(e)&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","First argument should be a String.")}},{key:"includeEmbeddedItems",value:function(){return this._query.include_embedded_items=["BASE"],this}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeBranch",value:function(){return this._query.include_branch=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return console.warn("The includeOwner function is deprecated."),this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"fetch",value:function(e){var t=this.config.host+":"+this.config.port;if(this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(t=this.live_preview.host),this.entry_uid){this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+t+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var r=b(this.fetchOptions,e);return w(b({},this),r)}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide an entry uid. e.g. .Entry('asset_uid')")}}],r&&E(t.prototype,r),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==A(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===A(o)?o:String(o)),n)}var i,o}var N=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=g("only"),this}var t,r,n;return t=e,(r=[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide a valid parameters.")}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=b(this.fetchOptions,e);return w(b({},this),t)}e.debug&&e.logHandler("error","Kindly provide an asset uid. e.g. .Assets('asset_uid')")}}])&&C(t.prototype,r),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function H(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==G(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==G(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===G(o)?o:String(o)),n)}var i,o}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=K(e);if(t){var i=K(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===G(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},K(e)}function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}var I=function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},$=function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},B=function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},J=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof M&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===G(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},U=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a string.")}},D=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a number.")}};function F(e,t,r,n){var i;switch(e){case"asset":i=n+t.urls.assets;break;case"taxonomy":i=n+t.urls.taxonomies;break;default:i=n+t.urls.content_types+r+t.urls.entries}return i}var M=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(o,e);var t,r,n,i=L(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this))._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=I("$lt"),e.lessThanOrEqualTo=I("$lte"),e.greaterThan=I("$gt"),e.greaterThanOrEqualTo=I("$gte"),e.notEqualTo=I("$ne"),e.containedIn=$(!0),e.notContainedIn=$(!1),e.exists=B(!0),e.notExists=B(!1),e.ascending=U("asc"),e.descending=U("desc"),e.beforeUid=U("before_uid"),e.afterUid=U("after_uid"),e.skip=D("skip"),e.limit=D("limit"),e.or=J("$or"),e.and=J("$and"),e}return t=o,(r=[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=F(this.type,this.config,this.content_type_uid,e);return this._query.count=!0,this.requestParams={method:"POST",headers:b({},this.headers),url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===G(e))return this._query.query=b(this._query.query,e),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,t){var r={};return t instanceof o&&t._query.query?r.$in_query=t._query.query:"object"===G(t)&&(r.$in_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"referenceNotIn",value:function(e,t){var r={};return t instanceof o&&t._query.query?r.$nin_query=t._query.query:"object"===G(t)&&(r.$nin_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.host+":"+this.config.port;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(t=this.live_preview.host);var r=this.config.protocol+"://"+t+"/"+this.config.version,n=F(this.type,this.config,this.content_type_uid,r);this.requestParams={method:"POST",headers:b({},this.headers),url:n,body:{_method:"GET",query:this._query}};var i=b(this.fetchOptions,e);return w(b({},this),i)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.content_type_uid===this.content_type_uid&&(e=this.config.protocol+"://"+this.live_preview.host+"/"+this.config.version);var t=F(this.type,this.config,this.content_type_uid,e);this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:b({},this.headers),url:t,body:{_method:"GET",query:this._query}};var r=b({},this.fetchOptions);return w(b({},this),r)}}])&&H(t.prototype,r),n&&H(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(T);function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==Q(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===Q(o)?o:String(o)),n)}var i,o}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function Y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var i=Z(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===Q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}var X=function(e){return function(t,r,n){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,n&&"number"==typeof n&&(this._query.query[t].levels=n),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(o,e);var t,r,n,i=Y(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).above=X("$above"),e.equalAndAbove=X("$eq_above"),e.below=X("$below"),e.equalAndBelow=X("$eq_below"),e}return t=o,r&&z(t.prototype,r),n&&z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(M);const ee=require("localStorage");const te=r.n(ee)();function re(e){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(e)}function ne(){return te||null}function ie(){return te?Object.keys(te):[]}var oe={};function se(e,t){!t&&e&&e.length&&e.push("");var r,n=ie(),i=ne();if(e&&e.length){r=e.join(".");for(var o=0,s=n.length;o<s;o++)n[o]&&0===n[o].indexOf(r)&&delete i[n[o]]}else for(var u=0,a=n.length;u<a;u++)delete i[n[u]]}oe.get=function(e,t){try{t(null,function(e){var t=te.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null}(e))}catch(e){t(e)}},oe.set=function(e,t,r){try{e&&t&&function(e,t){try{"object"===re(t)?te.setItem(e,JSON.stringify(t)):te.setItem(e,t)}catch(e){}}(e,t),r()}catch(e){r(e)}},oe.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),se(r),t()}}catch(e){callback(e)}},oe.clearByQuery=function(e,t){try{for(var r=ie(),n=ne(),i=0,o=r.length;i<o;i++)r[i]&&~r[i].indexOf(e)&&delete n[r[i]];t()}catch(e){t(e)}},oe.clearAll=function(e){try{se(),e()}catch(t){e(t)}};const ue=oe;var ae={providers:function(e){if(e)return ue;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};const ce=ae;function le(e){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(e)}function fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==le(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===le(o)?o:String(o)),n)}var i,o}var ye=[408,429],he=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!ye.includes(e.status)},debug:!1,logHandler:function(e,t){"error"===e&&t?console.error("[error] ".concat(t)):"warning"===e&&t?console.warn("[warning] ".concat(t)):"info"===e&&t&&console.info("[info] ".concat(t))}},this.config=JSON.parse(JSON.stringify(n)),this.plugins=[];for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];switch(i[0].region&&void 0!==i[0].region&&"us"!==i[0].region&&(this.config.host=i[0].region+"-cdn.contentstack.com"),i[0].fetchOptions&&void 0!==i[0].fetchOptions&&(this.fetchOptions=b(this.fetchOptions,i[0].fetchOptions)),i[0].plugins&&void 0!==i[0].plugins&&i[0].plugins.forEach((function(e){t.plugins.push(e)})),this.cachePolicy=ce.policies.IGNORE_CACHE,this.provider=ce.providers("localstorage"),i.length){case 1:if("object"===le(i[0])&&"string"==typeof i[0].api_key&&"string"==typeof i[0].delivery_token&&"string"==typeof i[0].environment)return this.headers={api_key:i[0].api_key,access_token:i[0].delivery_token},"object"==le(i[0].live_preview)&&(this.live_preview=b(this.config.live_preview,i[0].live_preview)),"string"==typeof i[0].branch&&void 0!==i[0].branch&&(this.headers.branch=i[0].branch),"object"==le(i[0].early_access)&&Array.isArray(i[0].early_access)&&i[0].early_access.length>0&&(this.headers["x-header-ea"]=i[0].early_access.join(",")),this.environment=i[0].environment,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if(this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2])return this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2],this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters.");case 4:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2]?(this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),i[3]&&("string"==typeof i[3]&&void 0!==i[3]&&"us"!==i[3]?this.config.host=i[3]+"-cdn.contentstack.com":"object"===le(i[3])&&(this.fetchOptions=b(this.fetchOptions,i[3]))),this;case 5:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof i[0]&&"string"==typeof i[1]&&"string"==typeof i[2]?(this.headers={api_key:i[0],access_token:i[1]},this.environment=i[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),i[3]&&("string"==typeof i[3]&&void 0!==i[3]&&"us"!==i[3]?this.config.host=i[3]+"-cdn.contentstack.com":"object"===le(i[3])&&(this.fetchOptions=b(this.fetchOptions,i[3]))),i[4]&&"object"===le(i[4])&&(this.fetchOptions=b(this.fetchOptions,i[4])),this;default:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}var t,r,i;return t=e,r=[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"livePreviewQuery",value:function(e){this.live_preview&&(this.live_preview.live_preview=e.live_preview||"init",this.live_preview.content_type_uid=e.content_type_uid,this.live_preview.entry_uid=e.entry_uid)}},{key:"setCacheProvider",value:function(e){return e&&"object"===le(e)&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Taxonomies",value:function(){return this.type="taxonomy",_(new V,this)}},{key:"Entry",value:function(e){var t=new T;return e&&"string"==typeof e&&(t.entry_uid=e),_(t,this)}},{key:"fetch",value:function(e){return this.requestParams={method:"POST",headers:b({},this.headers),plugins:this.plugins,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}},u(this,b(this.fetchOptions,e))}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new N;return t.asset_uid=e,_(t,this)}return this}},{key:"Query",value:function(){return _("contentType"===this.type?new V:new M,this)}},{key:"getLastActivities",value:function(){return this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}},u(this,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}},e)for(var t in e)this.requestParams.body[t]=e[t];return u(this,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=b(this._query,e),this.requestParams={method:"POST",headers:b({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=b(this.fetchOptions,t);return w(b({},this),r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===le(t)&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}],r&&fe(t.prototype,r),i&&fe(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();const pe={EU:"eu",US:"us",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na"};function de(e){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(e)}function ve(e,t,r){return ve=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&me(i,r.prototype),i},ve.apply(null,arguments)}function me(e,t){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},me(e,t)}function ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==de(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===de(o)?o:String(o)),n)}var i,o}e=r.hmd(e);var be=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=ce.policies,this.Region=pe,this.Utils=r(464)}var t,n,i;return t=e,n=[{key:"Stack",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ve(he,t)}}],n&&ge(t.prototype,n),i&&ge(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=new be},464:e=>{e.exports=require("@contentstack/utils")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n](o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=r(367);module.exports=n})();
(()=>{"use strict";var e={259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"rest-preview.contentstack.com"}}},29:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(280))&&n.__esModule?n:{default:n};var o={providers:function(e){if(e)return i.default;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};t.default=o},280:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(187));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}var u={};function s(e,t){!t&&e&&e.length&&e.push("");var r,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var u=0,s=n.length;u<s;u++)n[u]&&0===n[u].indexOf(r)&&delete o[n[u]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}u.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},u.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},u.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),s(r),t()}}catch(e){callback(e)}},u.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,u=r.length;o<u;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},u.clearAll=function(e){try{s(),e()}catch(t){e(t)}};t.default=u},187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e){var t=i.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null},t.getKeys=function(){return i.default?Object.keys(i.default):[]},t.getStorage=function(){return i.default||null},t.set=function(e,t){try{"object"===o(t)?i.default.setItem(e,JSON.stringify(t)):i.default.setItem(e,t)}catch(e){}};var n,i=(n=r(118))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}},28:(e,t,r)=>{var n=u(r(88)),i=u(r(29)),o=u(r(871));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t,r){return a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i},a.apply(null,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===s(o)?o:String(o)),n)}var i,o}var f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=i.default.policies,this.Region=o.default,this.Utils=r(464)}var t,u,s;return t=e,u=[{key:"Stack",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(n.default,t)}}],u&&l(t.prototype,u),s&&l(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=new f},871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={EU:"eu",US:"us",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na"}},517:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=e.requestParams;return new Promise((function(n,i){var o;return r.headers["Content-Type"]="application/json; charset=UTF-8",r.headers["X-User-Agent"]="contentstack-delivery-javascript-react-native/"+a,r.body&&"object"===s(r.body)&&(delete r.body._method,"object"===s(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,o=function e(t,r){var n=[];if("object"===s(t)&&void 0!==t.length)for(var i=0,o=t.length;i<o;i++)n.push(r+"[]="+t[i]);else for(var u in t){var a=r?r+"["+u+"]":u,c=t[u];n.push(null!==c&&"object"===s(c)&&"query"!==u?e(c,a):a+"="+encodeURIComponent("query"!==u?c:JSON.stringify(c)))}return n.join("&")}(r.body)),c(e,o,t,n,i,t.retryDelay,t.retryLimit)}))};var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=s(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=(n=r(885))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var a="3.19.0";function c(e,t,r,n,u){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,l=e.requestParams,f=l.url+"?"+t,y=l.headers,p=i.mergeDeep({method:"GET",headers:y,timeout:3e4},r);function h(i){if(0===a)r.debug&&r.logHandler("error",i),u(i);else{var o=s;a-=1;var l=r.retryLimit-a;r.retryDelayOptions&&(r.retryDelayOptions.base?o=r.retryDelayOptions.base*l:r.retryDelayOptions.customBackoff&&(o=r.retryDelayOptions.customBackoff(l,i))),function(e){return new Promise((function(t){setTimeout(t,e)}))}(o).then((function(){return c(e,t,r,n,u,s,a)})).catch((function(){return c(e,t,r,n,u,s,a)}))}}r.debug&&r.logHandler("info",{url:f,option:p});var d={url:f,option:p},v=e.plugins;if(v&&void 0!==v)for(var g=0;g<v.length;g++)"function"==typeof v[g].onRequest&&(d=v[g].onRequest(e,d));(0,o.default)(d.url,d.option).then((function(t){r.debug&&r.logHandler("info",t);var i=t.json();if(t.ok&&200===t.status)i.then((function(r){for(var i=0;i<v.length&&"function"==typeof v[i].onResponse;i++)r=v[i].onResponse(e,d,t,r);n(r)}));else{var o=t.status,s=t.statusText;i.then((function(e){var n={error_message:e.error_message,error_code:e.error_code,errors:e.errors,status:o,statusText:s};r.retryCondition&&r.retryCondition(t)?h(n):(r.debug&&r.logHandler("error",n),u(n))})).catch((function(){r.debug&&r.logHandler("error",{status:o,statusText:s}),u({status:o,statusText:s})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),u(e)}))}},5:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._type=function(e){var t=c(e);"object"===t?(t,Array.isArray(e)&&(t="array")):t;return t},t.generateHash=p,t.getHash=y,t.isBrowser=function(){return"undefined"!=typeof window&&"object"===("undefined"==typeof process?"undefined":c(process))&&"browser"===process.title},t.merge=l,t.mergeDeep=function(e,t){var r=this;return function e(t,n){for(var i in n)"object"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?e(t[i],n[i]):"array"==r._type(n[i])&&r._type(t[i])==r._type(n[i])?t[i]=t[i].concat(n[i]):t[i]=n[i]}(e,t),e},t.parseQueryFromParams=f,t.resultWrapper=h,t.sendRequest=function(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var i=e,o=void 0!==i.queryCachePolicy?i.queryCachePolicy:i.cachePolicy,s=void 0!==i.tojson&&i.tojson,p=!!(i.entry_uid||i.singleEntry||i.asset_uid),v=y(f(i,p,s));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var g=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==c(g)&&(g=JSON.parse(g)),delete e.requestParams.body.query,e.requestParams.body=l(e.requestParams.body,g),e.live_preview&&!0===e.live_preview.enable&&e.live_preview.live_preview&&"init"!==e.live_preview.live_preview&&(e.requestParams.body=l(e.requestParams.body,{live_preview:e.live_preview.live_preview||"init"}),o=2,e.requestParams.body.environment&&delete e.requestParams.body.environment,e.requestParams.headers.access_token&&delete e.requestParams.headers.access_token,delete e.requestParams.headers.authorization,delete e.requestParams.headers.preview_token,e.live_preview.preview_token?(e.requestParams.headers.preview_token=e.live_preview.preview_token,e.requestParams.headers.live_preview=e.live_preview.live_preview):e.live_preview.management_token&&(e.requestParams.headers.authorization=e.live_preview.management_token))}var _=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),s||(t=h(t)),r(d(t))}catch(e){n(e)}}))}},b=function(r,u,a){r&&(0,n.default)(e,t).then(function(t){try{i.entry_uid=i.asset_uid=i.tojson=i.queryCachePolicy=void 0;var r={},n={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2===o&&null!==i.provider?void i.provider.get(v,_()):a({error_code:141,error_message:"The requested entry doesn't exist."});r.assets=t.assets[0]}else t.items?n={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==o&&null!==i.provider?(i.provider.set(v,r,(function(e){try{return e&&a(e),s||(r=h(r)),u(d(r))}catch(e){return a(e)}})),u(d(r))):Object.keys(n).length?u(n):(s||(r=h(r)),u(d(r)))}catch(e){return a({message:e.message})}}.bind(i)).catch((function(e){if(2!==o||null===i.provider)return a(e);i.provider.get(v,_())}))};switch(o){case 1:return new Promise(function(){var e=a(u().mark((function e(t,r){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===i.provider){e.next=5;break}return e.next=3,i.provider.get(v,function(){var e=a(u().mark((function e(n,i){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!n&&i){e.next=5;break}b(!0,t,r),e.next=7;break;case 5:return s||(i=h(i)),e.abrupt("return",t(d(i)));case 7:e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",r(e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t,r){return e.apply(this,arguments)}}());case 3:e.next=6;break;case 5:b(!0,t,r);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 2:case 0:case void 0:case-1:return new Promise((function(e,t){b(!0,e,t)}))}if(3===o){return new Promise((function(e,t){null!==i.provider&&i.provider.get(v,(function(r,n){try{r||!n?t(r):(s||(n=h(n)),e(d(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){b(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){b(!0,e,t)}))}))}},t.spreadResult=d,t.transform=function(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}};var n=o(r(517)),i=o(r(484));function o(e){return e&&e.__esModule?e:{default:e}}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function y(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,u=Object.create(o.prototype),s=new M(n||[]);return i(u,"_invoke",{value:E(e,r,s)}),u}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=y;var h="suspendedStart",d="suspendedYield",v="executing",g="completed",_={};function b(){}function m(){}function O(){}var w={};f(w,s,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(A([])));k&&k!==r&&n.call(k,s)&&(w=k);var P=O.prototype=b.prototype=Object.create(w);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,o,u,s){var a=p(e[i],e,o);if("throw"!==a.type){var l=a.arg,f=l.value;return f&&"object"==c(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return r("throw",e,u,s)}))}s(a.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function E(t,r,n){var i=h;return function(o,u){if(i===v)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw u;return{value:e,done:!0}}for(n.method=o,n.arg=u;;){var s=n.delegate;if(s){var a=T(s,n);if(a){if(a===_)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?g:d,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function T(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,_;var u=o.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,_):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(c(t)+" is not iterable")}return m.prototype=O,i(P,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:m,configurable:!0}),m.displayName=f(O,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,f(e,l,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},j(S.prototype),f(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new S(y(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(P),f(P,l,"Generator"),f(P,s,(function(){return this})),f(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var a=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),_}},t}function s(e,t,r,n,i,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function u(e){s(o,n,i,u,a,"next",e)}function a(e){s(o,n,i,u,a,"throw",e)}u(void 0)}))}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function f(e,t,r){if(e&&e.requestParams){var n=l({},e.requestParams.body&&e.requestParams.body.query||{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function y(e){try{var t=p(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function p(e){var t,r,n=0;if(0===e.length)return n;for(t=0,r=e.length;t<r;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n<-1?-1*n:n}function h(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,i.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,i.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,i.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,i.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,i.default)(e.items).toJSON());return e}function d(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then((function(t){return e.apply(e,t)})).catch((function(e){t(e)}))})},876:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,u=void 0,u=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(u)?u:String(u)),n)}var i,u}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this}var t,r,i;return t=e,(r=[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide a valid parameters.")}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),t)}e.debug&&e.logHandler("error","Kindly provide an asset uid. e.g. .Assets('asset_uid')")}}])&&u(t.prototype,r),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},441:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,u=void 0,u=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(u)?u:String(u)),n)}var i,u}t.default=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=n.transform("only"),this.except=n.transform("except"),this}var t,r,i;return t=e,r=[{key:"setCacheProvider",value:function(e){return e&&"object"===o(e)&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","First argument should be a String.")}},{key:"includeEmbeddedItems",value:function(){return this._query.include_embedded_items=["BASE"],this}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeFallback",value:function(){return this._query.include_fallback=!0,this}},{key:"includeBranch",value:function(){return this._query.include_branch=!0,this}},{key:"includeMetadata",value:function(){return this._query.include_metadata=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return console.warn("The includeOwner function is deprecated."),this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"fetch",value:function(e){var t=this.config.host+":"+this.config.port;if(this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(t=this.live_preview.host),this.entry_uid){this.requestParams={method:"POST",headers:n.mergeDeep({},this.headers),url:this.config.protocol+"://"+t+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var r=n.mergeDeep(this.fetchOptions,e);return n.sendRequest(n.mergeDeep({},this),r)}this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide an entry uid. e.g. .Entry('asset_uid')")}}],r&&u(t.prototype,r),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},525:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=f(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=(n=r(441))&&n.__esModule?n:{default:n};function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==f(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===f(o)?o:String(o)),n)}var i,o}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var y=function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},p=function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},h=function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},d=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof b&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===f(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},v=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a string.")}},g=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Argument should be a number.")}};function _(e,t,r,n){var i;switch(e){case"asset":i=n+t.urls.assets;break;case"taxonomy":i=n+t.urls.taxonomies;break;default:i=n+t.urls.content_types+r+t.urls.entries}return i}var b=t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(u,e);var t,r,n,o=c(u);function u(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(e=o.call(this))._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=y("$lt"),e.lessThanOrEqualTo=y("$lte"),e.greaterThan=y("$gt"),e.greaterThanOrEqualTo=y("$gte"),e.notEqualTo=y("$ne"),e.containedIn=p(!0),e.notContainedIn=p(!1),e.exists=h(!0),e.notExists=h(!1),e.ascending=v("asc"),e.descending=v("desc"),e.beforeUid=v("before_uid"),e.afterUid=v("after_uid"),e.skip=g("skip"),e.limit=g("limit"),e.or=d("$or"),e.and=d("$and"),e}return t=u,(r=[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=_(this.type,this.config,this.content_type_uid,e);return this._query.count=!0,this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===f(e))return this._query.query=i.mergeDeep(this._query.query,e),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,t){var r={};return t instanceof u&&t._query.query?r.$in_query=t._query.query:"object"===f(t)&&(r.$in_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"referenceNotIn",value:function(e,t){var r={};return t instanceof u&&t._query.query?r.$nin_query=t._query.query:"object"===f(t)&&(r.$nin_query=t),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(r):this._query.query[e]=r,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.host+":"+this.config.port;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(t=this.live_preview.host);var r=this.config.protocol+"://"+t+"/"+this.config.version,n=_(this.type,this.config,this.content_type_uid,r);this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:n,body:{_method:"GET",query:this._query}};var o=i.mergeDeep(this.fetchOptions,e);return i.sendRequest(i.mergeDeep({},this),o)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version;this.type&&"asset"!==this.type&&this.live_preview&&!0===this.live_preview.enable&&this.live_preview.live_preview&&"init"!==this.live_preview.live_preview&&(e=this.config.protocol+"://"+this.live_preview.host+"/"+this.config.version);var t=_(this.type,this.config,this.content_type_uid,e);this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:t,body:{_method:"GET",query:this._query}};var r=i.mergeDeep({},this.fetchOptions);return i.sendRequest(i.mergeDeep({},this),r)}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),u}(o.default)},484:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=u?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(5));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,u=void 0,u=function(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(u)?u:String(u)),n)}var i,u}t.default=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.object=function(){return t}),this}var t,r,i;return t=e,(r=[{key:"toJSON",value:function(){return this.object()?n.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e)return e.split(".").reduce((function(e,t){return e[t]}),this.object())}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null;return t?t+"?disposition="+(e&&"string"==typeof e?e:"attachment"):null}}}])&&u(t.prototype,r),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},987:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=r(525))&&i.__esModule?i:{default:i};function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(o=i.key,u=void 0,u=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===n(u)?u:String(u)),i)}var o,u}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=c(e);if(t){var o=c(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}var l=function(e){return function(t,r,n){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,n&&"number"==typeof n&&(this._query.query[t].levels=n),this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters.")}};t.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(o,e);var t,r,n,i=a(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).above=l("$above"),e.equalAndAbove=l("$eq_above"),e.below=l("$below"),e.equalAndBelow=l("$eq_below"),e}return t=o,r&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(o.default)},88:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=y(r(259)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=p(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(5)),o=y(r(441)),u=y(r(876)),s=y(r(525)),a=y(r(987)),c=y(r(517)),l=y(r(29));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function y(e){return e&&e.__esModule?e:{default:e}}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===p(o)?o:String(o)),n)}var i,o}var d=[408,429];t.default=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!d.includes(e.status)},debug:!1,logHandler:function(e,t){"error"===e&&t?console.error("[error] ".concat(t)):"warning"===e&&t?console.warn("[warning] ".concat(t)):"info"===e&&t&&console.info("[info] ".concat(t))}},this.config=JSON.parse(JSON.stringify(n.default)),this.plugins=[];for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];switch(o[0].live_preview&&!0===o[0].live_preview.enable&&null!==o[0].live_preview.management_token&&o[0].live_preview.management_token&&(this.config.live_preview.host="api.contentstack.io"),o[0].region&&void 0!==o[0].region&&"us"!==o[0].region&&(this.config.host=o[0].region+"-cdn.contentstack.com",o[0].live_preview&&!0===o[0].live_preview.enable&&(o[0].live_preview.management_token?this.config.live_preview.host=o[0].region+"-api.contentstack.com":this.config.live_preview.host=o[0].region+"-rest-preview.contentstack.com")),o[0].fetchOptions&&void 0!==o[0].fetchOptions&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[0].fetchOptions)),o[0].plugins&&void 0!==o[0].plugins&&o[0].plugins.forEach((function(e){t.plugins.push(e)})),this.cachePolicy=l.default.policies.IGNORE_CACHE,this.provider=l.default.providers("localstorage"),o.length){case 1:if("object"===p(o[0])&&"string"==typeof o[0].api_key&&"string"==typeof o[0].delivery_token&&"string"==typeof o[0].environment)return this.headers={api_key:o[0].api_key,access_token:o[0].delivery_token},"object"==p(o[0].live_preview)&&(this.live_preview=i.mergeDeep(this.config.live_preview,o[0].live_preview)),"string"==typeof o[0].branch&&void 0!==o[0].branch&&(this.headers.branch=o[0].branch),"object"==p(o[0].early_access)&&Array.isArray(o[0].early_access)&&o[0].early_access.length>0&&(this.headers["x-header-ea"]=o[0].early_access.join(",")),this.environment=o[0].environment,this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if(this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2])return this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2],this;this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters.");case 4:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2]?(this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),o[3]&&("string"==typeof o[3]&&void 0!==o[3]&&"us"!==o[3]?this.config.host=o[3]+"-cdn.contentstack.com":"object"===p(o[3])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[3]))),this;case 5:return this.fetchOptions.debug&&this.fetchOptions.logHandler("warning","WARNING! Obsolete function called. Function 'Contentstack.Stack(api_key, delivery_token, environment)' has been deprecated, please use 'Contentstack.Stack({api_key, delivery_token, environment, region, branch, fetchOptions})' function instead!"),"string"==typeof o[0]&&"string"==typeof o[1]&&"string"==typeof o[2]?(this.headers={api_key:o[0],access_token:o[1]},this.environment=o[2]):this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid string parameters."),o[3]&&("string"==typeof o[3]&&void 0!==o[3]&&"us"!==o[3]?this.config.host=o[3]+"-cdn.contentstack.com":"object"===p(o[3])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[3]))),o[4]&&"object"===p(o[4])&&(this.fetchOptions=i.mergeDeep(this.fetchOptions,o[4])),this;default:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}var t,r,f;return t=e,r=[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:this.fetchOptions.debug&&this.fetchOptions.logHandler("error","Kindly provide the valid policy"),this}},{key:"livePreviewQuery",value:function(e){this.live_preview&&(this.live_preview.live_preview=e.live_preview||"init",this.live_preview.content_type_uid=e.content_type_uid,this.live_preview.entry_uid=e.entry_uid)}},{key:"setCacheProvider",value:function(e){return e&&"object"===p(e)&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Taxonomies",value:function(){return this.type="taxonomy",i.merge(new a.default,this)}},{key:"Entry",value:function(e){var t=new o.default;return e&&"string"==typeof e&&(t.entry_uid=e),i.merge(t,this)}},{key:"fetch",value:function(e){this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),plugins:this.plugins,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}};var t=i.mergeDeep(this.fetchOptions,e);return(0,c.default)(this,t)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new u.default;return t.asset_uid=e,i.merge(t,this)}return this}},{key:"Query",value:function(){var e="contentType"===this.type?new a.default:new s.default;return i.merge(e,this)}},{key:"getLastActivities",value:function(){return this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}},(0,c.default)(this,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}},e)for(var t in e)this.requestParams.body[t]=e[t];return(0,c.default)(this,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=i.mergeDeep(this._query,e),this.requestParams={method:"POST",headers:i.mergeDeep({},this.headers),url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=i.mergeDeep(this.fetchOptions,t);return i.sendRequest(i.mergeDeep({},this),r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===p(t)&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}],r&&h(t.prototype,r),f&&h(t,f),Object.defineProperty(t,"prototype",{writable:!1}),e}()},885:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=fetch},118:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(856))&&n.__esModule?n:{default:n};t.default=i.default},464:e=>{e.exports=require("@contentstack/utils")},856:e=>{e.exports=require("localStorage")}},t={};var r=function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(28);module.exports=r})();

@@ -75,8 +75,19 @@ // Type definitions for contentstack v3.12.2 and above

export interface LivePreview {
host: string
management_token: string
export type LivePreview = {
host?: string
enable: boolean
} & (LivePreivewConfigWithManagementToken | LivePreviewConfigWithPreviewToken)
export interface LivePreivewConfigWithManagementToken {
/**
* @deprecated Please use `preview_token` instead to enable live preview.
* The `management_token` will be removed in future releases.
*/
management_token: string;
}
export interface LivePreviewConfigWithPreviewToken {
preview_token: string;
}
export interface LivePreviewQuery {

@@ -83,0 +94,0 @@ live_preview: string

{
"name": "contentstack",
"version": "3.18.1",
"version": "3.19.0",
"description": "Contentstack Javascript SDK",

@@ -5,0 +5,0 @@ "homepage": "https://www.contentstack.com/",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc