microcms-js-sdk
Advanced tools
Comparing version 2.3.3 to 2.4.0
@@ -5,3 +5,3 @@ import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, WriteApiRequestResult, CreateRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent, UpdateRequest, DeleteRequest } from './types'; | ||
*/ | ||
export declare const createClient: ({ serviceDomain, apiKey, customFetch, }: MicroCMSClient) => { | ||
export declare const createClient: ({ serviceDomain, apiKey, customFetch, retry: retryOption, }: MicroCMSClient) => { | ||
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>; | ||
@@ -8,0 +8,0 @@ getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("qs"),t=require("cross-fetch");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e),o=n(t),i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,u)}s((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=t.call(e,c)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}var s=function(e){return"string"==typeof e},a=function(e){var t;return t=e||("undefined"==typeof fetch?o.default:fetch),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}},d=function(e,n){var r=a(n),o="undefined"==typeof Headers?t.Headers:Headers;return function(t,n){return c(void 0,void 0,void 0,(function(){var c;return u(this,(function(u){return(c=new o(null==n?void 0:n.headers)).has("X-MICROCMS-API-KEY")||c.set("X-MICROCMS-API-KEY",e),[2,r(t,i(i({},n),{headers:c}))]}))}))}};exports.createClient=function(e){var t=e.serviceDomain,n=e.apiKey,o=e.customFetch;if(!t||!n)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!s(t)||!s(n))throw new Error("parameter is not string");var i="https://".concat(t,".").concat("microcms.io","/api/").concat("v1"),a=function(e){var t=e.endpoint,s=e.contentId,a=e.queries,f=void 0===a?{}:a,l=e.method,v=e.customHeaders,p=e.customBody;return c(void 0,void 0,void 0,(function(){var e,a,h,w,y,m,b;return u(this,(function(E){switch(E.label){case 0:e=d(n,o),a=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return r.default.stringify(e,{arrayFormat:"comma"})}(f),h="".concat(i,"/").concat(t).concat(s?"/".concat(s):"").concat(a?"?".concat(a):""),E.label=1;case 1:return E.trys.push([1,5,,6]),[4,e(h,{method:l||"GET",headers:v,body:p})];case 2:return(w=E.sent()).ok?[3,4]:[4,c(void 0,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,w.json()];case 1:return[2,null!=(e=t.sent().message)?e:null];case 2:return t.sent(),[2,null];case 3:return[2]}}))}))];case 3:return y=E.sent(),[2,Promise.reject(new Error("fetch API response status: ".concat(w.status).concat(y?"\n message is `".concat(y,"`"):"")))];case 4:return"DELETE"===l?[2]:[2,w.json()];case 5:if((m=E.sent()).data)throw m.data;if(null===(b=m.response)||void 0===b?void 0:b.data)throw m.response.data;return[2,Promise.reject(new Error("Network Error.\n Details: ".concat(m)))];case 6:return[2]}}))}))};return{get:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,a({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,a({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,a({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,a({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var t=e.endpoint,n=e.contentId,r=e.content,o=e.isDraft,i=void 0!==o&&o;return c(void 0,void 0,void 0,(function(){var e,o,c,s;return u(this,(function(u){return t?(e=i?{status:"draft"}:{},o=n?"PUT":"POST",c={"Content-Type":"application/json"},s=JSON.stringify(r),[2,a({endpoint:t,contentId:n,queries:e,method:o,customHeaders:c,customBody:s})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var t=e.endpoint,n=e.contentId,r=e.content;return c(void 0,void 0,void 0,(function(){var e,o;return u(this,(function(i){return t?("PATCH",e={"Content-Type":"application/json"},o=JSON.stringify(r),[2,a({endpoint:t,contentId:n,method:"PATCH",customHeaders:e,customBody:o})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var t=e.endpoint,n=e.contentId;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?n?("DELETE",[4,a({endpoint:t,contentId:n,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("qs"),t=require("cross-fetch"),n=require("async-retry");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),i=r(t),c=r(n),u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,u)}s((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=t.call(e,c)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}var d=function(e){return"string"==typeof e},f=function(e){var t;return t=e||("undefined"==typeof fetch?i.default:fetch),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}},l=function(e,n){var r=f(n),o="undefined"==typeof Headers?t.Headers:Headers;return function(t,n){return s(void 0,void 0,void 0,(function(){var i;return a(this,(function(c){return(i=new o(null==n?void 0:n.headers)).has("X-MICROCMS-API-KEY")||i.set("X-MICROCMS-API-KEY",e),[2,r(t,u(u({},n),{headers:i}))]}))}))}};exports.createClient=function(e){var t=e.serviceDomain,n=e.apiKey,r=e.customFetch,i=e.retry;if(!t||!n)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!d(t)||!d(n))throw new Error("parameter is not string");var u="https://".concat(t,".").concat("microcms.io","/api/").concat("v1"),f=function(e){var t=e.endpoint,d=e.contentId,f=e.queries,v=void 0===f?{}:f,p=e.method,h=e.customHeaders,y=e.customBody;return s(void 0,void 0,void 0,(function(){var e,f,w,m;return a(this,(function(b){switch(b.label){case 0:return e=l(n,r),f=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return o.default.stringify(e,{arrayFormat:"comma"})}(v),w="".concat(u,"/").concat(t).concat(d?"/".concat(d):"").concat(f?"?".concat(f):""),m=function(e){return s(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.json()];case 1:return[2,null!=(t=n.sent().message)?t:null];case 2:return n.sent(),[2,null];case 3:return[2]}}))}))},[4,c.default((function(t){return s(void 0,void 0,void 0,(function(){var n,r,o,i;return a(this,(function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),[4,e(w,{method:p||"GET",headers:h,body:y})];case 1:return 429!==(n=c.sent()).status&&n.status>=400&&n.status<500?[4,m(n)]:[3,3];case 2:return r=c.sent(),[2,t(new Error("fetch API response status: ".concat(n.status).concat(r?"\n message is `".concat(r,"`"):"")))];case 3:return n.ok?[3,5]:[4,m(n)];case 4:return r=c.sent(),[2,Promise.reject(new Error("fetch API response status: ".concat(n.status).concat(r?"\n message is `".concat(r,"`"):"")))];case 5:return"DELETE"===p?[2]:[2,n.json()];case 6:if((o=c.sent()).data)throw o.data;if(null===(i=o.response)||void 0===i?void 0:i.data)throw o.response.data;return[2,Promise.reject(new Error("Network Error.\n Details: ".concat(o)))];case 7:return[2]}}))}))}),{retries:i?2:0,onRetry:function(e,t){console.log(e),console.log("Waiting for retry (".concat(t,"/").concat(2,")"))},minTimeout:5e3})];case 1:return[2,b.sent()]}}))}))};return{get:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return s(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return t?[4,f({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return s(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return t?[4,f({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return s(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return t?[4,f({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return s(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return t?[4,f({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var t=e.endpoint,n=e.contentId,r=e.content,o=e.isDraft,i=void 0!==o&&o;return s(void 0,void 0,void 0,(function(){var e,o,c,u;return a(this,(function(s){return t?(e=i?{status:"draft"}:{},o=n?"PUT":"POST",c={"Content-Type":"application/json"},u=JSON.stringify(r),[2,f({endpoint:t,contentId:n,queries:e,method:o,customHeaders:c,customBody:u})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var t=e.endpoint,n=e.contentId,r=e.content;return s(void 0,void 0,void 0,(function(){var e,o;return a(this,(function(i){return t?("PATCH",e={"Content-Type":"application/json"},o=JSON.stringify(r),[2,f({endpoint:t,contentId:n,method:"PATCH",customHeaders:e,customBody:o})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var t=e.endpoint,n=e.contentId;return s(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return t?n?("DELETE",[4,f({endpoint:t,contentId:n,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9 |
@@ -9,2 +9,3 @@ export declare type Fetch = typeof fetch; | ||
customFetch?: Fetch; | ||
retry?: boolean; | ||
} | ||
@@ -11,0 +12,0 @@ declare type depthNumber = 1 | 2 | 3; |
export declare const BASE_DOMAIN = "microcms.io"; | ||
export declare const API_VERSION = "v1"; | ||
export declare const MAX_RETRY_COUNT = 2; | ||
export declare const MIN_TIMEOUT_MS = 5000; |
@@ -5,3 +5,3 @@ import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, WriteApiRequestResult, CreateRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent, UpdateRequest, DeleteRequest } from './types'; | ||
*/ | ||
export declare const createClient: ({ serviceDomain, apiKey, customFetch, }: MicroCMSClient) => { | ||
export declare const createClient: ({ serviceDomain, apiKey, customFetch, retry: retryOption, }: MicroCMSClient) => { | ||
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>; | ||
@@ -8,0 +8,0 @@ getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>; |
@@ -1,2 +0,2 @@ | ||
import e from"qs";import n,{Headers as t}from"cross-fetch";var r=function(){return(r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function o(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,u)}s((r=r.apply(e,n||[])).next())}))}function i(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=n.call(e,c)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}var c=function(e){return"string"==typeof e},u=function(e){var t;return t=e||("undefined"==typeof fetch?n:fetch),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}},s=function(e,n){var c=u(n),s="undefined"==typeof Headers?t:Headers;return function(n,t){return o(void 0,void 0,void 0,(function(){var o;return i(this,(function(i){return(o=new s(null==t?void 0:t.headers)).has("X-MICROCMS-API-KEY")||o.set("X-MICROCMS-API-KEY",e),[2,c(n,r(r({},t),{headers:o}))]}))}))}},a=function(n){var t=n.serviceDomain,r=n.apiKey,u=n.customFetch;if(!t||!r)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!c(t)||!c(r))throw new Error("parameter is not string");var a="https://".concat(t,".").concat("microcms.io","/api/").concat("v1"),d=function(n){var t=n.endpoint,c=n.contentId,d=n.queries,f=void 0===d?{}:d,l=n.method,v=n.customHeaders,p=n.customBody;return o(void 0,void 0,void 0,(function(){var n,d,h,m,w,y,b;return i(this,(function(E){switch(E.label){case 0:n=s(r,u),d=function(n){if(null===(t=n)||"object"!=typeof t)throw new Error("queries is not object");var t;return e.stringify(n,{arrayFormat:"comma"})}(f),h="".concat(a,"/").concat(t).concat(c?"/".concat(c):"").concat(d?"?".concat(d):""),E.label=1;case 1:return E.trys.push([1,5,,6]),[4,n(h,{method:l||"GET",headers:v,body:p})];case 2:return(m=E.sent()).ok?[3,4]:[4,o(void 0,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,m.json()];case 1:return[2,null!=(e=n.sent().message)?e:null];case 2:return n.sent(),[2,null];case 3:return[2]}}))}))];case 3:return w=E.sent(),[2,Promise.reject(new Error("fetch API response status: ".concat(m.status).concat(w?"\n message is `".concat(w,"`"):"")))];case 4:return"DELETE"===l?[2]:[2,m.json()];case 5:if((y=E.sent()).data)throw y.data;if(null===(b=y.response)||void 0===b?void 0:b.data)throw y.response.data;return[2,Promise.reject(new Error("Network Error.\n Details: ".concat(y)))];case 6:return[2]}}))}))};return{get:function(e){var n=e.endpoint,t=e.contentId,r=e.queries,c=void 0===r?{}:r;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,contentId:t,queries:c})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var n=e.endpoint,t=e.queries,r=void 0===t?{}:t;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var n=e.endpoint,t=e.contentId,r=e.queries,c=void 0===r?{}:r;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,contentId:t,queries:c})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var n=e.endpoint,t=e.queries,r=void 0===t?{}:t;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var n=e.endpoint,t=e.contentId,r=e.content,c=e.isDraft,u=void 0!==c&&c;return o(void 0,void 0,void 0,(function(){var e,o,c,s;return i(this,(function(i){return n?(e=u?{status:"draft"}:{},o=t?"PUT":"POST",c={"Content-Type":"application/json"},s=JSON.stringify(r),[2,d({endpoint:n,contentId:t,queries:e,method:o,customHeaders:c,customBody:s})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var n=e.endpoint,t=e.contentId,r=e.content;return o(void 0,void 0,void 0,(function(){var e,o;return i(this,(function(i){return n?("PATCH",e={"Content-Type":"application/json"},o=JSON.stringify(r),[2,d({endpoint:n,contentId:t,method:"PATCH",customHeaders:e,customBody:o})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var n=e.endpoint,t=e.contentId;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?t?("DELETE",[4,d({endpoint:n,contentId:t,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}};export{a as createClient}; | ||
import e from"qs";import t,{Headers as n}from"cross-fetch";import r from"async-retry";var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}u((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return c.label++,{value:s[1],done:!1};case 5:c.label++,r=s[1],s=[0];continue;case 7:s=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){c=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){c.label=s[1];break}if(6===s[0]&&c.label<o[1]){c.label=o[1],o=s;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(s);break}o[2]&&c.ops.pop(),c.trys.pop();continue}s=t.call(e,c)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var s=function(e){return"string"==typeof e},u=function(e){var n;return n=e||("undefined"==typeof fetch?t:fetch),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.apply(void 0,e)}},a=function(e,t){var r=u(t),s="undefined"==typeof Headers?n:Headers;return function(t,n){return i(void 0,void 0,void 0,(function(){var i;return c(this,(function(c){return(i=new s(null==n?void 0:n.headers)).has("X-MICROCMS-API-KEY")||i.set("X-MICROCMS-API-KEY",e),[2,r(t,o(o({},n),{headers:i}))]}))}))}},d=function(t){var n=t.serviceDomain,o=t.apiKey,u=t.customFetch,d=t.retry;if(!n||!o)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!s(n)||!s(o))throw new Error("parameter is not string");var f="https://".concat(n,".").concat("microcms.io","/api/").concat("v1"),l=function(t){var n=t.endpoint,s=t.contentId,l=t.queries,v=void 0===l?{}:l,p=t.method,h=t.customHeaders,m=t.customBody;return i(void 0,void 0,void 0,(function(){var t,l,y,w;return c(this,(function(b){switch(b.label){case 0:return t=a(o,u),l=function(t){if(null===(n=t)||"object"!=typeof n)throw new Error("queries is not object");var n;return e.stringify(t,{arrayFormat:"comma"})}(v),y="".concat(f,"/").concat(n).concat(s?"/".concat(s):"").concat(l?"?".concat(l):""),w=function(e){return i(void 0,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.json()];case 1:return[2,null!=(t=n.sent().message)?t:null];case 2:return n.sent(),[2,null];case 3:return[2]}}))}))},[4,r((function(e){return i(void 0,void 0,void 0,(function(){var n,r,o,i;return c(this,(function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),[4,t(y,{method:p||"GET",headers:h,body:m})];case 1:return 429!==(n=c.sent()).status&&n.status>=400&&n.status<500?[4,w(n)]:[3,3];case 2:return r=c.sent(),[2,e(new Error("fetch API response status: ".concat(n.status).concat(r?"\n message is `".concat(r,"`"):"")))];case 3:return n.ok?[3,5]:[4,w(n)];case 4:return r=c.sent(),[2,Promise.reject(new Error("fetch API response status: ".concat(n.status).concat(r?"\n message is `".concat(r,"`"):"")))];case 5:return"DELETE"===p?[2]:[2,n.json()];case 6:if((o=c.sent()).data)throw o.data;if(null===(i=o.response)||void 0===i?void 0:i.data)throw o.response.data;return[2,Promise.reject(new Error("Network Error.\n Details: ".concat(o)))];case 7:return[2]}}))}))}),{retries:d?2:0,onRetry:function(e,t){console.log(e),console.log("Waiting for retry (".concat(t,"/").concat(2,")"))},minTimeout:5e3})];case 1:return[2,b.sent()]}}))}))};return{get:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return i(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return t?[4,l({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return i(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return t?[4,l({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return i(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return t?[4,l({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return i(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return t?[4,l({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var t=e.endpoint,n=e.contentId,r=e.content,o=e.isDraft,s=void 0!==o&&o;return i(void 0,void 0,void 0,(function(){var e,o,i,u;return c(this,(function(c){return t?(e=s?{status:"draft"}:{},o=n?"PUT":"POST",i={"Content-Type":"application/json"},u=JSON.stringify(r),[2,l({endpoint:t,contentId:n,queries:e,method:o,customHeaders:i,customBody:u})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var t=e.endpoint,n=e.contentId,r=e.content;return i(void 0,void 0,void 0,(function(){var e,o;return c(this,(function(i){return t?("PATCH",e={"Content-Type":"application/json"},o=JSON.stringify(r),[2,l({endpoint:t,contentId:n,method:"PATCH",customHeaders:e,customBody:o})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var t=e.endpoint,n=e.contentId;return i(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return t?n?("DELETE",[4,l({endpoint:t,contentId:n,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}};export{d as createClient}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9 |
@@ -9,2 +9,3 @@ export declare type Fetch = typeof fetch; | ||
customFetch?: Fetch; | ||
retry?: boolean; | ||
} | ||
@@ -11,0 +12,0 @@ declare type depthNumber = 1 | 2 | 3; |
export declare const BASE_DOMAIN = "microcms.io"; | ||
export declare const API_VERSION = "v1"; | ||
export declare const MAX_RETRY_COUNT = 2; | ||
export declare const MIN_TIMEOUT_MS = 5000; |
@@ -5,3 +5,3 @@ import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, WriteApiRequestResult, CreateRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent, UpdateRequest, DeleteRequest } from './types'; | ||
*/ | ||
export declare const createClient: ({ serviceDomain, apiKey, customFetch, }: MicroCMSClient) => { | ||
export declare const createClient: ({ serviceDomain, apiKey, customFetch, retry: retryOption, }: MicroCMSClient) => { | ||
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>; | ||
@@ -8,0 +8,0 @@ getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>; |
@@ -15,2 +15,2 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).microcms={})}(this,(function(t){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function a(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var c,u="undefined"!=typeof Symbol&&Symbol,s=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0},p="Function.prototype.bind called on incompatible ",f=Array.prototype.slice,l=Object.prototype.toString,y="[object Function]",d=function(t){var e=this;if("function"!=typeof e||l.call(e)!==y)throw new TypeError(p+e);for(var r,n=f.call(arguments,1),o=function(){if(this instanceof r){var o=e.apply(this,n.concat(f.call(arguments)));return Object(o)===o?o:this}return e.apply(t,n.concat(f.call(arguments)))},i=Math.max(0,e.length-n.length),a=[],c=0;c<i;c++)a.push("$"+c);if(r=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var u=function(){};u.prototype=e.prototype,r.prototype=new u,u.prototype=null}return r},h=Function.prototype.bind||d,b=h.call(Function.call,Object.prototype.hasOwnProperty),m=SyntaxError,g=Function,v=TypeError,w=function(t){try{return g('"use strict"; return ('+t+").constructor;")()}catch(t){}},j=Object.getOwnPropertyDescriptor;if(j)try{j({},"")}catch(t){j=null}var O=function(){throw new v},S=j?function(){try{return O}catch(t){try{return j(arguments,"callee").get}catch(t){return O}}}():O,A="function"==typeof u&&"function"==typeof Symbol&&"symbol"==typeof u("foo")&&"symbol"==typeof Symbol("bar")&&s(),P=Object.getPrototypeOf||function(t){return t.__proto__},E={},x="undefined"==typeof Uint8Array?c:P(Uint8Array),I={"%AggregateError%":"undefined"==typeof AggregateError?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?c:ArrayBuffer,"%ArrayIteratorPrototype%":A?P([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":"undefined"==typeof Atomics?c:Atomics,"%BigInt%":"undefined"==typeof BigInt?c:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?c:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?c:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?c:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":E,"%Int8Array%":"undefined"==typeof Int8Array?c:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?c:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?P(P([][Symbol.iterator]())):c,"%JSON%":"object"==typeof JSON?JSON:c,"%Map%":"undefined"==typeof Map?c:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A?P((new Map)[Symbol.iterator]()):c,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?c:Promise,"%Proxy%":"undefined"==typeof Proxy?c:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?c:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?c:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A?P((new Set)[Symbol.iterator]()):c,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?P(""[Symbol.iterator]()):c,"%Symbol%":A?Symbol:c,"%SyntaxError%":m,"%ThrowTypeError%":S,"%TypedArray%":x,"%TypeError%":v,"%Uint8Array%":"undefined"==typeof Uint8Array?c:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?c:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?c:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?c:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?c:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?c:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?c:WeakSet},R=function t(e){var r;if("%AsyncFunction%"===e)r=w("async function () {}");else if("%GeneratorFunction%"===e)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=P(o.prototype))}return I[e]=r,r},T={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=h,F=b,_=D.call(Function.call,Array.prototype.concat),k=D.call(Function.apply,Array.prototype.splice),B=D.call(Function.call,String.prototype.replace),M=D.call(Function.call,String.prototype.slice),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,C=function(t){var e=M(t,0,1),r=M(t,-1);if("%"===e&&"%"!==r)throw new m("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new m("invalid intrinsic syntax, expected opening `%`");var n=[];return B(t,U,(function(t,e,r,o){n[n.length]=r?B(o,N,"$1"):e||t})),n},L=function(t,e){var r,n=t;if(F(T,n)&&(n="%"+(r=T[n])[0]+"%"),F(I,n)){var o=I[n];if(o===E&&(o=R(n)),void 0===o&&!e)throw new v("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new m("intrinsic "+t+" does not exist!")},q=function(t,e){if("string"!=typeof t||0===t.length)throw new v("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new v('"allowMissing" argument must be a boolean');var r=C(t),n=r.length>0?r[0]:"",o=L("%"+n+"%",e),i=o.name,a=o.value,c=!1,u=o.alias;u&&(n=u[0],k(r,_([0,1],u)));for(var s=1,p=!0;s<r.length;s+=1){var f=r[s],l=M(f,0,1),y=M(f,-1);if(('"'===l||"'"===l||"`"===l||'"'===y||"'"===y||"`"===y)&&l!==y)throw new m("property names with quotes must have matching quotes");if("constructor"!==f&&p||(c=!0),F(I,i="%"+(n+="."+f)+"%"))a=I[i];else if(null!=a){if(!(f in a)){if(!e)throw new v("base intrinsic for "+t+" exists, but the property is not available.");return}if(j&&s+1>=r.length){var d=j(a,f);a=(p=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[f]}else p=F(a,f),a=a[f];p&&!c&&(I[i]=a)}}return a},H={exports:{}};!function(t){var e=h,r=q,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||e.call(o,n),a=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var r=i(e,o,arguments);if(a&&c){var n=a(r,"length");n.configurable&&c(r,"length",{value:1+u(0,t.length-(arguments.length-1))})}return r};var s=function(){return i(e,n,arguments)};c?c(t.exports,"apply",{value:s}):t.exports.apply=s}(H);var W=q,G=H.exports,V=G(W("String.prototype.indexOf")),z=a(Object.freeze({__proto__:null,default:{}})),J="function"==typeof Map&&Map.prototype,Q=Object.getOwnPropertyDescriptor&&J?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$=J&&Q&&"function"==typeof Q.get?Q.get:null,K=J&&Map.prototype.forEach,X="function"==typeof Set&&Set.prototype,Y=Object.getOwnPropertyDescriptor&&X?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Z=X&&Y&&"function"==typeof Y.get?Y.get:null,tt=X&&Set.prototype.forEach,et="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,rt="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,nt="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,ot=Boolean.prototype.valueOf,it=Object.prototype.toString,at=Function.prototype.toString,ct=String.prototype.match,ut="function"==typeof BigInt?BigInt.prototype.valueOf:null,st=Object.getOwnPropertySymbols,pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ft=Object.prototype.propertyIsEnumerable,lt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),yt=z.custom,dt=yt&&vt(yt)?yt:null,ht="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag?Symbol.toStringTag:null;function bt(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function mt(t){return String(t).replace(/"/g,""")}function gt(t){return!("[object Array]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}function vt(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!pt)return!1;try{return pt.call(t),!0}catch(t){}return!1}var wt=Object.prototype.hasOwnProperty||function(t){return t in this};function jt(t,e){return wt.call(t,e)}function Ot(t){return it.call(t)}function St(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function At(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return At(t.slice(0,e.maxStringLength),e)+n}return bt(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Pt),"single",e)}function Pt(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function Et(t){return"Object("+t+")"}function xt(t){return t+" { ? }"}function It(t,e,r,n){return t+" ("+e+") {"+(n?Rt(r,n):r.join(", "))+"}"}function Rt(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+t.join(","+r)+"\n"+e.prev}function Tt(t,e){var r=gt(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=jt(t,o)?e(t[o],t):""}for(var i in t)jt(t,i)&&(r&&String(Number(i))===i&&i<t.length||(/[^\w$]/.test(i)?n.push(e(i,t)+": "+e(t[i],t)):n.push(i+": "+e(t[i],t))));if("function"==typeof st)for(var a=st(t),c=0;c<a.length;c++)ft.call(t,a[c])&&n.push("["+e(a[c])+"]: "+e(t[a[c]],t));return n}var Dt=q,Ft=function(t,e){var r=W(t,!!e);return"function"==typeof r&&V(t,".prototype.")>-1?G(r):r},_t=function t(e,r,n,o){var i=r||{};if(jt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(jt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!jt(i,"customInspect")||i.customInspect;if("boolean"!=typeof a)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(jt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return At(e,i);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var c=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=c&&c>0&&"object"==typeof e)return gt(e)?"[Array]":"[Object]";var u=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=Array(t.indent+1).join(" ")}return{base:r,prev:Array(e+1).join(r)}}(i,n);if(void 0===o)o=[];else if(St(o,e)>=0)return"[Circular]";function s(e,r,a){if(r&&(o=o.slice()).push(r),a){var c={depth:i.depth};return jt(i,"quoteStyle")&&(c.quoteStyle=i.quoteStyle),t(e,c,n+1,o)}return t(e,i,n+1,o)}if("function"==typeof e){var p=function(t){if(t.name)return t.name;var e=ct.call(at.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),f=Tt(e,s);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(f.length>0?" { "+f.join(", ")+" }":"")}if(vt(e)){var l=pt.call(e);return"object"==typeof e?Et(l):l}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+String(e.nodeName).toLowerCase(),d=e.attributes||[],h=0;h<d.length;h++)y+=" "+d[h].name+"="+bt(mt(d[h].value),"double",i);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+String(e.nodeName).toLowerCase()+">"}if(gt(e)){if(0===e.length)return"[]";var b=Tt(e,s);return u&&!function(t){for(var e=0;e<t.length;e++)if(St(t[e],"\n")>=0)return!1;return!0}(b)?"["+Rt(b,u)+"]":"[ "+b.join(", ")+" ]"}if(function(t){return!("[object Error]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)){var m=Tt(e,s);return 0===m.length?"["+String(e)+"]":"{ ["+String(e)+"] "+m.join(", ")+" }"}if("object"==typeof e&&a){if(dt&&"function"==typeof e[dt])return e[dt]();if("function"==typeof e.inspect)return e.inspect()}if(function(t){if(!$||!t||"object"!=typeof t)return!1;try{$.call(t);try{Z.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var g=[];return K.call(e,(function(t,r){g.push(s(r,e,!0)+" => "+s(t,e))})),It("Map",$.call(e),g,u)}if(function(t){if(!Z||!t||"object"!=typeof t)return!1;try{Z.call(t);try{$.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var v=[];return tt.call(e,(function(t){v.push(s(t,e))})),It("Set",Z.call(e),v,u)}if(function(t){if(!et||!t||"object"!=typeof t)return!1;try{et.call(t,et);try{rt.call(t,rt)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return xt("WeakMap");if(function(t){if(!rt||!t||"object"!=typeof t)return!1;try{rt.call(t,rt);try{et.call(t,et)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return xt("WeakSet");if(function(t){if(!nt||!t||"object"!=typeof t)return!1;try{return nt.call(t),!0}catch(t){}return!1}(e))return xt("WeakRef");if(function(t){return!("[object Number]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(s(Number(e)));if(function(t){if(!t||"object"!=typeof t||!ut)return!1;try{return ut.call(t),!0}catch(t){}return!1}(e))return Et(s(ut.call(e)));if(function(t){return!("[object Boolean]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(ot.call(e));if(function(t){return!("[object String]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(s(String(e)));if(!function(t){return!("[object Date]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)&&!function(t){return!("[object RegExp]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)){var w=Tt(e,s),j=lt?lt(e)===Object.prototype:e instanceof Object||e.constructor===Object,O=e instanceof Object?"":"null prototype",S=!j&&ht&&Object(e)===e&&ht in e?Ot(e).slice(8,-1):O?"Object":"",A=(j||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(S||O?"["+[].concat(S||[],O||[]).join(": ")+"] ":"");return 0===w.length?A+"{}":u?A+"{"+Rt(w,u)+"}":A+"{ "+w.join(", ")+" }"}return String(e)},kt=Dt("%TypeError%"),Bt=Dt("%WeakMap%",!0),Mt=Dt("%Map%",!0),Ut=Ft("WeakMap.prototype.get",!0),Nt=Ft("WeakMap.prototype.set",!0),Ct=Ft("WeakMap.prototype.has",!0),Lt=Ft("Map.prototype.get",!0),qt=Ft("Map.prototype.set",!0),Ht=Ft("Map.prototype.has",!0),Wt=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},Gt=String.prototype.replace,Vt=/%20/g,zt="RFC3986",Jt={default:zt,formatters:{RFC1738:function(t){return Gt.call(t,Vt,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:zt},Qt=Jt,$t=Object.prototype.hasOwnProperty,Kt=Array.isArray,Xt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Yt=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},Zt={arrayToObject:Yt,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var o=e[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var u=a[c],s=i[u];"object"==typeof s&&null!==s&&-1===r.indexOf(s)&&(e.push({obj:i,prop:u}),r.push(s))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(Kt(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,n,o){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",c=0;c<i.length;++c){var u=i.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===Qt.RFC1738&&(40===u||41===u)?a+=i.charAt(c):u<128?a+=Xt[u]:u<2048?a+=Xt[192|u>>6]+Xt[128|63&u]:u<55296||u>=57344?a+=Xt[224|u>>12]+Xt[128|u>>6&63]+Xt[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&i.charCodeAt(c)),a+=Xt[240|u>>18]+Xt[128|u>>12&63]+Xt[128|u>>6&63]+Xt[128|63&u])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(Kt(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(Kt(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!$t.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return Kt(e)&&!Kt(r)&&(o=Yt(e,n)),Kt(e)&&Kt(r)?(r.forEach((function(r,o){if($t.call(e,o)){var i=e[o];i&&"object"==typeof i&&r&&"object"==typeof r?e[o]=t(i,r,n):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var i=r[o];return $t.call(e,o)?e[o]=t(e[o],i,n):e[o]=i,e}),o)}},te=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new kt("Side channel does not contain "+_t(t))},get:function(n){if(Bt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Ut(t,n)}else if(Mt){if(e)return Lt(e,n)}else if(r)return function(t,e){var r=Wt(t,e);return r&&r.value}(r,n)},has:function(n){if(Bt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Ct(t,n)}else if(Mt){if(e)return Ht(e,n)}else if(r)return function(t,e){return!!Wt(t,e)}(r,n);return!1},set:function(n,o){Bt&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new Bt),Nt(t,n,o)):Mt?(e||(e=new Mt),qt(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=Wt(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n},ee=Zt,re=Jt,ne=Object.prototype.hasOwnProperty,oe={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ie=Array.isArray,ae=Array.prototype.push,ce=function(t,e){ae.apply(t,ie(e)?e:[e])},ue=Date.prototype.toISOString,se=re.default,pe={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ee.encode,encodeValuesOnly:!1,format:se,formatter:re.formatters[se],indices:!1,serializeDate:function(t){return ue.call(t)},skipNulls:!1,strictNullHandling:!1},fe=function t(e,r,n,o,i,a,c,u,s,p,f,l,y,d,h){var b,m=e;if(h.has(e))throw new RangeError("Cyclic object value");if("function"==typeof c?m=c(r,m):m instanceof Date?m=p(m):"comma"===n&&ie(m)&&(m=ee.maybeMap(m,(function(t){return t instanceof Date?p(t):t}))),null===m){if(o)return a&&!y?a(r,pe.encoder,d,"key",f):r;m=""}if("string"==typeof(b=m)||"number"==typeof b||"boolean"==typeof b||"symbol"==typeof b||"bigint"==typeof b||ee.isBuffer(m))return a?[l(y?r:a(r,pe.encoder,d,"key",f))+"="+l(a(m,pe.encoder,d,"value",f))]:[l(r)+"="+l(String(m))];var g,v=[];if(void 0===m)return v;if("comma"===n&&ie(m))g=[{value:m.length>0?m.join(",")||null:void 0}];else if(ie(c))g=c;else{var w=Object.keys(m);g=u?w.sort(u):w}for(var j=0;j<g.length;++j){var O=g[j],S="object"==typeof O&&void 0!==O.value?O.value:m[O];if(!i||null!==S){var A=ie(m)?"function"==typeof n?n(r,O):r:r+(s?"."+O:"["+O+"]");h.set(e,!0);var P=te();ce(v,t(S,A,n,o,i,a,c,u,s,p,f,l,y,d,P))}}return v},le=Zt,ye=Object.prototype.hasOwnProperty,de=Array.isArray,he={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:le.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},be=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},me=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ge=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,u=[];if(c){if(!r.plainObjects&&ye.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var s=0;r.depth>0&&null!==(a=i.exec(o))&&s<r.depth;){if(s+=1,!r.plainObjects&&ye.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+o.slice(a.index)+"]"),function(t,e,r,n){for(var o=n?e:me(e,r),i=t.length-1;i>=0;--i){var a,c=t[i];if("[]"===c&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var u="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,s=parseInt(u,10);r.parseArrays||""!==u?!isNaN(s)&&c!==u&&String(s)===u&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(a=[])[s]=o:a[u]=o:a={0:o}}o=a}return o}(u,e,r,n)}},ve={formats:Jt,parse:function(t,e){var r=function(t){if(!t)return he;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?he.charset:t.charset;return{allowDots:void 0===t.allowDots?he.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:he.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:he.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:he.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:he.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:he.comma,decoder:"function"==typeof t.decoder?t.decoder:he.decoder,delimiter:"string"==typeof t.delimiter||le.isRegExp(t.delimiter)?t.delimiter:he.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:he.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:he.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:he.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:he.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:he.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},o=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=e.parameterLimit===1/0?void 0:e.parameterLimit,a=o.split(e.delimiter,i),c=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?u="utf-8":"utf8=%26%2310003%3B"===a[r]&&(u="iso-8859-1"),c=r,r=a.length);for(r=0;r<a.length;++r)if(r!==c){var s,p,f=a[r],l=f.indexOf("]="),y=-1===l?f.indexOf("="):l+1;-1===y?(s=e.decoder(f,he.decoder,u,"key"),p=e.strictNullHandling?null:""):(s=e.decoder(f.slice(0,y),he.decoder,u,"key"),p=le.maybeMap(me(f.slice(y+1),e),(function(t){return e.decoder(t,he.decoder,u,"value")}))),p&&e.interpretNumericEntities&&"iso-8859-1"===u&&(p=be(p)),f.indexOf("[]=")>-1&&(p=de(p)?[p]:p),ye.call(n,s)?n[s]=le.combine(n[s],p):n[s]=p}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;a<i.length;++a){var c=i[a],u=ge(c,n[c],r,"string"==typeof t);o=le.merge(o,u,r)}return!0===r.allowSparse?o:le.compact(o)},stringify:function(t,e){var r,n=t,o=function(t){if(!t)return pe;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||pe.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=re.default;if(void 0!==t.format){if(!ne.call(re.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=re.formatters[r],o=pe.filter;return("function"==typeof t.filter||ie(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:pe.addQueryPrefix,allowDots:void 0===t.allowDots?pe.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:pe.charsetSentinel,delimiter:void 0===t.delimiter?pe.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:pe.encode,encoder:"function"==typeof t.encoder?t.encoder:pe.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:pe.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:pe.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:pe.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:pe.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):ie(o.filter)&&(r=o.filter);var i,a=[];if("object"!=typeof n||null===n)return"";i=e&&e.arrayFormat in oe?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var c=oe[i];r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var u=te(),s=0;s<r.length;++s){var p=r[s];o.skipNulls&&null===n[p]||ce(a,fe(n[p],p,c,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,u))}var f=a.join(o.delimiter),l=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?l+="utf8=%26%2310003%3B&":l+="utf8=%E2%9C%93&"),f.length>0?l+f:""}},we=function(t){return"string"==typeof t},je={exports:{}};!function(t,e){var r="undefined"!=typeof self?self:o,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,a="ArrayBuffer"in t;if(a)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&c.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function y(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function h(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t,e,r,n=y(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=d(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=s(t),e=p(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[s(t)]},l.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},l.prototype.set=function(t,e){this.map[s(t)]=p(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),f(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),f(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),f(t)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r,n,o=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),g.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function j(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},j.error=function(){var t=new j(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];j.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new j(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,i){var a=new v(t,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function u(){c.abort()}c.onload=function(){var t,e,r={status:c.status,statusText:c.statusText,headers:(t=c.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}})),e)};r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var o="response"in c?c.response:c.responseText;n(new j(o,r))},c.onerror=function(){i(new TypeError("Network request failed"))},c.ontimeout=function(){i(new TypeError("Network request failed"))},c.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},c.open(a.method,a.url,!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&o&&(c.responseType="blob"),a.headers.forEach((function(t,e){c.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),c.onreadystatechange=function(){4===c.readyState&&a.signal.removeEventListener("abort",u)}),c.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=l,t.Request=v,t.Response=j),e.Headers=l,e.Request=v,e.Response=j,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(je,je.exports);var Oe=i(je.exports),Se=function(t){var e;return e=t||("undefined"==typeof fetch?Oe:fetch),function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.apply(void 0,t)}},Ae=function(t,o){var i=Se(o),a="undefined"==typeof Headers?je.exports.Headers:Headers;return function(o,c){return r(void 0,void 0,void 0,(function(){var r;return n(this,(function(n){return(r=new a(null==c?void 0:c.headers)).has("X-MICROCMS-API-KEY")||r.set("X-MICROCMS-API-KEY",t),[2,i(o,e(e({},c),{headers:r}))]}))}))}};t.createClient=function(t){var e=t.serviceDomain,o=t.apiKey,i=t.customFetch;if(!e||!o)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!we(e)||!we(o))throw new Error("parameter is not string");var a="https://".concat(e,".").concat("microcms.io","/api/").concat("v1"),c=function(t){var e=t.endpoint,c=t.contentId,u=t.queries,s=void 0===u?{}:u,p=t.method,f=t.customHeaders,l=t.customBody;return r(void 0,void 0,void 0,(function(){var t,u,y,d,h,b,m;return n(this,(function(g){switch(g.label){case 0:t=Ae(o,i),u=function(t){if(null===(e=t)||"object"!=typeof e)throw new Error("queries is not object");var e;return ve.stringify(t,{arrayFormat:"comma"})}(s),y="".concat(a,"/").concat(e).concat(c?"/".concat(c):"").concat(u?"?".concat(u):""),g.label=1;case 1:return g.trys.push([1,5,,6]),[4,t(y,{method:p||"GET",headers:f,body:l})];case 2:return(d=g.sent()).ok?[3,4]:[4,r(void 0,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.json()];case 1:return[2,null!=(t=e.sent().message)?t:null];case 2:return e.sent(),[2,null];case 3:return[2]}}))}))];case 3:return h=g.sent(),[2,Promise.reject(new Error("fetch API response status: ".concat(d.status).concat(h?"\n message is `".concat(h,"`"):"")))];case 4:return"DELETE"===p?[2]:[2,d.json()];case 5:if((b=g.sent()).data)throw b.data;if(null===(m=b.response)||void 0===m?void 0:m.data)throw b.response.data;return[2,Promise.reject(new Error("Network Error.\n Details: ".concat(b)))];case 6:return[2]}}))}))};return{get:function(t){var e=t.endpoint,o=t.contentId,i=t.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,contentId:o,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getList:function(t){var e=t.endpoint,o=t.queries,i=void 0===o?{}:o;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getListDetail:function(t){var e=t.endpoint,o=t.contentId,i=t.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,contentId:o,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getObject:function(t){var e=t.endpoint,o=t.queries,i=void 0===o?{}:o;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},create:function(t){var e=t.endpoint,o=t.contentId,i=t.content,a=t.isDraft,u=void 0!==a&&a;return r(void 0,void 0,void 0,(function(){var t,r,a,s;return n(this,(function(n){return e?(t=u?{status:"draft"}:{},r=o?"PUT":"POST",a={"Content-Type":"application/json"},s=JSON.stringify(i),[2,c({endpoint:e,contentId:o,queries:t,method:r,customHeaders:a,customBody:s})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(t){var e=t.endpoint,o=t.contentId,i=t.content;return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){return e?("PATCH",t={"Content-Type":"application/json"},r=JSON.stringify(i),[2,c({endpoint:e,contentId:o,method:"PATCH",customHeaders:t,customBody:r})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(t){var e=t.endpoint,o=t.contentId;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?o?("DELETE",[4,c({endpoint:e,contentId:o,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return t.sent(),[2]}}))}))}}},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function r(t,e,r,o){return new(r||(r=Promise))((function(n,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function u(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((o=o.apply(t,e||[])).next())}))}function o(t,e){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function a(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})})),e}var u,c="undefined"!=typeof Symbol&&Symbol,s=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0},p="Function.prototype.bind called on incompatible ",f=Array.prototype.slice,l=Object.prototype.toString,y="[object Function]",d=function(t){var e=this;if("function"!=typeof e||l.call(e)!==y)throw new TypeError(p+e);for(var r,o=f.call(arguments,1),n=function(){if(this instanceof r){var n=e.apply(this,o.concat(f.call(arguments)));return Object(n)===n?n:this}return e.apply(t,o.concat(f.call(arguments)))},i=Math.max(0,e.length-o.length),a=[],u=0;u<i;u++)a.push("$"+u);if(r=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var c=function(){};c.prototype=e.prototype,r.prototype=new c,c.prototype=null}return r},h=Function.prototype.bind||d,m=h.call(Function.call,Object.prototype.hasOwnProperty),b=SyntaxError,v=Function,g=TypeError,w=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},j=Object.getOwnPropertyDescriptor;if(j)try{j({},"")}catch(t){j=null}var O=function(){throw new g},S=j?function(){try{return O}catch(t){try{return j(arguments,"callee").get}catch(t){return O}}}():O,A="function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&s(),P=Object.getPrototypeOf||function(t){return t.__proto__},E={},_="undefined"==typeof Uint8Array?u:P(Uint8Array),x={"%AggregateError%":"undefined"==typeof AggregateError?u:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?u:ArrayBuffer,"%ArrayIteratorPrototype%":A?P([][Symbol.iterator]()):u,"%AsyncFromSyncIteratorPrototype%":u,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":"undefined"==typeof Atomics?u:Atomics,"%BigInt%":"undefined"==typeof BigInt?u:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?u:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?u:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?u:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?u:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":E,"%Int8Array%":"undefined"==typeof Int8Array?u:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?u:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?u:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?P(P([][Symbol.iterator]())):u,"%JSON%":"object"==typeof JSON?JSON:u,"%Map%":"undefined"==typeof Map?u:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A?P((new Map)[Symbol.iterator]()):u,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?u:Promise,"%Proxy%":"undefined"==typeof Proxy?u:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?u:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?u:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A?P((new Set)[Symbol.iterator]()):u,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?u:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?P(""[Symbol.iterator]()):u,"%Symbol%":A?Symbol:u,"%SyntaxError%":b,"%ThrowTypeError%":S,"%TypedArray%":_,"%TypeError%":g,"%Uint8Array%":"undefined"==typeof Uint8Array?u:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?u:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?u:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?u:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?u:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?u:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?u:WeakSet},T=function t(e){var r;if("%AsyncFunction%"===e)r=w("async function () {}");else if("%GeneratorFunction%"===e)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=w("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(r=P(n.prototype))}return x[e]=r,r},R={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},I=h,D=m,F=I.call(Function.call,Array.prototype.concat),k=I.call(Function.apply,Array.prototype.splice),M=I.call(Function.call,String.prototype.replace),U=I.call(Function.call,String.prototype.slice),B=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,C=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new b("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new b("invalid intrinsic syntax, expected opening `%`");var o=[];return M(t,B,(function(t,e,r,n){o[o.length]=r?M(n,N,"$1"):e||t})),o},L=function(t,e){var r,o=t;if(D(R,o)&&(o="%"+(r=R[o])[0]+"%"),D(x,o)){var n=x[o];if(n===E&&(n=T(o)),void 0===n&&!e)throw new g("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:n}}throw new b("intrinsic "+t+" does not exist!")},q=function(t,e){if("string"!=typeof t||0===t.length)throw new g("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new g('"allowMissing" argument must be a boolean');var r=C(t),o=r.length>0?r[0]:"",n=L("%"+o+"%",e),i=n.name,a=n.value,u=!1,c=n.alias;c&&(o=c[0],k(r,F([0,1],c)));for(var s=1,p=!0;s<r.length;s+=1){var f=r[s],l=U(f,0,1),y=U(f,-1);if(('"'===l||"'"===l||"`"===l||'"'===y||"'"===y||"`"===y)&&l!==y)throw new b("property names with quotes must have matching quotes");if("constructor"!==f&&p||(u=!0),D(x,i="%"+(o+="."+f)+"%"))a=x[i];else if(null!=a){if(!(f in a)){if(!e)throw new g("base intrinsic for "+t+" exists, but the property is not available.");return}if(j&&s+1>=r.length){var d=j(a,f);a=(p=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[f]}else p=D(a,f),a=a[f];p&&!u&&(x[i]=a)}}return a},H={exports:{}};!function(t){var e=h,r=q,o=r("%Function.prototype.apply%"),n=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||e.call(n,o),a=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var r=i(e,n,arguments);if(a&&u){var o=a(r,"length");o.configurable&&u(r,"length",{value:1+c(0,t.length-(arguments.length-1))})}return r};var s=function(){return i(e,o,arguments)};u?u(t.exports,"apply",{value:s}):t.exports.apply=s}(H);var W=q,G=H.exports,z=G(W("String.prototype.indexOf")),V=a(Object.freeze({__proto__:null,default:{}})),J="function"==typeof Map&&Map.prototype,Q=Object.getOwnPropertyDescriptor&&J?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$=J&&Q&&"function"==typeof Q.get?Q.get:null,K=J&&Map.prototype.forEach,X="function"==typeof Set&&Set.prototype,Y=Object.getOwnPropertyDescriptor&&X?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Z=X&&Y&&"function"==typeof Y.get?Y.get:null,tt=X&&Set.prototype.forEach,et="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,rt="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ot="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,nt=Boolean.prototype.valueOf,it=Object.prototype.toString,at=Function.prototype.toString,ut=String.prototype.match,ct="function"==typeof BigInt?BigInt.prototype.valueOf:null,st=Object.getOwnPropertySymbols,pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ft=Object.prototype.propertyIsEnumerable,lt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),yt=V.custom,dt=yt&>(yt)?yt:null,ht="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag?Symbol.toStringTag:null;function mt(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function bt(t){return String(t).replace(/"/g,""")}function vt(t){return!("[object Array]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}function gt(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!pt)return!1;try{return pt.call(t),!0}catch(t){}return!1}var wt=Object.prototype.hasOwnProperty||function(t){return t in this};function jt(t,e){return wt.call(t,e)}function Ot(t){return it.call(t)}function St(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function At(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return At(t.slice(0,e.maxStringLength),e)+o}return mt(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Pt),"single",e)}function Pt(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function Et(t){return"Object("+t+")"}function _t(t){return t+" { ? }"}function xt(t,e,r,o){return t+" ("+e+") {"+(o?Tt(r,o):r.join(", "))+"}"}function Tt(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+t.join(","+r)+"\n"+e.prev}function Rt(t,e){var r=vt(t),o=[];if(r){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=jt(t,n)?e(t[n],t):""}for(var i in t)jt(t,i)&&(r&&String(Number(i))===i&&i<t.length||(/[^\w$]/.test(i)?o.push(e(i,t)+": "+e(t[i],t)):o.push(i+": "+e(t[i],t))));if("function"==typeof st)for(var a=st(t),u=0;u<a.length;u++)ft.call(t,a[u])&&o.push("["+e(a[u])+"]: "+e(t[a[u]],t));return o}var It=q,Dt=function(t,e){var r=W(t,!!e);return"function"==typeof r&&z(t,".prototype.")>-1?G(r):r},Ft=function t(e,r,o,n){var i=r||{};if(jt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(jt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!jt(i,"customInspect")||i.customInspect;if("boolean"!=typeof a)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(jt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return At(e,i);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var u=void 0===i.depth?5:i.depth;if(void 0===o&&(o=0),o>=u&&u>0&&"object"==typeof e)return vt(e)?"[Array]":"[Object]";var c=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=Array(t.indent+1).join(" ")}return{base:r,prev:Array(e+1).join(r)}}(i,o);if(void 0===n)n=[];else if(St(n,e)>=0)return"[Circular]";function s(e,r,a){if(r&&(n=n.slice()).push(r),a){var u={depth:i.depth};return jt(i,"quoteStyle")&&(u.quoteStyle=i.quoteStyle),t(e,u,o+1,n)}return t(e,i,o+1,n)}if("function"==typeof e){var p=function(t){if(t.name)return t.name;var e=ut.call(at.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),f=Rt(e,s);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(f.length>0?" { "+f.join(", ")+" }":"")}if(gt(e)){var l=pt.call(e);return"object"==typeof e?Et(l):l}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+String(e.nodeName).toLowerCase(),d=e.attributes||[],h=0;h<d.length;h++)y+=" "+d[h].name+"="+mt(bt(d[h].value),"double",i);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+String(e.nodeName).toLowerCase()+">"}if(vt(e)){if(0===e.length)return"[]";var m=Rt(e,s);return c&&!function(t){for(var e=0;e<t.length;e++)if(St(t[e],"\n")>=0)return!1;return!0}(m)?"["+Tt(m,c)+"]":"[ "+m.join(", ")+" ]"}if(function(t){return!("[object Error]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)){var b=Rt(e,s);return 0===b.length?"["+String(e)+"]":"{ ["+String(e)+"] "+b.join(", ")+" }"}if("object"==typeof e&&a){if(dt&&"function"==typeof e[dt])return e[dt]();if("function"==typeof e.inspect)return e.inspect()}if(function(t){if(!$||!t||"object"!=typeof t)return!1;try{$.call(t);try{Z.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var v=[];return K.call(e,(function(t,r){v.push(s(r,e,!0)+" => "+s(t,e))})),xt("Map",$.call(e),v,c)}if(function(t){if(!Z||!t||"object"!=typeof t)return!1;try{Z.call(t);try{$.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var g=[];return tt.call(e,(function(t){g.push(s(t,e))})),xt("Set",Z.call(e),g,c)}if(function(t){if(!et||!t||"object"!=typeof t)return!1;try{et.call(t,et);try{rt.call(t,rt)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return _t("WeakMap");if(function(t){if(!rt||!t||"object"!=typeof t)return!1;try{rt.call(t,rt);try{et.call(t,et)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return _t("WeakSet");if(function(t){if(!ot||!t||"object"!=typeof t)return!1;try{return ot.call(t),!0}catch(t){}return!1}(e))return _t("WeakRef");if(function(t){return!("[object Number]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(s(Number(e)));if(function(t){if(!t||"object"!=typeof t||!ct)return!1;try{return ct.call(t),!0}catch(t){}return!1}(e))return Et(s(ct.call(e)));if(function(t){return!("[object Boolean]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(nt.call(e));if(function(t){return!("[object String]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(s(String(e)));if(!function(t){return!("[object Date]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)&&!function(t){return!("[object RegExp]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)){var w=Rt(e,s),j=lt?lt(e)===Object.prototype:e instanceof Object||e.constructor===Object,O=e instanceof Object?"":"null prototype",S=!j&&ht&&Object(e)===e&&ht in e?Ot(e).slice(8,-1):O?"Object":"",A=(j||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(S||O?"["+[].concat(S||[],O||[]).join(": ")+"] ":"");return 0===w.length?A+"{}":c?A+"{"+Tt(w,c)+"}":A+"{ "+w.join(", ")+" }"}return String(e)},kt=It("%TypeError%"),Mt=It("%WeakMap%",!0),Ut=It("%Map%",!0),Bt=Dt("WeakMap.prototype.get",!0),Nt=Dt("WeakMap.prototype.set",!0),Ct=Dt("WeakMap.prototype.has",!0),Lt=Dt("Map.prototype.get",!0),qt=Dt("Map.prototype.set",!0),Ht=Dt("Map.prototype.has",!0),Wt=function(t,e){for(var r,o=t;null!==(r=o.next);o=r)if(r.key===e)return o.next=r.next,r.next=t.next,t.next=r,r},Gt=String.prototype.replace,zt=/%20/g,Vt="RFC3986",Jt={default:Vt,formatters:{RFC1738:function(t){return Gt.call(t,zt,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:Vt},Qt=Jt,$t=Object.prototype.hasOwnProperty,Kt=Array.isArray,Xt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Yt=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)void 0!==t[o]&&(r[o]=t[o]);return r},Zt={arrayToObject:Yt,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o<e.length;++o)for(var n=e[o],i=n.obj[n.prop],a=Object.keys(i),u=0;u<a.length;++u){var c=a[u],s=i[c];"object"==typeof s&&null!==s&&-1===r.indexOf(s)&&(e.push({obj:i,prop:c}),r.push(s))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(Kt(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,r){var o=t.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,r,o,n){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",u=0;u<i.length;++u){var c=i.charCodeAt(u);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||n===Qt.RFC1738&&(40===c||41===c)?a+=i.charAt(u):c<128?a+=Xt[c]:c<2048?a+=Xt[192|c>>6]+Xt[128|63&c]:c<55296||c>=57344?a+=Xt[224|c>>12]+Xt[128|c>>6&63]+Xt[128|63&c]:(u+=1,c=65536+((1023&c)<<10|1023&i.charCodeAt(u)),a+=Xt[240|c>>18]+Xt[128|c>>12&63]+Xt[128|c>>6&63]+Xt[128|63&c])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(Kt(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(e(t[o]));return r}return e(t)},merge:function t(e,r,o){if(!r)return e;if("object"!=typeof r){if(Kt(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(o&&(o.plainObjects||o.allowPrototypes)||!$t.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var n=e;return Kt(e)&&!Kt(r)&&(n=Yt(e,o)),Kt(e)&&Kt(r)?(r.forEach((function(r,n){if($t.call(e,n)){var i=e[n];i&&"object"==typeof i&&r&&"object"==typeof r?e[n]=t(i,r,o):e.push(r)}else e[n]=r})),e):Object.keys(r).reduce((function(e,n){var i=r[n];return $t.call(e,n)?e[n]=t(e[n],i,o):e[n]=i,e}),n)}},te=function(){var t,e,r,o={assert:function(t){if(!o.has(t))throw new kt("Side channel does not contain "+Ft(t))},get:function(o){if(Mt&&o&&("object"==typeof o||"function"==typeof o)){if(t)return Bt(t,o)}else if(Ut){if(e)return Lt(e,o)}else if(r)return function(t,e){var r=Wt(t,e);return r&&r.value}(r,o)},has:function(o){if(Mt&&o&&("object"==typeof o||"function"==typeof o)){if(t)return Ct(t,o)}else if(Ut){if(e)return Ht(e,o)}else if(r)return function(t,e){return!!Wt(t,e)}(r,o);return!1},set:function(o,n){Mt&&o&&("object"==typeof o||"function"==typeof o)?(t||(t=new Mt),Nt(t,o,n)):Ut?(e||(e=new Ut),qt(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=Wt(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o},ee=Zt,re=Jt,oe=Object.prototype.hasOwnProperty,ne={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ie=Array.isArray,ae=Array.prototype.push,ue=function(t,e){ae.apply(t,ie(e)?e:[e])},ce=Date.prototype.toISOString,se=re.default,pe={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ee.encode,encodeValuesOnly:!1,format:se,formatter:re.formatters[se],indices:!1,serializeDate:function(t){return ce.call(t)},skipNulls:!1,strictNullHandling:!1},fe=function t(e,r,o,n,i,a,u,c,s,p,f,l,y,d,h){var m,b=e;if(h.has(e))throw new RangeError("Cyclic object value");if("function"==typeof u?b=u(r,b):b instanceof Date?b=p(b):"comma"===o&&ie(b)&&(b=ee.maybeMap(b,(function(t){return t instanceof Date?p(t):t}))),null===b){if(n)return a&&!y?a(r,pe.encoder,d,"key",f):r;b=""}if("string"==typeof(m=b)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||ee.isBuffer(b))return a?[l(y?r:a(r,pe.encoder,d,"key",f))+"="+l(a(b,pe.encoder,d,"value",f))]:[l(r)+"="+l(String(b))];var v,g=[];if(void 0===b)return g;if("comma"===o&&ie(b))v=[{value:b.length>0?b.join(",")||null:void 0}];else if(ie(u))v=u;else{var w=Object.keys(b);v=c?w.sort(c):w}for(var j=0;j<v.length;++j){var O=v[j],S="object"==typeof O&&void 0!==O.value?O.value:b[O];if(!i||null!==S){var A=ie(b)?"function"==typeof o?o(r,O):r:r+(s?"."+O:"["+O+"]");h.set(e,!0);var P=te();ue(g,t(S,A,o,n,i,a,u,c,s,p,f,l,y,d,P))}}return g},le=Zt,ye=Object.prototype.hasOwnProperty,de=Array.isArray,he={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:le.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},me=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},be=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ve=function(t,e,r,o){if(t){var n=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(n),u=a?n.slice(0,a.index):n,c=[];if(u){if(!r.plainObjects&&ye.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var s=0;r.depth>0&&null!==(a=i.exec(n))&&s<r.depth;){if(s+=1,!r.plainObjects&&ye.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(a[1])}return a&&c.push("["+n.slice(a.index)+"]"),function(t,e,r,o){for(var n=o?e:be(e,r),i=t.length-1;i>=0;--i){var a,u=t[i];if("[]"===u&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var c="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,s=parseInt(c,10);r.parseArrays||""!==c?!isNaN(s)&&u!==c&&String(s)===c&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(a=[])[s]=n:a[c]=n:a={0:n}}n=a}return n}(c,e,r,o)}},ge={formats:Jt,parse:function(t,e){var r=function(t){if(!t)return he;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?he.charset:t.charset;return{allowDots:void 0===t.allowDots?he.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:he.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:he.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:he.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:he.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:he.comma,decoder:"function"==typeof t.decoder?t.decoder:he.decoder,delimiter:"string"==typeof t.delimiter||le.isRegExp(t.delimiter)?t.delimiter:he.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:he.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:he.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:he.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:he.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:he.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var o="string"==typeof t?function(t,e){var r,o={},n=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=e.parameterLimit===1/0?void 0:e.parameterLimit,a=n.split(e.delimiter,i),u=-1,c=e.charset;if(e.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?c="utf-8":"utf8=%26%2310003%3B"===a[r]&&(c="iso-8859-1"),u=r,r=a.length);for(r=0;r<a.length;++r)if(r!==u){var s,p,f=a[r],l=f.indexOf("]="),y=-1===l?f.indexOf("="):l+1;-1===y?(s=e.decoder(f,he.decoder,c,"key"),p=e.strictNullHandling?null:""):(s=e.decoder(f.slice(0,y),he.decoder,c,"key"),p=le.maybeMap(be(f.slice(y+1),e),(function(t){return e.decoder(t,he.decoder,c,"value")}))),p&&e.interpretNumericEntities&&"iso-8859-1"===c&&(p=me(p)),f.indexOf("[]=")>-1&&(p=de(p)?[p]:p),ye.call(o,s)?o[s]=le.combine(o[s],p):o[s]=p}return o}(t,r):t,n=r.plainObjects?Object.create(null):{},i=Object.keys(o),a=0;a<i.length;++a){var u=i[a],c=ve(u,o[u],r,"string"==typeof t);n=le.merge(n,c,r)}return!0===r.allowSparse?n:le.compact(n)},stringify:function(t,e){var r,o=t,n=function(t){if(!t)return pe;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||pe.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=re.default;if(void 0!==t.format){if(!oe.call(re.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=re.formatters[r],n=pe.filter;return("function"==typeof t.filter||ie(t.filter))&&(n=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:pe.addQueryPrefix,allowDots:void 0===t.allowDots?pe.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:pe.charsetSentinel,delimiter:void 0===t.delimiter?pe.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:pe.encode,encoder:"function"==typeof t.encoder?t.encoder:pe.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:pe.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:pe.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:pe.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:pe.strictNullHandling}}(e);"function"==typeof n.filter?o=(0,n.filter)("",o):ie(n.filter)&&(r=n.filter);var i,a=[];if("object"!=typeof o||null===o)return"";i=e&&e.arrayFormat in ne?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var u=ne[i];r||(r=Object.keys(o)),n.sort&&r.sort(n.sort);for(var c=te(),s=0;s<r.length;++s){var p=r[s];n.skipNulls&&null===o[p]||ue(a,fe(o[p],p,u,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var f=a.join(n.delimiter),l=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?l+="utf8=%26%2310003%3B&":l+="utf8=%E2%9C%93&"),f.length>0?l+f:""}},we=function(t){return"string"==typeof t},je={exports:{}};!function(t,e){var r="undefined"!=typeof self?self:n,o=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,o="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,a="ArrayBuffer"in t;if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function y(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function h(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||c(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t,e,r,o=y(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=d(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=s(t),e=p(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[s(t)]},l.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},l.prototype.set=function(t,e){this.map[s(t)]=p(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),f(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),f(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),f(t)},o&&(l.prototype[Symbol.iterator]=l.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,e){var r,o,n=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",o=r.toUpperCase(),v.indexOf(o)>-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}})),e}function j(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},b.call(g.prototype),b.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},j.error=function(){var t=new j(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];j.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new j(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(o,i){var a=new g(t,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),o=r.shift().trim();if(o){var n=r.join(":").trim();e.append(o,n)}})),e)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;o(new j(n,r))},u.onerror=function(){i(new TypeError("Network request failed"))},u.ontimeout=function(){i(new TypeError("Network request failed"))},u.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&n&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",c)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=l,t.Request=g,t.Response=j),e.Headers=l,e.Request=g,e.Response=j,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(o),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var i=o;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(je,je.exports);var Oe=i(je.exports),Se=function(t){var e;return e=t||("undefined"==typeof fetch?Oe:fetch),function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.apply(void 0,t)}},Ae=function(t,n){var i=Se(n),a="undefined"==typeof Headers?je.exports.Headers:Headers;return function(n,u){return r(void 0,void 0,void 0,(function(){var r;return o(this,(function(o){return(r=new a(null==u?void 0:u.headers)).has("X-MICROCMS-API-KEY")||r.set("X-MICROCMS-API-KEY",t),[2,i(n,e(e({},u),{headers:r}))]}))}))}},Pe={};function Ee(t,e){"boolean"==typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var _e=Ee;Ee.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Ee.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Ee.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var o=this;return this._timer=setTimeout((function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout((function(){o._operationTimeoutCb(o._attempts)}),o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)}),r),this._options.unref&&this._timer.unref(),!0},Ee.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Ee.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},Ee.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},Ee.prototype.start=Ee.prototype.try,Ee.prototype.errors=function(){return this._errors},Ee.prototype.attempts=function(){return this._attempts},Ee.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,r=0,o=0;o<this._errors.length;o++){var n=this._errors[o],i=n.message,a=(t[i]||0)+1;t[i]=a,a>=r&&(e=n,r=a)}return e},function(t){var e=_e;t.operation=function(r){var o=t.timeouts(r);return new e(o,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],n=0;n<e.retries;n++)o.push(this.createTimeout(n,e));return t&&t.forever&&!o.length&&o.push(this.createTimeout(n,e)),o.sort((function(t,e){return t-e})),o},t.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,o=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return o=Math.min(o,e.maxTimeout)},t.wrap=function(e,r,o){if(r instanceof Array&&(o=r,r=null),!o)for(var n in o=[],e)"function"==typeof e[n]&&o.push(n);for(var i=0;i<o.length;i++){var a=o[i],u=e[a];e[a]=function(o){var n=t.operation(r),i=Array.prototype.slice.call(arguments,1),a=i.pop();i.push((function(t){n.retry(t)||(t&&(arguments[0]=n.mainError()),a.apply(this,arguments))})),n.attempt((function(){o.apply(e,i)}))}.bind(e,u),e[a].options=r}}}(Pe);var xe=Pe;var Te=function(t,e){return new Promise((function(r,o){var n,i=e||{};function a(t){o(t||new Error("Aborted"))}function u(t,e){t.bail?a(t):n.retry(t)?i.onRetry&&i.onRetry(t,e):o(n.mainError())}"randomize"in i||(i.randomize=!0),(n=xe.operation(i)).attempt((function(e){var o;try{o=t(a,e)}catch(t){return void u(t,e)}Promise.resolve(o).then(r).catch((function(t){u(t,e)}))}))}))};t.createClient=function(t){var e=t.serviceDomain,n=t.apiKey,i=t.customFetch,a=t.retry;if(!e||!n)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!we(e)||!we(n))throw new Error("parameter is not string");var u="https://".concat(e,".").concat("microcms.io","/api/").concat("v1"),c=function(t){var e=t.endpoint,c=t.contentId,s=t.queries,p=void 0===s?{}:s,f=t.method,l=t.customHeaders,y=t.customBody;return r(void 0,void 0,void 0,(function(){var t,s,d,h;return o(this,(function(m){switch(m.label){case 0:return t=Ae(n,i),s=function(t){if(null===(e=t)||"object"!=typeof e)throw new Error("queries is not object");var e;return ge.stringify(t,{arrayFormat:"comma"})}(p),d="".concat(u,"/").concat(e).concat(c?"/".concat(c):"").concat(s?"?".concat(s):""),h=function(t){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.json()];case 1:return[2,null!=(e=r.sent().message)?e:null];case 2:return r.sent(),[2,null];case 3:return[2]}}))}))},[4,Te((function(e){return r(void 0,void 0,void 0,(function(){var r,n,i,a;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,6,,7]),[4,t(d,{method:f||"GET",headers:l,body:y})];case 1:return 429!==(r=o.sent()).status&&r.status>=400&&r.status<500?[4,h(r)]:[3,3];case 2:return n=o.sent(),[2,e(new Error("fetch API response status: ".concat(r.status).concat(n?"\n message is `".concat(n,"`"):"")))];case 3:return r.ok?[3,5]:[4,h(r)];case 4:return n=o.sent(),[2,Promise.reject(new Error("fetch API response status: ".concat(r.status).concat(n?"\n message is `".concat(n,"`"):"")))];case 5:return"DELETE"===f?[2]:[2,r.json()];case 6:if((i=o.sent()).data)throw i.data;if(null===(a=i.response)||void 0===a?void 0:a.data)throw i.response.data;return[2,Promise.reject(new Error("Network Error.\n Details: ".concat(i)))];case 7:return[2]}}))}))}),{retries:a?2:0,onRetry:function(t,e){console.log(t),console.log("Waiting for retry (".concat(e,"/").concat(2,")"))},minTimeout:5e3})];case 1:return[2,m.sent()]}}))}))};return{get:function(t){var e=t.endpoint,n=t.contentId,i=t.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,contentId:n,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getList:function(t){var e=t.endpoint,n=t.queries,i=void 0===n?{}:n;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getListDetail:function(t){var e=t.endpoint,n=t.contentId,i=t.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,contentId:n,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getObject:function(t){var e=t.endpoint,n=t.queries,i=void 0===n?{}:n;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},create:function(t){var e=t.endpoint,n=t.contentId,i=t.content,a=t.isDraft,u=void 0!==a&&a;return r(void 0,void 0,void 0,(function(){var t,r,a,s;return o(this,(function(o){return e?(t=u?{status:"draft"}:{},r=n?"PUT":"POST",a={"Content-Type":"application/json"},s=JSON.stringify(i),[2,c({endpoint:e,contentId:n,queries:t,method:r,customHeaders:a,customBody:s})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(t){var e=t.endpoint,n=t.contentId,i=t.content;return r(void 0,void 0,void 0,(function(){var t,r;return o(this,(function(o){return e?("PATCH",t={"Content-Type":"application/json"},r=JSON.stringify(i),[2,c({endpoint:e,contentId:n,method:"PATCH",customHeaders:t,customBody:r})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(t){var e=t.endpoint,n=t.contentId;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?n?("DELETE",[4,c({endpoint:e,contentId:n,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return t.sent(),[2]}}))}))}}},Object.defineProperty(t,"__esModule",{value:!0})})); |
@@ -9,2 +9,3 @@ export declare type Fetch = typeof fetch; | ||
customFetch?: Fetch; | ||
retry?: boolean; | ||
} | ||
@@ -11,0 +12,0 @@ declare type depthNumber = 1 | 2 | 3; |
export declare const BASE_DOMAIN = "microcms.io"; | ||
export declare const API_VERSION = "v1"; | ||
export declare const MAX_RETRY_COUNT = 2; | ||
export declare const MIN_TIMEOUT_MS = 5000; |
{ | ||
"name": "microcms-js-sdk", | ||
"version": "2.3.3", | ||
"version": "2.4.0", | ||
"description": "JavaScript SDK Client for microCMS.", | ||
@@ -32,2 +32,3 @@ "main": "./dist/cjs/microcms-js-sdk.js", | ||
"dependencies": { | ||
"async-retry": "^1.3.3", | ||
"cross-fetch": "^3.1.5", | ||
@@ -42,2 +43,3 @@ "encoding": "^0.1.13", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"@types/async-retry": "^1.4.5", | ||
"@types/jest": "^28.1.6", | ||
@@ -44,0 +46,0 @@ "@types/node": "^15.0.2", |
@@ -39,2 +39,3 @@ # microCMS JavaScript SDK | ||
apiKey: "YOUR_API_KEY", | ||
// retry: true // Retry attempts up to a maximum of two times. | ||
}); | ||
@@ -53,2 +54,3 @@ ``` | ||
apiKey: "YOUR_API_KEY", | ||
// retry: true // Retry attempts up to a maximum of two times. | ||
// customFetcher: fetch.bind(globalThis), // Provide a custom `fetch` implementation as an option | ||
@@ -55,0 +57,0 @@ }); |
97032
718
300
4
21
+ Addedasync-retry@^1.3.3
+ Addedasync-retry@1.3.3(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedretry@0.13.1(transitive)
- Removedobject-inspect@1.13.4(transitive)