@hackersheet/core 0.1.0-alpha.2 → 0.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3GXIDS5H.mjs +1 -0
- package/dist/chunk-4P6CMRB3.mjs +1 -0
- package/dist/chunk-7R3CATQT.mjs +1 -0
- package/dist/chunk-C3G2CMRR.mjs +1 -0
- package/dist/chunk-EXRG4APR.mjs +1 -0
- package/dist/chunk-FIFBNWMD.mjs +1 -0
- package/dist/chunk-FRXB4F4I.mjs +0 -0
- package/dist/chunk-JGQBUURE.mjs +1 -0
- package/dist/chunk-OLUJJPKQ.mjs +1 -0
- package/dist/chunk-PA32N4A6.mjs +1 -0
- package/dist/chunk-PUTNZ4GU.mjs +1 -0
- package/dist/chunk-RRJUH3D4.mjs +0 -0
- package/dist/chunk-SYHSU6VH.mjs +1 -0
- package/dist/chunk-VKWT2GNZ.mjs +0 -0
- package/dist/chunk-WIUPPYM5.mjs +1 -0
- package/dist/chunk-YAN7TO2B.mjs +0 -0
- package/dist/chunk-ZZFAG7Y6.mjs +1 -0
- package/dist/client/client.js +1 -1
- package/dist/client/client.mjs +1 -1
- package/dist/client/create-client.js +1 -1
- package/dist/client/create-client.mjs +1 -1
- package/dist/client/operations/get-document.js +1 -1
- package/dist/client/operations/get-document.mjs +1 -1
- package/dist/client/operations/get-documents.js +1 -1
- package/dist/client/operations/get-documents.mjs +1 -1
- package/dist/client/operations/get-tag.js +1 -1
- package/dist/client/operations/get-tag.mjs +1 -1
- package/dist/client/operations/get-tags.js +1 -1
- package/dist/client/operations/get-tags.mjs +1 -1
- package/dist/client/operations/get-websites.js +1 -1
- package/dist/client/operations/get-websites.mjs +1 -1
- package/dist/client/operations/index.js +1 -1
- package/dist/client/operations/index.mjs +1 -1
- package/dist/gql/fragment-masking.js +1 -1
- package/dist/gql/fragment-masking.mjs +1 -1
- package/dist/gql/gql.js +1 -1
- package/dist/gql/gql.mjs +1 -1
- package/dist/gql/graphql.js +1 -1
- package/dist/gql/graphql.mjs +1 -1
- package/dist/gql/index.js +1 -1
- package/dist/gql/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/document.js +1 -1
- package/dist/types/document.mjs +0 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/tag.js +1 -1
- package/dist/types/tag.mjs +0 -1
- package/dist/types/website.js +1 -1
- package/dist/types/website.mjs +0 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/make-after-cursor-from-page.js +1 -1
- package/dist/utils/make-after-cursor-from-page.mjs +1 -1
- package/dist/utils/non-nullable-filter.js +1 -1
- package/dist/utils/non-nullable-filter.mjs +1 -1
- package/dist/utils/to-array-from-edges.js +1 -1
- package/dist/utils/to-array-from-edges.mjs +1 -1
- package/package.json +6 -4
- package/dist/client/client.js.map +0 -1
- package/dist/client/client.mjs.map +0 -1
- package/dist/client/create-client.js.map +0 -1
- package/dist/client/create-client.mjs.map +0 -1
- package/dist/client/operations/get-document.js.map +0 -1
- package/dist/client/operations/get-document.mjs.map +0 -1
- package/dist/client/operations/get-documents.js.map +0 -1
- package/dist/client/operations/get-documents.mjs.map +0 -1
- package/dist/client/operations/get-tag.js.map +0 -1
- package/dist/client/operations/get-tag.mjs.map +0 -1
- package/dist/client/operations/get-tags.js.map +0 -1
- package/dist/client/operations/get-tags.mjs.map +0 -1
- package/dist/client/operations/get-websites.js.map +0 -1
- package/dist/client/operations/get-websites.mjs.map +0 -1
- package/dist/client/operations/index.js.map +0 -1
- package/dist/client/operations/index.mjs.map +0 -1
- package/dist/gql/fragment-masking.js.map +0 -1
- package/dist/gql/fragment-masking.mjs.map +0 -1
- package/dist/gql/gql.js.map +0 -1
- package/dist/gql/gql.mjs.map +0 -1
- package/dist/gql/graphql.js.map +0 -1
- package/dist/gql/graphql.mjs.map +0 -1
- package/dist/gql/index.js.map +0 -1
- package/dist/gql/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/document.js.map +0 -1
- package/dist/types/document.mjs.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs.map +0 -1
- package/dist/types/tag.js.map +0 -1
- package/dist/types/tag.mjs.map +0 -1
- package/dist/types/website.js.map +0 -1
- package/dist/types/website.mjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs.map +0 -1
- package/dist/utils/make-after-cursor-from-page.js.map +0 -1
- package/dist/utils/make-after-cursor-from-page.mjs.map +0 -1
- package/dist/utils/non-nullable-filter.js.map +0 -1
- package/dist/utils/non-nullable-filter.mjs.map +0 -1
- package/dist/utils/to-array-from-edges.js.map +0 -1
- package/dist/utils/to-array-from-edges.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DocumentDocument as n,DocumentsDocument as e,TagDocument as t,TagsDocument as i,WebsitesDocument as o}from"./chunk-ZZFAG7Y6.mjs";var d={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":n,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":e,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":t,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":i,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":o};function s(n){return d[n]??{}}export{s as graphql};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeGetDocumentsResponse as t}from"./chunk-JGQBUURE.mjs";import{makeGetTagResponse as r}from"./chunk-SYHSU6VH.mjs";import{makeGetTagsResponse as e}from"./chunk-EXRG4APR.mjs";import{makeGetWebsitesResponse as s}from"./chunk-WIUPPYM5.mjs";import{makeGetDocumentResponse as n}from"./chunk-7R3CATQT.mjs";import{DocumentDocument as i,DocumentsDocument as c,TagDocument as u,TagsDocument as a,WebsitesDocument as o}from"./chunk-ZZFAG7Y6.mjs";import{createClient as l,cacheExchange as h,fetchExchange as m}from"@urql/core";var q=class{url;accessKey;urqlClient;constructor(t){this.url=t.url,this.accessKey=t.accessKey,this.urqlClient=t.urqlClient??this.createUrqlClient()}async getDocument(t){const r=await this.urqlClient.query(i,t);return n(r)}async getDocuments(r){const e=await this.urqlClient.query(c,r??{});return t(e)}async getTag(t){const e=await this.urqlClient.query(u,t);return r(e)}async getTags(t){const r=await this.urqlClient.query(a,t??{});return e(r)}async getWebsites(t){const r=await this.urqlClient.query(o,t??{});return s(r)}createUrqlClient(){return l({url:this.url,exchanges:[h,m],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};export{q as Client};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-3GXIDS5H.mjs";function t(e){if(!e.data?.document)return{document:null,error:e.error};const t=e.data?.document;return{document:{...t,tags:n(t.tags?.edges),assets:n(t.assets?.edges),outboundLinkDocuments:n(t.outboundLinkDocuments?.edges).map((e=>({...e,tags:n(e.tags?.edges)}))),inboundLinkDocuments:n(t.inboundLinkDocuments?.edges).map((e=>({...e,tags:n(e.tags?.edges)}))),websites:n(t.websites?.edges)},error:e.error}}e("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n");export{t as makeGetDocumentResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{nonNullableFilter as r}from"./chunk-PA32N4A6.mjs";function n(n){return n?n.map((r=>r?.node)).filter(r)??[]:[]}export{n as toArrayFromEdges};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-3GXIDS5H.mjs";function o(t){const o=n(t.data?.tags?.edges),r=t.data?.tags?.totalCount||0;return{tags:o,totalCount:r,isEmpty:0===r,error:t.error}}t("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n");export{o as makeGetTagsResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n,e){return e}function e(n,e){return n}function t(n,e,t){const r=n.__meta__?.deferredFields;if(!r)return!0;const i=e.definitions[0],u=i?.name?.value,o=u&&r[u]||[];return o.length>0&&o.every((n=>t&&n in t))}export{n as getFragmentData,e as makeFragmentData,t as isFragmentReady};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-3GXIDS5H.mjs";function e(t){if(!t.data||!t.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:t.error};const e=t.data.documents,r=n(e?.edges).map((t=>({...t,tags:n(t.tags?.edges)}))),o=t.data?.documents?.totalCount||0;return{documents:r,totalCount:o,isEmpty:0===o,error:t.error}}t("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n");export{e as makeGetDocumentsResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Client as n}from"./chunk-4P6CMRB3.mjs";function r(r){return new n(r)}export{r as createClient};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=l=>null!=l;export{l as nonNullableFilter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,r){const n=(t-1)*r;if(0!==n)return Buffer.from(n.toString()).toString("base64")}export{t as makeAfterCursorFromPage};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-3GXIDS5H.mjs";function t(e){const t=e.data?.tag;return{tag:t?{...t,relatedTags:n(t.relatedTags?.edges)}:null,error:e.error}}e("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n");export{t as makeGetTagResponse};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-3GXIDS5H.mjs";function e(t){const e=n(t.data?.websites?.edges).map((t=>({...t,documents:n(t.documents?.edges)}))),o=t.data?.websites?.totalCount||0;return{websites:e,totalCount:o,isEmpty:0===o,error:t.error}}t("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n");export{e as makeGetWebsitesResponse};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},d={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]};export{e as DocumentDocument,i as DocumentsDocument,n as TagDocument,a as TagsDocument,d as WebsitesDocument};
|
package/dist/client/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,r={};((e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})})(r,{Client:()=>un}),module.exports=(e=r,((e,r,o,d)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let l of t(r))a.call(e,l)||l===o||n(e,l,{get:()=>r[l],enumerable:!(d=i(r,l))||d.enumerable});return e})(n({},"__esModule",{value:!0}),e));var o,d,l="Name",s="OperationDefinition",u="Field",c=class extends Error{constructor(e,n,i,t,a,r,o){super(e),this.name="GraphQLError",this.message=e,a&&(this.path=a),n&&(this.nodes=Array.isArray(n)?n:[n]),i&&(this.source=i),t&&(this.positions=t),r&&(this.originalError=r);var d=o;if(!d&&r){var l=r.extensions;l&&"object"==typeof l&&(d=l)}this.extensions=d||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}};function m(e){return new c(`Syntax Error: Unexpected token at ${d} in ${e}`)}function k(e){if(e.lastIndex=d,e.test(o))return o.slice(d,d=e.lastIndex)}var v=/ +(?=[^\s])/y;function f(e){for(var n=e.split("\n"),i="",t=0,a=0,r=n.length-1,o=0;o<n.length;o++)v.lastIndex=0,v.test(n[o])&&(o&&(!t||v.lastIndex<t)&&(t=v.lastIndex),a=a||o,r=o);for(var d=a;d<=r;d++)d!==a&&(i+="\n"),i+=n[d].slice(t).replace(/\\"""/g,'"""');return i}function g(){for(var e=0|o.charCodeAt(d++);9===e||10===e||13===e||32===e||35===e||44===e||65279===e;e=0|o.charCodeAt(d++))if(35===e)for(;10!==(e=o.charCodeAt(d++))&&13!==e;);d--}var h,p=/[_A-Za-z]\w*/y,y=new RegExp("(?:(null|true|false)|\\$("+p.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+p.source+"))","y"),N=((h=N||{})[h.Const=1]="Const",h[h.Var=2]="Var",h[h.Int=3]="Int",h[h.Float=4]="Float",h[h.BlockString=5]="BlockString",h[h.String=6]="String",h[h.Enum=7]="Enum",h),S=/\\/g;function b(e){var n,i;if(y.lastIndex=d,91===o.charCodeAt(d)){d++,g();for(var t=[];93!==o.charCodeAt(d);)t.push(b(e));return d++,g(),{kind:"ListValue",values:t}}if(123===o.charCodeAt(d)){d++,g();for(var a=[];125!==o.charCodeAt(d);){if(null==(n=k(p)))throw m("ObjectField");if(g(),58!==o.charCodeAt(d++))throw m("ObjectField");g(),a.push({kind:"ObjectField",name:{kind:"Name",value:n},value:b(e)})}return d++,g(),{kind:"ObjectValue",fields:a}}if(null!=(i=y.exec(o))){if(d=y.lastIndex,g(),null!=(n=i[N.Const]))return"null"===n?{kind:"NullValue"}:{kind:"BooleanValue",value:"true"===n};if(null!=(n=i[N.Var])){if(e)throw m("Variable");return{kind:"Variable",name:{kind:"Name",value:n}}}var r;if(null!=(n=i[N.Int]))return null!=(r=i[N.Float])?{kind:"FloatValue",value:n+r}:{kind:"IntValue",value:n};if(null!=(n=i[N.BlockString]))return{kind:"StringValue",value:f(n.slice(3,-3)),block:!0};if(null!=(n=i[N.String]))return{kind:"StringValue",value:S.test(n)?JSON.parse(n):n.slice(1,-1),block:!1};if(null!=(n=i[N.Enum]))return{kind:"EnumValue",value:n}}throw m("Value")}function F(e){if(40===o.charCodeAt(d)){var n,i=[];d++,g();do{if(null==(n=k(p)))throw m("Argument");if(g(),58!==o.charCodeAt(d++))throw m("Argument");g(),i.push({kind:"Argument",name:{kind:"Name",value:n},value:b(e)})}while(41!==o.charCodeAt(d));return d++,g(),i}}function w(e){if(64===o.charCodeAt(d)){var n,i=[];do{if(d++,null==(n=k(p)))throw m("Directive");g(),i.push({kind:"Directive",name:{kind:"Name",value:n},arguments:F(e)})}while(64===o.charCodeAt(d));return i}}function x(){for(var e,n=0;91===o.charCodeAt(d);)n++,d++,g();if(null==(e=k(p)))throw m("NamedType");g();var i={kind:"NamedType",name:{kind:"Name",value:e}};do{if(33===o.charCodeAt(d)&&(d++,g(),i={kind:"NonNullType",type:i}),n){if(93!==o.charCodeAt(d++))throw m("NamedType");g(),i={kind:"ListType",type:i}}}while(n--);return i}var D=new RegExp("(?:(\\.{3})|("+p.source+"))","y"),A=function(e){return e[e.Spread=1]="Spread",e[e.Name=2]="Name",e}(A||{});function C(){var e,n,i=[];do{if(D.lastIndex=d,null==(n=D.exec(o)))throw m("SelectionSet");if(d=D.lastIndex,null!=n[A.Spread]){g();var t=k(p);if(null!=t&&"on"!==t)g(),i.push({kind:"FragmentSpread",name:{kind:"Name",value:t},directives:w(!1)});else{if(g(),"on"===t){if(null==(t=k(p)))throw m("NamedType");g()}var a=w(!1);if(123!==o.charCodeAt(d++))throw m("InlineFragment");g(),i.push({kind:"InlineFragment",typeCondition:t?{kind:"NamedType",name:{kind:"Name",value:t}}:void 0,directives:a,selectionSet:C()})}}else if(null!=(e=n[A.Name])){var r=void 0;if(g(),58===o.charCodeAt(d)){if(d++,g(),r=e,null==(e=k(p)))throw m("Field");g()}var l=F(!1);g();var s=w(!1),u=void 0;123===o.charCodeAt(d)&&(d++,g(),u=C()),i.push({kind:"Field",alias:r?{kind:"Name",value:r}:void 0,name:{kind:"Name",value:e},arguments:l,directives:s,selectionSet:u})}}while(125!==o.charCodeAt(d));return d++,g(),{kind:"SelectionSet",selections:i}}function O(){var e,n;if(null==(e=k(p)))throw m("FragmentDefinition");if(g(),"on"!==k(p))throw m("FragmentDefinition");if(g(),null==(n=k(p)))throw m("FragmentDefinition");g();var i=w(!1);if(123!==o.charCodeAt(d++))throw m("FragmentDefinition");return g(),{kind:"FragmentDefinition",name:{kind:"Name",value:e},typeCondition:{kind:"NamedType",name:{kind:"Name",value:n}},directives:i,selectionSet:C()}}var q=/(?:query|mutation|subscription|fragment)/y;function E(e){var n,i,t;if(e&&(g(),n=k(p),i=function(){if(g(),40===o.charCodeAt(d)){var e,n=[];d++,g();do{if(36!==o.charCodeAt(d++))throw m("Variable");if(null==(e=k(p)))throw m("Variable");if(g(),58!==o.charCodeAt(d++))throw m("VariableDefinition");g();var i=x(),t=void 0;61===o.charCodeAt(d)&&(d++,g(),t=b(!0)),g(),n.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:e}},type:i,defaultValue:t,directives:w(!0)})}while(41!==o.charCodeAt(d));return d++,g(),n}}(),t=w(!1)),123===o.charCodeAt(d))return d++,g(),{kind:"OperationDefinition",operation:e||"query",name:n?{kind:"Name",value:n}:void 0,variableDefinitions:i,directives:t,selectionSet:C()}}function V(e,n,i){for(var t="",a=0;a<e.length;a++)a&&(t+=n),t+=i(e[a]);return t}var $="\n",T={OperationDefinition(e){var n=e.operation;return e.name&&(n+=" "+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(n+=" "),n+="("+V(e.variableDefinitions,", ",T.VariableDefinition)+")"),e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),"query"!==n?n+" "+T.SelectionSet(e.selectionSet):T.SelectionSet(e.selectionSet)},VariableDefinition(e){var n=T.Variable(e.variable)+": "+I(e.type);return e.defaultValue&&(n+=" = "+I(e.defaultValue)),e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n},Field(e){var n=e.alias?e.alias.value+": "+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var i=V(e.arguments,", ",T.Argument);n.length+i.length+2>80?n+="("+($+=" ")+V(e.arguments,$,T.Argument)+($=$.slice(0,-2))+")":n+="("+i+")"}return e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),e.selectionSet&&(n+=" "+T.SelectionSet(e.selectionSet)),n},StringValue:e=>e.block?function(e){return'"""\n'+e.replace(/"""/g,'\\"""')+'\n"""'}(e.value).replace(/\n/g,$):function(e){return JSON.stringify(e)}(e.value),BooleanValue:e=>""+e.value,NullValue:e=>"null",IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>"$"+e.name.value,ListValue:e=>"["+V(e.values,", ",I)+"]",ObjectValue:e=>"{"+V(e.fields,", ",T.ObjectField)+"}",ObjectField:e=>e.name.value+": "+I(e.value),Document:e=>e.definitions&&e.definitions.length?V(e.definitions,"\n\n",I):"",SelectionSet:e=>"{"+($+=" ")+V(e.selections,$,I)+($=$.slice(0,-2))+"}",Argument:e=>e.name.value+": "+I(e.value),FragmentSpread(e){var n="..."+e.name.value;return e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n},InlineFragment(e){var n="...";return e.typeCondition&&(n+=" on "+e.typeCondition.name.value),e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n+" "+T.SelectionSet(e.selectionSet)},FragmentDefinition(e){var n="fragment "+e.name.value;return n+=" on "+e.typeCondition.name.value,e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n+" "+T.SelectionSet(e.selectionSet)},Directive(e){var n="@"+e.name.value;return e.arguments&&e.arguments.length&&(n+="("+V(e.arguments,", ",T.Argument)+")"),n},NamedType:e=>e.name.value,ListType:e=>"["+I(e.type)+"]",NonNullType:e=>I(e.type)+"!"},I=e=>T[e.kind](e);var _=()=>{},j=_;function P(e){return{tag:0,0:e}}function L(e){return{tag:1,0:e}}var U=()=>"function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator",M=e=>e;function R(e){return n=>i=>{var t=j;n((n=>{0===n?i(0):0===n.tag?(t=n[0],i(n)):e(n[0])?i(n):t(0)}))}}function Q(e){return n=>i=>n((n=>{0===n||0===n.tag?i(n):i(L(e(n[0])))}))}function J(e){return n=>i=>{var t=[],a=j,r=!1,o=!1;n((n=>{var d,l;o||(0===n?(o=!0,t.length||i(0)):0===n.tag?a=n[0]:(r=!1,d=e(n[0]),l=j,d((e=>{if(0===e){if(t.length){var n=t.indexOf(l);n>-1&&(t=t.slice()).splice(n,1),t.length||(o?i(0):r||(r=!0,a(0)))}}else 0===e.tag?(t.push(l=e[0]),l(0)):t.length&&(i(e),l(0))})),r||(r=!0,a(0))))})),i(P((e=>{if(1===e){o||(o=!0,a(1));for(var n=0,i=t,d=t.length;n<d;n++)i[n](1);t.length=0}else{o||r?r=!1:(r=!0,a(0));for(var l=0,s=t,u=t.length;l<u;l++)s[l](0)}})))}}function G(e){return function(e){return J(M)(e)}(ee(e))}function B(e){return n=>i=>{var t=!1;n((n=>{if(t);else if(0===n)t=!0,i(0),e();else if(0===n.tag){var a=n[0];i(P((n=>{1===n?(t=!0,a(1),e()):a(n)})))}else i(n)}))}}function K(e){return n=>i=>{var t=!1;n((n=>{if(t);else if(0===n)t=!0,i(0);else if(0===n.tag){var a=n[0];i(P((e=>{1===e&&(t=!0),a(e)})))}else e(n[0]),i(n)}))}}function z(e){return n=>i=>n((n=>{0===n?i(0):0===n.tag?(i(n),e()):i(n)}))}function W(e){var n=[],i=j,t=!1;return a=>{n.push(a),1===n.length&&e((e=>{if(0===e){for(var a=0,r=n,o=n.length;a<o;a++)r[a](0);n.length=0}else if(0===e.tag)i=e[0];else{t=!1;for(var d=0,l=n,s=n.length;d<s;d++)l[d](e)}})),a(P((e=>{if(1===e){var r=n.indexOf(a);r>-1&&(n=n.slice()).splice(r,1),n.length||i(1)}else t||(t=!0,i(0))})))}}function H(e){return n=>i=>{var t=j,a=j,r=!1,o=!1,d=!1,l=!1;n((n=>{l||(0===n?(l=!0,d||i(0)):0===n.tag?t=n[0]:(d&&(a(1),a=j),r?r=!1:(r=!0,t(0)),function(e){d=!0,e((e=>{d&&(0===e?(d=!1,l?i(0):r||(r=!0,t(0))):0===e.tag?(o=!1,(a=e[0])(0)):(i(e),o?o=!1:a(0)))}))}(e(n[0]))))})),i(P((e=>{1===e?(l||(l=!0,t(1)),d&&(d=!1,a(1))):(l||r||(r=!0,t(0)),d&&!o&&(o=!0,a(0)))})))}}function Y(e){return n=>i=>{var t=j,a=!1,r=0;n((n=>{a||(0===n?(a=!0,i(0)):0===n.tag?e<=0?(a=!0,i(0),n[0](1)):t=n[0]:r++<e?(i(n),!a&&r>=e&&(a=!0,i(0),t(1))):i(n))})),i(P((n=>{1!==n||a?0===n&&!a&&r<e&&t(0):(a=!0,t(1))})))}}function Z(e){return n=>i=>{var t=j,a=j,r=!1;n((n=>{r||(0===n?(r=!0,a(1),i(0)):0===n.tag?(t=n[0],e((e=>{0===e||(0===e.tag?(a=e[0])(0):(r=!0,a(1),t(1),i(0)))}))):i(n))})),i(P((e=>{1!==e||r?r||t(0):(r=!0,t(1),a(1))})))}}function X(e){return n=>{var i,t=e[U()]&&e[U()]()||e,a=!1,r=!1,o=!1;n(P((async e=>{if(1===e)a=!0,t.return&&t.return();else if(r)o=!0;else{for(o=r=!0;o&&!a;)if((i=await t.next()).done)a=!0,t.return&&await t.return(),n(0);else try{o=!1,n(L(i.value))}catch(e){if(!t.throw)throw e;(a=!!(await t.throw(e)).done)&&n(0)}r=!1}})))}}var ee=function(e){return e[Symbol.asyncIterator]?X(e):n=>{var i,t=e[Symbol.iterator](),a=!1,r=!1,o=!1;n(P((e=>{if(1===e)a=!0,t.return&&t.return();else if(r)o=!0;else{for(o=r=!0;o&&!a;)if((i=t.next()).done)a=!0,t.return&&t.return(),n(0);else try{o=!1,n(L(i.value))}catch(e){if(!t.throw)throw e;(a=!!t.throw(e).done)&&n(0)}r=!1}})))}};function ne(e){return n=>{var i=!1;n(P((t=>{1===t?i=!0:i||(i=!0,n(L(e)),n(0))})))}}function ie(e){return n=>{var i=!1,t=e({next(e){i||n(L(e))},complete(){i||(i=!0,n(0))}});n(P((e=>{1!==e||i||(i=!0,t())})))}}function te(){var e,n;return{source:W(ie((i=>(e=i.next,n=i.complete,_)))),next(n){e&&e(n)},complete(){n&&n()}}}function ae(e){return n=>{var i=j,t=!1;return n((n=>{0===n?t=!0:0===n.tag?(i=n[0])(0):t||(e(n[0]),i(0))})),{unsubscribe(){t||(t=!0,i(1))}}}}var re=e=>e&&e.message&&(e.extensions||"GraphQLError"===e.name)?e:"object"==typeof e&&e.message?new c(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new c(e),oe=class extends Error{constructor(e){var n=(e.graphQLErrors||[]).map(re),i=((e,n)=>{var i="";if(e)return`[Network] ${e.message}`;if(n)for(var t of n)i&&(i+="\n"),i+=`[GraphQL] ${t.message}`;return i})(e.networkError,n);super(i),this.name="CombinedError",this.message=i,this.graphQLErrors=n,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},de=(e,n)=>{for(var i=0|(n||5381),t=0,a=0|e.length;t<a;t++)i=(i<<5)+i+e.charCodeAt(t);return i},le=new Set,se=new WeakMap,ue=(e,n)=>{if(null===e||le.has(e))return"null";if("object"!=typeof e)return JSON.stringify(e)||"";if(e.toJSON)return ue(e.toJSON(),n);if(Array.isArray(e)){var i="[";for(var t of e)i.length>1&&(i+=","),i+=ue(t,n)||"null";return i+"]"}if(!n&&(ve!==ke&&e instanceof ve||fe!==ke&&e instanceof fe))return"null";var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var r=se.get(e)||Math.random().toString(36).slice(2);return se.set(e,r),ue({__key:r},n)}le.add(e);var o="{";for(var d of a){var l=ue(e[d],n);l&&(o.length>1&&(o+=","),o+=ue(d,n)+":"+l)}return le.delete(e),o+"}"},ce=(e,n,i)=>{if(null==i||"object"!=typeof i||i.toJSON||le.has(i));else if(Array.isArray(i))for(var t=0,a=i.length;t<a;t++)ce(e,`${n}.${t}`,i[t]);else if(i instanceof ve||i instanceof fe)e.set(n,i);else for(var r of(le.add(i),Object.keys(i)))ce(e,`${n}.${r}`,i[r])},me=(e,n)=>(le.clear(),ue(e,n||!1)),ke=class{},ve="undefined"!=typeof File?File:ke,fe="undefined"!=typeof Blob?Blob:ke,ge=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,he=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,pe=(e,n)=>n%2==0?e.replace(he,"\n"):e,ye=e=>e.split(ge).map(pe).join("").trim(),Ne=new Map,Se=new Map,be=e=>{var n;return"string"==typeof e?n=ye(e):e.loc&&Se.get(e.__key)===e?n=e.loc.source.body:(n=Ne.get(e)||ye(function(e){return $="\n",T[e.kind]?T[e.kind](e):""}(e)),Ne.set(e,n)),"string"==typeof e||e.loc||(e.loc={start:0,end:n.length,source:{body:n,name:"gql",locationOffset:{line:1,column:1}}}),n},Fe=e=>{var n;if(e.documentId)n=de(e.documentId);else if(n=de(be(e)),e.definitions){var i=De(e);i&&(n=de(`\n# ${i}`,n))}return n},we=e=>{var n,i;return"string"==typeof e?(n=Fe(e),i=Se.get(n)||function(e,n){return o="string"==typeof e.body?e.body:e,d=0,function(){var e,n;g();var i=[];do{if("fragment"===(e=k(q)))g(),i.push(O());else{if(null==(n=E(e)))throw m("Document");i.push(n)}}while(d<o.length);return{kind:"Document",definitions:i}}()}(e)):(n=e.__key||Fe(e),i=Se.get(n)||e),i.loc||be(i),i.__key=n,Se.set(n,i),i},xe=(e,n,i)=>{var t=n||{},a=we(e),r=me(t,!0),o=a.__key;return"{}"!==r&&(o=de(r,o)),{key:o,query:a,variables:t,extensions:i}},De=e=>{for(var n of e.definitions)if(n.kind===s)return n.name?n.name.value:void 0},Ae=(e,n,i)=>{if(!("data"in n||"errors"in n&&Array.isArray(n.errors)))throw new Error("No Content");var t="subscription"===e.kind;return{operation:e,data:n.data,error:Array.isArray(n.errors)?new oe({graphQLErrors:n.errors,response:i}):void 0,extensions:n.extensions?{...n.extensions}:void 0,hasNext:null==n.hasNext?t:n.hasNext,stale:!1}},Ce=(e,n)=>{if("object"==typeof e&&null!=e&&(!e.constructor||e.constructor===Object||Array.isArray(e))){for(var i of(e=Array.isArray(e)?[...e]:{...e},Object.keys(n)))e[i]=Ce(e[i],n[i]);return e}return n},Oe=(e,n,i,t)=>{var a=e.error?e.error.graphQLErrors:[],r=!!e.extensions||!!(n.payload||n).extensions,o={...e.extensions,...(n.payload||n).extensions},d=n.incremental;"path"in n&&(d=[n]);var l={data:e.data};if(d){var s=function(e){Array.isArray(e.errors)&&a.push(...e.errors),e.extensions&&(Object.assign(o,e.extensions),r=!0);var n="data",i=l,d=[];if(e.path)d=e.path;else if(t){var s=t.find((n=>n.id===e.id));d=e.subPath?[...s.path,...e.subPath]:s.path}for(var u=0,c=d.length;u<c;n=d[u++])i=i[n]=Array.isArray(i[n])?[...i[n]]:{...i[n]};if(e.items)for(var m=+n>=0?n:0,k=0,v=e.items.length;k<v;k++)i[m+k]=Ce(i[m+k],e.items[k]);else void 0!==e.data&&(i[n]=Ce(i[n],e.data))};for(var u of d)s(u)}else l.data=(n.payload||n).data||e.data,a=n.errors||n.payload&&n.payload.errors||a;return{operation:e.operation,data:l.data,error:a.length?new oe({graphQLErrors:a,response:i}):void 0,extensions:r?o:void 0,hasNext:null!=n.hasNext?n.hasNext:e.hasNext,stale:!1}},qe=(e,n,i)=>({operation:e,data:void 0,error:new oe({networkError:n,response:i}),extensions:void 0,hasNext:!1,stale:!1});var Ee=e=>{var n=e.indexOf("?");return n>-1?[e.slice(0,n),new URLSearchParams(e.slice(n+1))]:[e,new URLSearchParams]},Ve=(e,n)=>{var i,t={accept:"subscription"===e.kind?"text/event-stream, multipart/mixed":"application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"},a=("function"==typeof e.context.fetchOptions?e.context.fetchOptions():e.context.fetchOptions)||{};if(a.headers)if("has"in(i=a.headers)&&!Object.keys(i).length)a.headers.forEach(((e,n)=>{t[n]=e}));else if(Array.isArray(a.headers))a.headers.forEach(((e,n)=>{Array.isArray(e)?t[e[0]]?t[e[0]]=`${t[e[0]]},${e[1]}`:t[e[0]]=e[1]:t[n]=e}));else for(var r in a.headers)t[r.toLowerCase()]=a.headers[r];var o=((e,n)=>{if(n&&("query"!==e.kind||!e.context.preferGetMethod)){var i=me(n),t=(d=n.variables,l=new Map,ve===ke&&fe===ke||(le.clear(),ce(l,"variables",d)),l);if(t.size){var a=new FormData;a.append("operations",i),a.append("map",me({...[...t.keys()].map((e=>[e]))}));var r=0;for(var o of t.values())a.append(""+r++,o);return a}return i}var d,l})(e,n);return"string"!=typeof o||t["content-type"]||(t["content-type"]="application/json"),{...a,method:o?"POST":"GET",body:o,headers:t}},$e="undefined"!=typeof TextDecoder?new TextDecoder:null,Te=/boundary="?([^=";]+)"?/i,Ie=/data: ?([^\n]+)/,_e=e=>"Buffer"===e.constructor.name?e.toString():$e.decode(e);async function*je(e){if(e.body[Symbol.asyncIterator])for await(var n of e.body)yield _e(n);else{var i,t=e.body.getReader();try{for(;!(i=await t.read()).done;)yield _e(i.value)}finally{t.cancel()}}}async function*Pe(e,n){var i,t="";for await(var a of e)for(t+=a;(i=t.indexOf(n))>-1;)yield t.slice(0,i),t=t.slice(i+n.length)}function Le(e,n,i){var t;return"undefined"!=typeof AbortController&&(i.signal=(t=new AbortController).signal),B((()=>{t&&t.abort()}))(R((e=>!!e))(X(async function*(e,n,i){var t,a=!0,r=null;try{yield await Promise.resolve();var o,d=(t=await(e.context.fetch||fetch)(n,i)).headers.get("Content-Type")||"";for await(var l of/multipart\/mixed/i.test(d)?async function*(e,n){var i,t=e.match(Te),a="--"+(t?t[1]:"-"),r=!0;for await(var o of Pe(je(n),"\r\n"+a)){if(r){r=!1;var d=o.indexOf(a);if(!(d>-1))continue;o=o.slice(d+a.length)}try{yield i=JSON.parse(o.slice(o.indexOf("\r\n\r\n")+4))}catch(e){if(!i)throw e}if(i&&!1===i.hasNext)break}i&&!1!==i.hasNext&&(yield{hasNext:!1})}(d,t):/text\/event-stream/i.test(d)?async function*(e){var n;for await(var i of Pe(je(e),"\n\n")){var t=i.match(Ie);if(t){var a=t[1];try{yield n=JSON.parse(a)}catch(e){if(!n)throw e}if(n&&!1===n.hasNext)break}}n&&!1!==n.hasNext&&(yield{hasNext:!1})}(t):/text\//i.test(d)?async function*(e){var n=await e.text();try{var i=JSON.parse(n);"production"!==process.env.NODE_ENV&&console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.'),yield i}catch(e){throw new Error(n)}}(t):async function*(e){yield JSON.parse(await e.text())}(t))l.pending&&!r?o=l.pending:l.pending&&(o=[...o,...l.pending]),r=r?Oe(r,l,t,o):Ae(e,l,t),a=!1,yield r,a=!0;r||(yield r=Ae(e,{},t))}catch(n){if(!a)throw n;yield qe(e,t&&(t.status<200||t.status>=300)&&t.statusText?new Error(t.statusText):n,t)}}(e,n,i))))}var Ue=(e,n)=>{if(Array.isArray(e))for(var i of e)Ue(i,n);else if("object"==typeof e&&null!==e)for(var t in e)"__typename"===t&&"string"==typeof e[t]?n.add(e[t]):Ue(e[t],n);return n},Me=e=>{if("definitions"in e){var n=[];for(var i of e.definitions){var t=Me(i);n.push(t)}return{...e,definitions:n}}if("directives"in e&&e.directives&&e.directives.length){var a=[],r={};for(var o of e.directives){var d=o.name.value;"_"!==d[0]?a.push(o):d=d.slice(1),r[d]=o}e={...e,directives:a,_directives:r}}if("selectionSet"in e){var c=[],m=e.kind===s;if(e.selectionSet){for(var k of e.selectionSet.selections||[]){m=m||k.kind===u&&"__typename"===k.name.value&&!k.alias;var v=Me(k);c.push(v)}return m||c.push({kind:u,name:{kind:l,value:"__typename"},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:c}}}}return e},Re=new Map;function Qe(e){var n=n=>e(n);return n.toPromise=()=>{return e=Y(1)(R((e=>!e.stale&&!e.hasNext))(n)),new Promise((n=>{var i,t=j;e((e=>{0===e?Promise.resolve(i).then(n):0===e.tag?(t=e[0])(0):(i=e[0],t(0))}))}));var e},n.then=(e,i)=>n.toPromise().then(e,i),n.subscribe=e=>ae(e)(n),n}function Je(e,n,i){return{...n,kind:e,context:n.context?{...n.context,...i}:i||n.context}}var Ge=(e,n)=>Je(e.kind,e,{meta:{...e.context.meta,...n}}),Be=()=>{},Ke=({kind:e})=>"mutation"!==e&&"query"!==e,ze=e=>{var n=(e=>{var n=we(e),i=Re.get(n.__key);return i||(Re.set(n.__key,i=Me(n)),Object.defineProperty(i,"__key",{value:n.__key,enumerable:!1})),i})(e.query);if(n!==e.query){var i=Je(e.kind,e);return i.query=n,i}return e},We=({forward:e,client:n,dispatchDebug:i})=>{var t=new Map,a=new Map,r=e=>"query"===e.kind&&"network-only"!==e.context.requestPolicy&&("cache-only"===e.context.requestPolicy||t.has(e.key));return o=>{var d=Q((e=>{var a=t.get(e.key);"production"!==process.env.NODE_ENV&&i({operation:e,...a?{type:"cacheHit",message:"The result was successfully retried from the cache"}:{type:"cacheMiss",message:"The result could not be retrieved from the cache"},source:"cacheExchange"});var r=a||Ae(e,{data:null});return r={...r,operation:"production"!==process.env.NODE_ENV?Ge(e,{cacheOutcome:a?"hit":"miss"}):e},"cache-and-network"===e.context.requestPolicy&&(r.stale=!0,He(n,e)),r}))(R((e=>!Ke(e)&&r(e)))(o)),l=K((e=>{var{operation:r}=e;if(r){var o,d=r.context.additionalTypenames||[];if("subscription"!==e.operation.kind&&(d=(o=e.data,[...Ue(o,new Set)]).concat(d)),"mutation"===e.operation.kind||"subscription"===e.operation.kind){var l=new Set;"production"!==process.env.NODE_ENV&&i({type:"cacheInvalidation",message:`The following typenames have been invalidated: ${d}`,operation:r,data:{typenames:d,response:e},source:"cacheExchange"});for(var s=0;s<d.length;s++){var u=d[s],c=a.get(u);for(var m of(c||a.set(u,c=new Set),c.values()))l.add(m);c.clear()}for(var k of l.values())t.has(k)&&(r=t.get(k).operation,t.delete(k),He(n,r))}else if("query"===r.kind&&e.data){t.set(r.key,e);for(var v=0;v<d.length;v++){var f=d[v],g=a.get(f);g||a.set(f,g=new Set),g.add(r.key)}}}}))(e(R((e=>"query"!==e.kind||"cache-only"!==e.context.requestPolicy))(Q((e=>"production"!==process.env.NODE_ENV?Ge(e,{cacheOutcome:"miss"}):e))(G([Q(ze)(R((e=>!Ke(e)&&!r(e)))(o)),R((e=>Ke(e)))(o)])))));return G([d,l])}},He=(e,n)=>e.reexecuteOperation(Je(n.kind,n,{requestPolicy:"network-only"})),Ye=({forward:e,dispatchDebug:n})=>i=>{var t=J((e=>{var t=function(e){var n={query:void 0,documentId:void 0,operationName:De(e.query),variables:e.variables||void 0,extensions:e.extensions};return!("documentId"in e.query)||!e.query.documentId||e.query.definitions&&e.query.definitions.length?e.extensions&&e.extensions.persistedQuery&&!e.extensions.persistedQuery.miss||(n.query=be(e.query)):n.documentId=e.query.documentId,n}(e),a=((e,n)=>{var i="query"===e.kind&&e.context.preferGetMethod;if(!i||!n)return e.context.url;var t=Ee(e.context.url);for(var a in n){var r=n[a];r&&t[1].set(a,"object"==typeof r?me(r):r)}var o=t.join("?");return o.length>2047&&"force"!==i?(e.context.preferGetMethod=!1,e.context.url):o})(e,t),r=Ve(e,t);"production"!==process.env.NODE_ENV&&n({type:"fetchRequest",message:"A fetch request is being executed.",operation:e,data:{url:a,fetchOptions:r},source:"fetchExchange"});var o=Z(R((n=>"teardown"===n.kind&&n.key===e.key))(i))(Le(e,a,r));return"production"!==process.env.NODE_ENV?K((i=>{var t=i.data?void 0:i.error;"production"!==process.env.NODE_ENV&&n({type:t?"fetchError":"fetchSuccess",message:`A ${t?"failed":"successful"} fetch response has been returned.`,operation:e,data:{url:a,fetchOptions:r,value:t||i},source:"fetchExchange"})}))(o):o}))(R((e=>"teardown"!==e.kind&&("subscription"!==e.kind||!!e.context.fetchSubscriptions)))(i));return G([t,e(R((e=>"teardown"===e.kind||"subscription"===e.kind&&!e.context.fetchSubscriptions))(i))])},Ze=({dispatchDebug:e})=>n=>("production"!==process.env.NODE_ENV&&(n=K((n=>{if("teardown"!==n.kind&&"production"!==process.env.NODE_ENV){var i=`No exchange has handled operations of kind "${n.kind}". Check whether you've added an exchange responsible for these operations.`;"production"!==process.env.NODE_ENV&&e({type:"fallbackCatch",message:i,operation:n,source:"fallbackExchange"}),console.warn(i)}}))(n)),R((e=>!1))(n)),Xe=function e(n){if("production"!==process.env.NODE_ENV&&!n.url)throw new Error("You are creating an urql-client without a url.");var i=0,t=new Map,a=new Map,r=new Set,o=[],d={url:n.url,fetchSubscriptions:n.fetchSubscriptions,fetchOptions:n.fetchOptions,fetch:n.fetch,preferGetMethod:n.preferGetMethod,requestPolicy:n.requestPolicy||"cache-first"},l=te();function u(e){"mutation"!==e.kind&&"teardown"!==e.kind&&r.has(e.key)||("teardown"===e.kind?r.delete(e.key):"mutation"!==e.kind&&r.add(e.key),l.next(e))}var c=!1;function m(e){if(e&&u(e),!c){for(c=!0;c&&(e=o.shift());)u(e);c=!1}}var k=e=>{var n=Z(R((n=>"teardown"===n.kind&&n.key===e.key))(l.source))(R((n=>n.operation.kind===e.kind&&n.operation.key===e.key&&(!n.operation.context._instance||n.operation.context._instance===e.context._instance)))(N));return n="query"!==e.kind?function(e,n){return i=>t=>{var a=j,r=!1;i((i=>{r||(0===i?(r=!0,t(0)):0===i.tag?(a=i[0],t(i)):e(i[0])?t(i):(r=!0,n&&t(i),t(0),a(1)))}))}}((e=>!!e.hasNext),!0)(n):H((n=>{var i=ne(n);return n.stale||n.hasNext?i:G([i,Q((()=>(n.stale=!0,n)))(Y(1)(R((n=>n.key===e.key))(l.source)))])}))(n),W(n="mutation"!==e.kind?B((()=>{r.delete(e.key),t.delete(e.key),a.delete(e.key),c=!1;for(var n=o.length-1;n>=0;n--)o[n].key===e.key&&o.splice(n,1);u(Je("teardown",e,e.context))}))(K((n=>{if(n.stale)if(n.hasNext){for(var i of o)if(i.key===n.operation.key){r.delete(i.key);break}}else r.delete(e.key);else n.hasNext||r.delete(e.key);t.set(e.key,n)}))(n)):z((()=>{u(e)}))(n))},v=this instanceof e?this:Object.create(e.prototype),f=Object.assign(v,{suspense:!!n.suspense,operations$:l.source,reexecuteOperation(e){if("teardown"===e.kind)m(e);else if("mutation"===e.kind)o.push(e),Promise.resolve().then(m);else if(a.has(e.key)){for(var n=!1,i=0;i<o.length;i++)o[i].key===e.key&&(o[i]=e,n=!0);n||r.has(e.key)&&"network-only"!==e.context.requestPolicy?(r.delete(e.key),Promise.resolve().then(m)):(o.push(e),Promise.resolve().then(m))}},createRequestOperation(e,n,t){var a;if(t||(t={}),"production"!==process.env.NODE_ENV&&"teardown"!==e&&(a=(e=>{for(var n of e.definitions)if(n.kind===s)return n.operation})(n.query))!==e)throw new Error(`Expected operation of type "${e}" but found "${a}"`);return Je(e,n,{_instance:"mutation"===e?i=i+1|0:void 0,...d,...t,requestPolicy:t.requestPolicy||d.requestPolicy,suspense:t.suspense||!1!==t.suspense&&f.suspense})},executeRequestOperation:e=>"mutation"===e.kind?Qe(k(e)):Qe(function(e){return n=>e()(n)}((()=>{var n=a.get(e.key);n||a.set(e.key,n=k(e)),n=z((()=>{m(e)}))(n);var i=t.get(e.key);return"query"===e.kind&&i&&(i.stale||i.hasNext)?H(ne)(G([n,R((n=>n===t.get(e.key)))(ne(i))])):n}))),executeQuery(e,n){var i=f.createRequestOperation("query",e,n);return f.executeRequestOperation(i)},executeSubscription(e,n){var i=f.createRequestOperation("subscription",e,n);return f.executeRequestOperation(i)},executeMutation(e,n){var i=f.createRequestOperation("mutation",e,n);return f.executeRequestOperation(i)},readQuery(e,n,i){var t=null;return ae((e=>{t=e}))(f.query(e,n,i)).unsubscribe(),t},query:(e,n,i)=>f.executeQuery(xe(e,n),i),subscription:(e,n,i)=>f.executeSubscription(xe(e,n),i),mutation:(e,n,i)=>f.executeMutation(xe(e,n),i)}),g=Be;if("production"!==process.env.NODE_ENV){var{next:h,source:p}=te();f.subscribeToDebugTarget=e=>ae(e)(p),g=h}var y=(e=>({client:n,forward:i,dispatchDebug:t})=>e.reduceRight(((e,i)=>{var a=!1;return i({client:n,forward(n){if("production"!==process.env.NODE_ENV){if(a)throw new Error("forward() must only be called once in each Exchange.");a=!0}return W(e(W(n)))},dispatchDebug(e){"production"!==process.env.NODE_ENV&&t({timestamp:Date.now(),source:i.name,...e})}})}),i))(n.exchanges),N=W(y({client:f,dispatchDebug:g,forward:Ze({dispatchDebug:g})})(l.source));return function(e){ae((e=>{}))(e)}(N),f},en={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},tn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},an={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},rn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]},on={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":en,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":nn,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":tn,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":an,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":rn};function dn(e){return on[e]??{}}var ln=e=>null!=e;function sn(e){return e?e.map((e=>e?.node)).filter(ln)??[]:[]}dn("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n"),dn("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n"),dn("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n"),dn("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n"),dn("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n");var un=class{url;accessKey;urqlClient;constructor(e){this.url=e.url,this.accessKey=e.accessKey,this.urqlClient=e.urqlClient??this.createUrqlClient()}async getDocument(e){return function(e){if(!e.data?.document)return{document:null,error:e.error};const n=e.data?.document;return{document:{...n,tags:sn(n.tags?.edges),assets:sn(n.assets?.edges),outboundLinkDocuments:sn(n.outboundLinkDocuments?.edges).map((e=>({...e,tags:sn(e.tags?.edges)}))),inboundLinkDocuments:sn(n.inboundLinkDocuments?.edges).map((e=>({...e,tags:sn(e.tags?.edges)}))),websites:sn(n.websites?.edges)},error:e.error}}(await this.urqlClient.query(en,e))}async getDocuments(e){return function(e){if(!e.data||!e.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:e.error};const n=e.data.documents,i=sn(n?.edges).map((e=>({...e,tags:sn(e.tags?.edges)}))),t=e.data?.documents?.totalCount||0;return{documents:i,totalCount:t,isEmpty:0===t,error:e.error}}(await this.urqlClient.query(nn,e??{}))}async getTag(e){return function(e){const n=e.data?.tag;return{tag:n?{...n,relatedTags:sn(n.relatedTags?.edges)}:null,error:e.error}}(await this.urqlClient.query(tn,e))}async getTags(e){return function(e){const n=sn(e.data?.tags?.edges),i=e.data?.tags?.totalCount||0;return{tags:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(an,e??{}))}async getWebsites(e){return function(e){const n=sn(e.data?.websites?.edges).map((e=>({...e,documents:sn(e.documents?.edges)}))),i=e.data?.websites?.totalCount||0;return{websites:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(rn,e??{}))}createUrqlClient(){return Xe({url:this.url,exchanges:[We,Ye],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};//# sourceMappingURL=client.js.map
|
|
1
|
+
"use strict";var e,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,t={};((e,i)=>{for(var a in i)n(e,a,{get:i[a],enumerable:!0})})(t,{Client:()=>N}),module.exports=(e=t,((e,t,l,m)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of a(t))d.call(e,o)||o===l||n(e,o,{get:()=>t[o],enumerable:!(m=i(t,o))||m.enumerable});return e})(n({},"__esModule",{value:!0}),e));var l=require("@urql/core"),m={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},o={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},s={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},k={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},u={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]},r={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":m,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":o,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":s,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":k,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":u};function c(e){return r[e]??{}}var v=e=>null!=e;function g(e){return e?e.map((e=>e?.node)).filter(v)??[]:[]}c("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n"),c("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n"),c("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n"),c("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n"),c("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n");var N=class{url;accessKey;urqlClient;constructor(e){this.url=e.url,this.accessKey=e.accessKey,this.urqlClient=e.urqlClient??this.createUrqlClient()}async getDocument(e){return function(e){if(!e.data?.document)return{document:null,error:e.error};const n=e.data?.document;return{document:{...n,tags:g(n.tags?.edges),assets:g(n.assets?.edges),outboundLinkDocuments:g(n.outboundLinkDocuments?.edges).map((e=>({...e,tags:g(e.tags?.edges)}))),inboundLinkDocuments:g(n.inboundLinkDocuments?.edges).map((e=>({...e,tags:g(e.tags?.edges)}))),websites:g(n.websites?.edges)},error:e.error}}(await this.urqlClient.query(m,e))}async getDocuments(e){return function(e){if(!e.data||!e.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:e.error};const n=e.data.documents,i=g(n?.edges).map((e=>({...e,tags:g(e.tags?.edges)}))),a=e.data?.documents?.totalCount||0;return{documents:i,totalCount:a,isEmpty:0===a,error:e.error}}(await this.urqlClient.query(o,e??{}))}async getTag(e){return function(e){const n=e.data?.tag;return{tag:n?{...n,relatedTags:g(n.relatedTags?.edges)}:null,error:e.error}}(await this.urqlClient.query(s,e))}async getTags(e){return function(e){const n=g(e.data?.tags?.edges),i=e.data?.tags?.totalCount||0;return{tags:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(k,e??{}))}async getWebsites(e){return function(e){const n=g(e.data?.websites?.edges).map((e=>({...e,documents:g(e.documents?.edges)}))),i=e.data?.websites?.totalCount||0;return{websites:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(u,e??{}))}createUrqlClient(){return(0,l.createClient)({url:this.url,exchanges:[l.cacheExchange,l.fetchExchange],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};
|
package/dist/client/client.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,n,i="Name",t="OperationDefinition",a="Field",r=class extends Error{constructor(e,n,i,t,a,r,d){super(e),this.name="GraphQLError",this.message=e,a&&(this.path=a),n&&(this.nodes=Array.isArray(n)?n:[n]),i&&(this.source=i),t&&(this.positions=t),r&&(this.originalError=r);var o=d;if(!o&&r){var l=r.extensions;l&&"object"==typeof l&&(o=l)}this.extensions=o||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}};function d(e){return new r(`Syntax Error: Unexpected token at ${n} in ${e}`)}function o(i){if(i.lastIndex=n,i.test(e))return e.slice(n,n=i.lastIndex)}var l=/ +(?=[^\s])/y;function s(e){for(var n=e.split("\n"),i="",t=0,a=0,r=n.length-1,d=0;d<n.length;d++)l.lastIndex=0,l.test(n[d])&&(d&&(!t||l.lastIndex<t)&&(t=l.lastIndex),a=a||d,r=d);for(var o=a;o<=r;o++)o!==a&&(i+="\n"),i+=n[o].slice(t).replace(/\\"""/g,'"""');return i}function u(){for(var i=0|e.charCodeAt(n++);9===i||10===i||13===i||32===i||35===i||44===i||65279===i;i=0|e.charCodeAt(n++))if(35===i)for(;10!==(i=e.charCodeAt(n++))&&13!==i;);n--}var c,m=/[_A-Za-z]\w*/y,k=new RegExp("(?:(null|true|false)|\\$("+m.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+m.source+"))","y"),v=((c=v||{})[c.Const=1]="Const",c[c.Var=2]="Var",c[c.Int=3]="Int",c[c.Float=4]="Float",c[c.BlockString=5]="BlockString",c[c.String=6]="String",c[c.Enum=7]="Enum",c),f=/\\/g;function g(i){var t,a;if(k.lastIndex=n,91===e.charCodeAt(n)){n++,u();for(var r=[];93!==e.charCodeAt(n);)r.push(g(i));return n++,u(),{kind:"ListValue",values:r}}if(123===e.charCodeAt(n)){n++,u();for(var l=[];125!==e.charCodeAt(n);){if(null==(t=o(m)))throw d("ObjectField");if(u(),58!==e.charCodeAt(n++))throw d("ObjectField");u(),l.push({kind:"ObjectField",name:{kind:"Name",value:t},value:g(i)})}return n++,u(),{kind:"ObjectValue",fields:l}}if(null!=(a=k.exec(e))){if(n=k.lastIndex,u(),null!=(t=a[v.Const]))return"null"===t?{kind:"NullValue"}:{kind:"BooleanValue",value:"true"===t};if(null!=(t=a[v.Var])){if(i)throw d("Variable");return{kind:"Variable",name:{kind:"Name",value:t}}}var c;if(null!=(t=a[v.Int]))return null!=(c=a[v.Float])?{kind:"FloatValue",value:t+c}:{kind:"IntValue",value:t};if(null!=(t=a[v.BlockString]))return{kind:"StringValue",value:s(t.slice(3,-3)),block:!0};if(null!=(t=a[v.String]))return{kind:"StringValue",value:f.test(t)?JSON.parse(t):t.slice(1,-1),block:!1};if(null!=(t=a[v.Enum]))return{kind:"EnumValue",value:t}}throw d("Value")}function h(i){if(40===e.charCodeAt(n)){var t,a=[];n++,u();do{if(null==(t=o(m)))throw d("Argument");if(u(),58!==e.charCodeAt(n++))throw d("Argument");u(),a.push({kind:"Argument",name:{kind:"Name",value:t},value:g(i)})}while(41!==e.charCodeAt(n));return n++,u(),a}}function p(i){if(64===e.charCodeAt(n)){var t,a=[];do{if(n++,null==(t=o(m)))throw d("Directive");u(),a.push({kind:"Directive",name:{kind:"Name",value:t},arguments:h(i)})}while(64===e.charCodeAt(n));return a}}function y(){for(var i,t=0;91===e.charCodeAt(n);)t++,n++,u();if(null==(i=o(m)))throw d("NamedType");u();var a={kind:"NamedType",name:{kind:"Name",value:i}};do{if(33===e.charCodeAt(n)&&(n++,u(),a={kind:"NonNullType",type:a}),t){if(93!==e.charCodeAt(n++))throw d("NamedType");u(),a={kind:"ListType",type:a}}}while(t--);return a}var N=new RegExp("(?:(\\.{3})|("+m.source+"))","y"),S=function(e){return e[e.Spread=1]="Spread",e[e.Name=2]="Name",e}(S||{});function b(){var i,t,a=[];do{if(N.lastIndex=n,null==(t=N.exec(e)))throw d("SelectionSet");if(n=N.lastIndex,null!=t[S.Spread]){u();var r=o(m);if(null!=r&&"on"!==r)u(),a.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:p(!1)});else{if(u(),"on"===r){if(null==(r=o(m)))throw d("NamedType");u()}var l=p(!1);if(123!==e.charCodeAt(n++))throw d("InlineFragment");u(),a.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:l,selectionSet:b()})}}else if(null!=(i=t[S.Name])){var s=void 0;if(u(),58===e.charCodeAt(n)){if(n++,u(),s=i,null==(i=o(m)))throw d("Field");u()}var c=h(!1);u();var k=p(!1),v=void 0;123===e.charCodeAt(n)&&(n++,u(),v=b()),a.push({kind:"Field",alias:s?{kind:"Name",value:s}:void 0,name:{kind:"Name",value:i},arguments:c,directives:k,selectionSet:v})}}while(125!==e.charCodeAt(n));return n++,u(),{kind:"SelectionSet",selections:a}}function F(){var i,t;if(null==(i=o(m)))throw d("FragmentDefinition");if(u(),"on"!==o(m))throw d("FragmentDefinition");if(u(),null==(t=o(m)))throw d("FragmentDefinition");u();var a=p(!1);if(123!==e.charCodeAt(n++))throw d("FragmentDefinition");return u(),{kind:"FragmentDefinition",name:{kind:"Name",value:i},typeCondition:{kind:"NamedType",name:{kind:"Name",value:t}},directives:a,selectionSet:b()}}var w=/(?:query|mutation|subscription|fragment)/y;function x(i){var t,a,r;if(i&&(u(),t=o(m),a=function(){if(u(),40===e.charCodeAt(n)){var i,t=[];n++,u();do{if(36!==e.charCodeAt(n++))throw d("Variable");if(null==(i=o(m)))throw d("Variable");if(u(),58!==e.charCodeAt(n++))throw d("VariableDefinition");u();var a=y(),r=void 0;61===e.charCodeAt(n)&&(n++,u(),r=g(!0)),u(),t.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:i}},type:a,defaultValue:r,directives:p(!0)})}while(41!==e.charCodeAt(n));return n++,u(),t}}(),r=p(!1)),123===e.charCodeAt(n))return n++,u(),{kind:"OperationDefinition",operation:i||"query",name:t?{kind:"Name",value:t}:void 0,variableDefinitions:a,directives:r,selectionSet:b()}}function D(e,n,i){for(var t="",a=0;a<e.length;a++)a&&(t+=n),t+=i(e[a]);return t}var A="\n",C={OperationDefinition(e){var n=e.operation;return e.name&&(n+=" "+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(n+=" "),n+="("+D(e.variableDefinitions,", ",C.VariableDefinition)+")"),e.directives&&e.directives.length&&(n+=" "+D(e.directives," ",C.Directive)),"query"!==n?n+" "+C.SelectionSet(e.selectionSet):C.SelectionSet(e.selectionSet)},VariableDefinition(e){var n=C.Variable(e.variable)+": "+q(e.type);return e.defaultValue&&(n+=" = "+q(e.defaultValue)),e.directives&&e.directives.length&&(n+=" "+D(e.directives," ",C.Directive)),n},Field(e){var n=e.alias?e.alias.value+": "+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var i=D(e.arguments,", ",C.Argument);n.length+i.length+2>80?n+="("+(A+=" ")+D(e.arguments,A,C.Argument)+(A=A.slice(0,-2))+")":n+="("+i+")"}return e.directives&&e.directives.length&&(n+=" "+D(e.directives," ",C.Directive)),e.selectionSet&&(n+=" "+C.SelectionSet(e.selectionSet)),n},StringValue:e=>e.block?function(e){return'"""\n'+e.replace(/"""/g,'\\"""')+'\n"""'}(e.value).replace(/\n/g,A):function(e){return JSON.stringify(e)}(e.value),BooleanValue:e=>""+e.value,NullValue:e=>"null",IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>"$"+e.name.value,ListValue:e=>"["+D(e.values,", ",q)+"]",ObjectValue:e=>"{"+D(e.fields,", ",C.ObjectField)+"}",ObjectField:e=>e.name.value+": "+q(e.value),Document:e=>e.definitions&&e.definitions.length?D(e.definitions,"\n\n",q):"",SelectionSet:e=>"{"+(A+=" ")+D(e.selections,A,q)+(A=A.slice(0,-2))+"}",Argument:e=>e.name.value+": "+q(e.value),FragmentSpread(e){var n="..."+e.name.value;return e.directives&&e.directives.length&&(n+=" "+D(e.directives," ",C.Directive)),n},InlineFragment(e){var n="...";return e.typeCondition&&(n+=" on "+e.typeCondition.name.value),e.directives&&e.directives.length&&(n+=" "+D(e.directives," ",C.Directive)),n+" "+C.SelectionSet(e.selectionSet)},FragmentDefinition(e){var n="fragment "+e.name.value;return n+=" on "+e.typeCondition.name.value,e.directives&&e.directives.length&&(n+=" "+D(e.directives," ",C.Directive)),n+" "+C.SelectionSet(e.selectionSet)},Directive(e){var n="@"+e.name.value;return e.arguments&&e.arguments.length&&(n+="("+D(e.arguments,", ",C.Argument)+")"),n},NamedType:e=>e.name.value,ListType:e=>"["+q(e.type)+"]",NonNullType:e=>q(e.type)+"!"},q=e=>C[e.kind](e);var O=()=>{},E=O;function V(e){return{tag:0,0:e}}function $(e){return{tag:1,0:e}}var T=()=>"function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator",I=e=>e;function _(e){return n=>i=>{var t=E;n((n=>{0===n?i(0):0===n.tag?(t=n[0],i(n)):e(n[0])?i(n):t(0)}))}}function j(e){return n=>i=>n((n=>{0===n||0===n.tag?i(n):i($(e(n[0])))}))}function P(e){return n=>i=>{var t=[],a=E,r=!1,d=!1;n((n=>{var o,l;d||(0===n?(d=!0,t.length||i(0)):0===n.tag?a=n[0]:(r=!1,o=e(n[0]),l=E,o((e=>{if(0===e){if(t.length){var n=t.indexOf(l);n>-1&&(t=t.slice()).splice(n,1),t.length||(d?i(0):r||(r=!0,a(0)))}}else 0===e.tag?(t.push(l=e[0]),l(0)):t.length&&(i(e),l(0))})),r||(r=!0,a(0))))})),i(V((e=>{if(1===e){d||(d=!0,a(1));for(var n=0,i=t,o=t.length;n<o;n++)i[n](1);t.length=0}else{d||r?r=!1:(r=!0,a(0));for(var l=0,s=t,u=t.length;l<u;l++)s[l](0)}})))}}function L(e){return function(e){return P(I)(e)}(z(e))}function U(e){return n=>i=>{var t=!1;n((n=>{if(t);else if(0===n)t=!0,i(0),e();else if(0===n.tag){var a=n[0];i(V((n=>{1===n?(t=!0,a(1),e()):a(n)})))}else i(n)}))}}function M(e){return n=>i=>{var t=!1;n((n=>{if(t);else if(0===n)t=!0,i(0);else if(0===n.tag){var a=n[0];i(V((e=>{1===e&&(t=!0),a(e)})))}else e(n[0]),i(n)}))}}function R(e){return n=>i=>n((n=>{0===n?i(0):0===n.tag?(i(n),e()):i(n)}))}function Q(e){var n=[],i=E,t=!1;return a=>{n.push(a),1===n.length&&e((e=>{if(0===e){for(var a=0,r=n,d=n.length;a<d;a++)r[a](0);n.length=0}else if(0===e.tag)i=e[0];else{t=!1;for(var o=0,l=n,s=n.length;o<s;o++)l[o](e)}})),a(V((e=>{if(1===e){var r=n.indexOf(a);r>-1&&(n=n.slice()).splice(r,1),n.length||i(1)}else t||(t=!0,i(0))})))}}function J(e){return n=>i=>{var t=E,a=E,r=!1,d=!1,o=!1,l=!1;n((n=>{l||(0===n?(l=!0,o||i(0)):0===n.tag?t=n[0]:(o&&(a(1),a=E),r?r=!1:(r=!0,t(0)),function(e){o=!0,e((e=>{o&&(0===e?(o=!1,l?i(0):r||(r=!0,t(0))):0===e.tag?(d=!1,(a=e[0])(0)):(i(e),d?d=!1:a(0)))}))}(e(n[0]))))})),i(V((e=>{1===e?(l||(l=!0,t(1)),o&&(o=!1,a(1))):(l||r||(r=!0,t(0)),o&&!d&&(d=!0,a(0)))})))}}function G(e){return n=>i=>{var t=E,a=!1,r=0;n((n=>{a||(0===n?(a=!0,i(0)):0===n.tag?e<=0?(a=!0,i(0),n[0](1)):t=n[0]:r++<e?(i(n),!a&&r>=e&&(a=!0,i(0),t(1))):i(n))})),i(V((n=>{1!==n||a?0===n&&!a&&r<e&&t(0):(a=!0,t(1))})))}}function B(e){return n=>i=>{var t=E,a=E,r=!1;n((n=>{r||(0===n?(r=!0,a(1),i(0)):0===n.tag?(t=n[0],e((e=>{0===e||(0===e.tag?(a=e[0])(0):(r=!0,a(1),t(1),i(0)))}))):i(n))})),i(V((e=>{1!==e||r?r||t(0):(r=!0,t(1),a(1))})))}}function K(e){return n=>{var i,t=e[T()]&&e[T()]()||e,a=!1,r=!1,d=!1;n(V((async e=>{if(1===e)a=!0,t.return&&t.return();else if(r)d=!0;else{for(d=r=!0;d&&!a;)if((i=await t.next()).done)a=!0,t.return&&await t.return(),n(0);else try{d=!1,n($(i.value))}catch(e){if(!t.throw)throw e;(a=!!(await t.throw(e)).done)&&n(0)}r=!1}})))}}var z=function(e){return e[Symbol.asyncIterator]?K(e):n=>{var i,t=e[Symbol.iterator](),a=!1,r=!1,d=!1;n(V((e=>{if(1===e)a=!0,t.return&&t.return();else if(r)d=!0;else{for(d=r=!0;d&&!a;)if((i=t.next()).done)a=!0,t.return&&t.return(),n(0);else try{d=!1,n($(i.value))}catch(e){if(!t.throw)throw e;(a=!!t.throw(e).done)&&n(0)}r=!1}})))}};function W(e){return n=>{var i=!1;n(V((t=>{1===t?i=!0:i||(i=!0,n($(e)),n(0))})))}}function H(e){return n=>{var i=!1,t=e({next(e){i||n($(e))},complete(){i||(i=!0,n(0))}});n(V((e=>{1!==e||i||(i=!0,t())})))}}function Y(){var e,n;return{source:Q(H((i=>(e=i.next,n=i.complete,O)))),next(n){e&&e(n)},complete(){n&&n()}}}function Z(e){return n=>{var i=E,t=!1;return n((n=>{0===n?t=!0:0===n.tag?(i=n[0])(0):t||(e(n[0]),i(0))})),{unsubscribe(){t||(t=!0,i(1))}}}}var X=e=>e&&e.message&&(e.extensions||"GraphQLError"===e.name)?e:"object"==typeof e&&e.message?new r(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new r(e),ee=class extends Error{constructor(e){var n=(e.graphQLErrors||[]).map(X),i=((e,n)=>{var i="";if(e)return`[Network] ${e.message}`;if(n)for(var t of n)i&&(i+="\n"),i+=`[GraphQL] ${t.message}`;return i})(e.networkError,n);super(i),this.name="CombinedError",this.message=i,this.graphQLErrors=n,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},ne=(e,n)=>{for(var i=0|(n||5381),t=0,a=0|e.length;t<a;t++)i=(i<<5)+i+e.charCodeAt(t);return i},ie=new Set,te=new WeakMap,ae=(e,n)=>{if(null===e||ie.has(e))return"null";if("object"!=typeof e)return JSON.stringify(e)||"";if(e.toJSON)return ae(e.toJSON(),n);if(Array.isArray(e)){var i="[";for(var t of e)i.length>1&&(i+=","),i+=ae(t,n)||"null";return i+"]"}if(!n&&(le!==oe&&e instanceof le||se!==oe&&e instanceof se))return"null";var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var r=te.get(e)||Math.random().toString(36).slice(2);return te.set(e,r),ae({__key:r},n)}ie.add(e);var d="{";for(var o of a){var l=ae(e[o],n);l&&(d.length>1&&(d+=","),d+=ae(o,n)+":"+l)}return ie.delete(e),d+"}"},re=(e,n,i)=>{if(null==i||"object"!=typeof i||i.toJSON||ie.has(i));else if(Array.isArray(i))for(var t=0,a=i.length;t<a;t++)re(e,`${n}.${t}`,i[t]);else if(i instanceof le||i instanceof se)e.set(n,i);else for(var r of(ie.add(i),Object.keys(i)))re(e,`${n}.${r}`,i[r])},de=(e,n)=>(ie.clear(),ae(e,n||!1)),oe=class{},le="undefined"!=typeof File?File:oe,se="undefined"!=typeof Blob?Blob:oe,ue=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,ce=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,me=(e,n)=>n%2==0?e.replace(ce,"\n"):e,ke=e=>e.split(ue).map(me).join("").trim(),ve=new Map,fe=new Map,ge=e=>{var n;return"string"==typeof e?n=ke(e):e.loc&&fe.get(e.__key)===e?n=e.loc.source.body:(n=ve.get(e)||ke(function(e){return A="\n",C[e.kind]?C[e.kind](e):""}(e)),ve.set(e,n)),"string"==typeof e||e.loc||(e.loc={start:0,end:n.length,source:{body:n,name:"gql",locationOffset:{line:1,column:1}}}),n},he=e=>{var n;if(e.documentId)n=ne(e.documentId);else if(n=ne(ge(e)),e.definitions){var i=Ne(e);i&&(n=ne(`\n# ${i}`,n))}return n},pe=i=>{var t,a;return"string"==typeof i?(t=he(i),a=fe.get(t)||function(i,t){return e="string"==typeof i.body?i.body:i,n=0,function(){var i,t;u();var a=[];do{if("fragment"===(i=o(w)))u(),a.push(F());else{if(null==(t=x(i)))throw d("Document");a.push(t)}}while(n<e.length);return{kind:"Document",definitions:a}}()}(i)):(t=i.__key||he(i),a=fe.get(t)||i),a.loc||ge(a),a.__key=t,fe.set(t,a),a},ye=(e,n,i)=>{var t=n||{},a=pe(e),r=de(t,!0),d=a.__key;return"{}"!==r&&(d=ne(r,d)),{key:d,query:a,variables:t,extensions:i}},Ne=e=>{for(var n of e.definitions)if(n.kind===t)return n.name?n.name.value:void 0},Se=(e,n,i)=>{if(!("data"in n||"errors"in n&&Array.isArray(n.errors)))throw new Error("No Content");var t="subscription"===e.kind;return{operation:e,data:n.data,error:Array.isArray(n.errors)?new ee({graphQLErrors:n.errors,response:i}):void 0,extensions:n.extensions?{...n.extensions}:void 0,hasNext:null==n.hasNext?t:n.hasNext,stale:!1}},be=(e,n)=>{if("object"==typeof e&&null!=e&&(!e.constructor||e.constructor===Object||Array.isArray(e))){for(var i of(e=Array.isArray(e)?[...e]:{...e},Object.keys(n)))e[i]=be(e[i],n[i]);return e}return n},Fe=(e,n,i,t)=>{var a=e.error?e.error.graphQLErrors:[],r=!!e.extensions||!!(n.payload||n).extensions,d={...e.extensions,...(n.payload||n).extensions},o=n.incremental;"path"in n&&(o=[n]);var l={data:e.data};if(o){var s=function(e){Array.isArray(e.errors)&&a.push(...e.errors),e.extensions&&(Object.assign(d,e.extensions),r=!0);var n="data",i=l,o=[];if(e.path)o=e.path;else if(t){var s=t.find((n=>n.id===e.id));o=e.subPath?[...s.path,...e.subPath]:s.path}for(var u=0,c=o.length;u<c;n=o[u++])i=i[n]=Array.isArray(i[n])?[...i[n]]:{...i[n]};if(e.items)for(var m=+n>=0?n:0,k=0,v=e.items.length;k<v;k++)i[m+k]=be(i[m+k],e.items[k]);else void 0!==e.data&&(i[n]=be(i[n],e.data))};for(var u of o)s(u)}else l.data=(n.payload||n).data||e.data,a=n.errors||n.payload&&n.payload.errors||a;return{operation:e.operation,data:l.data,error:a.length?new ee({graphQLErrors:a,response:i}):void 0,extensions:r?d:void 0,hasNext:null!=n.hasNext?n.hasNext:e.hasNext,stale:!1}},we=(e,n,i)=>({operation:e,data:void 0,error:new ee({networkError:n,response:i}),extensions:void 0,hasNext:!1,stale:!1});var xe=e=>{var n=e.indexOf("?");return n>-1?[e.slice(0,n),new URLSearchParams(e.slice(n+1))]:[e,new URLSearchParams]},De=(e,n)=>{var i,t={accept:"subscription"===e.kind?"text/event-stream, multipart/mixed":"application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"},a=("function"==typeof e.context.fetchOptions?e.context.fetchOptions():e.context.fetchOptions)||{};if(a.headers)if("has"in(i=a.headers)&&!Object.keys(i).length)a.headers.forEach(((e,n)=>{t[n]=e}));else if(Array.isArray(a.headers))a.headers.forEach(((e,n)=>{Array.isArray(e)?t[e[0]]?t[e[0]]=`${t[e[0]]},${e[1]}`:t[e[0]]=e[1]:t[n]=e}));else for(var r in a.headers)t[r.toLowerCase()]=a.headers[r];var d=((e,n)=>{if(n&&("query"!==e.kind||!e.context.preferGetMethod)){var i=de(n),t=(o=n.variables,l=new Map,le===oe&&se===oe||(ie.clear(),re(l,"variables",o)),l);if(t.size){var a=new FormData;a.append("operations",i),a.append("map",de({...[...t.keys()].map((e=>[e]))}));var r=0;for(var d of t.values())a.append(""+r++,d);return a}return i}var o,l})(e,n);return"string"!=typeof d||t["content-type"]||(t["content-type"]="application/json"),{...a,method:d?"POST":"GET",body:d,headers:t}},Ae="undefined"!=typeof TextDecoder?new TextDecoder:null,Ce=/boundary="?([^=";]+)"?/i,qe=/data: ?([^\n]+)/,Oe=e=>"Buffer"===e.constructor.name?e.toString():Ae.decode(e);async function*Ee(e){if(e.body[Symbol.asyncIterator])for await(var n of e.body)yield Oe(n);else{var i,t=e.body.getReader();try{for(;!(i=await t.read()).done;)yield Oe(i.value)}finally{t.cancel()}}}async function*Ve(e,n){var i,t="";for await(var a of e)for(t+=a;(i=t.indexOf(n))>-1;)yield t.slice(0,i),t=t.slice(i+n.length)}function $e(e,n,i){var t;return"undefined"!=typeof AbortController&&(i.signal=(t=new AbortController).signal),U((()=>{t&&t.abort()}))(_((e=>!!e))(K(async function*(e,n,i){var t,a=!0,r=null;try{yield await Promise.resolve();var d,o=(t=await(e.context.fetch||fetch)(n,i)).headers.get("Content-Type")||"";for await(var l of/multipart\/mixed/i.test(o)?async function*(e,n){var i,t=e.match(Ce),a="--"+(t?t[1]:"-"),r=!0;for await(var d of Ve(Ee(n),"\r\n"+a)){if(r){r=!1;var o=d.indexOf(a);if(!(o>-1))continue;d=d.slice(o+a.length)}try{yield i=JSON.parse(d.slice(d.indexOf("\r\n\r\n")+4))}catch(e){if(!i)throw e}if(i&&!1===i.hasNext)break}i&&!1!==i.hasNext&&(yield{hasNext:!1})}(o,t):/text\/event-stream/i.test(o)?async function*(e){var n;for await(var i of Ve(Ee(e),"\n\n")){var t=i.match(qe);if(t){var a=t[1];try{yield n=JSON.parse(a)}catch(e){if(!n)throw e}if(n&&!1===n.hasNext)break}}n&&!1!==n.hasNext&&(yield{hasNext:!1})}(t):/text\//i.test(o)?async function*(e){var n=await e.text();try{var i=JSON.parse(n);"production"!==process.env.NODE_ENV&&console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.'),yield i}catch(e){throw new Error(n)}}(t):async function*(e){yield JSON.parse(await e.text())}(t))l.pending&&!r?d=l.pending:l.pending&&(d=[...d,...l.pending]),r=r?Fe(r,l,t,d):Se(e,l,t),a=!1,yield r,a=!0;r||(yield r=Se(e,{},t))}catch(n){if(!a)throw n;yield we(e,t&&(t.status<200||t.status>=300)&&t.statusText?new Error(t.statusText):n,t)}}(e,n,i))))}var Te=(e,n)=>{if(Array.isArray(e))for(var i of e)Te(i,n);else if("object"==typeof e&&null!==e)for(var t in e)"__typename"===t&&"string"==typeof e[t]?n.add(e[t]):Te(e[t],n);return n},Ie=e=>{if("definitions"in e){var n=[];for(var r of e.definitions){var d=Ie(r);n.push(d)}return{...e,definitions:n}}if("directives"in e&&e.directives&&e.directives.length){var o=[],l={};for(var s of e.directives){var u=s.name.value;"_"!==u[0]?o.push(s):u=u.slice(1),l[u]=s}e={...e,directives:o,_directives:l}}if("selectionSet"in e){var c=[],m=e.kind===t;if(e.selectionSet){for(var k of e.selectionSet.selections||[]){m=m||k.kind===a&&"__typename"===k.name.value&&!k.alias;var v=Ie(k);c.push(v)}return m||c.push({kind:a,name:{kind:i,value:"__typename"},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:c}}}}return e},_e=new Map;function je(e){var n=n=>e(n);return n.toPromise=()=>{return e=G(1)(_((e=>!e.stale&&!e.hasNext))(n)),new Promise((n=>{var i,t=E;e((e=>{0===e?Promise.resolve(i).then(n):0===e.tag?(t=e[0])(0):(i=e[0],t(0))}))}));var e},n.then=(e,i)=>n.toPromise().then(e,i),n.subscribe=e=>Z(e)(n),n}function Pe(e,n,i){return{...n,kind:e,context:n.context?{...n.context,...i}:i||n.context}}var Le=(e,n)=>Pe(e.kind,e,{meta:{...e.context.meta,...n}}),Ue=()=>{},Me=({kind:e})=>"mutation"!==e&&"query"!==e,Re=e=>{var n=(e=>{var n=pe(e),i=_e.get(n.__key);return i||(_e.set(n.__key,i=Ie(n)),Object.defineProperty(i,"__key",{value:n.__key,enumerable:!1})),i})(e.query);if(n!==e.query){var i=Pe(e.kind,e);return i.query=n,i}return e},Qe=({forward:e,client:n,dispatchDebug:i})=>{var t=new Map,a=new Map,r=e=>"query"===e.kind&&"network-only"!==e.context.requestPolicy&&("cache-only"===e.context.requestPolicy||t.has(e.key));return d=>{var o=j((e=>{var a=t.get(e.key);"production"!==process.env.NODE_ENV&&i({operation:e,...a?{type:"cacheHit",message:"The result was successfully retried from the cache"}:{type:"cacheMiss",message:"The result could not be retrieved from the cache"},source:"cacheExchange"});var r=a||Se(e,{data:null});return r={...r,operation:"production"!==process.env.NODE_ENV?Le(e,{cacheOutcome:a?"hit":"miss"}):e},"cache-and-network"===e.context.requestPolicy&&(r.stale=!0,Je(n,e)),r}))(_((e=>!Me(e)&&r(e)))(d)),l=M((e=>{var{operation:r}=e;if(r){var d,o=r.context.additionalTypenames||[];if("subscription"!==e.operation.kind&&(o=(d=e.data,[...Te(d,new Set)]).concat(o)),"mutation"===e.operation.kind||"subscription"===e.operation.kind){var l=new Set;"production"!==process.env.NODE_ENV&&i({type:"cacheInvalidation",message:`The following typenames have been invalidated: ${o}`,operation:r,data:{typenames:o,response:e},source:"cacheExchange"});for(var s=0;s<o.length;s++){var u=o[s],c=a.get(u);for(var m of(c||a.set(u,c=new Set),c.values()))l.add(m);c.clear()}for(var k of l.values())t.has(k)&&(r=t.get(k).operation,t.delete(k),Je(n,r))}else if("query"===r.kind&&e.data){t.set(r.key,e);for(var v=0;v<o.length;v++){var f=o[v],g=a.get(f);g||a.set(f,g=new Set),g.add(r.key)}}}}))(e(_((e=>"query"!==e.kind||"cache-only"!==e.context.requestPolicy))(j((e=>"production"!==process.env.NODE_ENV?Le(e,{cacheOutcome:"miss"}):e))(L([j(Re)(_((e=>!Me(e)&&!r(e)))(d)),_((e=>Me(e)))(d)])))));return L([o,l])}},Je=(e,n)=>e.reexecuteOperation(Pe(n.kind,n,{requestPolicy:"network-only"})),Ge=({forward:e,dispatchDebug:n})=>i=>{var t=P((e=>{var t=function(e){var n={query:void 0,documentId:void 0,operationName:Ne(e.query),variables:e.variables||void 0,extensions:e.extensions};return!("documentId"in e.query)||!e.query.documentId||e.query.definitions&&e.query.definitions.length?e.extensions&&e.extensions.persistedQuery&&!e.extensions.persistedQuery.miss||(n.query=ge(e.query)):n.documentId=e.query.documentId,n}(e),a=((e,n)=>{var i="query"===e.kind&&e.context.preferGetMethod;if(!i||!n)return e.context.url;var t=xe(e.context.url);for(var a in n){var r=n[a];r&&t[1].set(a,"object"==typeof r?de(r):r)}var d=t.join("?");return d.length>2047&&"force"!==i?(e.context.preferGetMethod=!1,e.context.url):d})(e,t),r=De(e,t);"production"!==process.env.NODE_ENV&&n({type:"fetchRequest",message:"A fetch request is being executed.",operation:e,data:{url:a,fetchOptions:r},source:"fetchExchange"});var d=B(_((n=>"teardown"===n.kind&&n.key===e.key))(i))($e(e,a,r));return"production"!==process.env.NODE_ENV?M((i=>{var t=i.data?void 0:i.error;"production"!==process.env.NODE_ENV&&n({type:t?"fetchError":"fetchSuccess",message:`A ${t?"failed":"successful"} fetch response has been returned.`,operation:e,data:{url:a,fetchOptions:r,value:t||i},source:"fetchExchange"})}))(d):d}))(_((e=>"teardown"!==e.kind&&("subscription"!==e.kind||!!e.context.fetchSubscriptions)))(i));return L([t,e(_((e=>"teardown"===e.kind||"subscription"===e.kind&&!e.context.fetchSubscriptions))(i))])},Be=({dispatchDebug:e})=>n=>("production"!==process.env.NODE_ENV&&(n=M((n=>{if("teardown"!==n.kind&&"production"!==process.env.NODE_ENV){var i=`No exchange has handled operations of kind "${n.kind}". Check whether you've added an exchange responsible for these operations.`;"production"!==process.env.NODE_ENV&&e({type:"fallbackCatch",message:i,operation:n,source:"fallbackExchange"}),console.warn(i)}}))(n)),_((e=>!1))(n)),Ke=function e(n){if("production"!==process.env.NODE_ENV&&!n.url)throw new Error("You are creating an urql-client without a url.");var i=0,a=new Map,r=new Map,d=new Set,o=[],l={url:n.url,fetchSubscriptions:n.fetchSubscriptions,fetchOptions:n.fetchOptions,fetch:n.fetch,preferGetMethod:n.preferGetMethod,requestPolicy:n.requestPolicy||"cache-first"},s=Y();function u(e){"mutation"!==e.kind&&"teardown"!==e.kind&&d.has(e.key)||("teardown"===e.kind?d.delete(e.key):"mutation"!==e.kind&&d.add(e.key),s.next(e))}var c=!1;function m(e){if(e&&u(e),!c){for(c=!0;c&&(e=o.shift());)u(e);c=!1}}var k=e=>{var n=B(_((n=>"teardown"===n.kind&&n.key===e.key))(s.source))(_((n=>n.operation.kind===e.kind&&n.operation.key===e.key&&(!n.operation.context._instance||n.operation.context._instance===e.context._instance)))(N));return n="query"!==e.kind?function(e,n){return i=>t=>{var a=E,r=!1;i((i=>{r||(0===i?(r=!0,t(0)):0===i.tag?(a=i[0],t(i)):e(i[0])?t(i):(r=!0,n&&t(i),t(0),a(1)))}))}}((e=>!!e.hasNext),!0)(n):J((n=>{var i=W(n);return n.stale||n.hasNext?i:L([i,j((()=>(n.stale=!0,n)))(G(1)(_((n=>n.key===e.key))(s.source)))])}))(n),Q(n="mutation"!==e.kind?U((()=>{d.delete(e.key),a.delete(e.key),r.delete(e.key),c=!1;for(var n=o.length-1;n>=0;n--)o[n].key===e.key&&o.splice(n,1);u(Pe("teardown",e,e.context))}))(M((n=>{if(n.stale)if(n.hasNext){for(var i of o)if(i.key===n.operation.key){d.delete(i.key);break}}else d.delete(e.key);else n.hasNext||d.delete(e.key);a.set(e.key,n)}))(n)):R((()=>{u(e)}))(n))},v=this instanceof e?this:Object.create(e.prototype),f=Object.assign(v,{suspense:!!n.suspense,operations$:s.source,reexecuteOperation(e){if("teardown"===e.kind)m(e);else if("mutation"===e.kind)o.push(e),Promise.resolve().then(m);else if(r.has(e.key)){for(var n=!1,i=0;i<o.length;i++)o[i].key===e.key&&(o[i]=e,n=!0);n||d.has(e.key)&&"network-only"!==e.context.requestPolicy?(d.delete(e.key),Promise.resolve().then(m)):(o.push(e),Promise.resolve().then(m))}},createRequestOperation(e,n,a){var r;if(a||(a={}),"production"!==process.env.NODE_ENV&&"teardown"!==e&&(r=(e=>{for(var n of e.definitions)if(n.kind===t)return n.operation})(n.query))!==e)throw new Error(`Expected operation of type "${e}" but found "${r}"`);return Pe(e,n,{_instance:"mutation"===e?i=i+1|0:void 0,...l,...a,requestPolicy:a.requestPolicy||l.requestPolicy,suspense:a.suspense||!1!==a.suspense&&f.suspense})},executeRequestOperation:e=>"mutation"===e.kind?je(k(e)):je(function(e){return n=>e()(n)}((()=>{var n=r.get(e.key);n||r.set(e.key,n=k(e)),n=R((()=>{m(e)}))(n);var i=a.get(e.key);return"query"===e.kind&&i&&(i.stale||i.hasNext)?J(W)(L([n,_((n=>n===a.get(e.key)))(W(i))])):n}))),executeQuery(e,n){var i=f.createRequestOperation("query",e,n);return f.executeRequestOperation(i)},executeSubscription(e,n){var i=f.createRequestOperation("subscription",e,n);return f.executeRequestOperation(i)},executeMutation(e,n){var i=f.createRequestOperation("mutation",e,n);return f.executeRequestOperation(i)},readQuery(e,n,i){var t=null;return Z((e=>{t=e}))(f.query(e,n,i)).unsubscribe(),t},query:(e,n,i)=>f.executeQuery(ye(e,n),i),subscription:(e,n,i)=>f.executeSubscription(ye(e,n),i),mutation:(e,n,i)=>f.executeMutation(ye(e,n),i)}),g=Ue;if("production"!==process.env.NODE_ENV){var{next:h,source:p}=Y();f.subscribeToDebugTarget=e=>Z(e)(p),g=h}var y=(e=>({client:n,forward:i,dispatchDebug:t})=>e.reduceRight(((e,i)=>{var a=!1;return i({client:n,forward(n){if("production"!==process.env.NODE_ENV){if(a)throw new Error("forward() must only be called once in each Exchange.");a=!0}return Q(e(Q(n)))},dispatchDebug(e){"production"!==process.env.NODE_ENV&&t({timestamp:Date.now(),source:i.name,...e})}})}),i))(n.exchanges),N=Q(y({client:f,dispatchDebug:g,forward:Be({dispatchDebug:g})})(s.source));return function(e){Z((e=>{}))(e)}(N),f},ze={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},We={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},He={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},Ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},Ze={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]},Xe={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":ze,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":We,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":He,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":Ye,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":Ze};function en(e){return Xe[e]??{}}var nn=e=>null!=e;function tn(e){return e?e.map((e=>e?.node)).filter(nn)??[]:[]}en("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n"),en("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n"),en("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n"),en("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n"),en("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n");var an=class{url;accessKey;urqlClient;constructor(e){this.url=e.url,this.accessKey=e.accessKey,this.urqlClient=e.urqlClient??this.createUrqlClient()}async getDocument(e){return function(e){if(!e.data?.document)return{document:null,error:e.error};const n=e.data?.document;return{document:{...n,tags:tn(n.tags?.edges),assets:tn(n.assets?.edges),outboundLinkDocuments:tn(n.outboundLinkDocuments?.edges).map((e=>({...e,tags:tn(e.tags?.edges)}))),inboundLinkDocuments:tn(n.inboundLinkDocuments?.edges).map((e=>({...e,tags:tn(e.tags?.edges)}))),websites:tn(n.websites?.edges)},error:e.error}}(await this.urqlClient.query(ze,e))}async getDocuments(e){return function(e){if(!e.data||!e.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:e.error};const n=e.data.documents,i=tn(n?.edges).map((e=>({...e,tags:tn(e.tags?.edges)}))),t=e.data?.documents?.totalCount||0;return{documents:i,totalCount:t,isEmpty:0===t,error:e.error}}(await this.urqlClient.query(We,e??{}))}async getTag(e){return function(e){const n=e.data?.tag;return{tag:n?{...n,relatedTags:tn(n.relatedTags?.edges)}:null,error:e.error}}(await this.urqlClient.query(He,e))}async getTags(e){return function(e){const n=tn(e.data?.tags?.edges),i=e.data?.tags?.totalCount||0;return{tags:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(Ye,e??{}))}async getWebsites(e){return function(e){const n=tn(e.data?.websites?.edges).map((e=>({...e,documents:tn(e.documents?.edges)}))),i=e.data?.websites?.totalCount||0;return{websites:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(Ze,e??{}))}createUrqlClient(){return Ke({url:this.url,exchanges:[Qe,Ge],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};export{an as Client};//# sourceMappingURL=client.mjs.map
|
|
1
|
+
import{Client as m}from"../chunk-4P6CMRB3.mjs";import"../chunk-FRXB4F4I.mjs";import"../chunk-JGQBUURE.mjs";import"../chunk-SYHSU6VH.mjs";import"../chunk-EXRG4APR.mjs";import"../chunk-WIUPPYM5.mjs";import"../chunk-7R3CATQT.mjs";import"../chunk-VKWT2GNZ.mjs";import"../chunk-PUTNZ4GU.mjs";import"../chunk-C3G2CMRR.mjs";import"../chunk-PA32N4A6.mjs";import"../chunk-RRJUH3D4.mjs";import"../chunk-FIFBNWMD.mjs";import"../chunk-3GXIDS5H.mjs";import"../chunk-ZZFAG7Y6.mjs";export{m as Client};
|