This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate.mjs
1 lines (1 loc) · 56.3 KB
/
validate.mjs
1
"use strict";export const validate = validate10;export default validate10;const schema11 = {"$id":"http://vstream.com/schemas/suika/v1.schema.json","definitions":{"Profile":{"type":"object","properties":{"channelID":{"type":"string","format":"uuid"},"isVTuber":{"type":"boolean","default":false},"isModerator":{"type":"boolean","default":false},"pfp":{"type":"object","properties":{"url":{"type":"string","format":"uri"}}},"userID":{"type":"string","format":"uuid"},"username":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1}},"required":["channelID","displayName","userID","username"]},"TextNode":{"type":"object","properties":{"__typename":{"const":"TextChatNode"},"text":{"type":"string","minLength":1}}},"MentionedNode":{"type":"object","properties":{"__typename":{"const":"MentionedChatNode"},"channelID":{"type":"string","minLength":1},"username":{"type":"string","minLength":1}}},"EmojiNode":{"type":"object","properties":{"__typename":{"const":"EmojiChatNode"},"id":{"type":"string"},"channelID":{"type":"string","minLength":1},"altText":{"type":"string","default":""},"actionText":{"type":"string","minLength":1},"size28Src":{"type":"string","format":"uri"},"size2Srcset":{"type":"string"}},"required":["id","actionText"]},"ParagraphChatNode":{"type":"object","properties":{"__typename":{"const":"ParagraphChatNode"},"nodes":{"type":"array","items":{"$ref":"#/definitions/ChatNode"}}}},"LinkChatNode":{"type":"object","properties":{"__typename":{"const":"LinkChatNode"},"href":{"type":"string","minLength":1},"nodes":{"type":"array","items":{"type":"object","discriminator":{"propertyName":"__typename"},"oneOf":[{"$ref":"#/definitions/TextNode"},{"$ref":"#/definitions/EmojiNode"}],"required":["__typename"]}}}},"ChatNode":{"type":"object","discriminator":{"propertyName":"__typename"},"oneOf":[{"$ref":"#/definitions/TextNode"},{"$ref":"#/definitions/MentionedNode"},{"$ref":"#/definitions/EmojiNode"},{"$ref":"#/definitions/ParagraphChatNode"},{"$ref":"#/definitions/LinkChatNode"}],"required":["__typename"]}},"type":"object","required":["__typename","timestamp"],"allOf":[{"properties":{"timestamp":{"type":"string","format":"date-time"}}},{"discriminator":{"propertyName":"__typename"},"required":["__typename"],"oneOf":[{"properties":{"__typename":{"const":"ChatCreatedEvent"},"id":{"type":"string","format":"uuid"},"chatter":{"$ref":"#/definitions/Profile"},"chatterBadges":{"type":"array","items":{"type":"string","enum":["streamer","moderator","vteam"]}},"chatterColor":{"type":"string"},"chatterStanding":{"type":"object","discriminator":{"propertyName":"__typename"},"required":["__typename"],"oneOf":[{"properties":{"__typename":{"const":"BannedChatterStanding"}}},{"properties":{"__typename":{"const":"GoodChatterStanding"}}},{"properties":{"__typename":{"const":"ModeratorChatterStanding"}}},{"properties":{"__typename":{"const":"PlatformBannedChatterStanding"}}},{"properties":{"__typename":{"const":"TimedOutChatterStanding"},"timedOutUntil":{"type":"string"}}}]},"nodes":{"type":"array","items":{"$ref":"#/definitions/ChatNode"}}}},{"properties":{"__typename":{"const":"ChatDeletedEvent"},"chat":{"type":"object","properties":{"id":{"type":"string"},"deletedBy":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string"}}}}}}},{"properties":{"__typename":{"const":"UserBannedEvent"},"userID":{"type":"string","format":"uuid"}}},{"properties":{"__typename":{"const":"UserChatsDeletedEvent"},"userID":{"type":"string","format":"uuid"}}},{"properties":{"__typename":{"const":"UserTimedOutEvent"},"userID":{"type":"string","format":"uuid"},"timedOutUntil":{"type":"string","format":"date-time"}}},{"properties":{"__typename":{"const":"ViewerJoinedEvent"},"viewer":{"$ref":"#/definitions/Profile"}}},{"properties":{"__typename":{"const":"ViewerLeftEvent"},"channelID":{"type":"string","format":"uuid"},"userID":{"type":"string","format":"uuid"}}},{"properties":{"__typename":{"const":"ViewerCountUpdatedEvent"},"viewerCount":{"type":"string","minLength":1}}}]}]};const schema12 = {"type":"object","properties":{"channelID":{"type":"string","format":"uuid"},"isVTuber":{"type":"boolean","default":false},"isModerator":{"type":"boolean","default":false},"pfp":{"type":"object","properties":{"url":{"type":"string","format":"uri"}}},"userID":{"type":"string","format":"uuid"},"username":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1}},"required":["channelID","displayName","userID","username"]};const formats0 = require("ajv-formats/dist/formats").fullFormats["date-time"];const formats2 = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;const formats6 = require("ajv-formats/dist/formats").fullFormats.uri;const func2 = require("ajv/dist/runtime/ucs2length").default;const schema13 = {"type":"object","discriminator":{"propertyName":"__typename"},"oneOf":[{"$ref":"#/definitions/TextNode"},{"$ref":"#/definitions/MentionedNode"},{"$ref":"#/definitions/EmojiNode"},{"$ref":"#/definitions/ParagraphChatNode"},{"$ref":"#/definitions/LinkChatNode"}],"required":["__typename"]};const schema16 = {"type":"object","properties":{"__typename":{"const":"TextChatNode"},"text":{"type":"string","minLength":1}}};const schema19 = {"type":"object","properties":{"__typename":{"const":"MentionedChatNode"},"channelID":{"type":"string","minLength":1},"username":{"type":"string","minLength":1}}};const schema17 = {"type":"object","properties":{"__typename":{"const":"EmojiChatNode"},"id":{"type":"string"},"channelID":{"type":"string","minLength":1},"altText":{"type":"string","default":""},"actionText":{"type":"string","minLength":1},"size28Src":{"type":"string","format":"uri"},"size2Srcset":{"type":"string"}},"required":["id","actionText"]};const schema14 = {"type":"object","properties":{"__typename":{"const":"ParagraphChatNode"},"nodes":{"type":"array","items":{"$ref":"#/definitions/ChatNode"}}}};const wrapper0 = {validate: validate11};function validate12(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs1 = errors;if("ParagraphChatNode" !== data.__typename){validate12.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/properties/__typename/const",keyword:"const",params:{allowedValue: "ParagraphChatNode"},message:"must be equal to constant"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.nodes !== undefined){let data1 = data.nodes;const _errs2 = errors;if(errors === _errs2){if(Array.isArray(data1)){var valid1 = true;const len0 = data1.length;for(let i0=0; i0<len0; i0++){const _errs4 = errors;if(!(wrapper0.validate(data1[i0], {instancePath:instancePath+"/nodes/" + i0,parentData:data1,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? wrapper0.validate.errors : vErrors.concat(wrapper0.validate.errors);errors = vErrors.length;}var valid1 = _errs4 === errors;if(!valid1){break;}}}else {validate12.errors = [{instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}}}else {validate12.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate12.errors = vErrors;return errors === 0;}const schema15 = {"type":"object","properties":{"__typename":{"const":"LinkChatNode"},"href":{"type":"string","minLength":1},"nodes":{"type":"array","items":{"type":"object","discriminator":{"propertyName":"__typename"},"oneOf":[{"$ref":"#/definitions/TextNode"},{"$ref":"#/definitions/EmojiNode"}],"required":["__typename"]}}}};function validate13(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs1 = errors;if("LinkChatNode" !== data.__typename){validate13.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/properties/__typename/const",keyword:"const",params:{allowedValue: "LinkChatNode"},message:"must be equal to constant"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.href !== undefined){let data1 = data.href;const _errs2 = errors;if(errors === _errs2){if(typeof data1 === "string"){if(func2(data1) < 1){validate13.errors = [{instancePath:instancePath+"/href",schemaPath:"#/properties/href/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate13.errors = [{instancePath:instancePath+"/href",schemaPath:"#/properties/href/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.nodes !== undefined){let data2 = data.nodes;const _errs4 = errors;if(errors === _errs4){if(Array.isArray(data2)){var valid1 = true;const len0 = data2.length;for(let i0=0; i0<len0; i0++){let data3 = data2[i0];const _errs6 = errors;if(errors === _errs6){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){let missing0;if((data3.__typename === undefined) && (missing0 = "__typename")){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const tag0 = data3.__typename;if(typeof tag0 == "string"){if(tag0 === "TextChatNode"){const _errs10 = errors;if(errors === _errs10){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){if(data3.__typename !== undefined){const _errs12 = errors;if("TextChatNode" !== data3.__typename){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/__typename",schemaPath:"#/definitions/TextNode/properties/__typename/const",keyword:"const",params:{allowedValue: "TextChatNode"},message:"must be equal to constant"}];return false;}var valid5 = _errs12 === errors;}else {var valid5 = true;}if(valid5){if(data3.text !== undefined){let data5 = data3.text;const _errs13 = errors;if(errors === _errs13){if(typeof data5 === "string"){if(func2(data5) < 1){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/text",schemaPath:"#/definitions/TextNode/properties/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/text",schemaPath:"#/definitions/TextNode/properties/text/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid5 = _errs13 === errors;}else {var valid5 = true;}}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/definitions/TextNode/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}else if(tag0 === "EmojiChatNode"){const _errs16 = errors;if(errors === _errs16){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){let missing1;if(((data3.id === undefined) && (missing1 = "id")) || ((data3.actionText === undefined) && (missing1 = "actionText"))){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/definitions/EmojiNode/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data3.__typename !== undefined){const _errs18 = errors;if("EmojiChatNode" !== data3.__typename){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/__typename",schemaPath:"#/definitions/EmojiNode/properties/__typename/const",keyword:"const",params:{allowedValue: "EmojiChatNode"},message:"must be equal to constant"}];return false;}var valid8 = _errs18 === errors;}else {var valid8 = true;}if(valid8){if(data3.id !== undefined){const _errs19 = errors;if(typeof data3.id !== "string"){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/id",schemaPath:"#/definitions/EmojiNode/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid8 = _errs19 === errors;}else {var valid8 = true;}if(valid8){if(data3.channelID !== undefined){let data8 = data3.channelID;const _errs21 = errors;if(errors === _errs21){if(typeof data8 === "string"){if(func2(data8) < 1){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/channelID",schemaPath:"#/definitions/EmojiNode/properties/channelID/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/channelID",schemaPath:"#/definitions/EmojiNode/properties/channelID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid8 = _errs21 === errors;}else {var valid8 = true;}if(valid8){if(data3.altText !== undefined){const _errs23 = errors;if(typeof data3.altText !== "string"){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/altText",schemaPath:"#/definitions/EmojiNode/properties/altText/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid8 = _errs23 === errors;}else {var valid8 = true;}if(valid8){if(data3.actionText !== undefined){let data10 = data3.actionText;const _errs25 = errors;if(errors === _errs25){if(typeof data10 === "string"){if(func2(data10) < 1){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/actionText",schemaPath:"#/definitions/EmojiNode/properties/actionText/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/actionText",schemaPath:"#/definitions/EmojiNode/properties/actionText/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid8 = _errs25 === errors;}else {var valid8 = true;}if(valid8){if(data3.size28Src !== undefined){let data11 = data3.size28Src;const _errs27 = errors;if(errors === _errs27){if(errors === _errs27){if(typeof data11 === "string"){if(!(formats6(data11))){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/size28Src",schemaPath:"#/definitions/EmojiNode/properties/size28Src/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];return false;}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/size28Src",schemaPath:"#/definitions/EmojiNode/properties/size28Src/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid8 = _errs27 === errors;}else {var valid8 = true;}if(valid8){if(data3.size2Srcset !== undefined){const _errs29 = errors;if(typeof data3.size2Srcset !== "string"){validate13.errors = [{instancePath:instancePath+"/nodes/" + i0+"/size2Srcset",schemaPath:"#/definitions/EmojiNode/properties/size2Srcset/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid8 = _errs29 === errors;}else {var valid8 = true;}}}}}}}}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/definitions/EmojiNode/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/properties/nodes/items/discriminator",keyword:"discriminator",params:{error: "mapping", tag: "__typename", tagValue: tag0},message:"value of tag \"__typename\" must be in oneOf"}];return false;}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/properties/nodes/items/discriminator",keyword:"discriminator",params:{error: "tag", tag: "__typename", tagValue: tag0},message:"tag \"__typename\" must be string"}];return false;}}}else {validate13.errors = [{instancePath:instancePath+"/nodes/" + i0,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid1 = _errs6 === errors;if(!valid1){break;}}}else {validate13.errors = [{instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs4 === errors;}else {var valid0 = true;}}}}else {validate13.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate13.errors = vErrors;return errors === 0;}function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.__typename === undefined) && (missing0 = "__typename")){validate11.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const tag0 = data.__typename;if(typeof tag0 == "string"){if(tag0 === "TextChatNode"){const _errs3 = errors;if(errors === _errs3){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs5 = errors;if("TextChatNode" !== data.__typename){validate11.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/definitions/TextNode/properties/__typename/const",keyword:"const",params:{allowedValue: "TextChatNode"},message:"must be equal to constant"}];return false;}var valid3 = _errs5 === errors;}else {var valid3 = true;}if(valid3){if(data.text !== undefined){let data1 = data.text;const _errs6 = errors;if(errors === _errs6){if(typeof data1 === "string"){if(func2(data1) < 1){validate11.errors = [{instancePath:instancePath+"/text",schemaPath:"#/definitions/TextNode/properties/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/text",schemaPath:"#/definitions/TextNode/properties/text/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid3 = _errs6 === errors;}else {var valid3 = true;}}}else {validate11.errors = [{instancePath,schemaPath:"#/definitions/TextNode/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}else if(tag0 === "MentionedChatNode"){const _errs9 = errors;if(errors === _errs9){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs11 = errors;if("MentionedChatNode" !== data.__typename){validate11.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/definitions/MentionedNode/properties/__typename/const",keyword:"const",params:{allowedValue: "MentionedChatNode"},message:"must be equal to constant"}];return false;}var valid6 = _errs11 === errors;}else {var valid6 = true;}if(valid6){if(data.channelID !== undefined){let data3 = data.channelID;const _errs12 = errors;if(errors === _errs12){if(typeof data3 === "string"){if(func2(data3) < 1){validate11.errors = [{instancePath:instancePath+"/channelID",schemaPath:"#/definitions/MentionedNode/properties/channelID/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/channelID",schemaPath:"#/definitions/MentionedNode/properties/channelID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid6 = _errs12 === errors;}else {var valid6 = true;}if(valid6){if(data.username !== undefined){let data4 = data.username;const _errs14 = errors;if(errors === _errs14){if(typeof data4 === "string"){if(func2(data4) < 1){validate11.errors = [{instancePath:instancePath+"/username",schemaPath:"#/definitions/MentionedNode/properties/username/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/username",schemaPath:"#/definitions/MentionedNode/properties/username/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid6 = _errs14 === errors;}else {var valid6 = true;}}}}else {validate11.errors = [{instancePath,schemaPath:"#/definitions/MentionedNode/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}else if(tag0 === "EmojiChatNode"){const _errs17 = errors;if(errors === _errs17){if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if(((data.id === undefined) && (missing1 = "id")) || ((data.actionText === undefined) && (missing1 = "actionText"))){validate11.errors = [{instancePath,schemaPath:"#/definitions/EmojiNode/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data.__typename !== undefined){const _errs19 = errors;if("EmojiChatNode" !== data.__typename){validate11.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/definitions/EmojiNode/properties/__typename/const",keyword:"const",params:{allowedValue: "EmojiChatNode"},message:"must be equal to constant"}];return false;}var valid9 = _errs19 === errors;}else {var valid9 = true;}if(valid9){if(data.id !== undefined){const _errs20 = errors;if(typeof data.id !== "string"){validate11.errors = [{instancePath:instancePath+"/id",schemaPath:"#/definitions/EmojiNode/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs20 === errors;}else {var valid9 = true;}if(valid9){if(data.channelID !== undefined){let data7 = data.channelID;const _errs22 = errors;if(errors === _errs22){if(typeof data7 === "string"){if(func2(data7) < 1){validate11.errors = [{instancePath:instancePath+"/channelID",schemaPath:"#/definitions/EmojiNode/properties/channelID/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/channelID",schemaPath:"#/definitions/EmojiNode/properties/channelID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid9 = _errs22 === errors;}else {var valid9 = true;}if(valid9){if(data.altText !== undefined){const _errs24 = errors;if(typeof data.altText !== "string"){validate11.errors = [{instancePath:instancePath+"/altText",schemaPath:"#/definitions/EmojiNode/properties/altText/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs24 === errors;}else {var valid9 = true;}if(valid9){if(data.actionText !== undefined){let data9 = data.actionText;const _errs26 = errors;if(errors === _errs26){if(typeof data9 === "string"){if(func2(data9) < 1){validate11.errors = [{instancePath:instancePath+"/actionText",schemaPath:"#/definitions/EmojiNode/properties/actionText/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/actionText",schemaPath:"#/definitions/EmojiNode/properties/actionText/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid9 = _errs26 === errors;}else {var valid9 = true;}if(valid9){if(data.size28Src !== undefined){let data10 = data.size28Src;const _errs28 = errors;if(errors === _errs28){if(errors === _errs28){if(typeof data10 === "string"){if(!(formats6(data10))){validate11.errors = [{instancePath:instancePath+"/size28Src",schemaPath:"#/definitions/EmojiNode/properties/size28Src/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/size28Src",schemaPath:"#/definitions/EmojiNode/properties/size28Src/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid9 = _errs28 === errors;}else {var valid9 = true;}if(valid9){if(data.size2Srcset !== undefined){const _errs30 = errors;if(typeof data.size2Srcset !== "string"){validate11.errors = [{instancePath:instancePath+"/size2Srcset",schemaPath:"#/definitions/EmojiNode/properties/size2Srcset/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs30 === errors;}else {var valid9 = true;}}}}}}}}}else {validate11.errors = [{instancePath,schemaPath:"#/definitions/EmojiNode/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}else if(tag0 === "ParagraphChatNode"){if(!(validate12(data, {instancePath,parentData,parentDataProperty,rootData}))){vErrors = vErrors === null ? validate12.errors : vErrors.concat(validate12.errors);errors = vErrors.length;}}else if(tag0 === "LinkChatNode"){if(!(validate13(data, {instancePath,parentData,parentDataProperty,rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}else {validate11.errors = [{instancePath,schemaPath:"#/discriminator",keyword:"discriminator",params:{error: "mapping", tag: "__typename", tagValue: tag0},message:"value of tag \"__typename\" must be in oneOf"}];return false;}}else {validate11.errors = [{instancePath,schemaPath:"#/discriminator",keyword:"discriminator",params:{error: "tag", tag: "__typename", tagValue: tag0},message:"tag \"__typename\" must be string"}];return false;}}}else {validate11.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate11.errors = vErrors;return errors === 0;}function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="http://vstream.com/schemas/suika/v1.schema.json" */;let vErrors = null;let errors = 0;const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.timestamp !== undefined){let data0 = data.timestamp;const _errs2 = errors;if(errors === _errs2){if(errors === _errs2){if(typeof data0 === "string"){if(!(formats0.validate(data0))){validate10.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"#/allOf/0/properties/timestamp/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"#/allOf/0/properties/timestamp/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}}}var valid0 = _errs1 === errors;if(valid0){const _errs4 = errors;if(errors === _errs4){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.__typename === undefined) && (missing0 = "__typename")){validate10.errors = [{instancePath,schemaPath:"#/allOf/1/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const tag0 = data.__typename;if(typeof tag0 == "string"){if(tag0 === "ChatCreatedEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs7 = errors;if("ChatCreatedEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/0/properties/__typename/const",keyword:"const",params:{allowedValue: "ChatCreatedEvent"},message:"must be equal to constant"}];return false;}var valid4 = _errs7 === errors;}else {var valid4 = true;}if(valid4){if(data.id !== undefined){let data2 = data.id;const _errs8 = errors;if(errors === _errs8){if(errors === _errs8){if(typeof data2 === "string"){if(!(formats2.test(data2))){validate10.errors = [{instancePath:instancePath+"/id",schemaPath:"#/allOf/1/oneOf/0/properties/id/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/id",schemaPath:"#/allOf/1/oneOf/0/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid4 = _errs8 === errors;}else {var valid4 = true;}if(valid4){if(data.chatter !== undefined){let data3 = data.chatter;const _errs10 = errors;const _errs11 = errors;if(errors === _errs11){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){let missing1;if(((((data3.channelID === undefined) && (missing1 = "channelID")) || ((data3.displayName === undefined) && (missing1 = "displayName"))) || ((data3.userID === undefined) && (missing1 = "userID"))) || ((data3.username === undefined) && (missing1 = "username"))){validate10.errors = [{instancePath:instancePath+"/chatter",schemaPath:"#/definitions/Profile/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data3.channelID !== undefined){let data4 = data3.channelID;const _errs13 = errors;if(errors === _errs13){if(errors === _errs13){if(typeof data4 === "string"){if(!(formats2.test(data4))){validate10.errors = [{instancePath:instancePath+"/chatter/channelID",schemaPath:"#/definitions/Profile/properties/channelID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/chatter/channelID",schemaPath:"#/definitions/Profile/properties/channelID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid6 = _errs13 === errors;}else {var valid6 = true;}if(valid6){if(data3.isVTuber !== undefined){const _errs15 = errors;if(typeof data3.isVTuber !== "boolean"){validate10.errors = [{instancePath:instancePath+"/chatter/isVTuber",schemaPath:"#/definitions/Profile/properties/isVTuber/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid6 = _errs15 === errors;}else {var valid6 = true;}if(valid6){if(data3.isModerator !== undefined){const _errs17 = errors;if(typeof data3.isModerator !== "boolean"){validate10.errors = [{instancePath:instancePath+"/chatter/isModerator",schemaPath:"#/definitions/Profile/properties/isModerator/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid6 = _errs17 === errors;}else {var valid6 = true;}if(valid6){if(data3.pfp !== undefined){let data7 = data3.pfp;const _errs19 = errors;if(errors === _errs19){if(data7 && typeof data7 == "object" && !Array.isArray(data7)){if(data7.url !== undefined){let data8 = data7.url;const _errs21 = errors;if(errors === _errs21){if(errors === _errs21){if(typeof data8 === "string"){if(!(formats6(data8))){validate10.errors = [{instancePath:instancePath+"/chatter/pfp/url",schemaPath:"#/definitions/Profile/properties/pfp/properties/url/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/chatter/pfp/url",schemaPath:"#/definitions/Profile/properties/pfp/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}}}else {validate10.errors = [{instancePath:instancePath+"/chatter/pfp",schemaPath:"#/definitions/Profile/properties/pfp/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid6 = _errs19 === errors;}else {var valid6 = true;}if(valid6){if(data3.userID !== undefined){let data9 = data3.userID;const _errs23 = errors;if(errors === _errs23){if(errors === _errs23){if(typeof data9 === "string"){if(!(formats2.test(data9))){validate10.errors = [{instancePath:instancePath+"/chatter/userID",schemaPath:"#/definitions/Profile/properties/userID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/chatter/userID",schemaPath:"#/definitions/Profile/properties/userID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid6 = _errs23 === errors;}else {var valid6 = true;}if(valid6){if(data3.username !== undefined){let data10 = data3.username;const _errs25 = errors;if(errors === _errs25){if(typeof data10 === "string"){if(func2(data10) < 1){validate10.errors = [{instancePath:instancePath+"/chatter/username",schemaPath:"#/definitions/Profile/properties/username/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/chatter/username",schemaPath:"#/definitions/Profile/properties/username/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid6 = _errs25 === errors;}else {var valid6 = true;}if(valid6){if(data3.displayName !== undefined){let data11 = data3.displayName;const _errs27 = errors;if(errors === _errs27){if(typeof data11 === "string"){if(func2(data11) < 1){validate10.errors = [{instancePath:instancePath+"/chatter/displayName",schemaPath:"#/definitions/Profile/properties/displayName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/chatter/displayName",schemaPath:"#/definitions/Profile/properties/displayName/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid6 = _errs27 === errors;}else {var valid6 = true;}}}}}}}}}else {validate10.errors = [{instancePath:instancePath+"/chatter",schemaPath:"#/definitions/Profile/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid4 = _errs10 === errors;}else {var valid4 = true;}if(valid4){if(data.chatterBadges !== undefined){let data12 = data.chatterBadges;const _errs29 = errors;if(errors === _errs29){if(Array.isArray(data12)){var valid8 = true;const len0 = data12.length;for(let i0=0; i0<len0; i0++){let data13 = data12[i0];const _errs31 = errors;if(typeof data13 !== "string"){validate10.errors = [{instancePath:instancePath+"/chatterBadges/" + i0,schemaPath:"#/allOf/1/oneOf/0/properties/chatterBadges/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((data13 === "streamer") || (data13 === "moderator")) || (data13 === "vteam"))){validate10.errors = [{instancePath:instancePath+"/chatterBadges/" + i0,schemaPath:"#/allOf/1/oneOf/0/properties/chatterBadges/items/enum",keyword:"enum",params:{allowedValues: schema11.allOf[1].oneOf[0].properties.chatterBadges.items.enum},message:"must be equal to one of the allowed values"}];return false;}var valid8 = _errs31 === errors;if(!valid8){break;}}}else {validate10.errors = [{instancePath:instancePath+"/chatterBadges",schemaPath:"#/allOf/1/oneOf/0/properties/chatterBadges/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid4 = _errs29 === errors;}else {var valid4 = true;}if(valid4){if(data.chatterColor !== undefined){const _errs33 = errors;if(typeof data.chatterColor !== "string"){validate10.errors = [{instancePath:instancePath+"/chatterColor",schemaPath:"#/allOf/1/oneOf/0/properties/chatterColor/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs33 === errors;}else {var valid4 = true;}if(valid4){if(data.chatterStanding !== undefined){let data15 = data.chatterStanding;const _errs35 = errors;if(errors === _errs35){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){let missing2;if((data15.__typename === undefined) && (missing2 = "__typename")){validate10.errors = [{instancePath:instancePath+"/chatterStanding",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {const tag1 = data15.__typename;if(typeof tag1 == "string"){if(tag1 === "BannedChatterStanding"){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(data15.__typename !== undefined){if("BannedChatterStanding" !== data15.__typename){validate10.errors = [{instancePath:instancePath+"/chatterStanding/__typename",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/oneOf/0/properties/__typename/const",keyword:"const",params:{allowedValue: "BannedChatterStanding"},message:"must be equal to constant"}];return false;}}}}else if(tag1 === "GoodChatterStanding"){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(data15.__typename !== undefined){if("GoodChatterStanding" !== data15.__typename){validate10.errors = [{instancePath:instancePath+"/chatterStanding/__typename",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/oneOf/1/properties/__typename/const",keyword:"const",params:{allowedValue: "GoodChatterStanding"},message:"must be equal to constant"}];return false;}}}}else if(tag1 === "ModeratorChatterStanding"){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(data15.__typename !== undefined){if("ModeratorChatterStanding" !== data15.__typename){validate10.errors = [{instancePath:instancePath+"/chatterStanding/__typename",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/oneOf/2/properties/__typename/const",keyword:"const",params:{allowedValue: "ModeratorChatterStanding"},message:"must be equal to constant"}];return false;}}}}else if(tag1 === "PlatformBannedChatterStanding"){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(data15.__typename !== undefined){if("PlatformBannedChatterStanding" !== data15.__typename){validate10.errors = [{instancePath:instancePath+"/chatterStanding/__typename",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/oneOf/3/properties/__typename/const",keyword:"const",params:{allowedValue: "PlatformBannedChatterStanding"},message:"must be equal to constant"}];return false;}}}}else if(tag1 === "TimedOutChatterStanding"){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(data15.__typename !== undefined){const _errs47 = errors;if("TimedOutChatterStanding" !== data15.__typename){validate10.errors = [{instancePath:instancePath+"/chatterStanding/__typename",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/oneOf/4/properties/__typename/const",keyword:"const",params:{allowedValue: "TimedOutChatterStanding"},message:"must be equal to constant"}];return false;}var valid19 = _errs47 === errors;}else {var valid19 = true;}if(valid19){if(data15.timedOutUntil !== undefined){const _errs48 = errors;if(typeof data15.timedOutUntil !== "string"){validate10.errors = [{instancePath:instancePath+"/chatterStanding/timedOutUntil",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/oneOf/4/properties/timedOutUntil/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid19 = _errs48 === errors;}else {var valid19 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/chatterStanding",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/discriminator",keyword:"discriminator",params:{error: "mapping", tag: "__typename", tagValue: tag1},message:"value of tag \"__typename\" must be in oneOf"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/chatterStanding",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/discriminator",keyword:"discriminator",params:{error: "tag", tag: "__typename", tagValue: tag1},message:"tag \"__typename\" must be string"}];return false;}}}else {validate10.errors = [{instancePath:instancePath+"/chatterStanding",schemaPath:"#/allOf/1/oneOf/0/properties/chatterStanding/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid4 = _errs35 === errors;}else {var valid4 = true;}if(valid4){if(data.nodes !== undefined){let data22 = data.nodes;const _errs50 = errors;if(errors === _errs50){if(Array.isArray(data22)){var valid20 = true;const len1 = data22.length;for(let i1=0; i1<len1; i1++){const _errs52 = errors;if(!(validate11(data22[i1], {instancePath:instancePath+"/nodes/" + i1,parentData:data22,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}var valid20 = _errs52 === errors;if(!valid20){break;}}}else {validate10.errors = [{instancePath:instancePath+"/nodes",schemaPath:"#/allOf/1/oneOf/0/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid4 = _errs50 === errors;}else {var valid4 = true;}}}}}}}}}else if(tag0 === "ChatDeletedEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs54 = errors;if("ChatDeletedEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/1/properties/__typename/const",keyword:"const",params:{allowedValue: "ChatDeletedEvent"},message:"must be equal to constant"}];return false;}var valid22 = _errs54 === errors;}else {var valid22 = true;}if(valid22){if(data.chat !== undefined){let data25 = data.chat;const _errs55 = errors;if(errors === _errs55){if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(data25.id !== undefined){const _errs57 = errors;if(typeof data25.id !== "string"){validate10.errors = [{instancePath:instancePath+"/chat/id",schemaPath:"#/allOf/1/oneOf/1/properties/chat/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid23 = _errs57 === errors;}else {var valid23 = true;}if(valid23){if(data25.deletedBy !== undefined){let data27 = data25.deletedBy;const _errs59 = errors;if(errors === _errs59){if(data27 && typeof data27 == "object" && !Array.isArray(data27)){if(data27.id !== undefined){const _errs61 = errors;if(typeof data27.id !== "string"){validate10.errors = [{instancePath:instancePath+"/chat/deletedBy/id",schemaPath:"#/allOf/1/oneOf/1/properties/chat/properties/deletedBy/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid24 = _errs61 === errors;}else {var valid24 = true;}if(valid24){if(data27.username !== undefined){const _errs63 = errors;if(typeof data27.username !== "string"){validate10.errors = [{instancePath:instancePath+"/chat/deletedBy/username",schemaPath:"#/allOf/1/oneOf/1/properties/chat/properties/deletedBy/properties/username/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid24 = _errs63 === errors;}else {var valid24 = true;}}}else {validate10.errors = [{instancePath:instancePath+"/chat/deletedBy",schemaPath:"#/allOf/1/oneOf/1/properties/chat/properties/deletedBy/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid23 = _errs59 === errors;}else {var valid23 = true;}}}else {validate10.errors = [{instancePath:instancePath+"/chat",schemaPath:"#/allOf/1/oneOf/1/properties/chat/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid22 = _errs55 === errors;}else {var valid22 = true;}}}}else if(tag0 === "UserBannedEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs66 = errors;if("UserBannedEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/2/properties/__typename/const",keyword:"const",params:{allowedValue: "UserBannedEvent"},message:"must be equal to constant"}];return false;}var valid26 = _errs66 === errors;}else {var valid26 = true;}if(valid26){if(data.userID !== undefined){let data31 = data.userID;const _errs67 = errors;if(errors === _errs67){if(errors === _errs67){if(typeof data31 === "string"){if(!(formats2.test(data31))){validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/2/properties/userID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/2/properties/userID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid26 = _errs67 === errors;}else {var valid26 = true;}}}}else if(tag0 === "UserChatsDeletedEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs70 = errors;if("UserChatsDeletedEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/3/properties/__typename/const",keyword:"const",params:{allowedValue: "UserChatsDeletedEvent"},message:"must be equal to constant"}];return false;}var valid28 = _errs70 === errors;}else {var valid28 = true;}if(valid28){if(data.userID !== undefined){let data33 = data.userID;const _errs71 = errors;if(errors === _errs71){if(errors === _errs71){if(typeof data33 === "string"){if(!(formats2.test(data33))){validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/3/properties/userID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/3/properties/userID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid28 = _errs71 === errors;}else {var valid28 = true;}}}}else if(tag0 === "UserTimedOutEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs74 = errors;if("UserTimedOutEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/4/properties/__typename/const",keyword:"const",params:{allowedValue: "UserTimedOutEvent"},message:"must be equal to constant"}];return false;}var valid30 = _errs74 === errors;}else {var valid30 = true;}if(valid30){if(data.userID !== undefined){let data35 = data.userID;const _errs75 = errors;if(errors === _errs75){if(errors === _errs75){if(typeof data35 === "string"){if(!(formats2.test(data35))){validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/4/properties/userID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/4/properties/userID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid30 = _errs75 === errors;}else {var valid30 = true;}if(valid30){if(data.timedOutUntil !== undefined){let data36 = data.timedOutUntil;const _errs77 = errors;if(errors === _errs77){if(errors === _errs77){if(typeof data36 === "string"){if(!(formats0.validate(data36))){validate10.errors = [{instancePath:instancePath+"/timedOutUntil",schemaPath:"#/allOf/1/oneOf/4/properties/timedOutUntil/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/timedOutUntil",schemaPath:"#/allOf/1/oneOf/4/properties/timedOutUntil/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid30 = _errs77 === errors;}else {var valid30 = true;}}}}}else if(tag0 === "ViewerJoinedEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs80 = errors;if("ViewerJoinedEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/5/properties/__typename/const",keyword:"const",params:{allowedValue: "ViewerJoinedEvent"},message:"must be equal to constant"}];return false;}var valid32 = _errs80 === errors;}else {var valid32 = true;}if(valid32){if(data.viewer !== undefined){let data38 = data.viewer;const _errs81 = errors;const _errs82 = errors;if(errors === _errs82){if(data38 && typeof data38 == "object" && !Array.isArray(data38)){let missing3;if(((((data38.channelID === undefined) && (missing3 = "channelID")) || ((data38.displayName === undefined) && (missing3 = "displayName"))) || ((data38.userID === undefined) && (missing3 = "userID"))) || ((data38.username === undefined) && (missing3 = "username"))){validate10.errors = [{instancePath:instancePath+"/viewer",schemaPath:"#/definitions/Profile/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {if(data38.channelID !== undefined){let data39 = data38.channelID;const _errs84 = errors;if(errors === _errs84){if(errors === _errs84){if(typeof data39 === "string"){if(!(formats2.test(data39))){validate10.errors = [{instancePath:instancePath+"/viewer/channelID",schemaPath:"#/definitions/Profile/properties/channelID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/viewer/channelID",schemaPath:"#/definitions/Profile/properties/channelID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid34 = _errs84 === errors;}else {var valid34 = true;}if(valid34){if(data38.isVTuber !== undefined){const _errs86 = errors;if(typeof data38.isVTuber !== "boolean"){validate10.errors = [{instancePath:instancePath+"/viewer/isVTuber",schemaPath:"#/definitions/Profile/properties/isVTuber/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid34 = _errs86 === errors;}else {var valid34 = true;}if(valid34){if(data38.isModerator !== undefined){const _errs88 = errors;if(typeof data38.isModerator !== "boolean"){validate10.errors = [{instancePath:instancePath+"/viewer/isModerator",schemaPath:"#/definitions/Profile/properties/isModerator/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid34 = _errs88 === errors;}else {var valid34 = true;}if(valid34){if(data38.pfp !== undefined){let data42 = data38.pfp;const _errs90 = errors;if(errors === _errs90){if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.url !== undefined){let data43 = data42.url;const _errs92 = errors;if(errors === _errs92){if(errors === _errs92){if(typeof data43 === "string"){if(!(formats6(data43))){validate10.errors = [{instancePath:instancePath+"/viewer/pfp/url",schemaPath:"#/definitions/Profile/properties/pfp/properties/url/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/viewer/pfp/url",schemaPath:"#/definitions/Profile/properties/pfp/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}}}else {validate10.errors = [{instancePath:instancePath+"/viewer/pfp",schemaPath:"#/definitions/Profile/properties/pfp/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid34 = _errs90 === errors;}else {var valid34 = true;}if(valid34){if(data38.userID !== undefined){let data44 = data38.userID;const _errs94 = errors;if(errors === _errs94){if(errors === _errs94){if(typeof data44 === "string"){if(!(formats2.test(data44))){validate10.errors = [{instancePath:instancePath+"/viewer/userID",schemaPath:"#/definitions/Profile/properties/userID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/viewer/userID",schemaPath:"#/definitions/Profile/properties/userID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid34 = _errs94 === errors;}else {var valid34 = true;}if(valid34){if(data38.username !== undefined){let data45 = data38.username;const _errs96 = errors;if(errors === _errs96){if(typeof data45 === "string"){if(func2(data45) < 1){validate10.errors = [{instancePath:instancePath+"/viewer/username",schemaPath:"#/definitions/Profile/properties/username/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/viewer/username",schemaPath:"#/definitions/Profile/properties/username/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid34 = _errs96 === errors;}else {var valid34 = true;}if(valid34){if(data38.displayName !== undefined){let data46 = data38.displayName;const _errs98 = errors;if(errors === _errs98){if(typeof data46 === "string"){if(func2(data46) < 1){validate10.errors = [{instancePath:instancePath+"/viewer/displayName",schemaPath:"#/definitions/Profile/properties/displayName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/viewer/displayName",schemaPath:"#/definitions/Profile/properties/displayName/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid34 = _errs98 === errors;}else {var valid34 = true;}}}}}}}}}else {validate10.errors = [{instancePath:instancePath+"/viewer",schemaPath:"#/definitions/Profile/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid32 = _errs81 === errors;}else {var valid32 = true;}}}}else if(tag0 === "ViewerLeftEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs101 = errors;if("ViewerLeftEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/6/properties/__typename/const",keyword:"const",params:{allowedValue: "ViewerLeftEvent"},message:"must be equal to constant"}];return false;}var valid37 = _errs101 === errors;}else {var valid37 = true;}if(valid37){if(data.channelID !== undefined){let data48 = data.channelID;const _errs102 = errors;if(errors === _errs102){if(errors === _errs102){if(typeof data48 === "string"){if(!(formats2.test(data48))){validate10.errors = [{instancePath:instancePath+"/channelID",schemaPath:"#/allOf/1/oneOf/6/properties/channelID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/channelID",schemaPath:"#/allOf/1/oneOf/6/properties/channelID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid37 = _errs102 === errors;}else {var valid37 = true;}if(valid37){if(data.userID !== undefined){let data49 = data.userID;const _errs104 = errors;if(errors === _errs104){if(errors === _errs104){if(typeof data49 === "string"){if(!(formats2.test(data49))){validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/6/properties/userID/format",keyword:"format",params:{format: "uuid"},message:"must match format \""+"uuid"+"\""}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/userID",schemaPath:"#/allOf/1/oneOf/6/properties/userID/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid37 = _errs104 === errors;}else {var valid37 = true;}}}}}else if(tag0 === "ViewerCountUpdatedEvent"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.__typename !== undefined){const _errs107 = errors;if("ViewerCountUpdatedEvent" !== data.__typename){validate10.errors = [{instancePath:instancePath+"/__typename",schemaPath:"#/allOf/1/oneOf/7/properties/__typename/const",keyword:"const",params:{allowedValue: "ViewerCountUpdatedEvent"},message:"must be equal to constant"}];return false;}var valid39 = _errs107 === errors;}else {var valid39 = true;}if(valid39){if(data.viewerCount !== undefined){let data51 = data.viewerCount;const _errs108 = errors;if(errors === _errs108){if(typeof data51 === "string"){if(func2(data51) < 1){validate10.errors = [{instancePath:instancePath+"/viewerCount",schemaPath:"#/allOf/1/oneOf/7/properties/viewerCount/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/viewerCount",schemaPath:"#/allOf/1/oneOf/7/properties/viewerCount/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid39 = _errs108 === errors;}else {var valid39 = true;}}}}else {validate10.errors = [{instancePath,schemaPath:"#/allOf/1/discriminator",keyword:"discriminator",params:{error: "mapping", tag: "__typename", tagValue: tag0},message:"value of tag \"__typename\" must be in oneOf"}];return false;}}else {validate10.errors = [{instancePath,schemaPath:"#/allOf/1/discriminator",keyword:"discriminator",params:{error: "tag", tag: "__typename", tagValue: tag0},message:"tag \"__typename\" must be string"}];return false;}}}}var valid0 = _errs4 === errors;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing4;if(((data.__typename === undefined) && (missing4 = "__typename")) || ((data.timestamp === undefined) && (missing4 = "timestamp"))){validate10.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing4},message:"must have required property '"+missing4+"'"}];return false;}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;}