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.19.3 to 3.20.0

5

CHANGELOG.md
## Change log
### Version: 3.20.0
#### Date: May-31-2024
##### Enhanncement:
- Adds Timeline Preview changes
### Version: 3.19.3

@@ -4,0 +9,0 @@ #### Date: May-17-2024

2

dist/nativescript/contentstack.js
/*! 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:"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)}},{key:"updateAssetURL",value:function(e){if(null==e._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var t=function(t){var r=e._embedded_items[t];Array.isArray(r)&&r.forEach((function(r){if("sys_assets"==r._content_type_uid&&r.filename){var n=e[t].children.find((function(e){return e.attrs["asset-uid"]===r.uid}));n&&(n.attrs["asset-link"]=r.url)}}))};for(var r in e._embedded_items)t(r)}}],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.3";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)}}))}},m=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}m(!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:m(!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){m(!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){m(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){m(!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 m?t:m,u=Object.create(o.prototype),s=new A(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 m(){}function b(){}function O(){}var w={};f(w,s,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(C([])));k&&k!==r&&n.call(k,s)&&(w=k);var P=O.prototype=m.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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(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 b.prototype=O,i(P,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:b,configurable:!0}),b.displayName=f(O,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"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=C,A.prototype={constructor:A,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:C(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})();
(()=>{"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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(i,u,a):i[u]=e[u]}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 s={};function u(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 s=0,u=n.length;s<u;s++)n[s]&&0===n[s].indexOf(r)&&delete o[n[s]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}s.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},s.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},s.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),u(r),t()}}catch(e){callback(e)}},s.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,s=r.length;o<s;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},s.clearAll=function(e){try{u(),e()}catch(t){e(t)}},t.default=s},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=s(r(88)),i=s(r(29)),o=s(r(871));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="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},u(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"!==u(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===u(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,s;return t=e,s=[{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)}},{key:"updateAssetURL",value:function(e){if(null==e._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var t=function(t){var r=e._embedded_items[t];Array.isArray(r)&&r.forEach((function(r){if("sys_assets"==r._content_type_uid&&r.filename){var n=e[t].children.find((function(e){return e.attrs["asset-uid"]===r.uid}));n&&(n.attrs["asset-link"]=r.url)}}))};for(var r in e._embedded_items)t(r)}}],s&&l(t.prototype,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"===u(r.body)&&(delete r.body._method,"object"===u(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,o=function e(t,r){var n=[];if("object"===u(t)&&void 0!==t.length)for(var i=0,o=t.length;i<o;i++)n.push(r+"[]="+t[i]);else for(var s in t){var a=r?r+"["+s+"]":s,c=t[s];n.push(null!==c&&"object"===u(c)&&"query"!==s?e(c,a):a+"="+encodeURIComponent("query"!==s?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"!=u(e)&&"function"!=typeof e)return{default:e};var r=s(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 s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function u(e){return u="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},u(e)}var a="3.20.0";function c(e,t,r,n,s){var u=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),s(i);else{var o=u;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,s,u,a)})).catch((function(){return c(e,t,r,n,s,u,a)}))}}(y):(r.debug&&r.logHandler("error",y),s(y))})).catch((function(){r.debug&&r.logHandler("error",{status:l,statusText:f}),s({status:l,statusText:f})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),s(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},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,u=void 0!==i.tojson&&i.tojson,p=!!(i.entry_uid||i.singleEntry||i.asset_uid),v=y(f(i,p,u));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var _=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==c(_)&&(_=JSON.parse(_)),delete e.requestParams.body.query,e.requestParams.body=l(e.requestParams.body,_),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 g=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),u||(t=h(t)),r(d(t))}catch(e){n(e)}}))}},m=function(r,s,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,g()):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),u||(r=h(r)),s(d(r))}catch(e){return a(e)}})),s(d(r))):Object.keys(n).length?s(n):(u||(r=h(r)),s(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,g())}))};switch(o){case 1:return new Promise(function(){var e=a(s().mark((function e(t,r){return s().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(s().mark((function e(n,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!n&&i){e.next=5;break}m(!0,t,r),e.next=7;break;case 5:return u||(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:m(!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){m(!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):(u||(n=h(n)),e(d(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){m(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){m(!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 s(){s=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:{},u=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 m?t:m,s=Object.create(o.prototype),u=new A(n||[]);return i(s,"_invoke",{value:E(e,r,u)}),s}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",_="completed",g={};function m(){}function b(){}function w(){}var O={};f(O,u,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(C([])));k&&k!==r&&n.call(k,u)&&(O=k);var P=w.prototype=m.prototype=Object.create(O);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,s,u){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,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(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 E(t,r,n){var i=h;return function(o,s){if(i===v)throw new Error("Generator is already running");if(i===_){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=T(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===h)throw i=_,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?_:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=_,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")),g;var o=p(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 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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(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 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 b.prototype=w,i(P,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,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 s=new S(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},j(P),f(P,l,"Generator"),f(P,u,(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=C,A.prototype={constructor:A,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 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),D(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;D(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function u(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 a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){u(o,n,i,s,a,"next",e)}function a(e){u(o,n,i,s,a,"throw",e)}s(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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}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 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"!==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')")}}])&&s(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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}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 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"!==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&&s(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=s(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=(n=r(441))&&n.__esModule?n:{default:n};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(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"!==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 g&&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 _(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 g=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)}(g,e);var t,r,n,o,s=(n=g,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 g(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(e=s.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=g,(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"===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 g&&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 g&&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=_(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)}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),g}(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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}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 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"!==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}}}])&&s(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 s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(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&&s(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=u(r);if(i){var o=u(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 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=y(r(441)),s=y(r(876)),u=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),s=0;s<r;s++)o[s]=arguments[s];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),this.setLivePreviewTimelinePreviewForClient()),"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:"setLivePreviewTimelinePreviewForClient",value:function(){if(i.isBrowser()){var e=new URL(document.location.toString()).searchParams;e.has("live_preview")&&(this.live_preview.live_preview=e.get("live_preview")),e.has("release_id")&&(this.headers.release_id=e.get("release_id")),e.has("preview_timestamp")&&(this.headers.preview_timestamp=e.get("preview_timestamp"))}}},{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),e.hasOwnProperty("release_id")&&(this.headers.release_id=e.release_id),e.hasOwnProperty("preview_timestamp")&&(this.headers.preview_timestamp=e.preview_timestamp)}},{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 s.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 u.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:"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)}},{key:"updateAssetURL",value:function(e){if(null==e._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var t=function(t){var r=e._embedded_items[t];Array.isArray(r)&&r.forEach((function(r){if("sys_assets"==r._content_type_uid&&r.filename){var n=e[t].children.find((function(e){return e.attrs["asset-uid"]===r.uid}));n&&(n.attrs["asset-link"]=r.url)}}))};for(var r in e._embedded_items)t(r)}}],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.3";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)}}))}},m=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}m(!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:m(!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){m(!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){m(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){m(!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 m?t:m,u=Object.create(o.prototype),s=new A(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 m(){}function b(){}function O(){}var w={};f(w,s,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(M([])));k&&k!==r&&n.call(k,s)&&(w=k);var P=O.prototype=m.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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function M(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 b.prototype=O,i(P,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:b,configurable:!0}),b.displayName=f(O,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"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=M,A.prototype={constructor:A,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:M(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})();
(()=>{"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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(i,u,a):i[u]=e[u]}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 s={};function u(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 s=0,u=n.length;s<u;s++)n[s]&&0===n[s].indexOf(r)&&delete o[n[s]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}s.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},s.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},s.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),u(r),t()}}catch(e){callback(e)}},s.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,s=r.length;o<s;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},s.clearAll=function(e){try{u(),e()}catch(t){e(t)}},t.default=s},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=s(r(88)),i=s(r(29)),o=s(r(871));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="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},u(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"!==u(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===u(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,s;return t=e,s=[{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)}},{key:"updateAssetURL",value:function(e){if(null==e._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var t=function(t){var r=e._embedded_items[t];Array.isArray(r)&&r.forEach((function(r){if("sys_assets"==r._content_type_uid&&r.filename){var n=e[t].children.find((function(e){return e.attrs["asset-uid"]===r.uid}));n&&(n.attrs["asset-link"]=r.url)}}))};for(var r in e._embedded_items)t(r)}}],s&&l(t.prototype,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-nodejs/"+a,r.body&&"object"===u(r.body)&&(delete r.body._method,"object"===u(r.body.query)&&0===Object.keys(r.body.query).length&&delete r.body.query,o=function e(t,r){var n=[];if("object"===u(t)&&void 0!==t.length)for(var i=0,o=t.length;i<o;i++)n.push(r+"[]="+t[i]);else for(var s in t){var a=r?r+"["+s+"]":s,c=t[s];n.push(null!==c&&"object"===u(c)&&"query"!==s?e(c,a):a+"="+encodeURIComponent("query"!==s?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"!=u(e)&&"function"!=typeof e)return{default:e};var r=s(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 s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function u(e){return u="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},u(e)}var a="3.20.0";function c(e,t,r,n,s){var u=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),s(i);else{var o=u;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,s,u,a)})).catch((function(){return c(e,t,r,n,s,u,a)}))}}(y):(r.debug&&r.logHandler("error",y),s(y))})).catch((function(){r.debug&&r.logHandler("error",{status:l,statusText:f}),s({status:l,statusText:f})}))}})).catch((function(e){r.debug&&r.logHandler("error",e),s(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},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,u=void 0!==i.tojson&&i.tojson,p=!!(i.entry_uid||i.singleEntry||i.asset_uid),v=y(f(i,p,u));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var _=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==c(_)&&(_=JSON.parse(_)),delete e.requestParams.body.query,e.requestParams.body=l(e.requestParams.body,_),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 g=function(){return function(e,t){return new Promise((function(r,n){try{e&&n(e),u||(t=h(t)),r(d(t))}catch(e){n(e)}}))}},m=function(r,s,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,g()):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),u||(r=h(r)),s(d(r))}catch(e){return a(e)}})),s(d(r))):Object.keys(n).length?s(n):(u||(r=h(r)),s(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,g())}))};switch(o){case 1:return new Promise(function(){var e=a(s().mark((function e(t,r){return s().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(s().mark((function e(n,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!n&&i){e.next=5;break}m(!0,t,r),e.next=7;break;case 5:return u||(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:m(!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){m(!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):(u||(n=h(n)),e(d(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){m(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){m(!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 s(){s=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:{},u=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 m?t:m,s=Object.create(o.prototype),u=new A(n||[]);return i(s,"_invoke",{value:E(e,r,u)}),s}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",_="completed",g={};function m(){}function b(){}function w(){}var O={};f(O,u,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(C([])));k&&k!==r&&n.call(k,u)&&(O=k);var P=w.prototype=m.prototype=Object.create(O);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,s,u){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,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(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 E(t,r,n){var i=h;return function(o,s){if(i===v)throw new Error("Generator is already running");if(i===_){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=T(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===h)throw i=_,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?_:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=_,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")),g;var o=p(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 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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(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 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 b.prototype=w,i(P,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,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 s=new S(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},j(P),f(P,l,"Generator"),f(P,u,(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=C,A.prototype={constructor:A,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 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),D(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;D(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function u(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 a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){u(o,n,i,s,a,"next",e)}function a(e){u(o,n,i,s,a,"throw",e)}s(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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}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 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"!==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')")}}])&&s(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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}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 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"!==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&&s(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=s(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=(n=r(441))&&n.__esModule?n:{default:n};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(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"!==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 g&&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 _(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 g=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)}(g,e);var t,r,n,o,s=(n=g,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 g(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(e=s.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=g,(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"===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 g&&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 g&&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=_(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)}}])&&u(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),g}(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},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var a=s?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}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 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"!==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}}}])&&s(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 s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(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&&s(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=u(r);if(i){var o=u(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 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=y(r(441)),s=y(r(876)),u=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),s=0;s<r;s++)o[s]=arguments[s];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),this.setLivePreviewTimelinePreviewForClient()),"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:"setLivePreviewTimelinePreviewForClient",value:function(){if(i.isBrowser()){var e=new URL(document.location.toString()).searchParams;e.has("live_preview")&&(this.live_preview.live_preview=e.get("live_preview")),e.has("release_id")&&(this.headers.release_id=e.get("release_id")),e.has("preview_timestamp")&&(this.headers.preview_timestamp=e.get("preview_timestamp"))}}},{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),e.hasOwnProperty("release_id")&&(this.headers.release_id=e.release_id),e.hasOwnProperty("preview_timestamp")&&(this.headers.preview_timestamp=e.preview_timestamp)}},{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 s.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 u.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={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)}},{key:"updateAssetURL",value:function(e){if(null==e._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var t=function(t){var r=e._embedded_items[t];Array.isArray(r)&&r.forEach((function(r){if("sys_assets"==r._content_type_uid&&r.filename){var n=e[t].children.find((function(e){return e.attrs["asset-uid"]===r.uid}));n&&(n.attrs["asset-link"]=r.url)}}))};for(var r in e._embedded_items)t(r)}}],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.3";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 A(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(C([])));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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(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=C,A.prototype={constructor:A,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:C(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})();
(()=>{"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)}},{key:"updateAssetURL",value:function(e){if(null==e._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var t=function(t){var r=e._embedded_items[t];Array.isArray(r)&&r.forEach((function(r){if("sys_assets"==r._content_type_uid&&r.filename){var n=e[t].children.find((function(e){return e.attrs["asset-uid"]===r.uid}));n&&(n.attrs["asset-link"]=r.url)}}))};for(var r in e._embedded_items)t(r)}}],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.20.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},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)}}))}},m=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}m(!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:m(!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){m(!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){m(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){m(!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 m?t:m,u=Object.create(o.prototype),s=new A(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 m(){}function b(){}function w(){}var O={};f(O,s,(function(){return this}));var q=Object.getPrototypeOf,k=q&&q(q(C([])));k&&k!==r&&n.call(k,s)&&(O=k);var P=w.prototype=m.prototype=Object.create(O);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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(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 b.prototype=w,i(P,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,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=C,A.prototype={constructor:A,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:C(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 m&&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 m=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),this.setLivePreviewTimelinePreviewForClient()),"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:"setLivePreviewTimelinePreviewForClient",value:function(){if(i.isBrowser()){var e=new URL(document.location.toString()).searchParams;e.has("live_preview")&&(this.live_preview.live_preview=e.get("live_preview")),e.has("release_id")&&(this.headers.release_id=e.get("release_id")),e.has("preview_timestamp")&&(this.headers.preview_timestamp=e.get("preview_timestamp"))}}},{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),e.hasOwnProperty("release_id")&&(this.headers.release_id=e.release_id),e.hasOwnProperty("preview_timestamp")&&(this.headers.preview_timestamp=e.preview_timestamp)}},{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})();
{
"name": "contentstack",
"version": "3.19.3",
"version": "3.20.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