graphql-s2s
Version:
Transpile an enriched GraphQL string schema (e.g. support for metadata, inheritance, generic types, ...) into the standard string schema understood by graphql.js and the Apollo server client.
2 lines • 435 kB
JavaScript
/*! For license information please see graphqls2s.min.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return(()=>{var __webpack_modules__={52467:(e,t,n)=>{function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a=n(96486),o=n(89940),u=o.chain,c=o.log,s=o.escapeGraphQlSchema,f=o.removeMultiSpaces,l=o.matchLeftNonGreedy,p=o.newShortId,d="░",h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)return{schema:e,directives:null};var t=[],n=(e+="░").match(/directive\s(.*?)@(.*?)(\((.*?)\)\son\s(.*?)░|\son\s(.*?)░)/gm)||[];n.forEach((function(n){var r=n.match(/@(.*?)[\s(]/)[0].replace(/(░)\s/g,"").trim().replace("(","");(e=e.replace(n,"")).match(/░$/)||(e+="░");var i=e.match(new RegExp("".concat(r,"(.*?)░"),"g"))||[],a=[];i.forEach((function(t){var n="_".concat(p(),"_"),r=t.replace(/░$/,"");e=e.replace(r,n),a.push({id:n,value:r})})),t.push({name:r.replace("@",""),body:n,directive:!0,directiveValues:a})}));var i=(e.replace(/░/g,"░░").match(/░\s*[a-zA-Z0-9_]+([^░]*?)@(.*?)░/g)||[]).map((function(e){return e.replace(/^(.*?)@/,"@").replace(/\s*░$/,"")})).reduce((function(t,n){var r=(n=n.trim().replace(/{$/,"")).match(/^@[a-zA-Z0-9_]+/)[0].slice(1),i="_".concat(p(),"_");return e=e.replace(n,i),t[r]?t[r].directiveValues.push({id:i,value:n}):(t.push(r),t[r]={name:r,body:"",directive:!0,directiveValues:[{id:i,value:n}]}),t}),[]);return i.length>0&&t.push.apply(t,r(i.map((function(e){return i[e]})))),{schema:e,directives:t}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return e;var n=t.map((function(e){return e.body})).join("░");return t.forEach((function(t){var n=t.directiveValues;return(void 0===n?[]:n).forEach((function(t){var n=t.id,r=t.value;e=e.replace(n,r)}))})),"".concat(n).concat(e)},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=h(s(e,d,"_t_").replace(/_t_/g," ")),n=t.schema,r=t.directives,i=n.match(/@(.*?)(░)(.*?)({|░)/gm),o=u(a(i).map((function(e){return u(e.split(d)).next((function(t){if(t.length<2)throw new Error("Schema error: Misused metadata attribute in '".concat(t.join(" "),".'"));var r="".concat(t[0].trim()," ").match(/@(.*?)(\s|{|\(|\[)/);if(!r){var i="Schema error: Impossible to extract type from metadata attribute ".concat(t[0]);throw c(i),new Error(i)}var a=r[1].trim(),o=t[0].replace("@".concat(a),"").trim(),s=u(f(t[1].trim())).next((function(e){return e.match(/^(type\s|input\s|enum\s|interface\s)/)?u(e.split(" ")).next((function(e){return{schemaType:e[0].toUpperCase(),value:e[1].replace(/ /g,"").replace(/{$/,"")}})).val():{schemaType:"PROPERTY",value:e}})).val(),p=s.schemaType,d=s.value,h="PROPERTY"==p?u(n.split(e).join("___replace___")).next((function(e){return l(e,"(type |input |enum |interface )","___replace___")})).next((function(e){if(!e)throw new Error("Schema error: Property '".concat(d,"' with metadata '@").concat(d,"' does not live within any schema type (e.g. type, enum, interface, input, ...)"));return{type:e[1].trim().toUpperCase(),name:e[2].replace(/{/g," ").replace(/░/g," ").trim().split(" ")[0]}})).val():null;return{name:a,body:o,schemaType:p,schemaName:d,parent:h}})).val()}))).next((function(e){return e.map((function(t){return"PROPERTY"==t.schemaType&&t.parent?u(e.find((function(e){return e.schemaType==t.parent.type&&e.schemaName==t.parent.name}))).next((function(e){return e?(t.parent.metadata={type:e.schemaType,name:e.name},t):t})).val():t}))})).next((function(e){return a.toArray(e).concat(r)})).val()||[];return o.escSchema=n,o};e.exports={extractGraphMetadata:y,removeGraphMetadata:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=y(e)||[],n=t.filter((function(e){return e.directive})),r=(v(t.escSchema.replace(/@(.*?)░/g,""),n)||"").replace(/░/g,"\n");return{stdSchema:r,metadata:t}}}},88539:(module,__unused_webpack_exports,__webpack_require__)=>{function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){u=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(u)throw i}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=__webpack_require__(96486),_require=__webpack_require__(89940),chain=_require.chain,log=_require.log,escapeGraphQlSchema=_require.escapeGraphQlSchema,getQueryAST=_require.getQueryAST,buildQuery=_require.buildQuery,newShortId=_require.newShortId,isScalarType=_require.isScalarType,_require2=__webpack_require__(52467),extractGraphMetadata=_require2.extractGraphMetadata,removeGraphMetadata=_require2.removeGraphMetadata,GENERICTYPEREGEX=/<(.*?)>/,TYPENAMEREGEX=/type\s(.*?){/,INPUTNAMEREGEX=/input\s(.*?){/,ENUMNAMEREGEX=/enum\s(.*?){/,INTERFACENAMEREGEX=/interface\s(.*?){/,ABSTRACTNAMEREGEX=/abstract\s(.*?){/,INHERITSREGEX=/inherits\s+[\w<>]+(?:\s*,\s*\w+)*/g,IMPLEMENTSREGEX=/implements\s(.*?)\{/gm,PROPERTYPARAMSREGEX=/\((.*?)\)/,TYPE_REGEX={regex:/(extend type|type)\s(.*?){(.*?)░([^#]*?)}/gm,type:"type"},INPUT_REGEX={regex:/(extend input|input)\s(.*?){(.*?)░([^#]*?)}/gm,type:"input"},ENUM_REGEX={regex:/enum\s(.*?){(.*?)░([^#]*?)}/gm,type:"enum"},INTERFACE_REGEX={regex:/(extend interface|interface)\s(.*?){(.*?)░([^#]*?)}/gm,type:"interface"},ABSTRACT_REGEX={regex:/(extend abstract|abstract)\s(.*?){(.*?)░([^#]*?)}/gm,type:"abstract"},SCALAR_REGEX={regex:/(.{1}|.{0})scalar\s(.*?)([^\s]*?)(?![a-zA-Z0-9])/gm,type:"scalar"},UNION_REGEX={regex:/(.{1}|.{0})union([^\n]*?)\n/gm,type:"union"},carrReturnEsc="░",tabEsc="_t_",_s={},escapeGraphQlSchemaPlus=function(e,t,n){return e?(_s[e]||(_s[e]=escapeGraphQlSchema(e,t,n)),_s[e]):e},escapeDirectives=function(e,t){return(t||[]).filter((function(e){var t=e.directiveValues;return t&&t[0]&&t[0].id&&t[0].value})).reduce((function(e,t){var n=t.directiveValues;return e.push.apply(e,_toConsumableArray(n)),e}),[]).reduce((function(e,t){var n=t.id,r=t.value;return e[0]=e[0].replace(r,n),e[1].push({id:n,value:r}),e}),[e,[]])},_getSchemaBits=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=escapeGraphQlSchemaPlus(e,carrReturnEsc,tabEsc),r=[].concat(_toConsumableArray(n.match(/#(.*?)░/g)||[]),_toConsumableArray(n.match(/"""░(.*?)░\s*"""░/g)||[]),_toConsumableArray(n.match(/"([^"]+)"░/g)||[])),i=r.reduce((function(e,t){var n="#".concat(newShortId(),"░");return e.schema=e.schema.replace(t,n),e.tokens.push({id:n,value:t}),e}),{schema:n,tokens:[]}),a=i.schema,o=i.tokens,u=" "+e.replace(/#(.*?)\n/g,"").replace(/"""\s*\n([^]*?)\n\s*"""\s*\n/g,"").replace(/"([^"]+)"\n/g,"")+"\n",c=escapeGraphQlSchemaPlus(u,carrReturnEsc,tabEsc),s=escapeDirectives(a,t),f=_slicedToArray(s,2),l=f[0],p=f[1];return _.flatten([TYPE_REGEX,INPUT_REGEX,ENUM_REGEX,INTERFACE_REGEX,ABSTRACT_REGEX,SCALAR_REGEX,UNION_REGEX].map((function(e){return chain(("scalar"==e.type?c:"union"==e.type?u:l).match(e.regex)||[]).next((function(t){return"scalar"==e.type?t.filter((function(e){return 0==e.indexOf("scalar")||e.match(/^(?![a-zA-Z0-9])/)})):"union"==e.type?t.filter((function(e){return 0==e.indexOf("union")||e.match(/^(?![a-zA-Z0-9])/)})):t})).next((function(e){return e.map((function(e){return(e.match(/#(.*?)░/g)||[]).reduce((function(e,t){var n=(o.find((function(e){return e.id==t}))||{}).value;return n?e.replace(t,n):e}),e)}))})).next((function(t){var n="scalar"==e.type?_breakdownScalarBit:"union"==e.type?_breakdownUnionBit:function(e){return _breakdownSchemabBit(e,p)};return t.map((function(e){return n(e)}))})).val()})))},_breakdownSchemabBit=function(e,t){t=t||[];var n=e.match(/{(.*?)░([^#]*?)}/);if(!n){var r="Schema error: Missing block";throw log(r),new Error(r)}var i=_slicedToArray(t.reduce((function(e,t){var n=t.id,r=t.value;return e[0]=e[0].replace(n,r),e[1]=e[1].replace(n,r),e}),[n[0],e.split(carrReturnEsc).join(" ").split(tabEsc).join(" ").replace(/ +(?= )/g,"").trim()]),2),a=i[0],o=i[1],u=_.toArray(_(a.replace(/_t_/g,"").replace(/^{/,"").replace(/}$/,"").split(carrReturnEsc).map((function(e){return e.trim()}))).filter((function(e){return""!=e}))),c=0==o.indexOf("extend")?{property:o.replace("extend ",""),extend:!0}:{property:o,extend:!1};return{property:c.property,block:u,extend:c.extend}},_breakdownScalarBit=function(e){var t=(e.split(" ").slice(-1)||[])[0];return{property:"scalar ".concat(t),block:t,extend:!1}},_breakdownUnionBit=function(e){var t=e.replace(/(^union\s|\sunion\s|\n)/g,"").trim();return{property:"union ".concat(t),block:t,extend:!1}},_getSchemaEntity=function(e){return 0==e.indexOf("type")?{type:"TYPE",name:e.match(/type\s+(.*?)\s+.*/)[1].trim()}:0==e.indexOf("enum")?{type:"ENUM",name:e.match(/enum\s+(.*?)\s+.*/)[1].trim()}:0==e.indexOf("input")?{type:"INPUT",name:e.match(/input\s+(.*?)\s+.*/)[1].trim()}:0==e.indexOf("interface")?{type:"INTERFACE",name:e.match(/interface\s+(.*?)\s+.*/)[1].trim()}:0==e.indexOf("union")?{type:"UNION",name:e.match(/union\s+(.*?)\s+.*/)[1].trim()}:0==e.indexOf("scalar")?{type:"SCALAR",name:e.match(/scalar\s+(.*?)\s+.*/)[1].trim()}:{type:null,name:null}},_getCommentsBits=function(e){return(escapeGraphQlSchemaPlus(e,carrReturnEsc,tabEsc).match(/░\s*[#"](.*?)░([^#"]*?)({|}|:)/g)||[]).filter((function(e){return e.match(/{$/)})).map((function(e){var t=_(e.split(carrReturnEsc).map((function(e){return e.replace(/_t_/g," ").trim()}))).filter((function(e){return""!=e})),n=t.reduce((function(e,t){return e.count=e.count+(0==t.indexOf("#")||0==t.indexOf('"')||e.inComment?1:0),0===t.indexOf('"""')&&(e.inComment=!e.inComment),e}),{count:0,inComment:!1}).count;return{text:t.initial(),property:_getSchemaEntity(t.last()),comments:n==t.size()-1}})).filter((function(e){return e.comments})).map((function(e){return{text:e.text.join("\n"),property:e.property}}))},_genericDefaultNameAlias=function(e){if(!e)return"";var t=e.match(GENERICTYPEREGEX);if(t){var n=e.split(t[0]);return"".concat(n[0]).concat(t[1].split(",").map((function(e){return e.trim()})).join(""))}return e},_replaceGenericWithType=function(e,t,n){return chain({gType:e.replace(/\s/g,""),gLetters:t.map((function(e){return e.replace(/\s/g,"")})),cTypes:n.split(",").map((function(e){return e.replace(/\s/g,"")}))}).next((function(r){var i=r.gType,a=r.gLetters,o=r.cTypes,u=o.length,c=0==i.indexOf("[")&&i.indexOf("]")>0,s=i.match(/!$/)?"!":"";if(a.length!=u)throw new Error("Invalid argument exception. Mismatch between the number of types in 'genericLetters' (".concat(t.join(","),") and 'concreteType' (").concat(n,")."));if(1==a.length&&i.replace(/!$/,"")==a[0])return"".concat(o[0]).concat(s);if(i.indexOf("<")>0&&i.indexOf(">")>0){var f=c?i.match(/\[(.*?)\]/)[1]:i,l=f.match(/.*</)[0].replace(/<$/,"").trim(),p=f.match(/<(.*?)>/)[1].split(",").map((function(e){return e.trim()}));if(p.length!=a.length)throw new Error("Invalid argument exception. Mismatch between the number of types in 'genericLetters' (".concat(t.join(","),") and 'genericType' (").concat(e,")."));var d=p.map((function(n){for(var r=0;r<u;r++)if(a[r]==n)return o[r];throw new Error("Invalid argument exception. Mismatch types between the 'genericType' (".concat(e,") and the allowed types 'genericLetters' (").concat(t.join(","),")."))})),h="".concat(l,"<").concat(d.join(","),">");return c?"[".concat(h,"]").concat(s):"".concat(h).concat(s)}var v=(c?i.match(/\[(.*?)\]/)[1]:i).split(",").map((function(n){var r=/!$/.test(n);n=(r?n.replace(/!$/,""):n).trim();for(var i=0;i<u;i++)if(a[i]==n)return"".concat(o[i]).concat(r?"!":"");throw new Error("Invalid argument exception. Mismatch types between the 'genericType' (".concat(e,") and the allowed types 'genericLetters' (").concat(t.join(","),")."))})).join(",");return c?"[".concat(v,"]").concat(s):"".concat(v).concat(s)})).val()},memoizedGenericNameAliases={},_getAliasName=function(e,t){if(memoizedGenericNameAliases[e])return memoizedGenericNameAliases[e];var n=e.match(/.*</)[0],r=Array.isArray(t)?_getAllAliases(t).find((function(e){return 0==e.schemaName.indexOf(n)})):t&&"alias"==t.name?t:null,i=r&&r.body?getGenericAlias(r.body)(e):_genericDefaultNameAlias(e);return memoizedGenericNameAliases[e]=i,i},memoizedAliases=null,_getAllAliases=function(e){return memoizedAliases||chain((e||[]).filter((function(e){return"alias"==e.name}))).next((function(e){return memoizedAliases=e,e})).val()},memoizedGenericSchemaObjects={},_getTypeDetails=function(e,t,n){return chain((e.match(GENERICTYPEREGEX)||[])[1]).next((function(r){var i=!!r,a=i?r.split(",").map((function(e){return e.trim()})):null,o=e.replace(/@.+/,"").trim(),u=(e.match(/@.+/)||[])[0],c=o.match(/!$/)?"!":"",s=i&&n&&n.length>0&&a.some((function(e){return n.some((function(t){return e==t}))}));return{originName:o,directive:u,isGen:i,dependsOnParent:s,metadata:t,genericParentTypes:n,name:i&&!s?"".concat(_getAliasName(o,t)).concat(c):o}})).next((function(e){return e.isGen&&!memoizedGenericSchemaObjects[e.name]&&(memoizedGenericSchemaObjects[e.name]=e),e})).val()},_getTranspiledParams=function(e,t){return chain(e.split(",")).next((function(e){var n=[];return e.forEach((function(r){var i=!!r.match(GENERICTYPEREGEX),a=i?e.map((function(e){return e.trim()})):null;if(r){var o=_slicedToArray(r.split(":").map((function(e){return e.trim()})),2),u=o[0],c=o[1],s=c.match(/!$/)?"!":"",f=i&&t&&t.length>0&&a.some((function(e){return t.some((function(t){return e===t}))})),l={paramName:u,originName:c,isGen:i,name:i&&!f?"".concat(_getAliasName(c)).concat(s):c};l.isGen&&!memoizedGenericSchemaObjects[l.name]&&(memoizedGenericSchemaObjects[l.name]=l),n.push("".concat(l.paramName,": ").concat(l.name))}})),n})).next((function(e){return e.join(", ")})).val()},_getPropertyValue=function(e,t){var n=e.name,r=e.params,i=e.result,a="".concat(n).concat(r?"(".concat(r,")"):""),o="",u="";return i&&i.name&&(o=": ",u=t?t(i.name):i.name,i.directive&&(u="".concat(u," ").concat(i.directive))),"".concat(a).concat(o).concat(u)},_getBlockProperties=function(e,t,n){return chain(_(n).filter((function(e){return"PROPERTY"==e.schemaType&&e.parent&&e.parent.type==t.type&&e.parent.name==t.name}))).next((function(r){return _(e).reduce((function(e,i){var a=i.trim(),o=r.filter((function(e){return e.schemaName==a})).first()||null;if(0==a.indexOf("#")||0==a.indexOf('"')||e.insideComment)0===a.indexOf('"""')&&(e.insideComment=!e.insideComment),e.comments.push(a);else{var u=a.replace(/ +(?= )/g,"").replace(/,$/,""),c=u.replace(/@.+/,"").match(PROPERTYPARAMSREGEX),s=c?chain(u.split(c[0])).next((function(e){return{name:e[0].trim(),metadata:o,params:_getTranspiledParams(c[1],t.genericTypes),result:_getTypeDetails((e[1]||"").replace(":","").trim(),n,t.genericTypes)}})).val():chain(u.split(":")).next((function(e){return{name:e[0].trim(),metadata:o,params:null,result:_getTypeDetails(e.slice(1).join(":").trim(),n,t.genericTypes)}})).val();e.props.push({comments:e.comments.join("\n "),details:s,value:_getPropertyValue(s)}),e.comments=[]}return e}),{insideComment:!1,comments:[],props:[]}).props})).val()},_getSchemaObject=function(e,t,n,r){return _.toArray(_(e).filter((function(e){return 0==e.property.indexOf(t)})).map((function(e){if("scalar"==t)return{type:"SCALAR",extend:!1,name:e.block,metadata:null,genericType:!1,blockProps:[],inherits:null,implements:null};if("union"==t)return{type:"UNION",extend:!1,name:e.block,metadata:null,genericType:!1,blockProps:[],inherits:null,implements:null};var i=e.property.match(/(.*?){/);if(!i||i[0].indexOf("#")>=0)throw new Error("Schema error: Syntax error in '".concat(e.property,"'. Cannot any find schema type definition."));var a=i[0],o=a.match(n);if(!o)throw new Error("Schema error: ".concat(t," with missing name."));var u=o[1].trim().split(" ")[0],c=u.match(GENERICTYPEREGEX),s=c?c[1]:null,f=a.match(INHERITSREGEX),l=f&&f[0].replace("inherits","").trim().split(",").map((function(e){return e.trim()}))||null,p=a.match(IMPLEMENTSREGEX),d=(a.match(/@[a-zA-Z0-9_]+(.*?)$/)||[""])[0].trim().replace(/{$/,"").trim()||null,h=p?p[0].replace("implements ","").replace("{","").split(",").map((function(e){return e.trim().split(" ")[0]})):null,v=t.toUpperCase(),y=r&&_(r).filter((function(e){return e.schemaType==v&&e.schemaName==u})).first()||null,m=s?s.split(",").map((function(e){return e.trim()})):null,g={type:v,name:u,genericTypes:m};return{type:v,extend:e.extend,name:u,metadata:y,directive:d,genericType:s,blockProps:_getBlockProperties(e.block,g,r),inherits:l,implements:h}})))},getGenericAlias=function getGenericAlias(s){return s?function(genName){return chain(genName.match(GENERICTYPEREGEX)).next((function(m){return m?chain(m[1].split(",").map((function(e){return'"'.concat(e.trim(),'"')})).join(",")).next((function(genericTypeName){return eval(s+"("+genericTypeName+")")})).val():genName})).val()}:_genericDefaultNameAlias},_getInterfaces=function(e,t){return _getSchemaObject(e,"interface",INTERFACENAMEREGEX,t)},_getAbstracts=function(e,t){return _getSchemaObject(e,"abstract",ABSTRACTNAMEREGEX,t)},_getTypes=function(e,t){return _getSchemaObject(e,"type",TYPENAMEREGEX,t)},_getInputs=function(e,t){return _getSchemaObject(e,"input",INPUTNAMEREGEX,t)},_getEnums=function(e,t){return _getSchemaObject(e,"enum",ENUMNAMEREGEX,t)},_getScalars=function(e,t){return _getSchemaObject(e,"scalar",null,t)},_getUnions=function(e,t){return _getSchemaObject(e,"union",null,t)},_getCanonicalGenericType=function(e){var t=_slicedToArray((e||"").match(/<(.*?)>/)||[],2)[1];if(!t)return"";var n=t.split(",").map((function(e,t){return t})).join(",");return e.replace(/<(.*?)>/,"<".concat(n,">"))},_isGenericTypeDefined=function(e,t){if(!e||!t||0===t.length)return!1;var n=_getCanonicalGenericType(e);return!!n&&t.filter((function(e){return e.genericType})).map((function(e){var t=e.name;return _getCanonicalGenericType(t)})).some((function(e){return e===n}))},_getDefaultGenericName=function(e){return(e||"").replace(/[<>,\s]/g,"")},_memoizedConcreteGenericTypes={},_resolveGenericType=function e(t){var n=t.concreteGenericTypeName,r=t.rawSchemaTypes,i=t.comments,a=t.aliasName||_getDefaultGenericName(n);if(_memoizedConcreteGenericTypes[a])return _memoizedConcreteGenericTypes[a];var o=((n.match(/.+</)||[])[0]||"").replace(/\[/g,"");if(!o)throw new Error("Schema error: Cannot find type in generic object ".concat(n));var u=r.find((function(e){return 0==e.name.indexOf(o)}));if(!u)throw new Error("Schema error: Cannot find any definition for generic type starting with ".concat(o));if(!u.genericType)throw new Error("Schema error: Schema object ".concat(u.name," is not generic!"));var c=((n.match(/<(.*?)>/)||[])[1]||"").split(",").map((function(e){return e.trim()})).filter((function(e){return e}));c.map((function(e){isScalarType(e)||_getType(e,r,i)})),(u.inherits||[]).map((function(e){return _getType(e,r,i)})).map((function(e){if(!_inheritingIsAllowed(u,e))throw new Error("Schema error: "+u.type.toLowerCase()+" "+u.name+" cannot inherit from "+e.type+" "+e.name+".");return _resolveSchemaType(e,r,i)}));var s=u.blockProps.map((function(t){var n=t,a=c.join(",");if(isTypeGeneric(t.details.result.name,u.genericType)){var o={name:t.details.name,params:t.params,result:{originName:t.details.originName,isGen:t.details.isGen,name:_replaceGenericWithType(t.details.result.name,u.genericType.split(","),a)}};if(t.details.result.dependsOnParent){var s=t.details.result.name.match(/!$/),f=s?t.details.result.name.replace(/!$/,""):t.details.result.name,l=f.match(/^\[.*\]$/),p=_replaceGenericWithType(f,t.details.result.genericParentTypes,a),d=l?p.replace(/^\[|\]$/g,""):p,h=_getTypeDetails(d,t.details.result.metadata).name||_getDefaultGenericName(d),v=l?"[".concat(h,"]"):h;v+=s?"!":"",v=t.details.result.directive?"".concat(v," ").concat(t.details.result.directive):v,o.result={originName:t.details.result.directive?"".concat(t.details.result.name," ").concat(t.details.result.directive):t.details.result.name,isGen:!0,name:v},e({concreteGenericTypeName:d,rawSchemaTypes:r,comments:i,aliasName:h})}n={comments:t.comments,details:o,value:_getPropertyValue(o)}}return n})),f={comments:_getPropertyComments(u,i),type:u.type,name:a,implements:u.implements,blockProps:s,genericType:null};return _memoizedConcreteGenericTypes[a]=f,f},_getType=function(e,t,n){var r=t.find((function(t){return t.name==e}));if(!r){if(!_isGenericTypeDefined(e,t))throw new Error("Schema error: Type '".concat(e,"' cannot be found in the schema."));r=_resolveGenericType({concreteGenericTypeName:e,rawSchemaTypes:t,comments:n})}return r},_resolveGenericBlockProperies=function(e,t,n){return(e||[]).forEach((function(e){e&&e.details&&e.details.result&&e.details.result.isGen&&!e.details.result.dependsOnParent&&_resolveGenericType({concreteGenericTypeName:e.details.result.originName,rawSchemaTypes:t,comments:n,aliasName:e.details.result.name})}))},memoizedExtendedObject={},_resolveSchemaType=function e(t,n,r){var i=function(){if(!t||!n||!t.inherits)return _resolveUsingTrivialMethod(t,n,r);var i="".concat(t.type,"_").concat(t.name,"_").concat(t.genericType);if(memoizedExtendedObject[i])return memoizedExtendedObject[i];var a=t.inherits.map((function(e){return _getType(e,n,r)})).map((function(i){if(!_inheritingIsAllowed(t,i))throw new Error("Schema error: "+t.type.toLowerCase()+" "+t.name+" cannot inherit from "+i.type+" "+i.name+".");return e(i,n,r)})),o=a.length?a.reduce((function(e,t){var n=t.blockProps.filter((function(t){return!e.some((function(e){return e.details.name==t.details.name}))}));return e.push.apply(e,_toConsumableArray(n)),e}),t.blockProps):t.blockProps;_resolveGenericBlockProperies(o,n,r);var u={type:t.type,name:t.name,genericType:t.genericType,originalBlockProps:t.blockProps,metadata:t.metadata||_.last(a).metadata||null,directive:t.directive,implements:_.toArray(_.uniq(_.concat(t.implements,a.implements).filter((function(e){return e})))),inherits:a,blockProps:o};return memoizedExtendedObject[i]=u,_resolveUsingTrivialMethod(u,n,r)}();return _addComments(i,r)},_inheritingIsAllowed=function(e,t){return"TYPE"===e.type?"TYPE"===t.type||"INTERFACE"===t.type:e.type===t.type},_resolveUsingTrivialMethod=function(e,t,n){if(e&&e.blockProps&&_resolveGenericBlockProperies(e.blockProps,t,n),e&&t&&e.implements&&e.implements.length>0){var r=_.toArray(_.uniq(_.flatten(_.concat(e.implements.map((function(e){return _getInterfaceWithAncestors(e,t)}))))));return{type:e.type,name:e.name,genericType:e.genericType,originalBlockProps:e.blockProps,metadata:e.metadata,implements:r,inherits:e.inherits,blockProps:e.blockProps}}return e},memoizedInterfaceWithAncestors={},_getInterfaceWithAncestors=function e(t,n){if(memoizedInterfaceWithAncestors[t])return memoizedInterfaceWithAncestors[t];var r=n.filter((function(e){return e.name==t}))[0];if(!r)throw new Error("Schema error: interface ".concat(t," is not defined."));if("INTERFACE"!=r.type)throw new Error("Schema error: Schema property ".concat(t," is not an interface. It cannot be implemented."));var i=r.implements&&r.implements.length>0?_.toArray(_.uniq(_.flatten(_.concat([t],r.implements,r.implements.map((function(t){return e(t,n)})))))):[t];return memoizedInterfaceWithAncestors[t]=i,i},_getPropertyComments=function(e,t){var n=e||{},r=n.type,i=n.name;return r&&i&&((t||[]).filter((function(e){return e.property.type==r&&e.property.name==i}))[0]||{}).text||""},_addComments=function(e,t){return e.comments=_getPropertyComments(e,t),e},_parseSchemaObjToString=function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6?arguments[6]:void 0;return["".concat(e&&""!=e?"\n".concat(e):""),"".concat(a?"extend ":"").concat(t.toLowerCase()," ").concat(n.replace("!","")).concat(r&&r.length>0?" implements ".concat(r.join(", ")):""," ").concat(i.some((function(e){return e}))?"".concat(o?" ".concat(o," "):"","{"):""," "),i.map((function(e){return" ".concat(""!=e.comments?"".concat(e.comments,"\n "):"").concat(e.value)})).join("\n"),i.some((function(e){return e}))?"}":""].filter((function(e){return e})).join("\n")},SANITIZE_GEN_TYPE_REGEX=/^\[|\s|\](\s*)(!*)(\s*)$|!/g,isTypeGeneric=function(e,t){var n=e?e.replace(SANITIZE_GEN_TYPE_REGEX,""):e,r=t?t.replace(SANITIZE_GEN_TYPE_REGEX,""):t;if(n&&r){if(n==r)return!0;if(n.indexOf("<")>0&&n.indexOf(">")>0){var i=r.split(",");return(n.match(/<(.*?)>/)||[null,""])[1].split(",").some((function(e){return i.some((function(t){return t==e.trim()}))}))}return r.split(",").some((function(e){return e.trim()==n}))}return!1},getSchemaParts=function(e,t){t=t||[];var n=_getCommentsBits(e),r=_getSchemaBits(e,t),i=[_getInterfaces,_getAbstracts,_getTypes,_getInputs,_getEnums,_getScalars,_getUnions].reduce((function(e,n){var i=n(r,t)||[];return e.push.apply(e,_toConsumableArray(i)),e}),[]);Object.keys(memoizedGenericSchemaObjects).map((function(e){return memoizedGenericSchemaObjects[e]})).filter((function(e){var t=e.paramName,n=e.isGen;return t&&n})).map((function(e){var t=e.originName,r=e.name;return _resolveGenericType({concreteGenericTypeName:t,rawSchemaTypes:i,comments:n,aliasName:r})}));var a=i.map((function(e){return _resolveSchemaType(e,i,n)})),o=Object.keys(_memoizedConcreteGenericTypes).map((function(e){return _memoizedConcreteGenericTypes[e]})),u=[].concat(_toConsumableArray(a),_toConsumableArray(o)),c=(t||[]).filter((function(e){return e.directive}));return c.length>0&&u.push.apply(u,_toConsumableArray(c.map((function(e){return{type:"DIRECTIVE",name:e.name,raw:(e.body||"").replace(/░/g,"\n"),extend:!1,metadata:null,genericType:null,blockProps:[],inherits:null,implements:null,comments:void 0}})))),u},resetMemory=function(){return _s={},_memoizedConcreteGenericTypes=null,_memoizedConcreteGenericTypes={},memoizedGenericSchemaObjects=null,memoizedGenericSchemaObjects={},memoizedExtendedObject=null,memoizedExtendedObject={},memoizedInterfaceWithAncestors=null,memoizedInterfaceWithAncestors={},memoizedGenericNameAliases=null,memoizedGenericNameAliases={},memoizedAliases=null,1},_buildASTs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter((function(e){return!e.genericType&&"ABSTRACT"!=e.type&&"DIRECTIVE"!=e.type})).map((function(e){return _parseSchemaObjToString(e.comments,e.type,e.name,e.implements,e.blockProps,e.extend,e.directive)})).join("\n"),n=e.filter((function(e){return"DIRECTIVE"==e.type&&e.raw})).map((function(e){return e.raw})).join("");return n+"\n"+t},getSchemaAST=function(e){resetMemory();var t=removeGraphMetadata(e),n=t.stdSchema,r=t.metadata,i=getSchemaParts(n,r,!0);return resetMemory(),i},transpile=function(e){var t=getSchemaAST(e);return _buildASTs(t)},graphqls2s={getSchemaAST,transpileSchema:transpile,extractGraphMetadata,getGenericAlias,getQueryAST,buildQuery,isTypeGeneric};"undefined"!=typeof window&&(window.graphqls2s=graphqls2s),module.exports.graphqls2s=graphqls2s},89940:(e,t,n)=>{function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var o,u=n(10020).parse,c=n(14670),s=function e(t){return{next:function(n){return e(n(t))},val:function(){return t}}},f=function(e,t){return!e||function(){throw new Error(t)}()},l={ID:!0,String:!0,Float:!0,Int:!0,Boolean:!0},p=function(e){return l[e]},d=function(e,t){return s(f(!e,"Error in method 'isNodeType': Argument 'type' is required.")).next((function(){return e.replace(/!$/,"")})).next((function(e){return(e.match(/^\[(.*?)\]$/)||[null,e])[1]})).next((function(e){return!p(e)&&s({type:e,typeAST:t.find((function(t){return t.name==e}))}).next((function(e){var t=e.type,n=e.typeAST;return n?!("TYPE"!=n.type||!n.metadata||"node"!=n.metadata.name):f(!0,"Error in method 'isNodeType': Type '".concat(t,"' does not exist in the GraphQL schema."))})).val()})).val()},h=function e(t,n,r){return s(n.blockProps.find((function(e){return e.details.name==function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(":").slice(-1).join("")}(t.name)}))).next((function(n){return n?{name:t.name,kind:t.kind,type:n.details.result.name,metadata:n.details.metadata,isNode:d(n.details.result.name,r),edge:(i=n.details.metadata,i&&"edge"==i.name?i.body.replace(/(^\(|\)$)/g,""):null),args:t.args,properties:t.properties&&t.properties.length>0?s(n.details.result.name).next((function(e){return(e.match(/^\[(.*?)\]$/)||[null,e])[1].replace(/!$/,"")})).next((function(e){return r.find((function(t){return"TYPE"==t.type&&t.name==e}))})).next((function(i){return i?t.properties.map((function(t){return e(t,i,r)})):f(!0,"Error in method 'addMetadataToProperty': Cannot find type '".concat(n.details.result.name,"' in the GraphQL Schema."))})).val():null}:{name:t.name,kind:t.kind,type:null,metadata:null,isNode:null,edge:null,args:t.args,properties:t.properties,error:n?null:"Error in method 'addMetadataToProperty': Query function '".concat(t.name,"' is not defined in the GraphQL schema (specifically in the 'parentTypeAST' argument).")};var i})).val()},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Query";return s(t["get".concat(n)]||s(t["get".concat(n)]=t.find((function(e){return"TYPE"==e.type&&e.name==n}))).next((function(){return t["get".concat(n)]})).val()).next((function(n){return s(e&&e.properties?e.properties.map((function(e){return h(e,n,t)})):[]).next((function(t){return e.properties=t,e})).val()})).val()},y=function e(t){return t?(t.selections||[]).map((function(t){return{name:"".concat(t.alias?t.alias.value+":":"").concat(t.name.value),args:g(t.arguments),properties:e(t.selectionSet),kind:t.kind}})):null},m=function e(t){var n=t.kind,r=t.name,i=t.value;return{name:r?r.value:null,value:r||i.kind?{kind:i.kind,value:i.name?i.name.value:i.fields?i.fields.map((function(t){return e(t)})):i.values?i.values.map((function(t){return t.value?e(t):t.fields.map((function(t){return e(t)}))})):i.value}:{kind:n,value:i}}},g=function(e){return e&&e.length?e.map((function(e){return m(e)})):null},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return 0==e.length?null:e.map((function(e){return{name:(e.name||{}).value,type:((e.typeCondition||{}).name||{}).value,properties:y(e.selectionSet)}}))},_={query:"Query",mutation:"Mutation",subscription:"Subscription"},T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[];return t.push(e.type||"query"),e.name&&t.push(e.name),e.variables&&e.variables.length>0&&t.push("(".concat(e.variables.map((function(e){return"$".concat(e.name,": ").concat(e.type)})).join(", "),")")),t.join(" ")},E=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.properties&&n){var i=t.properties.filter((function(e){return n(e)})).map((function(t){return t.properties&&t.properties.length>0?Object.assign({},t,{properties:e(t,n,!0)}):t}));return r?i:Object.assign({},t,{properties:i})}return r?null:t},O=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return t.properties&&n&&(t.properties.some((function(e){return n(e)}))||t.properties.some((function(t){return e(t,n)})))},N=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=i?i+".":i;return t.properties&&n?t.properties.reduce((function(t,i){return n(i)&&t.push({property:a+i.name,type:i.type}),i.properties&&t.push.apply(t,r(e(i,n,a+i.name))),t}),[]):[]},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return s((e.properties||[]).map((function(e){return L(e)})).join("\n")).next((function(n){return"".concat(t?"":T(e),"{\n").concat(n,"\n}")})).next((function(t){return e.fragments&&e.fragments.length>0?"".concat(t,"\n").concat(w(e.fragments)):t})).val()},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){return"fragment ".concat(e.name," on ").concat(e.type," ").concat(I(e,!0))})).join("\n")},L=function(e){if(e&&e.name){var t=e.name,n=e.args?A(e.args).trim():"",r=e.properties&&e.properties.length>0?I(e,!0):"";return"FragmentSpread"==e.kind?"...".concat(t):"".concat(t).concat(n?"(".concat(n,")"):"").concat(r)}return""},S=function(e){var t=e.kind,n=e.value;return Array.isArray(n)?"ListValue"==t?"[".concat(A(n),"]"):"{".concat(A(n),"}"):"Variable"==t?"$".concat(n):"StringValue"==t?'"'.concat(n,'"'):n},A=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"".concat(t.map((function(t){return Array.isArray(t)?"{".concat(e(t),"}"):"".concat(t.name?t.name+":":"").concat(S(t.value))})).join(","))},j={},x=function(e){if(e&&e.fragments&&e.fragments.length>0){j={};var t=D(e.properties,e.fragments);return j={},Object.assign({},e,{properties:t,fragments:null})}return e},P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("FragmentSpread"==e.kind){var n=e.name,r=t.find((function(e){return e.name==n}));if(!r)throw new Error("Invalid GraphQL query. Fragment '".concat(n,"' does not exist."));return j[n]||(j[n]=D(r.properties,t)),j[n]}if(e.properties&&e.properties.length>0){var i=D(e.properties,t);return Object.assign({},e,{properties:i})}return e},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e&&e.length>0){var n=e.reduce((function(e,n){var r=P(n,t);if(Array.isArray(r))r.forEach((function(t){var n=e[t.name];n&&void 0!==n.metadata||(e[t.name]=t)}));else{var i=e[r.name];i&&void 0!==i.metadata||(e[r.name]=r)}return e}),{}),r=[];for(var i in n)r.push(n[i]);return r}return null};e.exports={chain:s,log:function(e,t,n){return s(t?"".concat(t,": ").concat("object"!=a(e)?e:JSON.stringify(e)):e).next((function(r){return n?console.log(s(n(e)).next((function(e){return t?"".concat(t,": ").concat(e):e})).val()):console.log(r)})).next((function(){return e})).val()},escapeGraphQlSchema:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"░",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";return e.replace(/[\n\r]+/g,t).replace(/[\t\r]+/g,n).replace(/\s+/g," ")},removeMultiSpaces:function(e){return e.replace(/ +(?= )/g,"")},matchLeftNonGreedy:function e(t,n,r){return s(t.match(new RegExp("".concat(n,"(.*?)").concat(r)))).next((function(t){return t&&t.length>0?s(e("".concat(t[t.length-1]).concat(r),n,r)).next((function(e){return e||t})).val():t})).val()},getQueryAST:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(u(e)||{}).definitions||[],a=i.find((function(e){return"OperationDefinition"==e.kind&&(!t||e.name.value==t)}));if(!a)throw t?new Error("Invalid Graphql query. Operation name '".concat(t,"' is not defined in the query.")):new Error("Invalid Graphql query. No 'OperationDefinition' defined in the query.");var o=i.filter((function(e){return"FragmentDefinition"==e.kind}));if(a){var c={type:a.operation,name:a.name?a.name.value:null,variables:a.variableDefinitions?a.variableDefinitions.map((function(e){var t=e.variable,n=e.type,r="NonNullType"==n.kind,i=r?"!":"",a=r?n.type:n;return{name:t.name.value,type:"ListType"==a.kind?"[".concat(a.type.name.value,"]").concat(i):"".concat(a.name.value).concat(i)}})):null,properties:y(a.selectionSet),fragments:b(o)},s=r.defrag?function(e){return v(x(e),n,_[a.operation])}:function(e){return e},f=s(v(c,n,_[a.operation]));return Object.assign(f,{filter:function(e){return E(f,e)},some:function(e){return O(f,e)},propertyPaths:function(e){return N(f,e)},containsProp:function(e){if(!e)return!1;var t=e instanceof RegExp?function(t){return t.match(e)}:function(t){return t.indexOf(e)>=0};return(N(f,(function(e){return e&&e.name}))||[]).some((function(e){var n=(e.property||"").split(".").map((function(e){return e.split(":").slice(-1)[0]})).join(".");return t(n)}))}}),f}return null},buildQuery:I,time:{start:function(e){return o=Date.now(),e},log:function(e,t){return o||(o=Date.now()),console.log(t?"".concat(t,": ").concat(Date.now()-o," ms"):"".concat(Date.now()-o," ms")),e}},newShortId:function(){return c.generate().replace(/-/g,"r").replace(/_/g,"9")},isScalarType:p}},19662:(e,t,n)=>{var r=n(60614),i=n(66330);e.exports=function(e){if(r(e))return e;throw TypeError(i(e)+" is not a function")}},39483:(e,t,n)=>{var r=n(4411),i=n(66330);e.exports=function(e){if(r(e))return e;throw TypeError(i(e)+" is not a constructor")}},96077:(e,t,n)=>{var r=n(60614);e.exports=function(e){if("object"==typeof e||r(e))return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},51223:(e,t,n)=>{var r=n(5112),i=n(70030),a=n(3070),o=r("unscopables"),u=Array.prototype;null==u[o]&&a.f(u,o,{configurable:!0,value:i(null)}),e.exports=function(e){u[o][e]=!0}},31530:(e,t,n)=>{"use strict";var r=n(28710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},25787:e=>{e.exports=function(e,t,n){if(e instanceof t)return e;throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}},19670:(e,t,n)=>{var r=n(70111);e.exports=function(e){if(r(e))return e;throw TypeError(String(e)+" is not an object")}},24019:e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},90260:(e,t,n)=>{"use strict";var r,i,a,o=n(24019),u=n(19781),c=n(17854),s=n(60614),f=n(70111),l=n(92597),p=n(70648),d=n(66330),h=n(68880),v=n(31320),y=n(3070).f,m=n(79518),g=n(27674),b=n(5112),_=n(69711),T=c.Int8Array,E=T&&T.prototype,O=c.Uint8ClampedArray,N=O&&O.prototype,I=T&&m(T),w=E&&m(E),L=Object.prototype,S=L.isPrototypeOf,A=b("toStringTag"),j=_("TYPED_ARRAY_TAG"),x=_("TYPED_ARRAY_CONSTRUCTOR"),P=o&&!!g&&"Opera"!==p(c.opera),D=!1,R={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},G={BigInt64Array:8,BigUint64Array:8},k=function(e){if(!f(e))return!1;var t=p(e);return l(R,t)||l(G,t)};for(r in R)(a=(i=c[r])&&i.prototype)?h(a,x,i):P=!1;for(r in G)(a=(i=c[r])&&i.prototype)&&h(a,x,i);if((!P||!s(I)||I===Function.prototype)&&(I=function(){throw TypeError("Incorrect invocation")},P))for(r in R)c[r]&&g(c[r],I);if((!P||!w||w===L)&&(w=I.prototype,P))for(r in R)c[r]&&g(c[r].prototype,w);if(P&&m(N)!==w&&g(N,w),u&&!l(w,A))for(r in D=!0,y(w,A,{get:function(){return f(this)?this[j]:void 0}}),R)c[r]&&h(c[r],j,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:P,TYPED_ARRAY_CONSTRUCTOR:x,TYPED_ARRAY_TAG:D&&j,aTypedArray:function(e){if(k(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(s(e)&&(!g||S.call(I,e)))return e;throw TypeError(d(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(u){if(n)for(var r in R){var i=c[r];if(i&&l(i.prototype,e))try{delete i.prototype[e]}catch(e){}}w[e]&&!n||v(w,e,n?t:P&&E[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(u){if(g){if(n)for(r in R)if((i=c[r])&&l(i,e))try{delete i[e]}catch(e){}if(I[e]&&!n)return;try{return v(I,e,n?t:P&&I[e]||t)}catch(e){}}for(r in R)!(i=c[r])||i[e]&&!n||v(i,e,t)}},isView:function(e){if(!f(e))return!1;var t=p(e);return"DataView"===t||l(R,t)||l(G,t)},isTypedArray:k,TypedArray:I,TypedArrayPrototype:w}},13331:(e,t,n)=>{"use strict";var r=n(17854),i=n(19781),a=n(24019),o=n(76530),u=n(68880),c=n(12248),s=n(47293),f=n(25787),l=n(19303),p=n(17466),d=n(57067),h=n(11179),v=n(79518),y=n(27674),m=n(8006).f,g=n(3070).f,b=n(21285),_=n(58003),T=n(29909),E=o.PROPER,O=o.CONFIGURABLE,N=T.get,I=T.set,w="ArrayBuffer",L="DataView",S="Wrong index",A=r.ArrayBuffer,j=A,x=r.DataView,P=x&&x.prototype,D=Object.prototype,R=r.RangeError,G=h.pack,k=h.unpack,F=function(e){return[255&e]},M=function(e){return[255&e,e>>8&255]},Q=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},C=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},U=function(e){return G(e,23,4)},V=function(e){return G(e,52,8)},B=function(e,t){g(e.prototype,t,{get:function(){return N(this)[t]}})},q=function(e,t,n,r){var i=d(n),a=N(e);if(i+t>a.byteLength)throw R(S);var o=N(a.buffer).bytes,u=i+a.byteOffset,c=o.slice(u,u+t);return r?c:c.reverse()},K=function(e,t,n,r,i,a){var o=d(n),u=N(e);if(o+t>u.byteLength)throw R(S);for(var c=N(u.buffer).bytes,s=o+u.byteOffset,f=r(+i),l=0;l<t;l++)c[s+l]=f[a?l:t-l-1]};if(a){var z=E&&A.name!==w;if(s((function(){A(1)}))&&s((function(){new A(-1)}))&&!s((function(){return new A,new A(1.5),new A(NaN),z&&!O})))z&&O&&u(A,"name",w);else{for(var Y,$=(j=function(e){return f(this,j),new A(d(e))}).prototype=A.prototype,W=m(A),J=0;W.length>J;)(Y=W[J++])in j||u(j,Y,A[Y]);$.constructor=j}y&&v(P)!==D&&y(P,D);var X=new x(new j(2)),H=P.setInt8;X.setInt8(0,2147483648),X.setInt8(1,2147483649),!X.getInt8(0)&&X.getInt8(1)||c(P,{setInt8:function(e,t){H.call(this,e,t<<24>>24)},setUint8:function(e,t){H.call(this,e,t<<24>>24)}},{unsafe:!0})}else j=function(e){f(this,j,w);var t=d(e);I(this,{bytes:b.call(new Array(t),0),byteLength:t}),i||(this.byteLength=t)},x=function(e,t,n){f(this,x,L),f(e,j,L);var r=N(e).byteLength,a=l(t);if(a<0||a>r)throw R("Wrong offset");if(a+(n=void 0===n?r-a:p(n))>r)throw R("Wrong length");I(this,{buffer:e,byteLength:n,byteOffset:a}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=a)},i&&(B(j,"byteLength"),B(x,"buffer"),B(x,"byteLength"),B(x,"byteOffset")),c(x.prototype,{getInt8:function(e){return q(this,1,e)[0]<<24>>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e){var t=q(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=q(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return C(q(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return C(q(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return k(q(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return k(q(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){K(this,1,e,F,t)},setUint8:function(e,t){K(this,1,e,F,t)},setInt16:function(e,t){K(this,2,e,M,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){K(this,2,e,M,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){K(this,4,e,Q,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){K(this,4,e,Q,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){K(this,4,e,U,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){K(this,8,e,V,t,arguments.length>2?arguments[2]:void 0)}});_(j,w),_(x,L),e.exports={ArrayBuffer:j,DataView:x}},1048:(e,t,n)=>{"use strict";var r=n(47908),i=n(51400),a=n(26244),o=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),u=a(n),c=i(e,u),s=i(t,u),f=arguments.length>2?arguments[2]:void 0,l=o((void 0===f?u:i(f,u))-s,u-c),p=1;for(s<c&&c<s+l&&(p=-1,s+=l-1,c+=l-1);l-- >0;)s in n?n[c]=n[s]:delete n[c],c+=p,s+=p;return n}},21285:(e,t,n)=>{"use strict";var r=n(47908),i=n(51400),a=n(26244);e.exports=function(e){for(var t=r(this),n=a(t),o=arguments.length,u=i(o>1?arguments[1]:void 0,n),c=o>2?arguments[2]:void 0,s=void 0===c?n:i(c,n);s>u;)t[u++]=e;return t}},18533:(e,t,n)=>{"use strict";var r=n(42092).forEach,i=n(9341)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},97745:e=>{e.exports=function(e,t){for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i}},48457:(e,t,n)=>{"use strict";var r=n(49974),i=n(47908),a=n(53411),o=n(97659),u=n(4411),c=n(26244),s=n(86135),f=n(18554),l=n(71246);e.exports=function(e){var t=i(e),n=u(this),p=arguments.length,d=p>1?arguments[1]:void 0,h=void 0!==d;h&&(d=r(d,p>2?arguments[2]:void 0,2));var v,y,m,g,b,_,T=l(t),E=0;if(!T||this==Array&&o(T))for(v=c(t),y=n?new this(v):Array(v);v>E;E++)_=h?d(t[E],E):t[E],s(y,E,_);else for(b=(g=f(t,T)).next,y=n?new this:[];!(m=b.call(g)).done;E++)_=h?a(g,d,[m.value,E],!0):m.value,s(y,E,_);return y.length=E,y}},41318:(e,t,n)=>{var r=n(45656),i=n(51400),a=n(26244),o=function(e){return function(t,n,o){var u,c=r(t),s=a(c),f=i(o,s);if(e&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((e||f in c)&&c[f]===n)return e||f||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},42092:(e,t,n)=>{var r=n(49974),i=n(68361),a=n(47908),o=n(26244),u=n(65417),c=[].push,s=function(e){var t=1==e,n=2==e,s=3==e,f=4==e,l=6==e,p=7==e,d=5==e||l;return function(h,v,y,m){for(var g,b,_=a(h),T=i(_),E=r(v,y,3),O=o(T),N=0,I=m||u,w=t?I(h,O):n||p?I(h,0):void 0;O>N;N++)if((d||N in T)&&(b=E(g=T[N],N,_),e))if(t)w[N]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return N;case 2:c.call(w,g)}else switch(e){case 4:return!1;case 7:c.call(w,g)}return l?-1:s||f?f:w}};e.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}},86583:(e,t,n)=>{"use strict";var r=n(45656),i=n(19303),a=n(26244),o=n(9341),u=Math.min,c=[].lastIndexOf,s=!!c&&1/[1].lastIndexOf(1,-0)<0,f=o("lastIndexOf"),l=s||!f;e.exports=l?function(e){if(s)return c.apply(this,arguments)||0;var t=r(this),n=a(t),o=n-1;for(arguments.length>1&&(o=u(o,i(arguments[1]))),o<0&&(o=n+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return-1}:c},81194:(e,t,n)=>{var r=n(47293),i=n(5112),a=n(7392),o=i("species");e.exports=function(e){return a>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:(e,t,n)=>{"use strict";var r=n(47293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},53671:(e,t,n)=>{var r=n(19662),i=n(47908),a=n(68361),o=n(26244),u=function(e){return function(t,n,u,c){r(n);var s=i(t),f=a(s),l=o(s),p=e?l-1:0,d=e?-1:1;if(u<2)for(;;){if(p in f){c=f[p],p+=d;break}if(p+=d,e?p<0:l<=p)throw TypeError("Reduce of empty array with no initial value")}for(;e?p>=0:l>p;p+=d)p in f&&(c=n(c,f[p],p,s));return c}};e.exports={left:u(!1),right:u(!0)}},94362:e=>{var t=Math.floor,n=function(e,a){var o=e.length,u=t(o/2);return o<8?r(e,a):i(n(e.slice(0,u),a),n(e.slice(u),a),a)},r=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},i=function(e,t,n){for(var r=e.length,i=t.length,a=0,o=0,u=[];a<r||o<i;)a<r&&o<i?u.push(n(e[a],t[o])<=0?e[a++]:t[o++]):u.push(a<r?e[a++]:t[o++]);return u};e.exports=n},77475:(e,t,n)=>{var r=n(43157),i=n(4411),a=n(70111),o=n(5112)("species");e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===Array||r(t.prototype))||a(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?Array:t}},65417:(e,t,n)=>{var r=n(77475);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},53411:(e,t,n)=>{var r=n(19670),i=n(99212);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){i(e,"throw",t)}}},17072:(e,t,n)=>{var r=n(5112)("iterator"),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.ex