decap-cms-backend-github 3.6.0 → 3.8.0

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.
@@ -1,25 +1,25 @@
1
1
  /*! For license information please see decap-cms-backend-github.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("decap-cms-lib-util"),require("@emotion/react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):"function"==typeof define&&define.amd?define("DecapCmsBackendGithub",["react","decap-cms-lib-util","@emotion/react","prop-types","decap-cms-lib-auth","decap-cms-ui-default"],t):"object"==typeof exports?exports.DecapCmsBackendGithub=t(require("react"),require("decap-cms-lib-util"),require("@emotion/react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):e.DecapCmsBackendGithub=t(e.React,e.DecapCmsLibUtil,e.DecapCmsDefaultExports.EmotionCore,e.DecapCmsDefaultExports.PropTypes,e.DecapCmsLibAuth,e.DecapCmsUiDefault)}(window,(e,t,r,n,i,o)=>(()=>{var a={8244(e){e.exports={__schema:{types:[{kind:"INTERFACE",name:"Node",possibleTypes:[{name:"AddedToProjectEvent"},{name:"App"},{name:"AssignedEvent"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"Blob"},{name:"Bot"},{name:"BranchProtectionRule"},{name:"ClosedEvent"},{name:"CodeOfConduct"},{name:"CommentDeletedEvent"},{name:"Commit"},{name:"CommitComment"},{name:"CommitCommentThread"},{name:"ConvertedNoteToIssueEvent"},{name:"CrossReferencedEvent"},{name:"DemilestonedEvent"},{name:"DeployKey"},{name:"DeployedEvent"},{name:"Deployment"},{name:"DeploymentEnvironmentChangedEvent"},{name:"DeploymentStatus"},{name:"ExternalIdentity"},{name:"Gist"},{name:"GistComment"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"Issue"},{name:"IssueComment"},{name:"Label"},{name:"LabeledEvent"},{name:"Language"},{name:"License"},{name:"LockedEvent"},{name:"Mannequin"},{name:"MarketplaceCategory"},{name:"MarketplaceListing"},{name:"MentionedEvent"},{name:"MergedEvent"},{name:"Milestone"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"Organization"},{name:"OrganizationIdentityProvider"},{name:"OrganizationInvitation"},{name:"PinnedEvent"},{name:"Project"},{name:"ProjectCard"},{name:"ProjectColumn"},{name:"PublicKey"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"},{name:"PullRequestReviewThread"},{name:"PushAllowance"},{name:"Reaction"},{name:"ReadyForReviewEvent"},{name:"Ref"},{name:"ReferencedEvent"},{name:"RegistryPackage"},{name:"RegistryPackageDependency"},{name:"RegistryPackageFile"},{name:"RegistryPackageTag"},{name:"RegistryPackageVersion"},{name:"Release"},{name:"ReleaseAsset"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"Repository"},{name:"RepositoryInvitation"},{name:"RepositoryTopic"},{name:"ReviewDismissalAllowance"},{name:"ReviewDismissedEvent"},{name:"ReviewRequest"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewRequestedEvent"},{name:"SavedReply"},{name:"SecurityAdvisory"},{name:"SponsorsListing"},{name:"Sponsorship"},{name:"Status"},{name:"StatusContext"},{name:"SubscribedEvent"},{name:"Tag"},{name:"Team"},{name:"Topic"},{name:"TransferredEvent"},{name:"Tree"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"},{name:"User"},{name:"UserBlockedEvent"},{name:"UserContentEdit"},{name:"UserStatus"}]},{kind:"INTERFACE",name:"UniformResourceLocatable",possibleTypes:[{name:"Bot"},{name:"ClosedEvent"},{name:"Commit"},{name:"CrossReferencedEvent"},{name:"Gist"},{name:"Issue"},{name:"Mannequin"},{name:"MergedEvent"},{name:"Milestone"},{name:"Organization"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"ReadyForReviewEvent"},{name:"Release"},{name:"Repository"},{name:"RepositoryTopic"},{name:"ReviewDismissedEvent"},{name:"User"}]},{kind:"INTERFACE",name:"Actor",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RegistryPackageOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"ProjectOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"Closable",possibleTypes:[{name:"Issue"},{name:"Milestone"},{name:"Project"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Updatable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"Project"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"UNION",name:"ProjectCardItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Assignable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Comment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"UpdatableComment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Labelable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Lockable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"RegistryPackageSearch",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RepositoryOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"MemberStatusable",possibleTypes:[{name:"Organization"},{name:"Team"}]},{kind:"INTERFACE",name:"ProfileOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"PinnableItem",possibleTypes:[{name:"Gist"},{name:"Repository"}]},{kind:"INTERFACE",name:"Starrable",possibleTypes:[{name:"Gist"},{name:"Repository"},{name:"Topic"}]},{kind:"INTERFACE",name:"RepositoryInfo",possibleTypes:[{name:"Repository"}]},{kind:"INTERFACE",name:"GitObject",possibleTypes:[{name:"Blob"},{name:"Commit"},{name:"Tag"},{name:"Tree"}]},{kind:"INTERFACE",name:"RepositoryNode",possibleTypes:[{name:"CommitComment"},{name:"CommitCommentThread"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Subscribable",possibleTypes:[{name:"Commit"},{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Deletable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"IssueComment"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Reactable",possibleTypes:[{name:"CommitComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"GitSignature",possibleTypes:[{name:"GpgSignature"},{name:"SmimeSignature"},{name:"UnknownSignature"}]},{kind:"UNION",name:"RequestedReviewer",possibleTypes:[{name:"User"},{name:"Team"},{name:"Mannequin"}]},{kind:"UNION",name:"PullRequestTimelineItem",possibleTypes:[{name:"Commit"},{name:"CommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestReviewComment"},{name:"IssueComment"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"MergedEvent"},{name:"ReferencedEvent"},{name:"CrossReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefRestoredEvent"},{name:"HeadRefForcePushedEvent"},{name:"BaseRefForcePushedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewDismissedEvent"},{name:"UserBlockedEvent"}]},{kind:"UNION",name:"Closer",possibleTypes:[{name:"Commit"},{name:"PullRequest"}]},{kind:"UNION",name:"ReferencedSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"Assignee",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"MilestoneItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"RenamedTitleSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"PullRequestTimelineItems",possibleTypes:[{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestRevisionMarker"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"MergedEvent"},{name:"ReviewDismissedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReadyForReviewEvent"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"IssueOrPullRequest",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"IssueTimelineItem",possibleTypes:[{name:"Commit"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"ReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"UserBlockedEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"TransferredEvent"}]},{kind:"UNION",name:"IssueTimelineItems",possibleTypes:[{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"ReviewDismissalAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PushAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PermissionGranter",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Sponsorable",possibleTypes:[{name:"User"}]},{kind:"INTERFACE",name:"Contribution",possibleTypes:[{name:"CreatedCommitContribution"},{name:"CreatedIssueContribution"},{name:"CreatedPullRequestContribution"},{name:"CreatedPullRequestReviewContribution"},{name:"CreatedRepositoryContribution"},{name:"JoinedGitHubContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedRepositoryOrRestrictedContribution",possibleTypes:[{name:"CreatedRepositoryContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedIssueOrRestrictedContribution",possibleTypes:[{name:"CreatedIssueContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedPullRequestOrRestrictedContribution",possibleTypes:[{name:"CreatedPullRequestContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"SearchResultItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"User"},{name:"Organization"},{name:"MarketplaceListing"},{name:"App"}]},{kind:"UNION",name:"CollectionItemContent",possibleTypes:[{name:"Repository"},{name:"Organization"},{name:"User"}]}]}}},7991(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,h=u>0?a-4:a;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(c(e,s,s+a>u?u:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(u(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1048(e,t,r){"use strict";const n=r(7991),i=r(9318),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=u,t.IS=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(H(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return l(e),s(e<0?0:0|d(e))}function f(e){const t=e.length<0?0:0|d(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(J(n))return a;e[r+a]=n}return a}function R(e,t,r,n){return W(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return W(G(t),e,r,n)}function O(e,t,r,n){return W(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(H(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){o=c[e],a=l[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return R(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function A(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function q(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function F(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function D(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X(function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=X(function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X(function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=X(function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X(function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=X(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X(function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=X(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const M={};function U(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){Q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function Q(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw Q(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},6075(e){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,a;if(Array.isArray(t)){for(a="[",r=0;r<t.length;r++)r&&(a+=","),a+=e(t[r])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(a="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(e)}},4077(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=o(r(1880)),i=o(r(7020));function o(e){return e&&e.__esModule?e:{default:e}}},3216(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return a(e,[])};var n,i=(n=r(7020))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){switch(o(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var o=n.call(e);if(o!==e)return"string"==typeof o?o:a(o,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(a(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map(function(r){return r+": "+a(e[r],t)}).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},1880(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},7020(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},3378(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(4077))&&n.__esModule?n:{default:n},o=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=o,(0,i.default)(o);var a=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=a,(0,i.default)(a)},4758(e,t){"use strict";function r(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function n(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringValue=function(e){var t=e.split(/\r\n|[\n\r]/g),i=n(e);if(0!==i)for(var o=1;o<t.length;o++)t[o]=t[o].slice(i);for(var a=0;a<t.length&&r(t[a]);)++a;for(var s=t.length;s>a&&r(t[s-1]);)--s;return t.slice(a,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!n||o||a||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}},3230(e,t,r){"use strict";t.y=function(e){return(0,n.visit)(e,{leave:o})};var n=r(8048),i=r(4758),o={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=c("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),o=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+c(" = ",n)+c(" ",s(i," "))},SelectionSet:function(e){return u(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,o=e.selectionSet,a=c("",t,": ")+r,u=a+c("(",s(n,", "),")");return u.length>80&&(u=a+c("(\n",l(s(n,"\n")),"\n)")),s([u,s(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+c(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",c("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(c("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(c("",s(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+c("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:a(function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),u(r)]," ")}),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:a(function(e){return s(["scalar",e.name,s(e.directives," ")]," ")}),ObjectTypeDefinition:a(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")}),FieldDefinition:a(function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(f(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+": "+n+c(" ",s(i," "))}),InputValueDefinition:a(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,c("= ",n),s(i," ")]," ")}),InterfaceTypeDefinition:a(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")}),UnionTypeDefinition:a(function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")}),EnumTypeDefinition:a(function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),u(n)]," ")}),EnumValueDefinition:a(function(e){return s([e.name,s(e.directives," ")]," ")}),InputObjectTypeDefinition:a(function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),u(n)]," ")}),DirectiveDefinition:a(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(f(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")}),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),u(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),u(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),u(n)]," ")}};function a(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(r))&&void 0!==t?t:""}function u(e){return c("{\n",l(s(e,"\n")),"\n}")}function c(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function l(e){return c(" ",e.replace(/\n/g,"\n "))}function h(e){return-1!==e.indexOf("\n")}function f(e){return null!=e&&e.some(h)}},8048(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,n=void 0,c=Array.isArray(e),l=[e],h=-1,f=[],p=void 0,d=void 0,m=void 0,y=[],v=[],g=e;do{var b=++h===l.length,w=b&&0!==f.length;if(b){if(d=0===v.length?void 0:y[y.length-1],p=m,m=v.pop(),w){if(c)p=p.slice();else{for(var R={},E=0,k=Object.keys(p);E<k.length;E++){var O=k[E];R[O]=p[O]}p=R}for(var x=0,S=0;S<f.length;S++){var _=f[S][0],I=f[S][1];c&&(_-=x),c&&null===I?(p.splice(_,1),x++):p[_]=I}}h=n.index,l=n.keys,f=n.edits,c=n.inArray,n=n.prev}else{if(d=m?c?h:l[h]:void 0,null==(p=m?m[d]:g))continue;m&&y.push(d)}var T,A=void 0;if(!Array.isArray(p)){if(!(0,o.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var P=u(t,p.kind,b);if(P){if((A=P.call(t,p,d,m,y,v))===s)break;if(!1===A){if(!b){y.pop();continue}}else if(void 0!==A&&(f.push([d,A]),!b)){if(!(0,o.isNode)(A)){y.pop();continue}p=A}}}void 0===A&&w&&f.push([d,p]),b?y.pop():(n={inArray:c,index:h,keys:l,edits:f,prev:n},l=(c=Array.isArray(p))?p:null!==(T=r[p.kind])&&void 0!==T?T:[],h=-1,f=[],m&&v.push(m),m=p)}while(void 0!==n);return 0!==f.length&&(g=f[f.length-1][1]),g},t.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!1);if(i){var o=i.apply(e[n],arguments);if(!1===o)t[n]=r;else if(o===s)t[n]=s;else if(void 0!==o)return o}}},leave:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!0);if(i){var o=i.apply(e[n],arguments);if(o===s)t[n]=s;else if(void 0!==o&&!1!==o)return o}}else t[n]===r&&(t[n]=null)}}},t.getVisitFn=u,t.BREAK=t.QueryDocumentKeys=void 0;var n,i=(n=r(3216))&&n.__esModule?n:{default:n},o=r(3378),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=a;var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var o=r?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}t.BREAK=s},9318(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*m}},5098(e,t,r){var n=r(3305),i=r(9361),o=r(1112),a=r(5276),s=r(7452);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},7553(e,t,r){var n=r(9747),i=r(5962);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},1386(e,t,r){var n=r(2393),i=r(2049),o=r(7144),a=r(5071),s=r(3964);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},528(e,t,r){var n=r(9747),i=r(5962);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},9770(e,t,r){var n=r(4715)(r(8942),"Map");e.exports=n},8250(e,t,r){var n=r(9753),i=r(5681),o=r(88),a=r(4732),s=r(9068);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},5650(e,t,r){var n=r(8942).Symbol;e.exports=n},9270(e,t,r){var n=r(4715)(r(8942),"WeakMap");e.exports=n},6912(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},9968(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},9756(e,t,r){var n=r(2478);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},5111(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},2837(e){e.exports=function(e){return e.split("")}},7034(e,t,r){var n=r(6285);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9747(e,t,r){var n=r(1580),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},7250(e){e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},7379(e,t,r){var n=r(5650),i=r(8870),o=r(9005),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},2478(e,t,r){var n=r(7250),i=r(9454),o=r(7706);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},9454(e){e.exports=function(e){return e!=e}},9624(e,t,r){var n=r(3655),i=r(4759),o=r(1580),a=r(4066),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?f:s).test(a(e))}},5962(e){e.exports=function(){}},3945(e,t,r){var n=r(2053),i=r(5234),o=r(796);e.exports=function(e,t){return o(i(e,t,n),e+"")}},4943(e,t,r){var n=r(2053),i=r(6065),o=i?function(e,t){return i.set(e,t),e}:n;e.exports=o},7403(e,t,r){var n=r(2619),i=r(2532),o=r(2053),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},3501(e){e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}},2291(e,t,r){var n=r(5650),i=r(5111),o=r(3142),a=r(1187),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},6403(e,t,r){var n=r(2945),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},3526(e,t,r){var n=r(3142),i=r(5187),o=r(6493),a=r(5243);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},8931(e,t,r){var n=r(3501);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},8774(e,t,r){var n=r(2478);e.exports=function(e,t){for(var r=e.length;r--&&n(t,e[r],0)>-1;);return r}},7905(e,t,r){var n=r(2478);e.exports=function(e,t){for(var r=-1,i=e.length;++r<i&&n(t,e[r],0)>-1;);return r}},4977(e){var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=n.length,u=-1,c=r.length,l=t(a-s,0),h=Array(c+l),f=!i;++u<c;)h[u]=r[u];for(;++o<s;)(f||o<a)&&(h[n[o]]=e[o]);for(;l--;)h[u++]=e[o++];return h}},5755(e){var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=-1,u=n.length,c=-1,l=r.length,h=t(a-u,0),f=Array(h+l),p=!i;++o<h;)f[o]=e[o];for(var d=o;++c<l;)f[d+c]=r[c];for(;++s<u;)(p||o<a)&&(f[d+n[s]]=e[o++]);return f}},4354(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},1950(e,t,r){var n=r(8942)["__core-js_shared__"];e.exports=n},3816(e){e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},6713(e,t,r){var n=r(4364),i=r(8942);e.exports=function(e,t,r){var o=1&t,a=n(e);return function t(){return(this&&this!==i&&this instanceof t?a:e).apply(o?r:this,arguments)}}},4364(e,t,r){var n=r(9747),i=r(1580);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),o=e.apply(r,t);return i(o)?o:r}}},2443(e,t,r){var n=r(6912),i=r(4364),o=r(3504),a=r(4216),s=r(6850),u=r(8813),c=r(8942);e.exports=function(e,t,r){var l=i(e);return function i(){for(var h=arguments.length,f=Array(h),p=h,d=s(i);p--;)f[p]=arguments[p];var m=h<3&&f[0]!==d&&f[h-1]!==d?[]:u(f,d);return(h-=m.length)<r?a(e,t,o,i.placeholder,void 0,f,m,void 0,void 0,r-h):n(this&&this!==c&&this instanceof i?l:e,this,f)}}},3504(e,t,r){var n=r(4977),i=r(5755),o=r(3816),a=r(4364),s=r(4216),u=r(6850),c=r(6591),l=r(8813),h=r(8942);e.exports=function e(t,r,f,p,d,m,y,v,g,b){var w=128&r,R=1&r,E=2&r,k=24&r,O=512&r,x=E?void 0:a(t);return function S(){for(var _=arguments.length,I=Array(_),T=_;T--;)I[T]=arguments[T];if(k)var A=u(S),P=o(I,A);if(p&&(I=n(I,p,d,k)),m&&(I=i(I,m,y,k)),_-=P,k&&_<b){var C=l(I,A);return s(t,r,e,S.placeholder,f,I,C,v,g,b-_)}var N=R?f:this,q=E?N[t]:t;return _=I.length,v?I=c(I,v):O&&_>1&&I.reverse(),w&&g<_&&(I.length=g),this&&this!==h&&this instanceof S&&(q=x||a(q)),q.apply(N,I)}}},6341(e,t,r){var n=r(6912),i=r(4364),o=r(8942);e.exports=function(e,t,r,a){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,h=a.length,f=Array(h+c),p=this&&this!==o&&this instanceof t?u:e;++l<h;)f[l]=a[l];for(;c--;)f[l++]=arguments[++i];return n(p,s?r:this,f)}}},4216(e,t,r){var n=r(6648),i=r(5512),o=r(5620);e.exports=function(e,t,r,a,s,u,c,l,h,f){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,h,f],m=r.apply(void 0,d);return n(e)&&i(m,d),m.placeholder=a,o(m,e,t)}},8638(e,t,r){var n=r(4943),i=r(6713),o=r(2443),a=r(3504),s=r(6341),u=r(5196),c=r(7028),l=r(5512),h=r(5620),f=r(7642),p=Math.max;e.exports=function(e,t,r,d,m,y,v,g){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var w=d?d.length:0;if(w||(t&=-97,d=m=void 0),v=void 0===v?v:p(f(v),0),g=void 0===g?g:f(g),w-=m?m.length:0,64&t){var R=d,E=m;d=m=void 0}var k=b?void 0:u(e),O=[e,t,r,d,m,R,E,y,v,g];if(k&&c(O,k),e=O[0],t=O[1],r=O[2],d=O[3],m=O[4],!(g=O[9]=void 0===O[9]?b?0:e.length:p(O[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||16==t?o(e,t,g):32!=t&&33!=t||m.length?a.apply(void 0,O):s(e,t,r,d);else var x=i(e,t,r);return h((k?n:l)(x,O),e,t)}},2532(e,t,r){var n=r(4715),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},4967(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5196(e,t,r){var n=r(6065),i=r(9071),o=n?function(e){return n.get(e)}:i;e.exports=o},961(e,t,r){var n=r(3476),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],o=i.call(n,t)?r.length:0;o--;){var a=r[o],s=a.func;if(null==s||s==e)return a.name}return t}},6850(e){e.exports=function(e){return e.placeholder}},4700(e,t,r){var n=r(9067);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},4715(e,t,r){var n=r(9624),i=r(155);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},8870(e,t,r){var n=r(5650),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},155(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8788(e){var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},3417(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},3305(e,t,r){var n=r(4497);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},9361(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112(e,t,r){var n=r(4497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},5276(e,t,r){var n=r(4497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},7452(e,t,r){var n=r(4497);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},9141(e){var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},9632(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},5187(e,t,r){var n=r(3142),i=r(1187),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},9067(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6648(e,t,r){var n=r(7553),i=r(5196),o=r(961),a=r(3321);e.exports=function(e){var t=o(e),r=a[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},4759(e,t,r){var n,i=r(1950),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},2393(e){e.exports=function(){this.__data__=[],this.size=0}},2049(e,t,r){var n=r(7034),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},7144(e,t,r){var n=r(7034);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},5071(e,t,r){var n=r(7034);e.exports=function(e){return n(this.__data__,e)>-1}},3964(e,t,r){var n=r(7034);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},9753(e,t,r){var n=r(5098),i=r(1386),o=r(9770);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},5681(e,t,r){var n=r(4700);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},88(e,t,r){var n=r(4700);e.exports=function(e){return n(this,e).get(e)}},4732(e,t,r){var n=r(4700);e.exports=function(e){return n(this,e).has(e)}},9068(e,t,r){var n=r(4700);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},6853(e,t,r){var n=r(9011);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},7028(e,t,r){var n=r(4977),i=r(5755),o=r(8813),a="__lodash_placeholder__",s=Math.min;e.exports=function(e,t){var r=e[1],u=t[1],c=r|u,l=c<131,h=128==u&&8==r||128==u&&256==r&&e[7].length<=t[8]||384==u&&t[7].length<=t[8]&&8==r;if(!l&&!h)return e;1&u&&(e[2]=t[2],c|=1&r?0:4);var f=t[3];if(f){var p=e[3];e[3]=p?n(p,f,t[4]):f,e[4]=p?o(e[3],a):t[4]}return(f=t[5])&&(p=e[5],e[5]=p?i(p,f,t[6]):f,e[6]=p?o(e[5],a):t[6]),(f=t[7])&&(e[7]=f),128&u&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}},6065(e,t,r){var n=r(9270),i=n&&new n;e.exports=i},4497(e,t,r){var n=r(4715)(Object,"create");e.exports=n},9005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5234(e,t,r){var n=r(6912),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=r(u),n(e,this,c)}}},3476(e){e.exports={}},6591(e,t,r){var n=r(4354),i=r(9632),o=Math.min;e.exports=function(e,t){for(var r=e.length,a=o(t.length,r),s=n(e);a--;){var u=t[a];e[a]=i(u,r)?s[u]:void 0}return e}},8813(e){var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,a[o++]=n)}return a}},8942(e,t,r){var n=r(4967),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},5512(e,t,r){var n=r(4943),i=r(3316)(n);e.exports=i},796(e,t,r){var n=r(7403),i=r(3316)(n);e.exports=i},5620(e,t,r){var n=r(8788),i=r(9141),o=r(796),a=r(33);e.exports=function(e,t,r){var s=t+"";return o(e,i(s,a(n(s),r)))}},3316(e){var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7706(e){e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},2237(e,t,r){var n=r(2837),i=r(3417),o=r(2013);e.exports=function(e){return i(e)?o(e):n(e)}},6493(e,t,r){var n=r(6853),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)}),t});e.exports=a},6040(e,t,r){var n=r(1187);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},4066(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2945(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},2013(e){var t="\\ud800-\\udfff",r="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",l=c+u+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+u+")*",h="(?:"+[o+n+"?",n,a,s,r].join("|")+")",f=RegExp(i+"(?="+i+")|"+h+l,"g");e.exports=function(e){return e.match(f)||[]}},33(e,t,r){var n=r(9968),i=r(9756),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(o,function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)}),e.sort()}},3410(e,t,r){var n=r(7553),i=r(528),o=r(4354);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=o(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},2619(e){e.exports=function(e){return function(){return e}}},6285(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2053(e){e.exports=function(e){return e}},7715(e,t,r){var n=r(3501);e.exports=function(e){return null!=e&&e.length?n(e,0,-1):[]}},3142(e){var t=Array.isArray;e.exports=t},3655(e,t,r){var n=r(7379),i=r(1580);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1187(e,t,r){var n=r(7379),i=r(547);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},8087(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},9011(e,t,r){var n=r(8250);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},9071(e){e.exports=function(){}},578(e,t,r){var n=r(3945),i=r(8638),o=r(6850),a=r(8813),s=n(function(e,t){var r=a(t,o(s));return i(e,32,void 0,t,r)});s.placeholder={},e.exports=s},1034(e,t,r){var n=r(3526),i=r(3655),o=r(6040);e.exports=function(e,t,r){var a=-1,s=(t=n(t,e)).length;for(s||(s=1,e=void 0);++a<s;){var u=null==e?void 0:e[o(t[a])];void 0===u&&(a=s,u=r),e=i(u)?u.call(e):u}return e}},3301(e,t,r){var n=r(6131),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7642(e,t,r){var n=r(3301);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},6131(e,t,r){var n=r(6403),i=r(1580),o=r(1187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},5243(e,t,r){var n=r(2291);e.exports=function(e){return null==e?"":n(e)}},107(e,t,r){var n=r(2291),i=r(6403),o=r(8931),a=r(8774),s=r(7905),u=r(2237),c=r(5243);e.exports=function(e,t,r){if((e=c(e))&&(r||void 0===t))return i(e);if(!e||!(t=n(t)))return e;var l=u(e),h=u(t),f=s(l,h),p=a(l,h)+1;return o(l,f,p).join("")}},959(e,t,r){var n=r(2291),i=r(8931),o=r(7905),a=r(2237),s=r(5243),u=/^\s+/;e.exports=function(e,t,r){if((e=s(e))&&(r||void 0===t))return e.replace(u,"");if(!e||!(t=n(t)))return e;var c=a(e),l=o(c,a(t));return i(c,l).join("")}},3321(e,t,r){var n=r(7553),i=r(528),o=r(5962),a=r(3142),s=r(547),u=r(3410),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},9942(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=s,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,i=47===a.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,a=o-i,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var u=r.length-s,c=a<u?a:u,l=-1,h=0;h<=c;++h){if(h===c){if(u>c){if(47===r.charCodeAt(s+h))return r.slice(s+h+1);if(0===h)return r.slice(s+h)}else a>c&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(s+h))break;47===f&&(l=h)}var p="";for(h=i+l+1;h<=o;++h)h!==o&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(s+l):(s+=l,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!o){i=a;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,u=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!a){i=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(c===r.charCodeAt(s)?-1===--s&&(o=n):(s=-1,o=u))}return i===o?o=u:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){i=n+1;break}}else-1===o&&(a=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,a=0,s=e.length-1;s>=0;--s){var u=e.charCodeAt(s);if(47!==u)-1===i&&(o=!1,i=s+1),46===u?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!o){n=s+1;break}}return-1===r||-1===i||0===a||1===a&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,c=!0,l=e.length-1,h=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===a?a=l:1!==h&&(h=1):-1!==a&&(h=-1);else if(!c){s=l+1;break}return-1===a||-1===u||0===h||1===h&&a===u-1&&a===s+1?-1!==u&&(r.base=r.name=0===s&&o?e.slice(1,u):e.slice(s,u)):(0===s&&o?(r.name=e.slice(1,a),r.base=e.slice(1,u)):(r.name=e.slice(s,a),r.base=e.slice(s,u)),r.ext=e.slice(a,u)),s>0?r.dir=e.slice(0,s-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},3554(e){!function(){"use strict";var t=function(e){setTimeout(e,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(t=process.nextTick),e.exports=function(e){var r={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===r.firstHere){r.current++,r.firstHere=!0;var e=1}else e=0;var t={n:1};"function"==typeof arguments[0]?t.task=arguments[0]:t.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?t.task=arguments[1]:t.n=arguments[1]);var n=t.task;if(t.task=function(){n(r.leave)},r.current+t.n-e>r.capacity)return 1===e&&(r.current--,r.firstHere=!1),r.queue.push(t);r.current+=t.n-e,t.task(r.leave),1===e&&(r.firstHere=!1)},leave:function(e){if(e=e||1,r.current-=e,r.queue.length){var n=r.queue[0];n.n+r.current>r.capacity||(r.queue.shift(),r.current+=n.n,t(n.task))}else if(r.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,r.current+e<=r.capacity}};return r}}()},1158(e,t,r){"use strict";r.d(t,{A:()=>n}),e=r.hmd(e);const n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},8784(e,t,r){e.exports=r(4834).Observable},4834(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var o=function(){return"function"==typeof Symbol},a=function(e){return o()&&Boolean(Symbol[e])},s=function(e){return a(e)?Symbol[e]:"@@"+e};o()&&!a("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function h(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function f(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function p(e){return e instanceof E}function d(e){d.log?d.log(e):setTimeout(function(){throw e})}function m(e){Promise.resolve().then(function(){try{e()}catch(e){d(e)}})}function y(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=h(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function v(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";var n=e._observer;try{var i=h(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(v(e),!i)throw r;i.call(n,r);break;case"complete":v(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?y(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void m(function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(g(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)})):void g(e,t,r);e._queue.push({type:t,value:r})}}var w=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new R(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(v(this),y(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),R=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new w(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise(function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}})}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))(function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))(function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=f(this),n=arguments.length>1,i=!1,o=arguments[1];return new r(function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})})}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=f(this);return new i(function(t){var n,o=0;return function e(a){n=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}})}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=f(this);return new r(function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),o.unsubscribe()}})}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=h(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r(function(e){return i.subscribe(e)})}if(a("iterator")&&(n=h(t,u)))return new r(function(e){m(function(){if(!e.closed){var r=!0,i=!1,o=void 0;try{for(var a,s=n.call(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}e.complete()}})});if(Array.isArray(t))return new r(function(e){m(function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)(function(e){m(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})}},{key:l,get:function(){return this}}]),e}();t.Observable=E,o()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},4119(t){"use strict";t.exports=e},8110(e){"use strict";e.exports=r},7434(e){"use strict";e.exports=n},7125(e){"use strict";e.exports=i},3135(e){"use strict";e.exports=t},6171(e){"use strict";e.exports=o}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(r.exports,r,r.exports,u),r.loaded=!0,r.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var c={};return(()=>{"use strict";u.d(c,{DecapCmsBackendGithub:()=>ha});var e,t,r=u(4119),n=u.n(r),i=u(3554),o=u.n(i),a=u(959),s=u.n(a),l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=(e=["",""],t=["",""],Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),f=function(){function e(){for(var t=this,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return"function"==typeof e?t.interimTag.bind(t,e):"string"==typeof e?t.transformEndResult(e):(e=e.map(t.transformString.bind(t)),t.transformEndResult(e.reduce(t.processSubstitutions.bind(t,n))))},n.length>0&&Array.isArray(n[0])&&(n=n[0]),this.transformers=n.map(function(e){return"function"==typeof e?e():e}),this.tag}return l(e,[{key:"interimTag",value:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this.tag(h,e.apply(void 0,[t].concat(n)))}},{key:"processSubstitutions",value:function(e,t,r){var n=this.transformSubstitution(e.shift(),t);return"".concat(t,n,r)}},{key:"transformString",value:function(e){return this.transformers.reduce(function(e,t){return t.onString?t.onString(e):e},e)}},{key:"transformSubstitution",value:function(e,t){return this.transformers.reduce(function(e,r){return r.onSubstitution?r.onSubstitution(e,t):e},e)}},{key:"transformEndResult",value:function(e){return this.transformers.reduce(function(e,t){return t.onEndResult?t.onEndResult(e):e},e)}}]),e}();const p=f;var d={separator:"",conjunction:"",serial:!1};const m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return{onSubstitution:function(t,r){if(Array.isArray(t)){var n=t.length,i=e.separator,o=e.conjunction,a=e.serial,s=r.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),o&&n>1){var u=t.lastIndexOf(i);t=t.slice(0,u)+(a?i:"")+" "+o+t.slice(u+1)}}return t}}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var r=t.match(/^[^\S\n]*(?=\S)/gm),n=r&&Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r.map(function(e){return e.length})));if(n){var i=new RegExp("^.{"+n+"}","gm");return t.replace(i,"")}return t}if("all"===e)return t.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+e)}}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};new p(m({separator:","}),y,v),new p(m({separator:",",conjunction:"and"}),y,v),new p(m({separator:",",conjunction:"or"}),y,v);const g=function(e){return{onSubstitution:function(t,r){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}};var b=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e};new p(g("\n"),function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(b):b(e)?e:""}}},m,y,v);const w=function(e,t){return{onSubstitution:function(r,n){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==r?r:r.toString().replace(e,t)}}};new p(g("\n"),m,y,v,w(/&/g,"&amp;"),w(/</g,"&lt;"),w(/>/g,"&gt;"),w(/"/g,"&quot;"),w(/'/g,"&#x27;"),w(/`/g,"&#x60;"));const R=function(e,t){return{onEndResult:function(r){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return r.replace(e,t)}}},E=new p(R(/(?:\n(?:\s*))+/g," "),v);new p(R(/(?:\n\s*)/g,""),v),new p(m({separator:","}),R(/(?:\s+)/g," "),v),new p(m({separator:",",conjunction:"or"}),R(/(?:\s+)/g," "),v),new p(m({separator:",",conjunction:"and"}),R(/(?:\s+)/g," "),v),new p(m,y,v),new p(m,R(/(?:\s+)/g," "),v);const k=new p(y,v);new p(y("all"),v);var O=u(3135);function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(null,arguments)}var S=u(8110),_={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function I(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var T=/[A-Z]|^ms/g,A=/_EMO_([^_]+?)_([^]*?)_EMO_/g,P=function(e){return 45===e.charCodeAt(1)},C=function(e){return null!=e&&"boolean"!=typeof e},N=I(function(e){return P(e)?e:e.replace(T,"-$&").toLowerCase()}),q=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(A,function(e,t,r){return D={name:t,styles:r,next:D},t})}return 1===_[e]||P(e)||"number"!=typeof t||0===t?t:t+"px"};function F(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var i=r;if(1===i.anim)return D={name:i.name,styles:i.styles,next:D},i.name;var o=r;if(void 0!==o.styles){var a=o.next;if(void 0!==a)for(;void 0!==a;)D={name:a.name,styles:a.styles,next:D},a=a.next;return o.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=F(e,t,r[i])+";";else for(var o in r){var a=r[o];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?n+=o+"{"+t[s]+"}":C(s)&&(n+=N(o)+":"+q(o,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var u=F(e,t,a);switch(o){case"animation":case"animationName":n+=N(o)+":"+u+";";break;default:n+=o+"{"+u+"}"}}else for(var c=0;c<a.length;c++)C(a[c])&&(n+=N(o)+":"+q(o,a[c])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=D,u=r(e);return D=s,F(e,t,u)}}var c=r;if(null==t)return c;var l=t[c];return void 0!==l?l:c}var D,B=/label:\s*([^\s;{]+)\s*(;|$)/g,L=!!r.useInsertionEffect&&r.useInsertionEffect,M=L||function(e){return e()};L||r.useLayoutEffect;var U=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,$=I(function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Q=function(e){return"theme"!==e},V=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?$:Q},z=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},K=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return U(t,r,n),M(function(){return function(e,t,r){U(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)}),null},G=function e(t,n){var i,o,a=t.__emotion_real===t,s=a&&t.__emotion_base||t;void 0!==n&&(i=n.label,o=n.target);var u=z(t,n,a),c=u||V(s),l=!c("as");return function(){var h=arguments,f=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&f.push("label:"+i+";"),null==h[0]||void 0===h[0].raw)f.push.apply(f,h);else{var p=h[0];f.push(p[0]);for(var d=h.length,m=1;m<d;m++)f.push(h[m],p[m])}var y=(0,S.withEmotionCache)(function(e,t,n){var i,a,h,p,d=l&&e.as||s,m="",y=[],v=e;if(null==e.theme){for(var g in v={},e)v[g]=e[g];v.theme=r.useContext(S.ThemeContext)}"string"==typeof e.className?(i=t.registered,a=y,h=e.className,p="",h.split(" ").forEach(function(e){void 0!==i[e]?a.push(i[e]+";"):e&&(p+=e+" ")}),m=p):null!=e.className&&(m=e.className+" ");var b=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";D=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,i+=F(r,t,o)):i+=o[0];for(var a=1;a<e.length;a++)i+=F(r,t,e[a]),n&&(i+=o[a]);B.lastIndex=0;for(var s,u="";null!==(s=B.exec(i));)u+="-"+s[1];var c=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:c,styles:i,next:D}}(f.concat(y),t.registered,v);m+=t.key+"-"+b.name,void 0!==o&&(m+=" "+o);var w=l&&void 0===u?V(d):c,R={};for(var E in e)l&&"as"===E||w(E)&&(R[E]=e[E]);return R.className=m,n&&(R.ref=n),r.createElement(r.Fragment,null,r.createElement(K,{cache:t,serialized:b,isStringTag:"string"==typeof d}),r.createElement(d,R))});return y.displayName=void 0!==i?i:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",y.defaultProps=t.defaultProps,y.__emotion_real=y,y.__emotion_base=s,y.__emotion_styles=f,y.__emotion_forwardProp=u,Object.defineProperty(y,"toString",{value:function(){return"."+o}}),y.withComponent=function(t,r){return e(t,x({},n,r,{shouldForwardProp:z(y,r,!0)})).apply(void 0,f)},y}},W=u(7434),H=u.n(W),J=u(7125),Y=u(6171);function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},X.apply(null,arguments)}const Z=G(Y.Icon,{target:"e1ko648l2",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"}),ee=G("div",{target:"e1ko648l1",label:"ForkApprovalContainer"})({name:"13alw87",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;flex-grow:0.2"}),te=G("div",{target:"e1ko648l0",label:"ForkButtonsContainer"})({name:"125bg8c",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;align-items:center"});class re extends n().Component{static propTypes={onLogin:H().func.isRequired,inProgress:H().bool,base_url:H().string,siteId:H().string,authEndpoint:H().string,config:H().object.isRequired,clearHash:H().func,t:H().func.isRequired};state={};componentDidMount(){H().checkPropTypes(re.propTypes,this.props,"prop","GitHubAuthenticationPage")}getPermissionToFork=()=>new Promise((e,t)=>{this.setState({requestingFork:!0,approveFork:()=>{this.setState({requestingFork:!1}),e()},refuseFork:()=>{this.setState({requestingFork:!1}),t()}})});loginWithOpenAuthoring(e){const{backend:t}=this.props;return this.setState({findingFork:!0}),t.authenticateWithFork({userData:e,getPermissionToFork:this.getPermissionToFork}).catch(e=>{throw this.setState({findingFork:!1}),console.error(e),e})}handleLogin=e=>{e.preventDefault();const t={base_url:this.props.base_url,site_id:"localhost"===document.location.host.split(":")[0]?"demo.decapcms.org":this.props.siteId,auth_endpoint:this.props.authEndpoint},r=new J.NetlifyAuthenticator(t),{open_authoring:n=!1,auth_scope:i=""}=this.props.config.backend,o=i||(n?"public_repo":"repo");r.authenticate({provider:"github",scope:o},(e,t)=>{if(!e)return n?this.loginWithOpenAuthoring(t).then(()=>this.props.onLogin(t)):void this.props.onLogin(t);this.setState({loginError:e.toString()})})};renderLoginButton=()=>{const{inProgress:e,t}=this.props;return e||this.state.findingFork?t("auth.loggingIn"):(0,S.jsx)(n().Fragment,null,(0,S.jsx)(Z,{type:"github"}),t("auth.loginWithGitHub"))};getAuthenticationPageRenderArgs(){const{requestingFork:e}=this.state;if(e){const{approveFork:e,refuseFork:t}=this.state;return{renderPageContent:({LoginButton:r,TextButton:n,showAbortButton:i})=>(0,S.jsx)(ee,null,(0,S.jsx)("p",null,"Open Authoring is enabled: we need to use a fork on your github account. (If a fork already exists, we'll use that.)"),(0,S.jsx)(te,null,(0,S.jsx)(r,{onClick:e},"Fork the repo"),i&&(0,S.jsx)(n,{onClick:t},"Don't fork the repo")))}}return{renderButtonContent:this.renderLoginButton}}render(){const{inProgress:e,config:t,t:r}=this.props,{loginError:n,requestingFork:i,findingFork:o}=this.state;return(0,S.jsx)(Y.AuthenticationPage,X({onLogin:this.handleLogin,loginDisabled:e||o||i,loginErrorMessage:n,logoUrl:t.logo_url,logo:t.logo,siteUrl:t.site_url},this.getAuthenticationPageRenderArgs(),{t:r}))}}var ne=u(1048).hp;const ie="3.7.8",oe=ie,ae="function"==typeof ne,se="function"==typeof TextDecoder?new TextDecoder:void 0,ue="function"==typeof TextEncoder?new TextEncoder:void 0,ce=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),le=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(ce),he=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,fe=String.fromCharCode.bind(String),pe="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),de=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),me=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),ye=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=ce[t>>18&63]+ce[t>>12&63]+ce[t>>6&63]+ce[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},ve="function"==typeof btoa?e=>btoa(e):ae?e=>ne.from(e,"binary").toString("base64"):ye,ge=ae?e=>ne.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(fe.apply(null,e.subarray(r,r+4096)));return ve(t.join(""))},be=(e,t=!1)=>t?de(ge(e)):ge(e),we=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?fe(192|t>>>6)+fe(128|63&t):fe(224|t>>>12&15)+fe(128|t>>>6&63)+fe(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fe(240|t>>>18&7)+fe(128|t>>>12&63)+fe(128|t>>>6&63)+fe(128|63&t)},Re=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ee=e=>e.replace(Re,we),ke=ae?e=>ne.from(e,"utf8").toString("base64"):ue?e=>ge(ue.encode(e)):e=>ve(Ee(e)),Oe=(e,t=!1)=>t?de(ke(e)):ke(e),xe=e=>Oe(e,!0),Se=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,_e=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fe((t>>>10)+55296)+fe(56320+(1023&t));case 3:return fe((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fe((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Ie=e=>e.replace(Se,_e),Te=e=>{if(e=e.replace(/\s+/g,""),!he.test(e))throw new TypeError("malformed base64.");let t,r,n;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=le[e.charAt(o++)]<<18|le[e.charAt(o++)]<<12|(r=le[e.charAt(o++)])<<6|(n=le[e.charAt(o++)]),64===r?i.push(fe(t>>16&255)):64===n?i.push(fe(t>>16&255,t>>8&255)):i.push(fe(t>>16&255,t>>8&255,255&t));return i.join("")},Ae="function"==typeof atob?e=>atob(me(e)):ae?e=>ne.from(e,"base64").toString("binary"):Te,Pe=ae?e=>pe(ne.from(e,"base64")):e=>pe(Ae(e).split("").map(e=>e.charCodeAt(0))),Ce=e=>Pe(qe(e)),Ne=ae?e=>ne.from(e,"base64").toString("utf8"):se?e=>se.decode(Pe(e)):e=>Ie(Ae(e)),qe=e=>me(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Fe=e=>Ne(qe(e)),De=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Be=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,De(t));e("fromBase64",function(){return Fe(this)}),e("toBase64",function(e){return Oe(this,e)}),e("toBase64URI",function(){return Oe(this,!0)}),e("toBase64URL",function(){return Oe(this,!0)}),e("toUint8Array",function(){return Ce(this)})},Le=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,De(t));e("toBase64",function(e){return be(this,e)}),e("toBase64URI",function(){return be(this,!0)}),e("toBase64URL",function(){return be(this,!0)})},Me={version:ie,VERSION:oe,atob:Ae,atobPolyfill:Te,btoa:ve,btoaPolyfill:ye,fromBase64:Fe,toBase64:Oe,encode:Oe,encodeURI:xe,encodeURL:xe,utob:Ee,btou:Ie,decode:Fe,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:be,toUint8Array:Ce,extendString:Be,extendUint8Array:Le,extendBuiltins:()=>{Be(),Le()}};var Ue=u(7715),je=u.n(Ue),$e=u(8087),Qe=u.n($e),Ve=u(578),ze=u.n(Ve),Ke=u(1034),Ge=u.n(Ke),We=u(107),He=u.n(We),Je=u(9942);const Ye="GitHub",Xe=-1;var Ze=function(e){return e.Error="error",e.Failure="failure",e.Pending="pending",e.Success="success",e}(Ze||{});let et=function(e){return e.Open="open",e.Closed="closed",e.All="all",e}({});function tt(e,t){return e.labels.some(e=>(0,O.isCMSLabel)(e.name,t))}function rt(e){return e.reduce((e,t)=>("removed"===t.status?e.push({sha:null,path:t.filename}):"renamed"===t.status?(e.push({sha:null,path:t.previous_filename}),e.push({sha:t.sha,path:t.filename})):e.push({sha:t.sha,path:t.filename}),e),[])}let nt=!1;class it{constructor(e){this.apiRoot=e.apiRoot||"https://api.github.com",this.token=e.token||"",this.tokenKeyword=e.tokenKeyword||"token",this.branch=e.branch||"master",this.useOpenAuthoring=e.useOpenAuthoring,this.repo=e.repo||"",this.originRepo=e.originRepo||this.repo,this.repoURL=`/repos/${this.repo}`,this.originRepoURL=`/repos/${this.originRepo}`;const[t,r]=[this.repo.split("/"),this.originRepo.split("/")];this.repoOwner=t[0],this.repoName=t[1],this.originRepoOwner=r[0],this.originRepoName=r[1],this.mergeMethod=e.squashMerges?"squash":"merge",this.cmsLabelPrefix=e.cmsLabelPrefix,this.initialWorkflowStatus=e.initialWorkflowStatus,this.baseUrl=e.baseUrl,this.getUser=e.getUser}static DEFAULT_COMMIT_MESSAGE="Automatically generated by Decap CMS";user(){return this._userPromise||(this._userPromise=this.getUser({token:this.token})),this._userPromise.then(e=>({name:e.name||"Unknown",login:e.login,email:e.email??void 0}))}async hasWriteAccess(){try{const e=await this.request(this.repoURL);return this.repoOwner=e.owner.login,e.permissions?.push??!1}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}reset(){}requestHeaders(e={}){const t={"Content-Type":"application/json; charset=utf-8",...e};return this.token?(t.Authorization=`${this.tokenKeyword} ${this.token}`,Promise.resolve(t)):Promise.resolve(t)}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),this.apiRoot+e}parseResponse(e){const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text().then(t=>e.ok?t:Promise.reject(t))}handleRequestError(e,t){throw new O.APIError(e.message,t,Ye)}buildRequest(e){return e}async request(e,t={},r=e=>this.parseResponse(e)){t={cache:"no-cache",...t};const n=await this.requestHeaders(t.headers||{}),i=this.urlFor(e,t);let o=500;try{const e=O.unsentRequest.fromFetchArguments(i,{...t,headers:n}),a=await(0,O.requestWithBackoff)(this,e);return o=a.status,await r(a)}catch(e){return this.handleRequestError(e,o)}}nextUrlProcessor(){return e=>e}async requestAllPages(e,t={}){t={cache:"no-cache",...t};const r=await this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),i=await(0,O.getAllResponses)(n,{...t,headers:r},"next",this.nextUrlProcessor()),o=await Promise.all(i.map(e=>this.parseResponse(e)));return[].concat(...o)}generateContentKey(e,t){const r=(0,O.generateContentKey)(e,t);return this.useOpenAuthoring?`${this.repo}/${r}`:r}parseContentKey(e){return this.useOpenAuthoring?(0,O.parseContentKey)(e.slice(this.repo.length+1)):(0,O.parseContentKey)(e)}checkMetadataRef(){return this.request(`${this.repoURL}/git/refs/meta/_decap_cms`).then(e=>e.object).catch(()=>this.uploadBlob({raw:"# Decap CMS\n\nThis tree is used by the Decap CMS to store metadata information for specific files and branches."}).then(e=>this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({tree:[{path:"README.md",mode:"100644",type:"blob",sha:e.sha}]})})).then(e=>this.commit("First Commit",e)).then(e=>this.createRef("meta","_decap_cms",e.sha)).then(e=>e.object))}async storeMetadata(e,t){return this._metadataSemaphore||(this._metadataSemaphore=o()(1)),new Promise((r,n)=>this._metadataSemaphore?.take(async()=>{try{const n=await this.checkMetadataRef(),i={path:`${e}.json`,raw:JSON.stringify(t)};await this.uploadBlob(i);const o=await this.updateTree(n.sha,[i]),{sha:a}=await this.commit(`Updating “${e}” metadata`,o);await this.patchRef("meta","_decap_cms",a),await O.localForage.setItem(`gh.meta.${e}`,{expires:Date.now()+3e5,data:t}),this._metadataSemaphore?.leave(),r()}catch(e){n(e)}}))}deleteMetadata(e){return this._metadataSemaphore||(this._metadataSemaphore=o()(1)),new Promise(t=>this._metadataSemaphore?.take(async()=>{try{const r=await this.checkMetadataRef(),n={path:`${e}.json`,sha:null},i=await this.updateTree(r.sha,[n]),{sha:o}=await this.commit(`Deleting “${e}” metadata`,i);await this.patchRef("meta","_decap_cms",o),this._metadataSemaphore?.leave(),t()}catch(e){this._metadataSemaphore?.leave(),t()}}))}async retrieveMetadataOld(e){console.log("%c Checking for MetaData files","line-height: 30px;text-align: center;font-weight: bold");const t={params:{ref:"refs/meta/_decap_cms"},headers:{Accept:"application/vnd.github.v3.raw"}};function r(t){throw"Not Found"===t.message&&console.log("%c %s does not have metadata","line-height: 30px;text-align: center;font-weight: bold",e),t}if(!this.useOpenAuthoring)return await this.request(`${this.repoURL}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(r);const[n,i]=e.split("/");return this.request(`/repos/${n}/${i}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(r)}async getPullRequests(e,t,r){return(await this.requestAllPages(`${this.originRepoURL}/pulls`,{params:{...e?{head:await this.getHeadReference(e)}:{},base:this.branch,state:t,per_page:100}})).filter(e=>e.head.ref.startsWith(`${O.CMS_BRANCH_PREFIX}/`)&&r(e))}async getOpenAuthoringPullRequest(e,t){const r=await this.getBranch(e).catch(()=>{throw new O.EditorialWorkflowError("content is not under editorial workflow",!0)}),n=t.filter(e=>e.head.sha===r.commit.sha)[0];if(n){n.labels=n.labels.filter(e=>!(0,O.isCMSLabel)(e.name,this.cmsLabelPrefix));const e=n.state===et.Closed?{name:(0,O.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}:{name:(0,O.statusToLabel)("pending_review",this.cmsLabelPrefix)};return n.labels.push(e),n}try{return{head:{sha:r.commit.sha},number:Xe,labels:[{name:(0,O.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}],state:et.Open}}catch(e){throw new O.EditorialWorkflowError("content is not under editorial workflow",!0)}}async getBranchPullRequest(e){if(this.useOpenAuthoring){const t=await this.getPullRequests(e,et.All,()=>!0);return this.getOpenAuthoringPullRequest(e,t)}{const t=await this.getPullRequests(e,et.Open,e=>tt(e,this.cmsLabelPrefix));if(t.length<=0)throw new O.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}}async getPullRequestCommits(e){if(e===Xe)return[];try{return await this.request(`${this.originRepoURL}/pulls/${e}/commits`)}catch(e){return console.log(e),[]}}async getPullRequestAuthor(e){if(e.user?.login)try{const t=await this.request(`/users/${e.user.login}`);return t.name||t.login}catch{return}}async retrieveUnpublishedEntryData(e){const{collection:t,slug:r}=this.parseContentKey(e),n=(0,O.branchFromContentKey)(e),i=await this.getBranchPullRequest(n),[{files:o},a]=await Promise.all([this.getDifferences(this.branch,i.head.sha),this.getPullRequestAuthor(i)]),s=await Promise.all((o||[]).map(e=>this.diffFromFile(e))),u=i.labels.find(e=>(0,O.isCMSLabel)(e.name,this.cmsLabelPrefix)),c=(0,O.labelToStatus)(u.name,this.cmsLabelPrefix),l=i.updated_at;return{collection:t,slug:r,status:c,diffs:s.map(e=>({path:e.path,newFile:e.newFile,id:e.sha})),updatedAt:l,pullRequestAuthor:a}}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await this.fetchBlobContent({sha:t,repoURL:n,parseText:i})}async readFileMetadata(e,t){const r=await(0,O.readFileMetadata)(t,async()=>{try{const t=await this.request(`${this.originRepoURL}/commits`,{params:{path:e,sha:this.branch}}),{commit:r}=t[0];return{author:r.author?.name||r.author?.email||"",updatedOn:r.author?.date||""}}catch(e){return{author:"",updatedOn:""}}},O.localForage);return r}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){const n=await this.request(`${t}/git/blobs/${e}`,{cache:"force-cache"});if(r)return Me.decode(n.content);{const e=Me.atob(n.content),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Blob([t])}}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={}){const i=He()(e,"/");try{return(await this.request(`${t}/git/trees/${r}:${i}`,{params:n>1?{recursive:1}:{}})).tree.filter(e=>"blob"===e.type&&e.path&&e.path.split("/").length<=n).map(e=>({type:e.type,id:e.sha,name:(0,O.basename)(e.path),path:`${i}/${e.path}`,size:e.size||0}))}catch(e){if(e&&404===e.status)return console.log("This 404 was expected and handled appropriately."),[];throw e}}filterOpenAuthoringBranches=async e=>{try{const t=await this.getBranchPullRequest(e),{state:r,merged_at:n}=t;return t.number!==Xe&&r===et.Closed&&n?(await this.deleteBranch(e),{branch:e,filter:!1}):{branch:e,filter:!0}}catch(t){return{branch:e,filter:!1}}};async migrateToVersion1(e,t){const r=e.head.ref.slice(4),n=`${t.collection}/${r}`,i=`cms/${n}`;await this.getBranch(i).catch(()=>{})||await this.createBranch(i,e.head.sha);const o=(await this.getPullRequests(i,et.All,()=>!0))[0]||await this.createPR(e.title,i),a={...t,pr:{number:o.number,head:o.head.sha},branch:i,version:"1"};return await this.storeMetadata(n,a),await this.closePR(e.number),await this.deleteBranch(e.head.ref),await this.deleteMetadata(r),{metadata:a,pullRequest:o}}async migrateToPullRequestLabels(e,t){await this.setPullRequestStatus(e,t.status);const r=e.head.ref.slice(4);await this.deleteMetadata(r)}async migratePullRequest(e,t){const{number:r}=e;console.log(`Migrating Pull Request '${r}' (${t})`);const n=(0,O.contentKeyFromBranch)(e.head.ref);let i=await this.retrieveMetadataOld(n).catch(()=>{});if(!i)return void console.log(`Skipped migrating Pull Request '${r}' (${t})`);let o=r;if(!i.version){console.log(`Migrating Pull Request '${r}' to version 1`);try{({metadata:i,pullRequest:e}=await this.migrateToVersion1(e,i))}catch(e){return console.log(`Failed to migrate Pull Request '${r}' to version 1. See error below.`),void console.error(e)}o=e.number,console.log(`Done migrating Pull Request '${r}' to version 1. New pull request '${o}' created.`)}"1"===i.version&&(console.log(`Migrating Pull Request '${o}' to labels`),await this.migrateToPullRequestLabels(e,i),console.log(`Done migrating Pull Request '${o}' to labels`)),console.log(`Done migrating Pull Request '${r===o?o:`${r} => ${o}`}'`)}async getOpenAuthoringBranches(){return await this.requestAllPages(`${this.repoURL}/git/refs/heads/cms/${this.repo}`).catch(()=>[])}async listUnpublishedBranches(){let e;if(console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),this.useOpenAuthoring){e=(await this.getOpenAuthoringBranches()).map(e=>e.ref.slice(11));const t=await Promise.all(e.map(e=>this.filterOpenAuthoringBranches(e)));e=t.filter(e=>e.filter).map(e=>e.branch)}else{const t=await this.getPullRequests(void 0,et.Open,e=>!e.head.repo.fork&&function(e,t){return e.labels.every(e=>!(0,O.isCMSLabel)(e.name,t))}(e,this.cmsLabelPrefix));let r=0;for(const e of t)nt||(nt=!0,alert(E`
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("decap-cms-lib-util"),require("@emotion/react"),require("react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):"function"==typeof define&&define.amd?define("DecapCmsBackendGithub",["decap-cms-lib-util","@emotion/react","react","prop-types","decap-cms-lib-auth","decap-cms-ui-default"],t):"object"==typeof exports?exports.DecapCmsBackendGithub=t(require("decap-cms-lib-util"),require("@emotion/react"),require("react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):e.DecapCmsBackendGithub=t(e.DecapCmsLibUtil,e.DecapCmsDefaultExports.EmotionCore,e.React,e.DecapCmsDefaultExports.PropTypes,e.DecapCmsLibAuth,e.DecapCmsUiDefault)}(window,(e,t,r,n,i,a)=>(()=>{var o={8244(e){e.exports={__schema:{types:[{kind:"INTERFACE",name:"Node",possibleTypes:[{name:"AddedToProjectEvent"},{name:"App"},{name:"AssignedEvent"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"Blob"},{name:"Bot"},{name:"BranchProtectionRule"},{name:"ClosedEvent"},{name:"CodeOfConduct"},{name:"CommentDeletedEvent"},{name:"Commit"},{name:"CommitComment"},{name:"CommitCommentThread"},{name:"ConvertedNoteToIssueEvent"},{name:"CrossReferencedEvent"},{name:"DemilestonedEvent"},{name:"DeployKey"},{name:"DeployedEvent"},{name:"Deployment"},{name:"DeploymentEnvironmentChangedEvent"},{name:"DeploymentStatus"},{name:"ExternalIdentity"},{name:"Gist"},{name:"GistComment"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"Issue"},{name:"IssueComment"},{name:"Label"},{name:"LabeledEvent"},{name:"Language"},{name:"License"},{name:"LockedEvent"},{name:"Mannequin"},{name:"MarketplaceCategory"},{name:"MarketplaceListing"},{name:"MentionedEvent"},{name:"MergedEvent"},{name:"Milestone"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"Organization"},{name:"OrganizationIdentityProvider"},{name:"OrganizationInvitation"},{name:"PinnedEvent"},{name:"Project"},{name:"ProjectCard"},{name:"ProjectColumn"},{name:"PublicKey"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"},{name:"PullRequestReviewThread"},{name:"PushAllowance"},{name:"Reaction"},{name:"ReadyForReviewEvent"},{name:"Ref"},{name:"ReferencedEvent"},{name:"RegistryPackage"},{name:"RegistryPackageDependency"},{name:"RegistryPackageFile"},{name:"RegistryPackageTag"},{name:"RegistryPackageVersion"},{name:"Release"},{name:"ReleaseAsset"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"Repository"},{name:"RepositoryInvitation"},{name:"RepositoryTopic"},{name:"ReviewDismissalAllowance"},{name:"ReviewDismissedEvent"},{name:"ReviewRequest"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewRequestedEvent"},{name:"SavedReply"},{name:"SecurityAdvisory"},{name:"SponsorsListing"},{name:"Sponsorship"},{name:"Status"},{name:"StatusContext"},{name:"SubscribedEvent"},{name:"Tag"},{name:"Team"},{name:"Topic"},{name:"TransferredEvent"},{name:"Tree"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"},{name:"User"},{name:"UserBlockedEvent"},{name:"UserContentEdit"},{name:"UserStatus"}]},{kind:"INTERFACE",name:"UniformResourceLocatable",possibleTypes:[{name:"Bot"},{name:"ClosedEvent"},{name:"Commit"},{name:"CrossReferencedEvent"},{name:"Gist"},{name:"Issue"},{name:"Mannequin"},{name:"MergedEvent"},{name:"Milestone"},{name:"Organization"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"ReadyForReviewEvent"},{name:"Release"},{name:"Repository"},{name:"RepositoryTopic"},{name:"ReviewDismissedEvent"},{name:"User"}]},{kind:"INTERFACE",name:"Actor",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RegistryPackageOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"ProjectOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"Closable",possibleTypes:[{name:"Issue"},{name:"Milestone"},{name:"Project"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Updatable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"Project"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"UNION",name:"ProjectCardItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Assignable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Comment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"UpdatableComment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Labelable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Lockable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"RegistryPackageSearch",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RepositoryOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"MemberStatusable",possibleTypes:[{name:"Organization"},{name:"Team"}]},{kind:"INTERFACE",name:"ProfileOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"PinnableItem",possibleTypes:[{name:"Gist"},{name:"Repository"}]},{kind:"INTERFACE",name:"Starrable",possibleTypes:[{name:"Gist"},{name:"Repository"},{name:"Topic"}]},{kind:"INTERFACE",name:"RepositoryInfo",possibleTypes:[{name:"Repository"}]},{kind:"INTERFACE",name:"GitObject",possibleTypes:[{name:"Blob"},{name:"Commit"},{name:"Tag"},{name:"Tree"}]},{kind:"INTERFACE",name:"RepositoryNode",possibleTypes:[{name:"CommitComment"},{name:"CommitCommentThread"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Subscribable",possibleTypes:[{name:"Commit"},{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Deletable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"IssueComment"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Reactable",possibleTypes:[{name:"CommitComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"GitSignature",possibleTypes:[{name:"GpgSignature"},{name:"SmimeSignature"},{name:"UnknownSignature"}]},{kind:"UNION",name:"RequestedReviewer",possibleTypes:[{name:"User"},{name:"Team"},{name:"Mannequin"}]},{kind:"UNION",name:"PullRequestTimelineItem",possibleTypes:[{name:"Commit"},{name:"CommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestReviewComment"},{name:"IssueComment"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"MergedEvent"},{name:"ReferencedEvent"},{name:"CrossReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefRestoredEvent"},{name:"HeadRefForcePushedEvent"},{name:"BaseRefForcePushedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewDismissedEvent"},{name:"UserBlockedEvent"}]},{kind:"UNION",name:"Closer",possibleTypes:[{name:"Commit"},{name:"PullRequest"}]},{kind:"UNION",name:"ReferencedSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"Assignee",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"MilestoneItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"RenamedTitleSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"PullRequestTimelineItems",possibleTypes:[{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestRevisionMarker"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"MergedEvent"},{name:"ReviewDismissedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReadyForReviewEvent"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"IssueOrPullRequest",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"IssueTimelineItem",possibleTypes:[{name:"Commit"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"ReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"UserBlockedEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"TransferredEvent"}]},{kind:"UNION",name:"IssueTimelineItems",possibleTypes:[{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"ReviewDismissalAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PushAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PermissionGranter",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Sponsorable",possibleTypes:[{name:"User"}]},{kind:"INTERFACE",name:"Contribution",possibleTypes:[{name:"CreatedCommitContribution"},{name:"CreatedIssueContribution"},{name:"CreatedPullRequestContribution"},{name:"CreatedPullRequestReviewContribution"},{name:"CreatedRepositoryContribution"},{name:"JoinedGitHubContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedRepositoryOrRestrictedContribution",possibleTypes:[{name:"CreatedRepositoryContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedIssueOrRestrictedContribution",possibleTypes:[{name:"CreatedIssueContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedPullRequestOrRestrictedContribution",possibleTypes:[{name:"CreatedPullRequestContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"SearchResultItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"User"},{name:"Organization"},{name:"MarketplaceListing"},{name:"App"}]},{kind:"UNION",name:"CollectionItemContent",possibleTypes:[{name:"Repository"},{name:"Organization"},{name:"User"}]}]}}},6075(e){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=a.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(o="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(o&&(o+=","),o+=JSON.stringify(c)+":"+l)}return a.splice(s,1),"{"+o+"}"}}(e)}},4077(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(1880)),i=a(r(7020));function a(e){return e&&e.__esModule?e:{default:e}}},3216(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(7020))&&n.__esModule?n:{default:n};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map(function(r){return r+": "+o(e[r],t)}).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},1880(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},7020(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},3378(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(4077))&&n.__esModule?n:{default:n},a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},4758(e,t){"use strict";function r(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function n(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:10===e.charCodeAt(o+1)&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===a||i<a)&&(a=i),n=!1}return null!==(t=a)&&void 0!==t?t:0}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringValue=function(e){var t=e.split(/\r\n|[\n\r]/g),i=n(e);if(0!==i)for(var a=1;a<t.length;a++)t[a]=t[a].slice(i);for(var o=0;o<t.length&&r(t[o]);)++o;for(var s=t.length;s>o&&r(t[s-1]);)--s;return t.slice(o,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}},3230(e,t,r){"use strict";t.y=function(e){return(0,n.visit)(e,{leave:a})};var n=r(8048),i=r(4758),a={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=c("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+c(" = ",n)+c(" ",s(i," "))},SelectionSet:function(e){return u(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=c("",t,": ")+r,u=o+c("(",s(n,", "),")");return u.length>80&&(u=o+c("(\n",l(s(n,"\n")),"\n)")),s([u,s(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+c(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",c("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(c("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(c("",s(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+c("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:o(function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),u(r)]," ")}),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:o(function(e){return s(["scalar",e.name,s(e.directives," ")]," ")}),ObjectTypeDefinition:o(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")}),FieldDefinition:o(function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(p(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+": "+n+c(" ",s(i," "))}),InputValueDefinition:o(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,c("= ",n),s(i," ")]," ")}),InterfaceTypeDefinition:o(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")}),UnionTypeDefinition:o(function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")}),EnumTypeDefinition:o(function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),u(n)]," ")}),EnumValueDefinition:o(function(e){return s([e.name,s(e.directives," ")]," ")}),InputObjectTypeDefinition:o(function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),u(n)]," ")}),DirectiveDefinition:o(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(p(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")}),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),u(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),u(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),u(n)]," ")}};function o(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(r))&&void 0!==t?t:""}function u(e){return c("{\n",l(s(e,"\n")),"\n}")}function c(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function l(e){return c(" ",e.replace(/\n/g,"\n "))}function h(e){return-1!==e.indexOf("\n")}function p(e){return null!=e&&e.some(h)}},8048(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],h=-1,p=[],f=void 0,d=void 0,m=void 0,y=[],v=[],g=e;do{var b=++h===l.length,w=b&&0!==p.length;if(b){if(d=0===v.length?void 0:y[y.length-1],f=m,m=v.pop(),w){if(c)f=f.slice();else{for(var R={},E=0,k=Object.keys(f);E<k.length;E++){var S=k[E];R[S]=f[S]}f=R}for(var O=0,x=0;x<p.length;x++){var _=p[x][0],T=p[x][1];c&&(_-=O),c&&null===T?(f.splice(_,1),O++):f[_]=T}}h=n.index,l=n.keys,p=n.edits,c=n.inArray,n=n.prev}else{if(d=m?c?h:l[h]:void 0,null==(f=m?m[d]:g))continue;m&&y.push(d)}var P,I=void 0;if(!Array.isArray(f)){if(!(0,a.isNode)(f))throw new Error("Invalid AST Node: ".concat((0,i.default)(f),"."));var C=u(t,f.kind,b);if(C){if((I=C.call(t,f,d,m,y,v))===s)break;if(!1===I){if(!b){y.pop();continue}}else if(void 0!==I&&(p.push([d,I]),!b)){if(!(0,a.isNode)(I)){y.pop();continue}f=I}}}void 0===I&&w&&p.push([d,f]),b?y.pop():(n={inArray:c,index:h,keys:l,edits:p,prev:n},l=(c=Array.isArray(f))?f:null!==(P=r[f.kind])&&void 0!==P?P:[],h=-1,p=[],m&&v.push(m),m=f)}while(void 0!==n);return 0!==p.length&&(g=p[p.length-1][1]),g},t.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!1);if(i){var a=i.apply(e[n],arguments);if(!1===a)t[n]=r;else if(a===s)t[n]=s;else if(void 0!==a)return a}}},leave:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!0);if(i){var a=i.apply(e[n],arguments);if(a===s)t[n]=s;else if(void 0!==a&&!1!==a)return a}}else t[n]===r&&(t[n]=null)}}},t.getVisitFn=u,t.BREAK=t.QueryDocumentKeys=void 0;var n,i=(n=r(3216))&&n.__esModule?n:{default:n},a=r(3378),o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=o;var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}t.BREAK=s},5985(e,t,r){"use strict";var n=r(524),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return n.isMemo(e)?o:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var c=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(d){var i=f(r);i&&i!==d&&e(t,i,n)}var o=l(r);h&&(o=o.concat(h(r)));for(var s=u(t),m=u(r),y=0;y<o.length;++y){var v=o[y];if(!(a[v]||n&&n[v]||m&&m[v]||s&&s[v])){var g=p(r,v);try{c(t,v,g)}catch(e){}}}}return t}},5098(e,t,r){var n=r(3305),i=r(9361),a=r(1112),o=r(5276),s=r(7452);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},7553(e,t,r){var n=r(9747),i=r(5962);function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},1386(e,t,r){var n=r(2393),i=r(2049),a=r(7144),o=r(5071),s=r(3964);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},528(e,t,r){var n=r(9747),i=r(5962);function a(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},9770(e,t,r){var n=r(4715)(r(8942),"Map");e.exports=n},8250(e,t,r){var n=r(9753),i=r(5681),a=r(88),o=r(4732),s=r(9068);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},5650(e,t,r){var n=r(8942).Symbol;e.exports=n},9270(e,t,r){var n=r(4715)(r(8942),"WeakMap");e.exports=n},6912(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},9968(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},9756(e,t,r){var n=r(2478);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},5111(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},2837(e){e.exports=function(e){return e.split("")}},7034(e,t,r){var n=r(6285);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9747(e,t,r){var n=r(1580),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},7250(e){e.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}},7379(e,t,r){var n=r(5650),i=r(8870),a=r(9005),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},2478(e,t,r){var n=r(7250),i=r(9454),a=r(7706);e.exports=function(e,t,r){return t==t?a(e,t,r):n(e,i,r)}},9454(e){e.exports=function(e){return e!=e}},9624(e,t,r){var n=r(3655),i=r(4759),a=r(1580),o=r(4066),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,p=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||i(e))&&(n(e)?p:s).test(o(e))}},5962(e){e.exports=function(){}},3945(e,t,r){var n=r(2053),i=r(5234),a=r(796);e.exports=function(e,t){return a(i(e,t,n),e+"")}},4943(e,t,r){var n=r(2053),i=r(6065),a=i?function(e,t){return i.set(e,t),e}:n;e.exports=a},7403(e,t,r){var n=r(2619),i=r(2532),a=r(2053),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=o},3501(e){e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}},2291(e,t,r){var n=r(5650),i=r(5111),a=r(3142),o=r(1187),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return i(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},6403(e,t,r){var n=r(2945),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},3526(e,t,r){var n=r(3142),i=r(5187),a=r(6493),o=r(5243);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:a(o(e))}},8931(e,t,r){var n=r(3501);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},8774(e,t,r){var n=r(2478);e.exports=function(e,t){for(var r=e.length;r--&&n(t,e[r],0)>-1;);return r}},7905(e,t,r){var n=r(2478);e.exports=function(e,t){for(var r=-1,i=e.length;++r<i&&n(t,e[r],0)>-1;);return r}},4977(e){var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,c=r.length,l=t(o-s,0),h=Array(c+l),p=!i;++u<c;)h[u]=r[u];for(;++a<s;)(p||a<o)&&(h[n[a]]=e[a]);for(;l--;)h[u++]=e[a++];return h}},5755(e){var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,c=-1,l=r.length,h=t(o-u,0),p=Array(h+l),f=!i;++a<h;)p[a]=e[a];for(var d=a;++c<l;)p[d+c]=r[c];for(;++s<u;)(f||a<o)&&(p[d+n[s]]=e[a++]);return p}},4354(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},1950(e,t,r){var n=r(8942)["__core-js_shared__"];e.exports=n},3816(e){e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},6713(e,t,r){var n=r(4364),i=r(8942);e.exports=function(e,t,r){var a=1&t,o=n(e);return function t(){return(this&&this!==i&&this instanceof t?o:e).apply(a?r:this,arguments)}}},4364(e,t,r){var n=r(9747),i=r(1580);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),a=e.apply(r,t);return i(a)?a:r}}},2443(e,t,r){var n=r(6912),i=r(4364),a=r(3504),o=r(4216),s=r(6850),u=r(8813),c=r(8942);e.exports=function(e,t,r){var l=i(e);return function i(){for(var h=arguments.length,p=Array(h),f=h,d=s(i);f--;)p[f]=arguments[f];var m=h<3&&p[0]!==d&&p[h-1]!==d?[]:u(p,d);return(h-=m.length)<r?o(e,t,a,i.placeholder,void 0,p,m,void 0,void 0,r-h):n(this&&this!==c&&this instanceof i?l:e,this,p)}}},3504(e,t,r){var n=r(4977),i=r(5755),a=r(3816),o=r(4364),s=r(4216),u=r(6850),c=r(6591),l=r(8813),h=r(8942);e.exports=function e(t,r,p,f,d,m,y,v,g,b){var w=128&r,R=1&r,E=2&r,k=24&r,S=512&r,O=E?void 0:o(t);return function x(){for(var _=arguments.length,T=Array(_),P=_;P--;)T[P]=arguments[P];if(k)var I=u(x),C=a(T,I);if(f&&(T=n(T,f,d,k)),m&&(T=i(T,m,y,k)),_-=C,k&&_<b){var A=l(T,I);return s(t,r,e,x.placeholder,p,T,A,v,g,b-_)}var N=R?p:this,q=E?N[t]:t;return _=T.length,v?T=c(T,v):S&&_>1&&T.reverse(),w&&g<_&&(T.length=g),this&&this!==h&&this instanceof x&&(q=O||o(q)),q.apply(N,T)}}},6341(e,t,r){var n=r(6912),i=r(4364),a=r(8942);e.exports=function(e,t,r,o){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,h=o.length,p=Array(h+c),f=this&&this!==a&&this instanceof t?u:e;++l<h;)p[l]=o[l];for(;c--;)p[l++]=arguments[++i];return n(f,s?r:this,p)}}},4216(e,t,r){var n=r(6648),i=r(5512),a=r(5620);e.exports=function(e,t,r,o,s,u,c,l,h,p){var f=8&t;t|=f?32:64,4&(t&=~(f?64:32))||(t&=-4);var d=[e,t,s,f?u:void 0,f?c:void 0,f?void 0:u,f?void 0:c,l,h,p],m=r.apply(void 0,d);return n(e)&&i(m,d),m.placeholder=o,a(m,e,t)}},8638(e,t,r){var n=r(4943),i=r(6713),a=r(2443),o=r(3504),s=r(6341),u=r(5196),c=r(7028),l=r(5512),h=r(5620),p=r(7642),f=Math.max;e.exports=function(e,t,r,d,m,y,v,g){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var w=d?d.length:0;if(w||(t&=-97,d=m=void 0),v=void 0===v?v:f(p(v),0),g=void 0===g?g:p(g),w-=m?m.length:0,64&t){var R=d,E=m;d=m=void 0}var k=b?void 0:u(e),S=[e,t,r,d,m,R,E,y,v,g];if(k&&c(S,k),e=S[0],t=S[1],r=S[2],d=S[3],m=S[4],!(g=S[9]=void 0===S[9]?b?0:e.length:f(S[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)O=8==t||16==t?a(e,t,g):32!=t&&33!=t||m.length?o.apply(void 0,S):s(e,t,r,d);else var O=i(e,t,r);return h((k?n:l)(O,S),e,t)}},2532(e,t,r){var n=r(4715),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},4967(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5196(e,t,r){var n=r(6065),i=r(9071),a=n?function(e){return n.get(e)}:i;e.exports=a},961(e,t,r){var n=r(3476),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],a=i.call(n,t)?r.length:0;a--;){var o=r[a],s=o.func;if(null==s||s==e)return o.name}return t}},6850(e){e.exports=function(e){return e.placeholder}},4700(e,t,r){var n=r(9067);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},4715(e,t,r){var n=r(9624),i=r(155);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},8870(e,t,r){var n=r(5650),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},155(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8788(e){var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},3417(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},3305(e,t,r){var n=r(4497);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},9361(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112(e,t,r){var n=r(4497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},5276(e,t,r){var n=r(4497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},7452(e,t,r){var n=r(4497);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},9141(e){var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},9632(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=r??9007199254740991)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},5187(e,t,r){var n=r(3142),i=r(1187),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||o.test(e)||!a.test(e)||null!=t&&e in Object(t)}},9067(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6648(e,t,r){var n=r(7553),i=r(5196),a=r(961),o=r(3321);e.exports=function(e){var t=a(e),r=o[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},4759(e,t,r){var n,i=r(1950),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},2393(e){e.exports=function(){this.__data__=[],this.size=0}},2049(e,t,r){var n=r(7034),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},7144(e,t,r){var n=r(7034);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},5071(e,t,r){var n=r(7034);e.exports=function(e){return n(this.__data__,e)>-1}},3964(e,t,r){var n=r(7034);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},9753(e,t,r){var n=r(5098),i=r(1386),a=r(9770);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},5681(e,t,r){var n=r(4700);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},88(e,t,r){var n=r(4700);e.exports=function(e){return n(this,e).get(e)}},4732(e,t,r){var n=r(4700);e.exports=function(e){return n(this,e).has(e)}},9068(e,t,r){var n=r(4700);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},6853(e,t,r){var n=r(9011);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},7028(e,t,r){var n=r(4977),i=r(5755),a=r(8813),o="__lodash_placeholder__",s=Math.min;e.exports=function(e,t){var r=e[1],u=t[1],c=r|u,l=c<131,h=128==u&&8==r||128==u&&256==r&&e[7].length<=t[8]||384==u&&t[7].length<=t[8]&&8==r;if(!l&&!h)return e;1&u&&(e[2]=t[2],c|=1&r?0:4);var p=t[3];if(p){var f=e[3];e[3]=f?n(f,p,t[4]):p,e[4]=f?a(e[3],o):t[4]}return(p=t[5])&&(f=e[5],e[5]=f?i(f,p,t[6]):p,e[6]=f?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),128&u&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}},6065(e,t,r){var n=r(9270),i=n&&new n;e.exports=i},4497(e,t,r){var n=r(4715)(Object,"create");e.exports=n},9005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5234(e,t,r){var n=r(6912),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o<s;)u[o]=a[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=a[o];return c[t]=r(u),n(e,this,c)}}},3476(e){e.exports={}},6591(e,t,r){var n=r(4354),i=r(9632),a=Math.min;e.exports=function(e,t){for(var r=e.length,o=a(t.length,r),s=n(e);o--;){var u=t[o];e[o]=i(u,r)?s[u]:void 0}return e}},8813(e){var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,a=0,o=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,o[a++]=n)}return o}},8942(e,t,r){var n=r(4967),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},5512(e,t,r){var n=r(4943),i=r(3316)(n);e.exports=i},796(e,t,r){var n=r(7403),i=r(3316)(n);e.exports=i},5620(e,t,r){var n=r(8788),i=r(9141),a=r(796),o=r(33);e.exports=function(e,t,r){var s=t+"";return a(e,i(s,o(n(s),r)))}},3316(e){var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),a=16-(i-n);if(n=i,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7706(e){e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},2237(e,t,r){var n=r(2837),i=r(3417),a=r(2013);e.exports=function(e){return i(e)?a(e):n(e)}},6493(e,t,r){var n=r(6853),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)}),t});e.exports=o},6040(e,t,r){var n=r(1187);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},4066(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2945(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},2013(e){var t="\\ud800-\\udfff",r="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",a="[^"+t+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",l=c+u+"(?:\\u200d(?:"+[a,o,s].join("|")+")"+c+u+")*",h="(?:"+[a+n+"?",n,o,s,r].join("|")+")",p=RegExp(i+"(?="+i+")|"+h+l,"g");e.exports=function(e){return e.match(p)||[]}},33(e,t,r){var n=r(9968),i=r(9756),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(a,function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)}),e.sort()}},3410(e,t,r){var n=r(7553),i=r(528),a=r(4354);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=a(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},2619(e){e.exports=function(e){return function(){return e}}},6285(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2053(e){e.exports=function(e){return e}},7715(e,t,r){var n=r(3501);e.exports=function(e){return null!=e&&e.length?n(e,0,-1):[]}},3142(e){var t=Array.isArray;e.exports=t},3655(e,t,r){var n=r(7379),i=r(1580);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1187(e,t,r){var n=r(7379),i=r(547);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},8087(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},9011(e,t,r){var n=r(8250);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},9071(e){e.exports=function(){}},578(e,t,r){var n=r(3945),i=r(8638),a=r(6850),o=r(8813),s=n(function(e,t){var r=o(t,a(s));return i(e,32,void 0,t,r)});s.placeholder={},e.exports=s},1034(e,t,r){var n=r(3526),i=r(3655),a=r(6040);e.exports=function(e,t,r){var o=-1,s=(t=n(t,e)).length;for(s||(s=1,e=void 0);++o<s;){var u=null==e?void 0:e[a(t[o])];void 0===u&&(o=s,u=r),e=i(u)?u.call(e):u}return e}},3301(e,t,r){var n=r(6131),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7642(e,t,r){var n=r(3301);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},6131(e,t,r){var n=r(6403),i=r(1580),a=r(1187),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},5243(e,t,r){var n=r(2291);e.exports=function(e){return null==e?"":n(e)}},107(e,t,r){var n=r(2291),i=r(6403),a=r(8931),o=r(8774),s=r(7905),u=r(2237),c=r(5243);e.exports=function(e,t,r){if((e=c(e))&&(r||void 0===t))return i(e);if(!e||!(t=n(t)))return e;var l=u(e),h=u(t),p=s(l,h),f=o(l,h)+1;return a(l,p,f).join("")}},959(e,t,r){var n=r(2291),i=r(8931),a=r(7905),o=r(2237),s=r(5243),u=/^\s+/;e.exports=function(e,t,r){if((e=s(e))&&(r||void 0===t))return e.replace(u,"");if(!e||!(t=n(t)))return e;var c=o(e),l=a(c,o(t));return i(c,l).join("")}},3321(e,t,r){var n=r(7553),i=r(528),a=r(5962),o=r(3142),s=r(547),u=r(3410),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},9942(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),a=s,o=0;continue}}else if(2===n.length||1===n.length){n="",i=0,a=s,o=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===r&&-1!==o?++o:o=-1}return n}var n={resolve:function(){for(var e,n="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(n=o+"/"+n,i=47===o.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var a=e.length,o=a-i,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var u=r.length-s,c=o<u?o:u,l=-1,h=0;h<=c;++h){if(h===c){if(u>c){if(47===r.charCodeAt(s+h))return r.slice(s+h+1);if(0===h)return r.slice(s+h)}else o>c&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var p=e.charCodeAt(i+h);if(p!==r.charCodeAt(s+h))break;47===p&&(l=h)}var f="";for(h=i+l+1;h<=a;++h)h!==a&&47!==e.charCodeAt(h)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(s+l):(s+=l,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,a=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,u=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!o){i=n+1;break}}else-1===u&&(o=!1,u=n+1),s>=0&&(c===r.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=u))}return i===a?a=u:-1===a&&(a=e.length),e.slice(i,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){i=n+1;break}}else-1===a&&(o=!1,a=n+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var u=e.charCodeAt(s);if(47!==u)-1===i&&(a=!1,i=s+1),46===u?-1===r?r=s:1!==o&&(o=1):-1!==r&&(o=-1);else if(!a){n=s+1;break}}return-1===r||-1===i||0===o||1===o&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),a=47===i;a?(r.root="/",n=1):n=0;for(var o=-1,s=0,u=-1,c=!0,l=e.length-1,h=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===o?o=l:1!==h&&(h=1):-1!==o&&(h=-1);else if(!c){s=l+1;break}return-1===o||-1===u||0===h||1===h&&o===u-1&&o===s+1?-1!==u&&(r.base=r.name=0===s&&a?e.slice(1,u):e.slice(s,u)):(0===s&&a?(r.name=e.slice(1,o),r.base=e.slice(1,u)):(r.name=e.slice(s,o),r.base=e.slice(s,u)),r.ext=e.slice(o,u)),s>0?r.dir=e.slice(0,s-1):a&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},320(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function R(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case l:case h:case a:case s:case o:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case y:case m:case u:return e;default:return t}}case i:return t}}}function E(e){return R(e)===h}t.AsyncMode=l,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=u,t.Element=n,t.ForwardRef=p,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return E(e)||R(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return R(e)===c},t.isContextProvider=function(e){return R(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return R(e)===p},t.isFragment=function(e){return R(e)===a},t.isLazy=function(e){return R(e)===y},t.isMemo=function(e){return R(e)===m},t.isPortal=function(e){return R(e)===i},t.isProfiler=function(e){return R(e)===s},t.isStrictMode=function(e){return R(e)===o},t.isSuspense=function(e){return R(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===h||e===s||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===u||e.$$typeof===c||e.$$typeof===p||e.$$typeof===g||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=R},524(e,t,r){"use strict";e.exports=r(320)},1197(e,t){"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(e,t,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:i,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=i,t.jsxs=i},1085(e,t,r){"use strict";e.exports=r(1197)},3554(e){!function(){"use strict";var t=function(e){setTimeout(e,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(t=process.nextTick),e.exports=function(e){var r={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===r.firstHere){r.current++,r.firstHere=!0;var e=1}else e=0;var t={n:1};"function"==typeof arguments[0]?t.task=arguments[0]:t.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?t.task=arguments[1]:t.n=arguments[1]);var n=t.task;if(t.task=function(){n(r.leave)},r.current+t.n-e>r.capacity)return 1===e&&(r.current--,r.firstHere=!1),r.queue.push(t);r.current+=t.n-e,t.task(r.leave),1===e&&(r.firstHere=!1)},leave:function(e){if(e=e||1,r.current-=e,r.queue.length){var n=r.queue[0];n.n+r.current>r.capacity||(r.queue.shift(),r.current+=n.n,t(n.task))}else if(r.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,r.current+e<=r.capacity}};return r}}()},1158(e,t,r){"use strict";r.d(t,{A:()=>n}),e=r.hmd(e);const n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},8784(e,t,r){e.exports=r(4834).Observable},4834(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var a=function(){return"function"==typeof Symbol},o=function(e){return a()&&Boolean(Symbol[e])},s=function(e){return o(e)?Symbol[e]:"@@"+e};a()&&!o("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function h(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function p(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function f(e){return e instanceof E}function d(e){d.log?d.log(e):setTimeout(function(){throw e})}function m(e){Promise.resolve().then(function(){try{e()}catch(e){d(e)}})}function y(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=h(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function v(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";var n=e._observer;try{var i=h(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(v(e),!i)throw r;i.call(n,r);break;case"complete":v(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?y(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void m(function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(g(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)})):void g(e,t,r);e._queue.push({type:t,value:r})}}var w=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new R(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(v(this),y(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),R=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new w(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise(function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,a)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function a(){i.unsubscribe(),r()}})}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(p(this))(function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(p(this))(function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=p(this),n=arguments.length>1,i=!1,a=arguments[1];return new r(function(r){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||n)try{a=e(a,t)}catch(e){return r.error(e)}else a=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(a),r.complete()}})})}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=p(this);return new i(function(t){var n,a=0;return function e(o){n=o.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){a===r.length?(n=void 0,t.complete()):e(i.from(r[a++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}})}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=p(this);return new r(function(n){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=h(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return f(i)&&i.constructor===r?i:new r(function(e){return i.subscribe(e)})}if(o("iterator")&&(n=h(t,u)))return new r(function(e){m(function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}})});if(Array.isArray(t))return new r(function(e){m(function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)(function(e){m(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})}},{key:l,get:function(){return this}}]),e}();t.Observable=E,a()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},4119(e){"use strict";e.exports=r},8110(e){"use strict";e.exports=t},7434(e){"use strict";e.exports=n},7125(e){"use strict";e.exports=i},3135(t){"use strict";t.exports=e},6171(e){"use strict";e.exports=a}};const s={};function u(e){const t=s[e];if(void 0!==t)return t.exports;const r=s[e]={id:e,loaded:!1,exports:{}};return o[e].call(r.exports,r,r.exports,u),r.loaded=!0,r.exports}u.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],i=t[r++];u.o(e,n)?0===i&&r++:0===i?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:i})}else for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let c={};return(()=>{"use strict";u.d(c,{DecapCmsBackendGithub:()=>ks});var e,t,r=u(3554),n=u.n(r),i=u(959),a=u.n(i),o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=(e=["",""],t=["",""],Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),l=function(){function e(){for(var t=this,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return"function"==typeof e?t.interimTag.bind(t,e):"string"==typeof e?t.transformEndResult(e):(e=e.map(t.transformString.bind(t)),t.transformEndResult(e.reduce(t.processSubstitutions.bind(t,n))))},n.length>0&&Array.isArray(n[0])&&(n=n[0]),this.transformers=n.map(function(e){return"function"==typeof e?e():e}),this.tag}return o(e,[{key:"interimTag",value:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this.tag(s,e.apply(void 0,[t].concat(n)))}},{key:"processSubstitutions",value:function(e,t,r){var n=this.transformSubstitution(e.shift(),t);return"".concat(t,n,r)}},{key:"transformString",value:function(e){return this.transformers.reduce(function(e,t){return t.onString?t.onString(e):e},e)}},{key:"transformSubstitution",value:function(e,t){return this.transformers.reduce(function(e,r){return r.onSubstitution?r.onSubstitution(e,t):e},e)}},{key:"transformEndResult",value:function(e){return this.transformers.reduce(function(e,t){return t.onEndResult?t.onEndResult(e):e},e)}}]),e}();const h=l,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var r=t.match(/^[^\S\n]*(?=\S)/gm),n=r&&Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r.map(function(e){return e.length})));if(n){var i=new RegExp("^.{"+n+"}","gm");return t.replace(i,"")}return t}if("all"===e)return t.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+e)}}};var f={separator:"",conjunction:"",serial:!1};const d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;return{onSubstitution:function(t,r){if(Array.isArray(t)){var n=t.length,i=e.separator,a=e.conjunction,o=e.serial,s=r.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),a&&n>1){var u=t.lastIndexOf(i);t=t.slice(0,u)+(o?i:"")+" "+a+t.slice(u+1)}}return t}}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};new h(d({separator:","}),p,m),new h(d({separator:",",conjunction:"and"}),p,m),new h(d({separator:",",conjunction:"or"}),p,m);const y=function(e){return{onSubstitution:function(t,r){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}};var v=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e};new h(y("\n"),function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(v):v(e)?e:""}}},d,p,m);const g=function(e,t){return{onSubstitution:function(r,n){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==r?r:r.toString().replace(e,t)}}};new h(y("\n"),d,p,m,g(/&/g,"&amp;"),g(/</g,"&lt;"),g(/>/g,"&gt;"),g(/"/g,"&quot;"),g(/'/g,"&#x27;"),g(/`/g,"&#x60;"));const b=function(e,t){return{onEndResult:function(r){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return r.replace(e,t)}}},w=new h(b(/(?:\n(?:\s*))+/g," "),m);new h(b(/(?:\n\s*)/g,""),m),new h(d({separator:","}),b(/(?:\s+)/g," "),m),new h(d({separator:",",conjunction:"or"}),b(/(?:\s+)/g," "),m),new h(d({separator:",",conjunction:"and"}),b(/(?:\s+)/g," "),m),new h(d,p,m),new h(d,b(/(?:\s+)/g," "),m);const R=new h(p,m);new h(p("all"),m);var E=u(3135);function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k.apply(null,arguments)}var S=u(8110),O={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function x(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var _=/[A-Z]|^ms/g,T=/_EMO_([^_]+?)_([^]*?)_EMO_/g,P=function(e){return 45===e.charCodeAt(1)},I=function(e){return null!=e&&"boolean"!=typeof e},C=x(function(e){return P(e)?e:e.replace(_,"-$&").toLowerCase()}),A=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(T,function(e,t,r){return q={name:t,styles:r,next:q},t})}return 1===O[e]||P(e)||"number"!=typeof t||0===t?t:t+"px"};function N(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var i=r;if(1===i.anim)return q={name:i.name,styles:i.styles,next:q},i.name;var a=r;if(void 0!==a.styles){var o=a.next;if(void 0!==o)for(;void 0!==o;)q={name:o.name,styles:o.styles,next:q},o=o.next;return a.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=N(e,t,r[i])+";";else for(var a in r){var o=r[a];if("object"!=typeof o){var s=o;null!=t&&void 0!==t[s]?n+=a+"{"+t[s]+"}":I(s)&&(n+=C(a)+":"+A(a,s)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var u=N(e,t,o);switch(a){case"animation":case"animationName":n+=C(a)+":"+u+";";break;default:n+=a+"{"+u+"}"}}else for(var c=0;c<o.length;c++)I(o[c])&&(n+=C(a)+":"+A(a,o[c])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=q,u=r(e);return q=s,N(e,t,u)}}var c=r;if(null==t)return c;var l=t[c];return void 0!==l?l:c}var q,F=/label:\s*([^\s;{]+)\s*(;|$)/g;function D(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";q=void 0;var a=e[0];null==a||void 0===a.raw?(n=!1,i+=N(r,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=N(r,t,e[o]),n&&(i+=a[o]);F.lastIndex=0;for(var s,u="";null!==(s=F.exec(i));)u+="-"+s[1];var c=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:c,styles:i,next:q}}var $=u(4119),L=u.n($),M=!!$.useInsertionEffect&&$.useInsertionEffect,j=M||function(e){return e()};function U(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")}),n}M||$.useLayoutEffect;var B=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},Q=function(e,t,r){B(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}},V=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,K=x(function(e){return V.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),z=function(e){return"theme"!==e},G=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?K:z},W=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},H=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return B(t,r,n),j(function(){return Q(t,r,n)}),null},J=function e(t,r){var n,i,a=t.__emotion_real===t,o=a&&t.__emotion_base||t;void 0!==r&&(n=r.label,i=r.target);var s=W(t,r,a),u=s||G(o),c=!u("as");return function(){var l=arguments,h=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==n&&h.push("label:"+n+";"),null==l[0]||void 0===l[0].raw)h.push.apply(h,l);else{var p=l[0];h.push(p[0]);for(var f=l.length,d=1;d<f;d++)h.push(l[d],p[d])}var m=(0,S.withEmotionCache)(function(e,t,r){var n=c&&e.as||o,a="",l=[],p=e;if(null==e.theme){for(var f in p={},e)p[f]=e[f];p.theme=$.useContext(S.ThemeContext)}"string"==typeof e.className?a=U(t.registered,l,e.className):null!=e.className&&(a=e.className+" ");var d=D(h.concat(l),t.registered,p);a+=t.key+"-"+d.name,void 0!==i&&(a+=" "+i);var m=c&&void 0===s?G(n):u,y={};for(var v in e)c&&"as"===v||m(v)&&(y[v]=e[v]);return y.className=a,r&&(y.ref=r),$.createElement($.Fragment,null,$.createElement(H,{cache:t,serialized:d,isStringTag:"string"==typeof n}),$.createElement(n,y))});return m.displayName=void 0!==n?n:"Styled("+("string"==typeof o?o:o.displayName||o.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=o,m.__emotion_styles=h,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,n){return e(t,k({},r,n,{shouldForwardProp:W(m,n,!0)})).apply(void 0,h)},m}},Y=u(7434),X=u.n(Y),Z=u(7125),ee=u(6171),te=u(1085),re=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),ne=Math.abs,ie=String.fromCharCode,ae=Object.assign;function oe(e){return e.trim()}function se(e,t,r){return e.replace(t,r)}function ue(e,t){return e.indexOf(t)}function ce(e,t){return 0|e.charCodeAt(t)}function le(e,t,r){return e.slice(t,r)}function he(e){return e.length}function pe(e){return e.length}function fe(e,t){return t.push(e),e}var de=1,me=1,ye=0,ve=0,ge=0,be="";function we(e,t,r,n,i,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:de,column:me,length:o,return:""}}function Re(e,t){return ae(we("",null,null,"",null,null,0),e,{length:-e.length},t)}function Ee(){return ge=ve>0?ce(be,--ve):0,me--,10===ge&&(me=1,de--),ge}function ke(){return ge=ve<ye?ce(be,ve++):0,me++,10===ge&&(me=1,de++),ge}function Se(){return ce(be,ve)}function Oe(){return ve}function xe(e,t){return le(be,e,t)}function _e(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Te(e){return de=me=1,ye=he(be=e),ve=0,[]}function Pe(e){return be="",e}function Ie(e){return oe(xe(ve-1,Ne(91===e?e+2:40===e?e+1:e)))}function Ce(e){for(;(ge=Se())&&ge<33;)ke();return _e(e)>2||_e(ge)>3?"":" "}function Ae(e,t){for(;--t&&ke()&&!(ge<48||ge>102||ge>57&&ge<65||ge>70&&ge<97););return xe(e,Oe()+(t<6&&32==Se()&&32==ke()))}function Ne(e){for(;ke();)switch(ge){case e:return ve;case 34:case 39:34!==e&&39!==e&&Ne(ge);break;case 40:41===e&&Ne(e);break;case 92:ke()}return ve}function qe(e,t){for(;ke()&&e+ge!==57&&(e+ge!==84||47!==Se()););return"/*"+xe(t,ve-1)+"*"+ie(47===e?e:ke())}function Fe(e){for(;!_e(Se());)ke();return xe(e,ve)}var De="-ms-",$e="-moz-",Le="-webkit-",Me="comm",je="rule",Ue="decl",Be="@keyframes";function Qe(e,t){for(var r="",n=pe(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Ve(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ue:return e.return=e.return||e.value;case Me:return"";case Be:return e.return=e.value+"{"+Qe(e.children,n)+"}";case je:e.value=e.props.join(",")}return he(r=Qe(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ke(e){return Pe(ze("",null,null,null,[""],e=Te(e),0,[0],e))}function ze(e,t,r,n,i,a,o,s,u){for(var c=0,l=0,h=o,p=0,f=0,d=0,m=1,y=1,v=1,g=0,b="",w=i,R=a,E=n,k=b;y;)switch(d=g,g=ke()){case 40:if(108!=d&&58==ce(k,h-1)){-1!=ue(k+=se(Ie(g),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:k+=Ie(g);break;case 9:case 10:case 13:case 32:k+=Ce(d);break;case 92:k+=Ae(Oe()-1,7);continue;case 47:switch(Se()){case 42:case 47:fe(We(qe(ke(),Oe()),t,r),u);break;default:k+="/"}break;case 123*m:s[c++]=he(k)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:y=0;case 59+l:-1==v&&(k=se(k,/\f/g,"")),f>0&&he(k)-h&&fe(f>32?He(k+";",n,r,h-1):He(se(k," ","")+";",n,r,h-2),u);break;case 59:k+=";";default:if(fe(E=Ge(k,t,r,c,l,i,s,b,w=[],R=[],h),a),123===g)if(0===l)ze(k,t,E,E,w,a,h,s,R);else switch(99===p&&110===ce(k,3)?100:p){case 100:case 108:case 109:case 115:ze(e,E,E,n&&fe(Ge(e,E,E,0,0,i,s,b,i,w=[],h),R),i,R,h,s,n?w:R);break;default:ze(k,E,E,E,[""],R,0,s,R)}}c=l=f=0,m=v=1,b=k="",h=o;break;case 58:h=1+he(k),f=d;default:if(m<1)if(123==g)--m;else if(125==g&&0==m++&&125==Ee())continue;switch(k+=ie(g),g*m){case 38:v=l>0?1:(k+="\f",-1);break;case 44:s[c++]=(he(k)-1)*v,v=1;break;case 64:45===Se()&&(k+=Ie(ke())),p=Se(),l=h=he(b=k+=Fe(Oe())),g++;break;case 45:45===d&&2==he(k)&&(m=0)}}return a}function Ge(e,t,r,n,i,a,o,s,u,c,l){for(var h=i-1,p=0===i?a:[""],f=pe(p),d=0,m=0,y=0;d<n;++d)for(var v=0,g=le(e,h+1,h=ne(m=o[d])),b=e;v<f;++v)(b=oe(m>0?p[v]+" "+g:se(g,/&\f/g,p[v])))&&(u[y++]=b);return we(e,t,r,0===i?je:s,u,c,l)}function We(e,t,r){return we(e,t,r,Me,ie(ge),le(e,2,-2),0)}function He(e,t,r,n){return we(e,t,r,Ue,le(e,0,n),le(e,n+1,-1),n)}var Je=function(e,t,r){for(var n=0,i=0;n=i,i=Se(),38===n&&12===i&&(t[r]=1),!_e(i);)ke();return xe(e,ve)},Ye=new WeakMap,Xe=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ye.get(r))&&!n){Ye.set(e,!0);for(var i=[],a=function(e,t){return Pe(function(e,t){var r=-1,n=44;do{switch(_e(n)){case 0:38===n&&12===Se()&&(t[r]=1),e[r]+=Je(ve-1,t,r);break;case 2:e[r]+=Ie(n);break;case 4:if(44===n){e[++r]=58===Se()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=ie(n)}}while(n=ke());return e}(Te(e),t))}(t,i),o=r.props,s=0,u=0;s<a.length;s++)for(var c=0;c<o.length;c++,u++)e.props[u]=i[s]?a[s].replace(/&\f/g,o[c]):o[c]+" "+a[s]}}},Ze=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function et(e,t){switch(function(e,t){return 45^ce(e,0)?(((t<<2^ce(e,0))<<2^ce(e,1))<<2^ce(e,2))<<2^ce(e,3):0}(e,t)){case 5103:return Le+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Le+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Le+e+$e+e+De+e+e;case 6828:case 4268:return Le+e+De+e+e;case 6165:return Le+e+De+"flex-"+e+e;case 5187:return Le+e+se(e,/(\w+).+(:[^]+)/,Le+"box-$1$2"+De+"flex-$1$2")+e;case 5443:return Le+e+De+"flex-item-"+se(e,/flex-|-self/,"")+e;case 4675:return Le+e+De+"flex-line-pack"+se(e,/align-content|flex-|-self/,"")+e;case 5548:return Le+e+De+se(e,"shrink","negative")+e;case 5292:return Le+e+De+se(e,"basis","preferred-size")+e;case 6060:return Le+"box-"+se(e,"-grow","")+Le+e+De+se(e,"grow","positive")+e;case 4554:return Le+se(e,/([^-])(transform)/g,"$1"+Le+"$2")+e;case 6187:return se(se(se(e,/(zoom-|grab)/,Le+"$1"),/(image-set)/,Le+"$1"),e,"")+e;case 5495:case 3959:return se(e,/(image-set\([^]*)/,Le+"$1$`$1");case 4968:return se(se(e,/(.+:)(flex-)?(.*)/,Le+"box-pack:$3"+De+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Le+e+e;case 4095:case 3583:case 4068:case 2532:return se(e,/(.+)-inline(.+)/,Le+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(he(e)-1-t>6)switch(ce(e,t+1)){case 109:if(45!==ce(e,t+4))break;case 102:return se(e,/(.+:)(.+)-([^]+)/,"$1"+Le+"$2-$3$1"+$e+(108==ce(e,t+3)?"$3":"$2-$3"))+e;case 115:return~ue(e,"stretch")?et(se(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ce(e,t+1))break;case 6444:switch(ce(e,he(e)-3-(~ue(e,"!important")&&10))){case 107:return se(e,":",":"+Le)+e;case 101:return se(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Le+(45===ce(e,14)?"inline-":"")+"box$3$1"+Le+"$2$3$1"+De+"$2box$3")+e}break;case 5936:switch(ce(e,t+11)){case 114:return Le+e+De+se(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Le+e+De+se(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Le+e+De+se(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Le+e+De+e+e}return e}var tt=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Ue:e.return=et(e.value,e.length);break;case Be:return Qe([Re(e,{value:se(e.value,"@","@"+Le)})],n);case je:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Qe([Re(e,{props:[se(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return Qe([Re(e,{props:[se(t,/:(plac\w+)/,":"+Le+"input-$1")]}),Re(e,{props:[se(t,/:(plac\w+)/,":-moz-$1")]}),Re(e,{props:[se(t,/:(plac\w+)/,De+"input-$1")]})],n)}return""})}}],rt=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var n,i,a=e.stylisPlugins||tt,o={},s=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)o[t[r]]=!0;s.push(e)});var u,c,l,h,p=[Ve,(h=function(e){u.insert(e)},function(e){e.root||(e=e.return)&&h(e)})],f=(c=[Xe,Ze].concat(a,p),l=pe(c),function(e,t,r,n){for(var i="",a=0;a<l;a++)i+=c[a](e,t,r,n)||"";return i});i=function(e,t,r,n){u=r,Qe(Ke(e?e+"{"+t.styles+"}":t.styles),f),n&&(d.inserted[t.name]=!0)};var d={key:t,sheet:new re({key:t,container:n,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:i};return d.sheet.hydrate(s),d},nt=$.createContext("undefined"!=typeof HTMLElement?rt({key:"css"}):null),it=(nt.Provider,function(e){return(0,$.forwardRef)(function(t,r){var n=(0,$.useContext)(nt);return e(t,n,r)})}),at=$.createContext({}),ot={}.hasOwnProperty,st="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",ut=function(e,t){var r={};for(var n in t)ot.call(t,n)&&(r[n]=t[n]);return r[st]=e,r},ct=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return B(t,r,n),j(function(){return Q(t,r,n)}),null},lt=it(function(e,t,r){var n=e.css;"string"==typeof n&&void 0!==t.registered[n]&&(n=t.registered[n]);var i=e[st],a=[n],o="";"string"==typeof e.className?o=U(t.registered,a,e.className):null!=e.className&&(o=e.className+" ");var s=D(a,void 0,$.useContext(at));o+=t.key+"-"+s.name;var u={};for(var c in e)ot.call(e,c)&&"css"!==c&&c!==st&&(u[c]=e[c]);return u.className=o,r&&(u.ref=r),$.createElement($.Fragment,null,$.createElement(ct,{cache:t,serialized:s,isStringTag:"string"==typeof i}),$.createElement(i,u))}),ht=(u(5985),te.Fragment,function(e,t,r){return ot.call(t,"css")?te.jsx(lt,ut(e,t),r):te.jsx(e,t,r)}),pt=function(e,t,r){return ot.call(t,"css")?te.jsxs(lt,ut(e,t),r):te.jsxs(e,t,r)};const ft=J(ee.Icon,{target:"e1ko648l2",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"}),dt=J("div",{target:"e1ko648l1",label:"ForkApprovalContainer"})({name:"13alw87",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;flex-grow:0.2"}),mt=J("div",{target:"e1ko648l0",label:"ForkButtonsContainer"})({name:"125bg8c",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;align-items:center"});class yt extends L().Component{static propTypes={onLogin:X().func.isRequired,inProgress:X().bool,base_url:X().string,siteId:X().string,authEndpoint:X().string,config:X().object.isRequired,clearHash:X().func,t:X().func.isRequired};state={};componentDidMount(){X().checkPropTypes(yt.propTypes,this.props,"prop","GitHubAuthenticationPage")}getPermissionToFork=()=>new Promise((e,t)=>{this.setState({requestingFork:!0,approveFork:()=>{this.setState({requestingFork:!1}),e()},refuseFork:()=>{this.setState({requestingFork:!1}),t()}})});loginWithOpenAuthoring(e){const{backend:t}=this.props;return this.setState({findingFork:!0}),t.authenticateWithFork({userData:e,getPermissionToFork:this.getPermissionToFork}).catch(e=>{throw this.setState({findingFork:!1}),console.error(e),e})}handleLogin=e=>{e.preventDefault();const t={base_url:this.props.base_url,site_id:"localhost"===document.location.host.split(":")[0]?"demo.decapcms.org":this.props.siteId,auth_endpoint:this.props.authEndpoint},r=new Z.NetlifyAuthenticator(t),{open_authoring:n=!1,auth_scope:i=""}=this.props.config.backend,a=i||(n?"public_repo":"repo");r.authenticate({provider:"github",scope:a},(e,t)=>{if(!e)return n?this.loginWithOpenAuthoring(t).then(()=>this.props.onLogin(t)):void this.props.onLogin(t);this.setState({loginError:e.toString()})})};renderLoginButton=()=>{const{inProgress:e,t}=this.props;return e||this.state.findingFork?t("auth.loggingIn"):pt(L().Fragment,{children:[ht(ft,{type:"github"}),t("auth.loginWithGitHub")]})};getAuthenticationPageRenderArgs(){const{requestingFork:e}=this.state;if(e){const{approveFork:e,refuseFork:t}=this.state;return{renderPageContent:({LoginButton:r,TextButton:n,showAbortButton:i})=>pt(dt,{children:[ht("p",{children:"Open Authoring is enabled: we need to use a fork on your github account. (If a fork already exists, we'll use that.)"}),pt(mt,{children:[ht(r,{onClick:e,children:"Fork the repo"}),i&&ht(n,{onClick:t,children:"Don't fork the repo"})]})]})}}return{renderButtonContent:this.renderLoginButton}}render(){const{inProgress:e,config:t,t:r}=this.props,{loginError:n,requestingFork:i,findingFork:a}=this.state;return ht(ee.AuthenticationPage,{onLogin:this.handleLogin,loginDisabled:e||a||i,loginErrorMessage:n,logoUrl:t.logo_url,logo:t.logo,siteUrl:t.site_url,...this.getAuthenticationPageRenderArgs(),t:r})}}const vt="3.9.1",gt=vt,bt="function"==typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,wt="function"==typeof TextEncoder?new TextEncoder:void 0,Rt=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Et=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(Rt),kt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,St=String.fromCharCode.bind(String),Ot="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),xt=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),_t=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Tt=e=>{let t,r,n,i,a="";const o=e.length%3;for(let o=0;o<e.length;){if((r=e.charCodeAt(o++))>255||(n=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,a+=Rt[t>>18&63]+Rt[t>>12&63]+Rt[t>>6&63]+Rt[63&t]}return o?a.slice(0,o-3)+"===".substring(o):a},Pt="function"==typeof btoa?e=>btoa(e):Tt,It="function"==typeof Uint8Array.prototype.toBase64?e=>e.toBase64():e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(St.apply(null,e.subarray(r,r+4096)));return Pt(t.join(""))},Ct=(e,t=!1)=>t?xt(It(e)):It(e),At=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?St(192|t>>>6)+St(128|63&t):St(224|t>>>12&15)+St(128|t>>>6&63)+St(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return St(240|t>>>18&7)+St(128|t>>>12&63)+St(128|t>>>6&63)+St(128|63&t)},Nt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,qt=e=>e.replace(Nt,At),Ft=wt?e=>It(wt.encode(e)):e=>Pt(qt(e)),Dt=(e,t=!1)=>t?xt(Ft(e)):Ft(e),$t=e=>Dt(e,!0),Lt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Mt=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return St((t>>>10)+55296)+St(56320+(1023&t));case 3:return St((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return St((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},jt=e=>e.replace(Lt,Mt),Ut=e=>{if(e=e.replace(/\s+/g,""),!kt.test(e))throw new TypeError("malformed base64.");let t,r,n;e+="==".slice(2-(3&e.length));let i=[];for(let a=0;a<e.length;)t=Et[e.charAt(a++)]<<18|Et[e.charAt(a++)]<<12|(r=Et[e.charAt(a++)])<<6|(n=Et[e.charAt(a++)]),64===r?i.push(St(t>>16&255)):64===n?i.push(St(t>>16&255,t>>8&255)):i.push(St(t>>16&255,t>>8&255,255&t));return i.join("")},Bt="function"==typeof atob?e=>atob(_t(e)):Ut,Qt="function"==typeof Uint8Array.fromBase64?e=>Uint8Array.fromBase64(e):e=>Ot(Bt(e).split("").map(e=>e.charCodeAt(0))),Vt=e=>Qt(zt(e)),Kt=bt?e=>bt.decode(Qt(e)):e=>jt(Bt(e)),zt=e=>_t(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Gt=e=>Kt(zt(e)),Wt=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Ht=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,Wt(t));e("fromBase64",function(){return Gt(this)}),e("toBase64",function(e){return Dt(this,e)}),e("toBase64URI",function(){return Dt(this,!0)}),e("toBase64URL",function(){return Dt(this,!0)}),e("toUint8Array",function(){return Vt(this)})},Jt=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Wt(t));e("toBase64",function(e){return Ct(this,e)}),e("toBase64URI",function(){return Ct(this,!0)}),e("toBase64URL",function(){return Ct(this,!0)})},Yt={version:vt,VERSION:gt,atob:Bt,atobPolyfill:Ut,btoa:Pt,btoaPolyfill:Tt,fromBase64:Gt,toBase64:Dt,encode:Dt,encodeURI:$t,encodeURL:$t,utob:qt,btou:jt,decode:Gt,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:Ct,toUint8Array:Vt,extendString:Ht,extendUint8Array:Jt,extendBuiltins:()=>{Ht(),Jt()}};var Xt=u(7715),Zt=u.n(Xt),er=u(8087),tr=u.n(er),rr=u(578),nr=u.n(rr),ir=u(1034),ar=u.n(ir),or=u(107),sr=u.n(or),ur=u(9942);const cr="GitHub",{fetchWithTimeout:lr}=E.unsentRequest;var hr=function(e){return e.Error="error",e.Failure="failure",e.Pending="pending",e.Success="success",e}(hr||{});let pr=function(e){return e.Open="open",e.Closed="closed",e.All="all",e}({});function fr(e,t){return e.labels.some(e=>(0,E.isCMSLabel)(e.name,t))}function dr(e){return e.reduce((e,t)=>("removed"===t.status?e.push({sha:null,path:t.filename}):"renamed"===t.status?(e.push({sha:null,path:t.previous_filename}),e.push({sha:t.sha,path:t.filename})):e.push({sha:t.sha,path:t.filename}),e),[])}let mr=!1;class yr{constructor(e){this.apiRoot=e.apiRoot||"https://api.github.com",this.token=e.token||"",this.tokenKeyword=e.tokenKeyword||"token",this.branch=e.branch||"master",this.useOpenAuthoring=e.useOpenAuthoring,this.repo=e.repo||"",this.originRepo=e.originRepo||this.repo,this.repoURL=`/repos/${this.repo}`,this.originRepoURL=`/repos/${this.originRepo}`;const[t,r]=[this.repo.split("/"),this.originRepo.split("/")];this.repoOwner=t[0],this.repoName=t[1],this.originRepoOwner=r[0],this.originRepoName=r[1],this.mergeMethod=e.squashMerges?"squash":"merge",this.cmsLabelPrefix=e.cmsLabelPrefix,this.initialWorkflowStatus=e.initialWorkflowStatus,this.baseUrl=e.baseUrl,this.getUser=e.getUser}static DEFAULT_COMMIT_MESSAGE="Automatically generated by Decap CMS";user(){return this._userPromise||(this._userPromise=this.getUser({token:this.token})),this._userPromise.then(e=>({name:e.name||"Unknown",login:e.login,email:e.email??void 0}))}async hasWriteAccess(){try{const e=await this.request(this.repoURL);return this.repoOwner=e.owner.login,e.permissions?.push??!1}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}reset(){}requestHeaders(e={}){const t={"Content-Type":"application/json; charset=utf-8",...e};return this.token?(t.Authorization=`${this.tokenKeyword} ${this.token}`,Promise.resolve(t)):Promise.resolve(t)}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),this.apiRoot+e}parseResponse(e){const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text().then(t=>e.ok?t:Promise.reject(t))}handleRequestError(e,t){throw new E.APIError(e.message,t,cr)}buildRequest(e){return e}async request(e,t={},r=e=>this.parseResponse(e)){t={cache:"no-cache",...t};const n=await this.requestHeaders(t.headers||{}),i=this.urlFor(e,t);let a=500;try{const e=E.unsentRequest.fromFetchArguments(i,{...t,headers:n}),o=await(0,E.requestWithBackoff)(this,e);return a=o.status,await r(o)}catch(e){return this.handleRequestError(e,a)}}nextUrlProcessor(){return e=>e}async requestAllPages(e,t={}){t={cache:"no-cache",...t};const r=await this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),i=await(0,E.getAllResponses)(n,{...t,headers:r},"next",this.nextUrlProcessor()),a=await Promise.all(i.map(e=>this.parseResponse(e)));return[].concat(...a)}generateContentKey(e,t){const r=(0,E.generateContentKey)(e,t);return this.useOpenAuthoring?`${this.repo}/${r}`:r}parseContentKey(e){return this.useOpenAuthoring?(0,E.parseContentKey)(e.slice(this.repo.length+1)):(0,E.parseContentKey)(e)}checkMetadataRef(){return this.request(`${this.repoURL}/git/refs/meta/_decap_cms`).then(e=>e.object).catch(()=>this.uploadBlob({raw:"# Decap CMS\n\nThis tree is used by the Decap CMS to store metadata information for specific files and branches."}).then(e=>this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({tree:[{path:"README.md",mode:"100644",type:"blob",sha:e.sha}]})})).then(e=>this.commit("First Commit",e)).then(e=>this.createRef("meta","_decap_cms",e.sha)).then(e=>e.object))}async storeMetadata(e,t){return this._metadataSemaphore||(this._metadataSemaphore=n()(1)),new Promise((r,n)=>this._metadataSemaphore?.take(async()=>{try{const n=await this.checkMetadataRef(),i={path:`${e}.json`,raw:JSON.stringify(t)};await this.uploadBlob(i);const a=await this.updateTree(n.sha,[i]),{sha:o}=await this.commit(`Updating “${e}” metadata`,a);await this.patchRef("meta","_decap_cms",o),await E.localForage.setItem(`gh.meta.${e}`,{expires:Date.now()+3e5,data:t}),this._metadataSemaphore?.leave(),r()}catch(e){n(e)}}))}deleteMetadata(e){return this._metadataSemaphore||(this._metadataSemaphore=n()(1)),new Promise(t=>this._metadataSemaphore?.take(async()=>{try{const r=await this.checkMetadataRef(),n={path:`${e}.json`,sha:null},i=await this.updateTree(r.sha,[n]),{sha:a}=await this.commit(`Deleting “${e}” metadata`,i);await this.patchRef("meta","_decap_cms",a),this._metadataSemaphore?.leave(),t()}catch(e){this._metadataSemaphore?.leave(),t()}}))}async retrieveMetadataOld(e){console.log("%c Checking for MetaData files","line-height: 30px;text-align: center;font-weight: bold");const t={params:{ref:"refs/meta/_decap_cms"},headers:{Accept:"application/vnd.github.v3.raw"}};function r(t){throw"Not Found"===t.message&&console.log("%c %s does not have metadata","line-height: 30px;text-align: center;font-weight: bold",e),t}if(!this.useOpenAuthoring)return await this.request(`${this.repoURL}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(r);const[n,i]=e.split("/");return this.request(`/repos/${n}/${i}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(r)}async getPullRequests(e,t,r){return(await this.requestAllPages(`${this.originRepoURL}/pulls`,{params:{...e?{head:await this.getHeadReference(e)}:{},base:this.branch,state:t,per_page:100}})).filter(e=>e.head.ref.startsWith(`${E.CMS_BRANCH_PREFIX}/`)&&r(e))}async getOpenAuthoringPullRequest(e,t){const r=await this.getBranch(e).catch(()=>{throw new E.EditorialWorkflowError("content is not under editorial workflow",!0)}),n=t.filter(e=>e.head.sha===r.commit.sha)[0];if(n){n.labels=n.labels.filter(e=>!(0,E.isCMSLabel)(e.name,this.cmsLabelPrefix));const e=n.state===pr.Closed?{name:(0,E.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}:{name:(0,E.statusToLabel)("pending_review",this.cmsLabelPrefix)};return n.labels.push(e),n}try{return{head:{sha:r.commit.sha},number:-1,labels:[{name:(0,E.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}],state:pr.Open}}catch(e){throw new E.EditorialWorkflowError("content is not under editorial workflow",!0)}}async getBranchPullRequest(e){if(this.useOpenAuthoring){const t=await this.getPullRequests(e,pr.All,()=>!0);return this.getOpenAuthoringPullRequest(e,t)}{const t=await this.getPullRequests(e,pr.Open,e=>fr(e,this.cmsLabelPrefix));if(t.length<=0)throw new E.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}}async getPullRequestCommits(e){if(-1===e)return[];try{return await this.request(`${this.originRepoURL}/pulls/${e}/commits`)}catch(e){return console.log(e),[]}}async getPullRequestAuthor(e){if(e.user?.login)try{const t=await this.request(`/users/${e.user.login}`);return t.name||t.login}catch{return}}async retrieveUnpublishedEntryData(e){const{collection:t,slug:r}=this.parseContentKey(e),n=(0,E.branchFromContentKey)(e),i=await this.getBranchPullRequest(n),[{files:a},o]=await Promise.all([this.getDifferences(this.branch,i.head.sha),this.getPullRequestAuthor(i)]),s=await Promise.all((a||[]).map(e=>this.diffFromFile(e))),u=i.labels.find(e=>(0,E.isCMSLabel)(e.name,this.cmsLabelPrefix)),c=(0,E.labelToStatus)(u.name,this.cmsLabelPrefix),l=i.updated_at;return{collection:t,slug:r,status:c,diffs:s.map(e=>({path:e.path,newFile:e.newFile,id:e.sha})),updatedAt:l,pullRequestAuthor:o}}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await this.fetchBlobContent({sha:t,repoURL:n,parseText:i})}async readFileMetadata(e,t){const r=await(0,E.readFileMetadata)(t,async()=>{try{const t=await this.request(`${this.originRepoURL}/commits`,{params:{path:e,sha:this.branch}}),{commit:r}=t[0];return{author:r.author?.name||r.author?.email||"",updatedOn:r.author?.date||""}}catch(e){return{author:"",updatedOn:""}}},E.localForage);return r}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){const n=await this.request(`${t}/git/blobs/${e}`,{cache:"force-cache"});if(r)return Yt.decode(n.content);{const e=Yt.atob(n.content),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Blob([t])}}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={}){const i=sr()(e,"/");try{return(await this.request(`${t}/git/trees/${r}:${i}`,{params:n>1?{recursive:1}:{}})).tree.filter(e=>"blob"===e.type&&e.path&&e.path.split("/").length<=n).map(e=>({type:e.type,id:e.sha,name:(0,E.basename)(e.path),path:`${i}/${e.path}`,size:e.size||0}))}catch(e){if(e&&404===e.status)return console.log("This 404 was expected and handled appropriately."),[];throw e}}filterOpenAuthoringBranches=async e=>{try{const t=await this.getBranchPullRequest(e),{state:r,merged_at:n}=t;return-1!==t.number&&r===pr.Closed&&n?(await this.deleteBranch(e),{branch:e,filter:!1}):{branch:e,filter:!0}}catch(t){return{branch:e,filter:!1}}};async migrateToVersion1(e,t){const r=e.head.ref.slice(4),n=`${t.collection}/${r}`,i=`cms/${n}`;await this.getBranch(i).catch(()=>{})||await this.createBranch(i,e.head.sha);const a=(await this.getPullRequests(i,pr.All,()=>!0))[0]||await this.createPR(e.title,i),o={...t,pr:{number:a.number,head:a.head.sha},branch:i,version:"1"};return await this.storeMetadata(n,o),await this.closePR(e.number),await this.deleteBranch(e.head.ref),await this.deleteMetadata(r),{metadata:o,pullRequest:a}}async migrateToPullRequestLabels(e,t){await this.setPullRequestStatus(e,t.status);const r=e.head.ref.slice(4);await this.deleteMetadata(r)}async migratePullRequest(e,t){const{number:r}=e;console.log(`Migrating Pull Request '${r}' (${t})`);const n=(0,E.contentKeyFromBranch)(e.head.ref);let i=await this.retrieveMetadataOld(n).catch(()=>{});if(!i)return void console.log(`Skipped migrating Pull Request '${r}' (${t})`);let a=r;if(!i.version){console.log(`Migrating Pull Request '${r}' to version 1`);try{({metadata:i,pullRequest:e}=await this.migrateToVersion1(e,i))}catch(e){return console.log(`Failed to migrate Pull Request '${r}' to version 1. See error below.`),void console.error(e)}a=e.number,console.log(`Done migrating Pull Request '${r}' to version 1. New pull request '${a}' created.`)}"1"===i.version&&(console.log(`Migrating Pull Request '${a}' to labels`),await this.migrateToPullRequestLabels(e,i),console.log(`Done migrating Pull Request '${a}' to labels`)),console.log(`Done migrating Pull Request '${r===a?a:`${r} => ${a}`}'`)}async getOpenAuthoringBranches(){return await this.requestAllPages(`${this.repoURL}/git/refs/heads/cms/${this.repo}`).catch(()=>[])}async listUnpublishedBranches(){let e;if(console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),this.useOpenAuthoring){e=(await this.getOpenAuthoringBranches()).map(e=>e.ref.slice(11));const t=await Promise.all(e.map(e=>this.filterOpenAuthoringBranches(e)));e=t.filter(e=>e.filter).map(e=>e.branch)}else{const t=await this.getPullRequests(void 0,pr.Open,e=>!e.head.repo.fork&&function(e,t){return e.labels.every(e=>!(0,E.isCMSLabel)(e.name,t))}(e,this.cmsLabelPrefix));let r=0;for(const e of t)mr||(mr=!0,alert(w`
3
3
  Decap CMS is adding labels to ${t.length} of your Editorial Workflow
4
4
  entries. The "Workflow" tab will be unavailable during this migration. You may use other
5
5
  areas of the CMS during this time. Note that closing the CMS will pause the migration.
6
- `)),r+=1,await this.migratePullRequest(e,`${r} of ${t.length}`);e=(await this.getPullRequests(void 0,et.Open,e=>tt(e,this.cmsLabelPrefix))).map(e=>e.head.ref)}return e}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map(e=>({context:e.context,target_url:e.target_url||"",state:e.state===Ze.Success?O.PreviewState.Success:O.PreviewState.Other}))}async persistFiles(e,t,r){const n=t.concat(e),i=n.map(e=>this.uploadBlob(e));if(await Promise.all(i),r.useWorkflow){const i=t.map(({sha:e,path:t})=>({path:s()(t,"/"),sha:e})),o=e[0].slug;return this.editorialWorkflowGit(n,o,i,r)}return this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,n)).then(e=>this.commit(r.commitMessage,e)).then(e=>this.patchBranch(this.branch,e.sha))}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const n=e.split("/"),i=Qe()(n),o=je()(n).join("/"),a=`${t}/git/trees/${r}:${encodeURIComponent(o)}`,s=(await this.request(a)).tree.find(e=>e.path===i);if(s)return s.sha;throw new O.APIError("Not Found",404,Ye)}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const r=await this.getDefaultBranch(),n=e.map(e=>({path:e,sha:null})),i=await this.updateTree(r.commit.sha,n),o=await this.commit(t,i);await this.patchBranch(this.branch,o.sha)}async createBranchAndPullRequest(e,t,r){return await this.createBranch(e,t),this.createPR(r,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha||"",binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,r,n){const i=this.generateContentKey(n.collectionName,t),o=(0,O.branchFromContentKey)(i);if(n.unpublished){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=await Promise.all((t||[]).map(e=>this.diffFromFile(e))),a=[];for(const e of i.filter(e=>e.binary))r.some(t=>t.path===e.path)||a.push({path:e.path,sha:null});const s=await this.rebaseBranch(o),u=a.concat(e),c=await this.updateTree(s.sha,u,o),l=await this.commit(n.commitMessage,c);return this.patchBranch(o,l.sha,{force:!0})}{const t=await this.getDefaultBranch(),r=await this.updateTree(t.commit.sha,e),i=await this.commit(n.commitMessage,r);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,n.commitMessage);await this.setPullRequestStatus(e,n.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const r=this.useOpenAuthoring?10:1;for(let n=1;n<=r;n++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(n===r)throw console.warn(`Reached maximum number of attempts '${r}' for getDifferences`),e;await new Promise(e=>setTimeout(e,500*n))}throw new O.APIError("Not Found",404,Ye)}async rebaseSingleCommit(e,t){const r=rt((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(r.length>0){const n=await this.updateTree(e.sha,r),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,n.sha,[e.sha],o?{name:o.name||"",email:o.email||"",date:o.date}:void 0,a?{name:a.name||"",email:a.email||"",date:a.date}:void 0)}return t}async rebaseCommits(e,t){return 0===t.length||t[0].parents[0].sha===e.sha?Qe()(t):t.reduce((e,t)=>e.then(e=>{const r=e,n=t;return this.rebaseSingleCommit(r,n)}),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:r}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,r)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const r=[...e.labels.filter(e=>!(0,O.isCMSLabel)(e.name,this.cmsLabelPrefix)).map(e=>e.name),(0,O.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,r)}async updateUnpublishedEntryStatus(e,t,r){const n=this.generateContentKey(e,t),i=(0,O.branchFromContentKey)(n),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(o.number!==Xe){const{state:e}=o;e===et.Open&&"draft"===r&&await this.closePR(o.number),e===et.Closed&&"pending_review"===r&&await this.openPR(o.number)}else if("pending_review"===r){const e=(0,O.branchFromContentKey)(n),t=await this.getDifferences(this.branch,await this.getHeadReference(e)),r=t.commits[0]?.commit?.message||it.DEFAULT_COMMIT_MESSAGE;await this.createPR(r,e)}}else await this.setPullRequestStatus(o,r)}async deleteUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);i.number!==Xe&&await this.closePR(i.number),await this.deleteBranch(n)}async publishUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);await this.mergePR(i),await this.deleteBranch(n)}async createRef(e,t,r){return await this.request(`${this.repoURL}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:r})})}async patchRef(e,t,r,n={}){const i=n.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:r,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(`${O.CMS_BRANCH_PREFIX}/`),`${O.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(r){const n=String(r.message||"");if("Reference update failed"===n)await(0,O.throwOnConflictingBranches)(e,e=>this.getBranch(e),Ye);else if("Reference already exists"===n&&e.startsWith(`${O.CMS_BRANCH_PREFIX}/`))try{return await this.backupBranch(e),await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw r}}assertCmsBranch(e){return e.startsWith(`${O.CMS_BRANCH_PREFIX}/`)}patchBranch(e,t,r={}){const n=r.force||!1;if(n&&!this.assertCmsBranch(e))throw Error(`Only CMS branches can be force updated, cannot force update ${e}`);return this.patchRef("heads",e,t,{force:n})}deleteBranch(e){return this.deleteRef("heads",e).catch(e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e)))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(`${this.originRepoURL}/pulls`,{method:"POST",body:JSON.stringify({title:e,body:O.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){return console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:et.Open})})}async closePR(e){return console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:et.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:O.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof O.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=rt((await this.getDifferences(e.base.sha,e.head.sha)).files);let r="Automatically generated. Merged on Decap CMS\n\nForce merge of:";return t.forEach(e=>{r+=`\n* "${e.path}"`}),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,t)).then(e=>this.commit(r,e)).then(e=>this.patchBranch(this.branch,e.sha))}toBase64(e){return Promise.resolve(Me.encode(e))}async uploadBlob(e){const t=await Ge()(e,"toBase64",ze()(this.toBase64,e.raw)),r=await this.request(`${this.repoURL}/git/blobs`,{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=r.sha,e}async updateTree(e,t,r=this.branch){const n=[],i=t.reduce((e,t)=>{const r={path:s()(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?n.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(r),e},[]);for(const{from:e,to:t,sha:o}of n){const n=(0,Je.dirname)(e),a=(0,Je.dirname)(t),s=await this.listFiles(n,{branch:r,depth:100});for(const t of s)i.push({path:t.path,mode:"100644",type:"blob",sha:null}),i.push({path:t.path.replace(n,a),mode:"100644",type:"blob",sha:t.path===e?o:t.id})}return{...await this.createTree(e,i),parentSha:e}}async createTree(e,t){return await this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const r=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,r)}async createCommit(e,t,r,n,i){return await this.request(`${this.repoURL}/git/commits`,{method:"POST",body:JSON.stringify({message:e,tree:t,parents:r,author:n,committer:i})})}async getUnpublishedEntrySha(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r);return(await this.getBranchPullRequest(n)).head.sha}}var ot=function(e,t){return ot=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ot(e,t)};function at(e,t){function r(){this.constructor=e}ot(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var st=function(){return st=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},st.apply(this,arguments)};function ut(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})}function ct(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var lt=u(8048),ht=function(e,t){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ht(e,t)},ft="Invariant Violation",pt=Object.setPrototypeOf,dt=void 0===pt?function(e,t){return e.__proto__=t,e}:pt,mt=function(e){function t(r){void 0===r&&(r=ft);var n=e.call(this,"number"==typeof r?ft+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ft,dt(n,t.prototype),n}return function(e,t){function r(){this.constructor=e}ht(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);function yt(e,t){if(!e)throw new mt(t)}function vt(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=vt("warn"),e.error=vt("error")}(yt||(yt={}));var gt={env:{}};if("object"==typeof process)gt=process;else try{Function("stub","process = stub")(gt)}catch(e){}var bt=function(){return bt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},bt.apply(this,arguments)};function wt(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var Rt=u(6075),Et=u.n(Rt),kt=Object.prototype,Ot=kt.toString,xt=kt.hasOwnProperty,St=new Map;function _t(e,t){try{return It(e,t)}finally{St.clear()}}function It(e,t){if(e===t)return!0;var r=Ot.call(e);if(r!==Ot.call(t))return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Tt(e,t))return!0;var n=Object.keys(e),i=Object.keys(t),o=n.length;if(o!==i.length)return!1;for(var a=0;a<o;++a)if(!xt.call(t,n[a]))return!1;for(a=0;a<o;++a){var s=n[a];if(!It(e[s],t[s]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Tt(e,t))return!0;for(var u=e.entries(),c="[object Map]"===r;;){var l=u.next();if(l.done)break;var h=l.value,f=h[0],p=h[1];if(!t.has(f))return!1;if(c&&!It(p,t.get(f)))return!1}return!0}return!1}function Tt(e,t){var r=St.get(e);if(r){if(r.has(t))return!0}else St.set(e,r=new Set);return r.add(t),!1}function At(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map(function(e){return At(i,e.name,e.value,n)}),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map(function(e){var r={};return At(r,t,e,n),r[t.value]});else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new mt(17);e[t.value]=null}}var Pt=["connection","include","skip","client","rest","export"];function Ct(e,t,r){if(r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i=t,o={};return n.forEach(function(e){o[e]=i[e]}),r.connection.key+"("+JSON.stringify(o)+")"}return r.connection.key}var a=e;if(t){var s=Et()(t);a+="("+s+")"}return r&&Object.keys(r).forEach(function(e){-1===Pt.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)}),a}function Nt(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(e){var n=e.name,i=e.value;return At(r,n,i,t)}),r}return null}function qt(e){return e.alias?e.alias.value:e.name.value}function Ft(e){return"Field"===e.kind}function Dt(e){return"InlineFragment"===e.kind}function Bt(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Lt(e,t){return void 0===t&&(t=!1),bt({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Mt(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach(function(e){r[e.name.value]=Nt(e,t)}),r}return null}function Ut(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(Qt).map(function(e){var t=e.arguments;e.name.value,yt(t&&1===t.length,14);var r=t[0];yt(r.name&&"if"===r.name.value,15);var n=r.value;return yt(n&&("Variable"===n.kind||"BooleanValue"===n.kind),16),{directive:e,ifArgument:r}}):[]).every(function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?yt(void 0!==(i=t[n.value.name.value]),13):i=n.value.value,"skip"===r.name.value?!i:i});var r}function jt(e,t){return function(e){var t=[];return(0,lt.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some(function(t){return e.indexOf(t)>-1})}function $t(e){return e&&jt(["client"],e)&&jt(["export"],e)}function Qt(e){var t=e.name.value;return"skip"===t||"include"===t}function Vt(e,t){var r=t,n=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new mt(11);"FragmentDefinition"===e.kind&&n.push(e)}),void 0===r&&(yt(1===n.length,12),r=n[0].name.value),bt(bt({},e),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function zt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach(function(t){null!=t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function Kt(e){return yt(e&&"Document"===e.kind,2),yt(e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new mt(3);return e}).length<=1,4),e}function Gt(e){return Kt(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function Wt(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null}function Ht(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function Jt(e){var t;Kt(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw new mt(10)}function Yt(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function Xt(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,r=e.defaultValue,n={};return At(n,t.name,r),n});return zt.apply(void 0,wt([{}],t))}return{}}function Zt(e,t,r){var n=0;return e.forEach(function(r,i){t.call(this,r,i,e)&&(e[n++]=r)},r),e.length=n,e}var er={kind:"Field",name:{kind:"Name",value:"__typename"}};function tr(e,t){return e.selectionSet.selections.every(function(e){return"FragmentSpread"===e.kind&&tr(t[e.name.value],t)})}function rr(e){return tr(Gt(e)||function(e){yt("Document"===e.kind,7),yt(e.definitions.length<=1,8);var t=e.definitions[0];return yt("FragmentDefinition"===t.kind,9),t}(e),Yt(Ht(e)))?null:e}function nr(e){return function(t){return e.some(function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)})}}function ir(e,t){var r=Object.create(null),n=[],i=Object.create(null),o=[],a=rr((0,lt.visit)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some(function(e){return e.remove})&&t.directives&&t.directives.some(nr(e)))return t.arguments&&t.arguments.forEach(function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})}),t.selectionSet&&ar(t.selectionSet).forEach(function(e){o.push({name:e.name.value})}),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(nr(e)(t))return null}}}));return a&&Zt(n,function(e){return!r[e.name]}).length&&(a=function(e,t){var r=function(e){return function(t){return e.some(function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return rr((0,lt.visit)(t,{OperationDefinition:{enter:function(t){return bt(bt({},t),{variableDefinitions:t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})})})}},Field:{enter:function(t){if(e.some(function(e){return e.remove})){var n=0;if(t.arguments.forEach(function(e){r(e)&&(n+=1)}),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,a)),a&&Zt(o,function(e){return!i[e.name]}).length&&(a=function(e,t){function r(t){if(e.some(function(e){return e.name===t.name.value}))return null}return rr((0,lt.visit)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,a)),a}var or={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some(function(e){return"key"===e.name.value})),t}};function ar(e){var t=[];return e.selections.forEach(function(e){(Ft(e)||Dt(e))&&e.selectionSet?ar(e.selectionSet).forEach(function(e){return t.push(e)}):"FragmentSpread"===e.kind&&t.push(e)}),t}function sr(e){return"query"===Jt(e).operation?e:(0,lt.visit)(e,{OperationDefinition:{enter:function(e){return bt(bt({},e),{operation:"query"})}}})}var ur="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),cr=Object.prototype.toString;function lr(e){return hr(e,new Map)}function hr(e,t){switch(cr.call(e)){case"[object Array]":if(t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(e,n){r[n]=hr(e,t)}),r;case"[object Object]":if(t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(r){n[r]=hr(e[r],t)}),n;default:return e}}function fr(e){return("undefined"!=typeof process?"production":"development")===e}function pr(e){try{return e()}catch(e){console.error&&console.error(e)}}function dr(e){return e.errors&&e.errors.length}var mr=Object.prototype.hasOwnProperty;function yr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vr(e)}function vr(e){var t=e[0]||{},r=e.length;if(r>1){var n=[];t=wr(t,n);for(var i=1;i<r;++i)t=br(t,e[i],n)}return t}function gr(e){return null!==e&&"object"==typeof e}function br(e,t,r){return gr(t)&&gr(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=wr(e,r)),Object.keys(t).forEach(function(n){var i=t[n];if(mr.call(e,n)){var o=e[n];i!==o&&(e[n]=br(wr(o,r),i,r))}else e[n]=i}),e):t}function wr(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):bt({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({});var Rr=u(8784);const Er=u.n(Rr)();var kr,Or=function(e,t){return Or=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Or(e,t)},xr=function(){return xr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xr.apply(this,arguments)};function Sr(e){return e.request.length<=1}function _r(e){return new Er(function(t){t.error(e)})}function Ir(e,t){return t?t(e):Er.of()}function Tr(e){return"function"==typeof e?new qr(e):e}function Ar(){return new qr(function(){return Er.of()})}function Pr(e){return 0===e.length?Ar():e.map(Tr).reduce(function(e,t){return e.concat(t)})}function Cr(e,t,r){var n=Tr(t),i=Tr(r||new qr(Ir));return Sr(n)&&Sr(i)?new qr(function(t){return e(t)?n.request(t)||Er.of():i.request(t)||Er.of()}):new qr(function(t,r){return e(t)?n.request(t,r)||Er.of():i.request(t,r)||Er.of()})}(function(e,t){function r(){this.constructor=e}Or(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(function(e,t){var r=kr.call(this,e)||this;return r.link=t,r},kr=Error);var Nr=function(e,t){var r=Tr(e);if(Sr(r))return r;var n=Tr(t);return Sr(n)?new qr(function(e){return r.request(e,function(e){return n.request(e)||Er.of()})||Er.of()}):new qr(function(e,t){return r.request(e,function(e){return n.request(e,t)||Er.of()})||Er.of()})},qr=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,r,n){return this.concat(Cr(t,r,n||new e(Ir)))},e.prototype.concat=function(e){return Nr(this,e)},e.prototype.request=function(e,t){throw new mt(1)},e.empty=Ar,e.from=Pr,e.split=Cr,e.execute=Fr,e}();function Fr(e,t){return e.request(function(e,t){var r=xr({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=xr({},r,"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return xr({},r)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,r=e.variables,n=e.operationName;return JSON.stringify([n,t,r])}(t)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Wt(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new mt(2)}return e}(t))))||Er.of()}var Dr,Br=u(1158);function Lr(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Dr||(Dr={}));var Mr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return at(t,e),t.prototype[Br.A]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(Er);function Ur(e){return Array.isArray(e)&&e.length>0}var jr,$r=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",Ur((n=c).graphQLErrors)&&n.graphQLErrors.forEach(function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"}),n.networkError&&(i+="Network error: "+n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return at(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(jr||(jr={}));var Qr=function(e){function t(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,function(e){return a.onSubscribe(e)})||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=o;var s=Gt(n.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=r,a}return at(t,e),t.prototype.result=function(){var e=this;return new Promise(function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){i.unsubscribe()},0)},error:r},i=e.subscribe(n)})},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Dr.error}}var t,r,n,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(r=s,void 0===(n=this.options.errorPolicy)&&(n="none"),r&&(r.networkError||"none"===n&&Ur(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new $r({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=st(st({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:o,loading:Lr(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var h=c||a&&"cache-only"!==u;t={data:o,loading:h,networkStatus:h?Dr.loading:Dr.ready}}return a||this.updateLastResult(st(st({},t),{stale:!1})),st(st({},t),{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&_t(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new mt(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),_t(this.variables,e)||(this.variables=st(st({},this.variables),e)),_t(this.options.variables,this.variables)||(this.options.variables=st(st({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,st(st({},this.options),{fetchPolicy:t}),jr.refetch))},t.prototype.fetchMore=function(e){var t=this;yt(e.updateQuery,2);var r=st(st({},e.query?e:st(st(st({},this.options),e),{variables:st(st({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,jr.normal,this.queryId).then(function(i){return t.updateQuery(function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:r.variables})}),t.queryManager.stopQuery(n),i},function(e){throw t.queryManager.stopQuery(n),e})},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery(function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})})},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=st(st({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&_t(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,o=r.document,a=pr(function(){return e(n,{variables:i})});a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){Kr(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:lr(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=Vr)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(Kr(this),t.startPollingQuery(this.options,r));var n=function(t){e.updateLastResult(st(st({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Dr.error,loading:!1})),zr(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then(function(i){var a=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==s&&t.transform(o).serverQuery&&!_t(a,i)?e.refetch():zr(e.observers,"next",r)}):zr(e.observers,"next",r)}},error:n}).catch(n)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Mr);function Vr(e){}function zr(e,t,r){var n=[];e.forEach(function(e){return e[t]&&n.push(e)}),n.forEach(function(e){return e[t](r)})}function Kr(e){var t=e.options.fetchPolicy;yt("cache-first"!==t&&"cache-only"!==t,3)}var Gr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Wr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];yt(!t||t.document===e.document||_t(t.document,e.document),19);var r,n=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Dr.loading&&(_t(t.variables,e.variables)||(n=!0,i=t.variables)),r=n?Dr.setVariables:e.isPoll?Dr.poll:e.isRefetch?Dr.refetch:Dr.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Dr.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=Ur(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Dr.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=Dr.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Dr.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=Dr.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach(function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=Dr.loading})},e}(),Hr=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=yr(t.resolvers,e)}):this.resolvers=yr(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return ut(this,void 0,void 0,function(){return ct(this,function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,a).then(function(e){return st(st({},r),{data:e.result})})]:[2,r]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return jt(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){Kt(e);var t=ir([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,lt.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every(function(e){return Ft(e)&&"__typename"===e.name.value}))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return st(st({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);yt(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),ut(this,void 0,void 0,function(){return ct(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then(function(e){return st(st({},t),e.exportedVariables)})]:[2,st({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,lt.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return lt.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:sr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),ut(this,void 0,void 0,function(){var a,s,u,c,l,h,f,p,d;return ct(this,function(m){var y;return a=Jt(e),s=Ht(e),u=Yt(s),c=a.operation,l=c?(y=c).charAt(0).toUpperCase()+y.slice(1):"Query",f=(h=this).cache,p=h.client,d={fragmentMap:u,context:st(st({},r),{cache:f,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,d).then(function(e){return{result:e,exportedVariables:d.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,r){return ut(this,void 0,void 0,function(){var n,i,o,a,s,u=this;return ct(this,function(c){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],s=function(e){return ut(u,void 0,void 0,function(){var s,u;return ct(this,function(c){return Ut(e,o)?Ft(e)?[2,this.resolveField(e,t,r).then(function(t){var r;void 0!==t&&a.push(((r={})[qt(e)]=t,r))})]:(Dt(e)?s=e:yt(s=n[e.name.value],7),s&&s.typeCondition&&(u=s.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then(function(e){a.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(s)).then(function(){return vr(a)})]})})},e.prototype.resolveField=function(e,t,r){return ut(this,void 0,void 0,function(){var n,i,o,a,s,u,c,l,h,f=this;return ct(this,function(p){return n=r.variables,i=e.name.value,o=qt(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(h=l[a?i:o])&&(u=Promise.resolve(h(t,Nt(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,u.then(function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)})}),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,r):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,r):void 0:t})]})})},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0}))},e}();function Jr(e){var t=new Set,r=null;return new Mr(function(n){return t.add(n),r=r||e.subscribe({next:function(e){t.forEach(function(t){return t.next&&t.next(e)})},error:function(e){t.forEach(function(t){return t.error&&t.error(e)})},complete:function(){t.forEach(function(e){return e.complete&&e.complete()})}}),function(){t.delete(n)&&!t.size&&r&&(r.unsubscribe(),r=null)}})}var Yr=Object.prototype.hasOwnProperty,Xr=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,h=e.localState,f=e.assumeImmutableResults;this.mutationStore=new Gr,this.queryStore=new Wr,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(ur?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=h||new Hr({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!f}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.fetchQueryRejectFns.forEach(function(e){e(new mt(8))})},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.errorPolicy,h=void 0===l?"none":l,f=e.fetchPolicy,p=e.context,d=void 0===p?{}:p;return ut(this,void 0,void 0,function(){var e,o,s,l=this;return ct(this,function(p){switch(p.label){case 0:return yt(t,9),yt(!f||"no-cache"===f,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,function(){return{document:t}}),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=p.sent(),p.label=2;case 2:return o=function(){var e={};return i&&l.queries.forEach(function(t,r){var n=t.observableQuery;if(n){var o=n.queryName;o&&Yr.call(i,o)&&(e[r]={updater:i[o],query:l.queryStore.get(r)})}}),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:o(),update:c,optimisticResponse:n}),this.broadcastQueries(),s=this,[2,new Promise(function(i,l){var p,m;s.getObservableFromLink(t,st(st({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){dr(n)&&"none"===h?m=new $r({graphQLErrors:n.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==f&&s.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:o(),update:c}),p=n)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),s.setQuery(e,function(){return{document:null}}),l(new $r({networkError:t}))},complete:function(){if(m&&s.mutationStore.markMutationError(e,m),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),m)l(m);else{"function"==typeof a&&(a=a(p));var t=[];Ur(a)&&a.forEach(function(e){if("string"==typeof e)s.queries.forEach(function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())});else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(s.query(r))}}),Promise.all(u?t:[]).then(function(){s.setQuery(e,function(){return{document:null}}),"ignore"===h&&p&&dr(p)&&delete p.errors,i(p)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,r,n){return ut(this,void 0,void 0,function(){var i,o,a,s,u,c,l,h,f,p,d,m,y,v,g,b,w,R,E=this;return ct(this,function(k){switch(k.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,s=void 0===a?"cache-first":a,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,h=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,h,c)]:[3,2];case 1:h=k.sent(),k.label=2;case 2:if(t=st(st({},t),{variables:h}),d=p="network-only"===s||"no-cache"===s,p||(m=this.dataStore.getCache().diff({query:l,variables:h,returnPartialData:!0,optimistic:!1}),y=m.complete,v=m.result,d=!y||"cache-and-network"===s,f=v),g=d&&"cache-only"!==s&&"standby"!==s,jt(["live"],l)&&(g=!0),b=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,function(){return{document:l,lastRequestId:b,invalidated:!0,cancel:w}}),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:g,variables:h,isPoll:r===jr.poll,isRefetch:r===jr.refetch,metadata:o,fetchMoreForQueryId:n}),this.broadcastQueries(),g){if(R=this.fetchRequest({requestId:b,queryId:e,document:l,options:t,fetchMoreForQueryId:n}).catch(function(t){throw t.hasOwnProperty("graphQLErrors")?t:(b>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,n),E.invalidate(e),E.invalidate(n),E.broadcastQueries()),new $r({networkError:t}))}),"cache-and-network"!==s)return[2,R];R.catch(function(){})}return this.queryStore.markQueryResultClient(e,!g),this.invalidate(e),this.invalidate(n),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:f},context:c,variables:h,onlyRunForcedResolvers:!0}).then(function(r){return E.markQueryResult(e,r,t,n),E.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:f}])}})})},e.prototype.markQueryResult=function(e,t,r,n){var i=r.fetchPolicy,o=r.variables,a=r.errorPolicy;"no-cache"===i?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,n,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function i(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,o){if(n.invalidate(e,!1),r){var a=n.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Lr(r.networkStatus),h=s&&s.getLastResult(),f=!(!h||h.networkStatus===r.networkStatus),p=t.returnPartialData||!o&&r.previousVariables||f&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||p){var d=Ur(r.graphQLErrors),m=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&d||r.networkError)return i("error",new $r({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var y=void 0,v=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&n.setQuery(e,function(){return{newData:null}}),y=o.result,v=!o.complete;else{var g=s&&s.getLastError(),b="none"!==m&&(g&&g.graphQLErrors)!==r.graphQLErrors;if(h&&h.data&&!b)y=h.data,v=!1;else{var w=n.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});y=w.result,v=!w.complete}}var R=v&&!(t.returnPartialData||"cache-only"===c),E={data:R?h&&h.data:y,loading:l,networkStatus:r.networkStatus,stale:R};"all"===m&&d&&(E.errors=r.graphQLErrors),i("next",E)}catch(e){i("error",new $r({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.dataStore.getCache(),i=n.transformDocument(e),o=(t=n.transformForLink(i),ir([or],Kt(t))),a=this.localState.clientQuery(i),s=this.localState.serverQuery(o),u={document:i,hasClientExports:$t(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:s,defaultVars:Xt(Gt(i))},c=function(e){e&&!r.has(e)&&r.set(e,u)};c(e),c(i),c(a),c(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return st(st({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),yt("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=st({},e);return new Qr({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return yt(e.query,12),yt("Document"===e.query.kind,13),yt(!e.returnPartialData,14),yt(!e.pollInterval,15),new Promise(function(r,n){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,n),i.result().then(r,n).then(function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)})})},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){return e.listeners.add(t),{invalidated:!1}})},e.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;return i&&i(),this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}})},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,function(){return{observableQuery:null}}),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach(function(e){e(new mt(16))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach(function(n,i){var o=n.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||r.push(o.refetch()),t.setQuery(i,function(){return{newData:null}}),t.invalidate(i)}}),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var o=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),dr(i))throw new $r({graphQLErrors:i.errors});return i})};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(o);return new Mr(function(e){var t=null;return a.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,o=r.fetchPolicy,a=r.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:n,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||a?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;yt(r,17),t=r}else t=e;var n=t.options,i=n.variables,o=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners.forEach(function(n){n&&n(e.queryStore.get(r),t.newData)})})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o=this;void 0===n&&(n=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var s=this.inFlightLinkObservables,u=this.link,c={query:a,variables:r,operationName:Wt(a)||void 0,context:this.prepareContext(st(st({},t),{forceFetch:!n}))};if(t=c.context,n){var l=s.get(a)||new Map;s.set(a,l);var h=JSON.stringify(r);if(!(i=l.get(h))){l.set(h,i=Jr(Fr(u,c)));var f=function(){l.delete(h),l.size||s.delete(a),p.unsubscribe()},p=i.subscribe({next:f,error:f,complete:f})}}else i=Jr(Fr(u,c))}else i=Mr.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e){return new Mr(function(n){var i=n.next,a=n.error,s=n.complete,u=0,c=!1,l={next:function(e){++u,new Promise(function(n){n(function(e){return o.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}(e))}).then(function(e){--u,i&&i.call(n,e),c&&l.complete()},function(e){--u,a&&a.call(n,e)})},error:function(e){a&&a.call(n,e)},complete:function(){c=!0,u||s&&s.call(n)}},h=e.subscribe(l);return function(){return h.unsubscribe()}})}(i)),i},e.prototype.fetchRequest=function(e){var t,r,n=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,h=void 0===l?"none":l,f=s.fetchPolicy;return new Promise(function(e,l){var p=n.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;n.fetchQueryRejectFns.set(d,l);var m=function(){n.fetchQueryRejectFns.delete(d),n.setQuery(o,function(e){e.subscriptions.delete(y)})},y=p.map(function(e){if(i>=n.getQuery(o).lastRequestId&&(n.markQueryResult(o,e,s,u),n.queryStore.markQueryResult(o,e,u),n.invalidate(o),n.invalidate(u),n.broadcastQueries()),"none"===h&&Ur(e.errors))return l(new $r({graphQLErrors:e.errors}));if("all"===h&&(r=e.errors),u||"no-cache"===f)t=e.data;else{var p=n.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=p.result;(p.complete||s.returnPartialData)&&(t=d)}}).subscribe({error:function(e){m(),l(e)},complete:function(){m(),e({data:t,errors:r,loading:!1,networkStatus:Dr.ready,stale:!1})}});n.setQuery(o,function(e){e.subscriptions.add(y)})})},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=st(st({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,function(){return{invalidated:t}})},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return st(st({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Dr.ready&&t.networkStatus!==Dr.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,i=e.pollInterval;if(yt(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=st(st({},e),{fetchPolicy:"network-only"});var a=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?s():n.fetchQuery(t,e.options,jr.poll).then(s,s))},s=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};r&&this.addQueryListener(t,r),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),Zr=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var o=!dr(e);i&&dr(e)&&e.data&&(o=!0),!n&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){dr(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction(function(n){var i=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=i}},e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!dr(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach(function(i){var o=n[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=pr(function(){return s(c,{mutationResult:e.result,queryName:Wt(a.document)||void 0,queryVariables:a.variables})});l&&r.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}}),this.cache.performTransaction(function(t){r.forEach(function(e){return t.write(e)});var n=e.update;n&&pr(function(){return n(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),en=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,i=void 0!==n&&n,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,h=e.assumeImmutableResults,f=void 0!==h&&h,p=e.resolvers,d=e.typeDefs,m=e.fragmentMatcher,y=e.name,v=e.version,g=e.link;if(!g&&p&&(g=qr.empty()),!g||!r)throw new mt(4);this.link=g,this.cache=r,this.store=new Zr(r),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout(function(){return t.disableNetworkFetches=!1},a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),void 0!==s&&s&&"undefined"!=typeof window&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new Hr({cache:r,client:this,resolvers:p,fragmentMatcher:m}),this.queryManager=new Xr({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:y,version:v},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=st(st({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=st(st({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=st(st({},this.defaultOptions.query),e)),yt("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=st(st({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=st(st({},this.defaultOptions.mutate),e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Fr(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}(),tn=function(e,t){return tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},tn(e,t)};function rn(e,t){function r(){this.constructor=e}tn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var nn=function(){return nn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nn.apply(this,arguments)};function on(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:an(e)}]}}function an(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return an(e[0]);var t=[];return Object.keys(e).forEach(function(r){var n={kind:"Field",name:{kind:"Name",value:r},selectionSet:an(e[r])||void 0};t.push(n)}),{kind:"SelectionSet",selections:t}}var sn,un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},cn=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Vt(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Vt(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,r,n=e.id,i=e.data;if(void 0!==n){var o=null;try{o=this.read({rootId:n,optimistic:!1,query:un})}catch(e){}var a=o&&o.__typename||"__ClientData",s=Object.assign({__typename:a},i);this.writeFragment({id:n,fragment:(t=s,r=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:r||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:an(t)}]}),data:s})}else this.writeQuery({query:on(i),data:i})},e}();sn||(sn={});var ln=null,hn={},fn=1,pn="@wry/context:Slot",dn=Array,mn=dn[pn]||function(){var e=function(){function e(){this.id=["slot",fn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=ln;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===hn)break;return e!==ln&&(ln.slots[this.id]=t),!0}return ln&&(ln.slots[this.id]=hn),!1},e.prototype.getValue=function(){if(this.hasValue())return ln.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=ln;ln={parent:a,slots:o};try{return t.apply(n,r)}finally{ln=a}},e.bind=function(e){var t=ln;return function(){var r=ln;try{return ln=t,e.apply(this,arguments)}finally{ln=r}}},e.noContext=function(e,t,r){if(!ln)return e.apply(r,t);var n=ln;try{return ln=null,e.apply(r,t)}finally{ln=n}},e}();try{Object.defineProperty(dn,pn,{value:dn[pn]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function yn(){}mn.bind,mn.noContext;var vn=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=yn),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),gn=new mn,bn=[],wn=[];function Rn(e,t){if(!e)throw new Error(t||"assertion failure")}function En(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var kn=function(){function e(t,r){this.fn=t,this.args=r,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(Rn(!this.recomputing,"already recomputing"),function(e){var t=gn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xn(e)?In(t,e):Tn(t,e),t}(this)||!Pn(this))return xn(this)?(t=Cn(e=this),gn.withValue(e,On,[e]),function(e){if("function"==typeof e.subscribe)try{qn(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){e.dirty=!1,xn(e)||_n(e)}(e),t.forEach(Pn),En(e.value)):En(this.value);var e,t},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Sn(this),qn(this))},e.prototype.dispose=function(){var e=this;Cn(this).forEach(Pn),qn(this),this.parents.forEach(function(t){t.setDirty(),Nn(t,e)})},e.count=0,e}();function On(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function xn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Sn(e){e.parents.forEach(function(t){return In(t,e)})}function _n(e){e.parents.forEach(function(t){return Tn(t,e)})}function In(e,t){if(Rn(e.childValues.has(t)),Rn(xn(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=wn.pop()||new Set;e.dirtyChildren.add(t),Sn(e)}function Tn(e,t){Rn(e.childValues.has(t)),Rn(!xn(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),An(e,t),xn(e)||_n(e)}function An(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(wn.length<100&&wn.push(r),e.dirtyChildren=null))}function Pn(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function Cn(e){var t=bn;return e.childValues.size>0&&(t=[],e.childValues.forEach(function(r,n){Nn(e,n),t.push(n)})),Rn(null===e.dirtyChildren),t}function Nn(e,t){t.parents.delete(e),e.childValues.delete(t),An(e,t)}function qn(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Fn=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach(function(e){return t=t.getChildTrie(e)}),t.data||(t.data=Object.create(null))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness)),n},e}(),Dn=new Fn("function"==typeof WeakMap);function Bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn.lookupArray(e)}var Ln=new Set;function Mn(e,t){void 0===t&&(t=Object.create(null));var r=new vn(t.max||Math.pow(2,16),function(e){return e.dispose()}),n=!!t.disposable,i=t.makeCacheKey||Bn;function o(){if(!n||gn.hasValue()){var o=i.apply(null,arguments);if(void 0===o)return e.apply(null,arguments);var a=Array.prototype.slice.call(arguments),s=r.get(o);s?s.args=a:(s=new kn(e,a),r.set(o,s),s.subscribe=t.subscribe,n&&(s.reportOrphan=function(){return r.delete(o)}));var u=s.recompute();return r.set(o,s),Ln.add(r),gn.hasValue()||(Ln.forEach(function(e){return e.clean()}),Ln.clear()),n?void 0:u}}return o.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&r.get(e);t&&t.setDirty()},o}var Un=!1;function jn(){var e=!Un;return!0===fr("test")||(Un=!0),e}var $n=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;return a&&a===t||(jn(),"heuristic")},e}(),Qn=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){yt(this.isReady,1);var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;if(yt(a,2),a===t)return!0;var s=this.possibleTypesMap[t];return!!(a&&s&&s.indexOf(a)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}(),Vn=Object.prototype.hasOwnProperty,zn=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Mn(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Vn.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){Vn.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function Kn(e){return new zn(e)}var Gn=function(){function e(e){var t=this,r=void 0===e?{}:e,n=r.cacheKeyRoot,i=void 0===n?new Fn(ur):n,o=r.freezeResults,a=void 0!==o&&o,s=this,u=s.executeStoreQuery,c=s.executeSelectionSet,l=s.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Mn(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,n=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(n.store instanceof zn)return i.lookup(n.store,t,a,JSON.stringify(o),r.id)}}),this.executeSelectionSet=Mn(function(e){return c.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof zn)return i.lookup(n.contextValue.store,t,n.fragmentMatcher,JSON.stringify(n.variableValues),r.id)}}),this.executeSubSelectedArray=Mn(function(e){return l.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.execContext;if(n.contextValue.store instanceof zn)return i.lookup(n.contextValue.store,t,r,JSON.stringify(n.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(nn(nn({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,h=e.config;i=zt({},Xt((yt((t=Gt(n))&&"query"===t.operation,6),t)),i);var f={store:r,dataIdFromObject:h&&h.dataIdFromObject,cacheRedirects:h&&h.cacheRedirects||{}},p=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:f,variableValues:i,fragmentMatcher:l}),d=p.missing&&p.missing.length>0;return d&&!s&&p.missing.forEach(function(e){if(!e.tolerable)throw new mt(8)}),o&&_t(o,p.result)&&(p.result=o),{result:p.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,r=e.rootValue,n=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Hn:o,s=Jt(t),u={query:t,fragmentMap:Yt(Ht(t)),contextValue:n,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:r,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,r=e.selectionSet,n=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,s=i.variableValues,u={result:null},c=[],l=a.store.get(n.id),h=l&&l.__typename||"ROOT_QUERY"===n.id&&"Query"||void 0;function f(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return r.selections.forEach(function(e){var r;if(Ut(e,s))if(Ft(e)){var u=f(t.executeField(l,h,e,i));void 0!==u&&c.push(((r={})[qt(e)]=u,r))}else{var p=void 0;if(Dt(e))p=e;else if(!(p=o[e.name.value]))throw new mt(9);var d=p.typeCondition&&p.typeCondition.name.value,m=!d||i.fragmentMatcher(n,d,a);if(m){var y=t.executeSelectionSet({selectionSet:p.selectionSet,rootValue:n,execContext:i});"heuristic"===m&&y.missing&&(y=nn(nn({},y),{missing:y.missing.map(function(e){return nn(nn({},e),{tolerable:!0})})})),c.push(f(y))}}}),u.result=vr(c),this.freezeResults,u},e.prototype.executeField=function(e,t,r,n){var i=n.variableValues,o=n.contextValue,a=function(e,t,r,n,i,o){var a=o.directives,s=r;(n||a)&&(s=Ct(s,n,a));var u,c=void 0;if(e&&void 0===(c=e[s])&&i.cacheRedirects&&"string"==typeof t){var l=i.cacheRedirects[t];if(l){var h=l[r];h&&(c=h(e,n,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Lt({id:t,typename:e.__typename})}}))}}return void 0===c?{result:c,missing:[{object:e,fieldName:s,tolerable:!1}]}:(null!=(u=c)&&"object"==typeof u&&"json"===u.type&&(c=c.json),{result:c})}(e,t,r.name.value,Nt(r,i),o,{resultKey:qt(r),directives:Mt(r,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:r,array:a.result,execContext:n})):r.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:r.selectionSet,rootValue:a.result,execContext:n})):(Wn(r,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.forEach(function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)}),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,r=this,n=e.field,i=e.array,o=e.execContext;function a(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map(function(e){return null===e?null:Array.isArray(e)?a(r.executeSubSelectedArray({field:n,array:e,execContext:o})):n.selectionSet?a(r.executeSelectionSet({selectionSet:n.selectionSet,rootValue:e,execContext:o})):(Wn(n,e),e)}),this.freezeResults,{result:i,missing:t}},e}();function Wn(e,t){if(!e.selectionSet&&Bt(t))throw new mt(10)}function Hn(){return!0}var Jn=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),Yn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return rn(t,e),t}(Error),Xn=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,r=e.result,n=e.store,i=void 0===n?Kn():n,o=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:r,document:t,store:i,variables:o,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,r=e.result,n=e.document,i=e.store,o=void 0===i?Kn():i,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=Gt(n);try{return this.writeSelectionSetToStore({result:r,dataId:t,selectionSet:c.selectionSet,context:{store:o,processedData:{},variables:zt({},Xt(c),a),dataIdFromObject:s,fragmentMap:Yt(Ht(n)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var r=new Yn("Error writing result to store for query:\n "+JSON.stringify(t));return r.message+="\n"+e.message,r.stack=e.stack,r}(e,n)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,r=e.result,n=e.dataId,i=e.selectionSet,o=e.context,a=o.variables,s=o.store,u=o.fragmentMap;return i.selections.forEach(function(e){var i;if(Ut(e,a))if(Ft(e)){var s=qt(e),c=r[s];if(void 0!==c)t.writeFieldToStore({dataId:n,value:c,field:e,context:o});else{var l=!1,h=!1;e.directives&&e.directives.length&&(l=e.directives.some(function(e){return e.name&&"defer"===e.name.value}),h=e.directives.some(function(e){return e.name&&"client"===e.name.value})),!l&&!h&&o.fragmentMatcherFunction}}else{var f=void 0;Dt(e)?f=e:yt(f=(u||{})[e.name.value],3);var p=!0;if(o.fragmentMatcherFunction&&f.typeCondition){var d=n||"self",m=Lt({id:d,typename:void 0}),y={store:new Jn((i={},i[d]=r,i)),cacheRedirects:{}},v=o.fragmentMatcherFunction(m,f.typeCondition.name.value,y);fr("production"),p=!!v}p&&t.writeSelectionSetToStore({result:r,selectionSet:f.selectionSet,dataId:n,context:o})}}),s},e.prototype.writeFieldToStore=function(e){var t,r,n,i=e.field,o=e.value,a=e.dataId,s=e.context,u=s.variables,c=s.dataIdFromObject,l=s.store,h=function(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var i=n.name,o=n.value;return At(r[e.name.value],i,o,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var r=e.name,i=e.value;return At(n,r,i,t)})),Ct(e.name.value,n,r)}(i,u);if(i.selectionSet&&null!==o)if(Array.isArray(o)){var f=a+"."+h;r=this.processArrayValue(o,f,i.selectionSet,s)}else{var p=a+"."+h,d=!0;if(Zn(p)||(p="$"+p),c){var m=c(o);yt(!m||!Zn(m),4),(m||"number"==typeof m&&0===m)&&(p=m,d=!1)}ti(p,i,s.processedData)||this.writeSelectionSetToStore({dataId:p,result:o,selectionSet:i.selectionSet,context:s});var y=o.__typename;r=Lt({id:p,typename:y},d);var v=(n=l.get(a))&&n[h];if(v!==r&&Bt(v)){var g=void 0!==v.typename,b=void 0!==y,w=g&&b&&v.typename!==y;yt(!d||v.generated||w,5),yt(!g||b,6),v.generated&&(w?d||l.delete(v.id):ei(v.id,r.id,l))}}else r=null!=o&&"object"==typeof o?{type:"json",json:o}:o;(n=l.get(a))&&_t(r,n[h])||l.set(a,nn(nn({},n),((t={})[h]=r,t)))},e.prototype.processArrayValue=function(e,t,r,n){var i=this;return e.map(function(e,o){if(null===e)return null;var a=t+"."+o;if(Array.isArray(e))return i.processArrayValue(e,a,r,n);var s=!0;if(n.dataIdFromObject){var u=n.dataIdFromObject(e);u&&(a=u,s=!1)}return ti(a,r,n.processedData)||i.writeSelectionSetToStore({dataId:a,result:e,selectionSet:r,context:n}),Lt({id:a,typename:e.__typename},s)})},e}();function Zn(e){return"$"===e[0]}function ei(e,t,r){if(e===t)return!1;var n=r.get(e),i=r.get(t),o=!1;Object.keys(n).forEach(function(e){var t=n[e],a=i[e];Bt(t)&&Zn(t.id)&&Bt(a)&&!_t(t,a)&&ei(t.id,a.id,r)&&(o=!0)}),r.delete(e);var a=nn(nn({},n),i);return _t(a,i)?o:(r.set(t,a),!0)}function ti(e,t,r){if(!r)return!1;if(r[e]){if(r[e].indexOf(t)>=0)return!0;r[e].push(t)}else r[e]=[t];return!1}var ri={fragmentMatcher:new $n,dataIdFromObject:ni,addTypename:!0,resultCaching:!0,freezeResults:!1};function ni(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var ii=Object.prototype.hasOwnProperty,oi=function(e){function t(t,r,n){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=r,i.transaction=n,i}return rn(t,e),t.prototype.toObject=function(){return nn(nn({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return ii.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(Jn),ai=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new Fn(ur),r.silenceBroadcast=!1,r.config=nn(nn({},ri),t),r.config.customResolvers&&(r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=!!r.config.addTypename,r.data=r.config.resultCaching?new zn:new Jn,r.optimisticData=r.data,r.storeWriter=new Xn,r.storeReader=new Gn({cacheKeyRoot:r.cacheKeyRoot,freezeResults:t.freezeResults});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=Mn(function(e){return i.call(r,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return n.data instanceof zn?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return rn(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new mt(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],r=0,n=this.optimisticData;n instanceof oi;)n.optimisticId===e?++r:t.push(n),n=n.parent;if(r>0){for(this.optimisticData=n;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var r=this.data,n=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new oi(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=n,this.data=r}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(r=e,t=(0,lt.visit)(Kt(r),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n&&!n.some(function(e){return Ft(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var i=r;if(!(Ft(i)&&i.directives&&i.directives.some(function(e){return"export"===e.name.value})))return bt(bt({},e),{selections:wt(n,[er])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}var r;return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(cn),si=function(e,t){return si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},si(e,t)},ui=function(){return ui=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ui.apply(this,arguments)},ci=function(){return ci=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ci.apply(this,arguments)},li=u(3230),hi={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},fi=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},pi=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new mt(2);throw n.parseError=e,n}return r},di=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new mt(1)}(n),n||(n=fetch);var s={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new qr(function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,c=u.name,l=u.version;c&&(a["apollographql-client-name"]=c),l&&(a["apollographql-client-version"]=l)}var h,f=ui({},a,i.headers),p={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:f},d=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ci({},t.options,{headers:t.headers,credentials:t.credentials}),o=t.http;r.forEach(function(e){i=ci({},i,e.options,{headers:ci({},i.headers,e.headers)}),e.credentials&&(i.credentials=e.credentials),o=ci({},o,e.http)});var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return o.includeExtensions&&(l.extensions=s),o.includeQuery&&(l.query=(0,li.y)(c)),{options:i,body:l}}(e,hi,s,p),m=d.options,y=d.body;if(!m.signal){var v=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),g=v.controller,b=v.signal;(h=g)&&(m.signal=b)}if(o&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(m.method="GET"),"GET"===m.method){var w=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=pi(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=pi(t.extensions)}catch(e){return{parseError:e}}n("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+a}}(t,y),R=w.newURI,E=w.parseError;if(E)return _r(E);t=R}else try{m.body=pi(y)}catch(E){return _r(E)}return new Er(function(r){var i;return n(t,m).then(function(t){return e.setContext({response:t}),t}).then((i=e,function(e){return e.text().then(function(t){try{return JSON.parse(t)}catch(n){var r=n;return r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,Promise.reject(r)}}).then(function(t){return e.status>=300&&fi(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||fi(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map(function(e){return e.operationName}):i.operationName)+"'."),t})})).then(function(e){return r.next(e),r.complete(),e}).catch(function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))}),function(){h&&h.abort()}})})};!function(e){!function(e,t){function r(){this.constructor=e}si(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(function(t){return e.call(this,di(t).request)||this},e)}(qr);var mi=u(8244),yi=u.n(mi),vi=function(){return vi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vi.apply(this,arguments)};function gi(e,t){if(!Boolean(e))throw new Error(t)}function bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var wi="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function Ri(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,o=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,o=t+1-(r.index+r[0].length);return{line:i,column:o}}function Ei(e){return ki(e.source,Ri(e.source,e.start))}function ki(e,t){var r=e.locationOffset.column-1,n=xi(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?r:0,u=t.column+s,c="".concat(e.name,":").concat(a,":").concat(u,"\n"),l=n.split(/\r\n|[\n\r]/g),h=l[i];if(h.length>120){for(var f=Math.floor(u/80),p=u%80,d=[],m=0;m<h.length;m+=80)d.push(h.slice(m,m+80));return c+Oi([["".concat(a),d[0]]].concat(d.slice(1,f+1).map(function(e){return["",e]}),[[" ",xi(p-1)+"^"],["",d[f+1]]]))}return c+Oi([["".concat(a-1),l[i-1]],["".concat(a),h],["",xi(u-1)+"^"],["".concat(a+1),l[i+1]]])}function Oi(e){var t=e.filter(function(e){return e[0],void 0!==e[1]}),r=Math.max.apply(Math,t.map(function(e){return e[0].length}));return t.map(function(e){var t,n=e[0],i=e[1];return xi(r-(t=n).length)+t+(i?" | "+i:" |")}).join("\n")}function xi(e){return Array(e+1).join(" ")}function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function _i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ai(e,t){return!t||"object"!==Si(t)&&"function"!=typeof t?Pi(e):t}function Pi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ci(e){var t="function"==typeof Map?new Map:void 0;return Ci=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ni(e,arguments,Di(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fi(n,e)},Ci(e)}function Ni(e,t,r){return Ni=qi()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Fi(i,r.prototype),i},Ni.apply(null,arguments)}function qi(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function Fi(e,t){return Fi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fi(e,t)}function Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Di(e)}var Bi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fi(e,t)}(a,e);var t,r,n,i,o=(t=a,r=qi(),function(){var e,n=Di(t);if(r){var i=Di(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return Ai(this,e)});function a(e,t,r,n,i,s,u){var c,l,h,f;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(f=o.call(this,e)).name="GraphQLError",f.originalError=null!=s?s:void 0,f.nodes=Li(Array.isArray(t)?t:t?[t]:void 0);for(var p=[],d=0,m=null!==(y=f.nodes)&&void 0!==y?y:[];d<m.length;d++){var y,v=m[d].loc;null!=v&&p.push(v)}p=Li(p),f.source=null!=r?r:null===(c=p)||void 0===c?void 0:c[0].source,f.positions=null!=n?n:null===(l=p)||void 0===l?void 0:l.map(function(e){return e.start}),f.locations=n&&r?n.map(function(e){return Ri(r,e)}):null===(h=p)||void 0===h?void 0:h.map(function(e){return Ri(e.source,e.start)}),f.path=null!=i?i:void 0;var g,b=null==s?void 0:s.extensions;return null==u&&"object"==bi(g=b)&&null!==g?f.extensions=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_i(Object(r),!0).forEach(function(t){Ii(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},b):f.extensions=null!=u?u:{},Object.defineProperties(Pi(f),{message:{enumerable:!0},locations:{enumerable:null!=f.locations},path:{enumerable:null!=f.path},extensions:{enumerable:null!=f.extensions&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(Pi(f),"stack",{value:s.stack,writable:!0,configurable:!0}),Ai(f)):(Error.captureStackTrace?Error.captureStackTrace(Pi(f),a):Object.defineProperty(Pi(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return n=a,(i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+Ei(i.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+ki(e.source,s)}return t}(this)}},{key:"toJSON",value:function(){return function(e){var t;e||gi(0,"Received null or undefined error.");var r=null!==(t=e.message)&&void 0!==t?t:"An unknown error occurred.",n=e.locations,i=e.path,o=e.extensions;return o&&Object.keys(o).length>0?{message:r,locations:n,path:i,extensions:o}:{message:r,locations:n,path:i}}(this)}},{key:wi,get:function(){return"Object"}}])&&Ti(n.prototype,i),a}(Ci(Error));function Li(e){return void 0===e||0===e.length?void 0:e}function Mi(e,t,r){return new Bi("Syntax Error: ".concat(r),void 0,e,[t])}var Ui=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const ji="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function $i(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,ji&&(e.prototype[ji]=t)}var Qi=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();$i(Qi);var Vi=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();$i(Vi);var zi=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Ki(e){return Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ki(e)}function Gi(e,t){switch(Ki(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(ji)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:Gi(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(Gi(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map(function(r){return r+": "+Gi(e[r],t)}).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function Wi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Hi=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||gi(0,"Body must be a string. Received: ".concat(Gi(e,[]),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||gi(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||gi(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:wi,get:function(){return"Source"}}])&&Wi(t.prototype,r),e}(),Ji=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function Yi(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&Xi(t[i]);)++i;for(var o=t.length;o>i&&Xi(t[o-1]);)--o;return t.slice(i,o).join("\n")}function Xi(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var Zi=function(){function e(e){var t=new Vi(zi.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==zi.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=to(this,e)}while(e.kind===zi.COMMENT);return e},e}();function eo(e){return isNaN(e)?zi.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function to(e,t){for(var r=e.source,n=r.body,i=n.length,o=t.end;o<i;){var a=n.charCodeAt(o),s=e.line,u=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new Vi(zi.BANG,o,o+1,s,u,t);case 35:return no(r,o,s,u,t);case 36:return new Vi(zi.DOLLAR,o,o+1,s,u,t);case 38:return new Vi(zi.AMP,o,o+1,s,u,t);case 40:return new Vi(zi.PAREN_L,o,o+1,s,u,t);case 41:return new Vi(zi.PAREN_R,o,o+1,s,u,t);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return new Vi(zi.SPREAD,o,o+3,s,u,t);break;case 58:return new Vi(zi.COLON,o,o+1,s,u,t);case 61:return new Vi(zi.EQUALS,o,o+1,s,u,t);case 64:return new Vi(zi.AT,o,o+1,s,u,t);case 91:return new Vi(zi.BRACKET_L,o,o+1,s,u,t);case 93:return new Vi(zi.BRACKET_R,o,o+1,s,u,t);case 123:return new Vi(zi.BRACE_L,o,o+1,s,u,t);case 124:return new Vi(zi.PIPE,o,o+1,s,u,t);case 125:return new Vi(zi.BRACE_R,o,o+1,s,u,t);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?so(r,o,s,u,t,e):ao(r,o,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return io(r,o,a,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return lo(r,o,s,u,t)}throw Mi(r,o,ro(a))}var c=e.line,l=1+o-e.lineStart;return new Vi(zi.EOF,i,i,c,l,t)}function ro(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(eo(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(eo(e),".")}function no(e,t,r,n,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new Vi(zi.COMMENT,t,s,r,n,i,a.slice(t+1,s))}function io(e,t,r,n,i,o){var a=e.body,s=r,u=t,c=!1;if(45===s&&(s=a.charCodeAt(++u)),48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw Mi(e,u,"Invalid number, unexpected digit after 0: ".concat(eo(s),"."))}else u=oo(e,u,s),s=a.charCodeAt(u);if(46===s&&(c=!0,s=a.charCodeAt(++u),u=oo(e,u,s),s=a.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=oo(e,u,s),s=a.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Mi(e,u,"Invalid number, expected digit but got: ".concat(eo(s),"."));return new Vi(c?zi.FLOAT:zi.INT,t,u,n,i,o,a.slice(t,u))}function oo(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw Mi(e,i,"Invalid number, expected digit but got: ".concat(eo(o),"."))}function ao(e,t,r,n,i){for(var o=e.body,a=t+1,s=a,u=0,c="";a<o.length&&!isNaN(u=o.charCodeAt(a))&&10!==u&&13!==u;){if(34===u)return c+=o.slice(s,a),new Vi(zi.STRING,t,a+1,r,n,i,c);if(u<32&&9!==u)throw Mi(e,a,"Invalid character within String: ".concat(eo(u),"."));if(++a,92===u){switch(c+=o.slice(s,a-1),u=o.charCodeAt(a)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=uo(o.charCodeAt(a+1),o.charCodeAt(a+2),o.charCodeAt(a+3),o.charCodeAt(a+4));if(l<0){var h=o.slice(a+1,a+5);throw Mi(e,a,"Invalid character escape sequence: \\u".concat(h,"."))}c+=String.fromCharCode(l),a+=4;break;default:throw Mi(e,a,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}s=++a}}throw Mi(e,a,"Unterminated string.")}function so(e,t,r,n,i,o){for(var a=e.body,s=t+3,u=s,c=0,l="";s<a.length&&!isNaN(c=a.charCodeAt(s));){if(34===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(u,s),new Vi(zi.BLOCK_STRING,t,s+3,r,n,i,Yi(l));if(c<32&&9!==c&&10!==c&&13!==c)throw Mi(e,s,"Invalid character within String: ".concat(eo(c),"."));10===c?(++s,++o.line,o.lineStart=s):13===c?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(u,s)+'"""',u=s+=4):++s}throw Mi(e,s,"Unterminated string.")}function uo(e,t,r,n){return co(e)<<12|co(t)<<8|co(r)<<4|co(n)}function co(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function lo(e,t,r,n,i){for(var o=e.body,a=o.length,s=t+1,u=0;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Vi(zi.NAME,t,s,r,n,i,o.slice(t,s))}var ho=function(){function e(e,t){var r=function(e){return e instanceof Hi}(e)?e:new Hi(e);this._lexer=new Zi(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(zi.NAME);return{kind:Ui.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:Ui.DOCUMENT,definitions:this.many(zi.SOF,this.parseDefinition,zi.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(zi.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(zi.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(zi.BRACE_L))return{kind:Ui.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(zi.NAME)&&(t=this.parseName()),{kind:Ui.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(zi.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(zi.PAREN_L,this.parseVariableDefinition,zi.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:Ui.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(zi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(zi.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(zi.DOLLAR),{kind:Ui.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:Ui.SELECTION_SET,selections:this.many(zi.BRACE_L,this.parseSelection,zi.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(zi.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(zi.COLON)?(e=n,t=this.parseName()):t=n,{kind:Ui.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(zi.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(zi.PAREN_L,t,zi.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(zi.COLON),{kind:Ui.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:Ui.ARGUMENT,name:this.parseName(),value:(this.expectToken(zi.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(zi.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(zi.NAME)?{kind:Ui.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:Ui.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:Ui.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:Ui.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case zi.BRACKET_L:return this.parseList(e);case zi.BRACE_L:return this.parseObject(e);case zi.INT:return this._lexer.advance(),{kind:Ui.INT,value:t.value,loc:this.loc(t)};case zi.FLOAT:return this._lexer.advance(),{kind:Ui.FLOAT,value:t.value,loc:this.loc(t)};case zi.STRING:case zi.BLOCK_STRING:return this.parseStringLiteral();case zi.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:Ui.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:Ui.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:Ui.NULL,loc:this.loc(t)};default:return{kind:Ui.ENUM,value:t.value,loc:this.loc(t)}}case zi.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:Ui.STRING,value:e.value,block:e.kind===zi.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:Ui.LIST,values:this.any(zi.BRACKET_L,function(){return t.parseValueLiteral(e)},zi.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:Ui.OBJECT,fields:this.any(zi.BRACE_L,function(){return t.parseObjectField(e)},zi.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(zi.COLON),{kind:Ui.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(zi.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(zi.AT),{kind:Ui.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(zi.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(zi.BRACKET_R),e={kind:Ui.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(zi.BANG)?{kind:Ui.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:Ui.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===zi.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(zi.STRING)||this.peek(zi.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(zi.BRACE_L,this.parseOperationTypeDefinition,zi.BRACE_R);return{kind:Ui.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(zi.COLON);var r=this.parseNamedType();return{kind:Ui.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:Ui.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:Ui.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(zi.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(zi.AMP)||this.peek(zi.NAME));return t}return this.delimitedMany(zi.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(zi.BRACE_L)&&this._lexer.lookahead().kind===zi.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(zi.BRACE_L,this.parseFieldDefinition,zi.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(zi.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:Ui.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(zi.PAREN_L,this.parseInputValueDef,zi.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(zi.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(zi.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:Ui.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:Ui.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:Ui.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(zi.EQUALS)?this.delimitedMany(zi.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:Ui.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(zi.BRACE_L,this.parseEnumValueDefinition,zi.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:Ui.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:Ui.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(zi.BRACE_L,this.parseInputValueDef,zi.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===zi.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(zi.BRACE_L,this.parseOperationTypeDefinition,zi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:Ui.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:Ui.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:Ui.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:Ui.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Ui.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Ui.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Ui.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(zi.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:Ui.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(zi.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==Ji[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new Qi(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Mi(this._lexer.source,t.start,"Expected ".concat(po(e),", found ").concat(fo(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==zi.NAME||t.value!==e)throw Mi(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(fo(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===zi.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Mi(this._lexer.source,t.start,"Unexpected ".concat(fo(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function fo(e){var t=e.value;return po(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function po(e){return function(e){return e===zi.BANG||e===zi.DOLLAR||e===zi.AMP||e===zi.PAREN_L||e===zi.PAREN_R||e===zi.SPREAD||e===zi.COLON||e===zi.EQUALS||e===zi.AT||e===zi.BRACKET_L||e===zi.BRACKET_R||e===zi.BRACE_L||e===zi.PIPE||e===zi.BRACE_R}(e)?'"'.concat(e,'"'):e}var mo=new Map,yo=new Map,vo=!0,go=!1;function bo(e){return e.replace(/[\s,]+/g," ").trim()}function wo(e){var t,r,n,i=bo(e);if(!mo.has(i)){var o=function(e,t){return new ho(e,t).parseDocument()}(e,{experimentalFragmentVariables:go,allowLegacyFragmentVariables:go});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");mo.set(i,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=bo((a=e.loc).source.body.substring(a.start,a.end)),o=yo.get(t);o&&!o.has(i)?vo&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||yo.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var a}),vi(vi({},t),{definitions:n}))))}return mo.get(i)}function Ro(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]}),wo(n)}var Eo,ko=Ro;(Eo=Ro||(Ro={})).gql=ko,Eo.resetCaches=function(){mo.clear(),yo.clear()},Eo.disableFragmentWarnings=function(){vo=!1},Eo.enableExperimentalFragmentVariables=function(){go=!0},Eo.disableExperimentalFragmentVariables=function(){go=!1},Ro.default=Ro;const Oo=Ro`
6
+ `)),r+=1,await this.migratePullRequest(e,`${r} of ${t.length}`);e=(await this.getPullRequests(void 0,pr.Open,e=>fr(e,this.cmsLabelPrefix))).map(e=>e.head.ref)}return e}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,E.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map(e=>({context:e.context,target_url:e.target_url||"",state:e.state===hr.Success?E.PreviewState.Success:E.PreviewState.Other}))}async persistFiles(e,t,r){const n=t.concat(e),i=n.map(e=>this.uploadBlob(e));if(await Promise.all(i),r.useWorkflow){const i=t.map(({sha:e,path:t})=>({path:a()(t,"/"),sha:e})),o=e[0].slug;return this.editorialWorkflowGit(n,o,i,r)}return this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,n)).then(e=>this.commit(r.commitMessage,e)).then(e=>this.patchBranch(this.branch,e.sha))}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const n=e.split("/"),i=tr()(n),a=Zt()(n).join("/"),o=`${t}/git/trees/${r}:${encodeURIComponent(a)}`,s=(await this.request(o)).tree.find(e=>e.path===i);if(s)return s.sha;throw new E.APIError("Not Found",404,cr)}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const r=await this.getDefaultBranch(),n=e.map(e=>({path:e,sha:null})),i=await this.updateTree(r.commit.sha,n),a=await this.commit(t,i);await this.patchBranch(this.branch,a.sha)}async createBranchAndPullRequest(e,t,r){return await this.createBranch(e,t),this.createPR(r,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha||"",binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,r,n){const i=this.generateContentKey(n.collectionName,t),a=(0,E.branchFromContentKey)(i),o=n.unpublished||!1,s=!1!==n.hasSubfolders;if(o){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(a)),i=await Promise.all((t||[]).map(e=>this.diffFromFile(e))),o=[];for(const e of i.filter(e=>e.binary))r.some(t=>t.path===e.path)||o.push({path:e.path,sha:null});const u=await this.rebaseBranch(a),c=o.concat(e),l=await this.updateTree(u.sha,c,a,s),h=await this.commit(n.commitMessage,l);return this.patchBranch(a,h.sha,{force:!0})}{const t=await this.getDefaultBranch(),r=await this.updateTree(t.commit.sha,e,this.branch,s),i=await this.commit(n.commitMessage,r);if(this.useOpenAuthoring)await this.createBranch(a,i.sha);else{const e=await this.createBranchAndPullRequest(a,i.sha,n.commitMessage);await this.setPullRequestStatus(e,n.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const r=this.useOpenAuthoring?10:1;for(let n=1;n<=r;n++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(n===r)throw console.warn(`Reached maximum number of attempts '${r}' for getDifferences`),e;await new Promise(e=>setTimeout(e,500*n))}throw new E.APIError("Not Found",404,cr)}async rebaseSingleCommit(e,t){const r=dr((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(r.length>0){const n=await this.updateTree(e.sha,r),{message:i,author:a,committer:o}=t.commit;return await this.createCommit(i,n.sha,[e.sha],a?{name:a.name||"",email:a.email||"",date:a.date}:void 0,o?{name:o.name||"",email:o.email||"",date:o.date}:void 0)}return t}async rebaseCommits(e,t){return 0===t.length||t[0].parents[0].sha===e.sha?tr()(t):t.reduce((e,t)=>e.then(e=>{const r=e,n=t;return this.rebaseSingleCommit(r,n)}),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:r}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,r)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const r=[...e.labels.filter(e=>!(0,E.isCMSLabel)(e.name,this.cmsLabelPrefix)).map(e=>e.name),(0,E.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,r)}async updateUnpublishedEntryStatus(e,t,r){const n=this.generateContentKey(e,t),i=(0,E.branchFromContentKey)(n),a=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(-1!==a.number){const{state:e}=a;e===pr.Open&&"draft"===r&&await this.closePR(a.number),e===pr.Closed&&"pending_review"===r&&await this.openPR(a.number)}else if("pending_review"===r){const e=(0,E.branchFromContentKey)(n),t=await this.getDifferences(this.branch,await this.getHeadReference(e)),r=t.commits[0]?.commit?.message||yr.DEFAULT_COMMIT_MESSAGE;await this.createPR(r,e)}}else await this.setPullRequestStatus(a,r)}async deleteUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,E.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);-1!==i.number&&await this.closePR(i.number),await this.deleteBranch(n)}async publishUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,E.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);await this.mergePR(i),await this.deleteBranch(n),await this.closeIssueOnPublish(e,t)}async createRef(e,t,r){return await this.request(`${this.repoURL}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:r})})}async patchRef(e,t,r,n={}){const i=n.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:r,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(`${E.CMS_BRANCH_PREFIX}/`),`${E.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(r){const n=String(r.message||"");if("Reference update failed"===n)await(0,E.throwOnConflictingBranches)(e,e=>this.getBranch(e),cr);else if("Reference already exists"===n&&e.startsWith(`${E.CMS_BRANCH_PREFIX}/`))try{return await this.backupBranch(e),await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw r}}assertCmsBranch(e){return e.startsWith(`${E.CMS_BRANCH_PREFIX}/`)}patchBranch(e,t,r={}){const n=r.force||!1;if(n&&!this.assertCmsBranch(e))throw Error(`Only CMS branches can be force updated, cannot force update ${e}`);return this.patchRef("heads",e,t,{force:n})}deleteBranch(e){return this.deleteRef("heads",e).catch(e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e)))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(`${this.originRepoURL}/pulls`,{method:"POST",body:JSON.stringify({title:e,body:E.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){return console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:pr.Open})})}async closePR(e){return console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:pr.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:E.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof E.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=dr((await this.getDifferences(e.base.sha,e.head.sha)).files);let r="Automatically generated. Merged on Decap CMS\n\nForce merge of:";return t.forEach(e=>{r+=`\n* "${e.path}"`}),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,t)).then(e=>this.commit(r,e)).then(e=>this.patchBranch(this.branch,e.sha))}toBase64(e){return Promise.resolve(Yt.encode(e))}async uploadBlob(e){const t=await ar()(e,"toBase64",nr()(this.toBase64,e.raw)),r=await this.request(`${this.repoURL}/git/blobs`,{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=r.sha,e}async updateTree(e,t,r=this.branch,n=!0){const i=[],o=t.reduce((e,t)=>{const r={path:a()(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?i.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(r),e},[]);for(const{from:e,to:t,sha:s}of i)if(n){const n=(0,ur.dirname)(e),i=(0,ur.dirname)(t),a=await this.listFiles(n,{branch:r,depth:100});for(const t of a)o.push({path:t.path,mode:"100644",type:"blob",sha:null}),o.push({path:t.path.replace(n,i),mode:"100644",type:"blob",sha:t.path===e?s:t.id})}else o.push({path:a()(e,"/"),mode:"100644",type:"blob",sha:null}),o.push({path:a()(t,"/"),mode:"100644",type:"blob",sha:s});return{...await this.createTree(e,o),parentSha:e}}async createTree(e,t){return await this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const r=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,r)}async createCommit(e,t,r,n,i){return await this.request(`${this.repoURL}/git/commits`,{method:"POST",body:JSON.stringify({message:e,tree:t,parents:r,author:n,committer:i})})}async getUnpublishedEntrySha(e,t){const r=this.generateContentKey(e,t),n=(0,E.branchFromContentKey)(r);return(await this.getBranchPullRequest(n)).head.sha}static NOTE_STATUS_RESOLVED="RESOLVED";static NOTE_STATUS_OPEN="OPEN";static NOTES_LABEL="decap-cms-notes";static NOTE_ISSUE_PREFIX="Notes: ";static NOTE_REGEX=/^<!-- DecapCMS Note - Status: (RESOLVED|OPEN) -->([\s\S]+)$/;formatNoteForGithub(e){return`\x3c!-- DecapCMS Note - Status: ${e.resolved?yr.NOTE_STATUS_RESOLVED:yr.NOTE_STATUS_OPEN} --\x3e\n${e.content}`}parseCommentToNote(e){if(!e||!e.body||!e.user)throw new Error("Invalid comment structure");const t=e.body.match(yr.NOTE_REGEX),r=t?t[2].trim():e.body,n=!!t&&t[1]===yr.NOTE_STATUS_RESOLVED;if(!r.trim())throw new Error("Empty note content");return{id:e.id.toString(),author:e.user.login,avatarUrl:e.user.avatar_url,timestamp:e.created_at,content:r,resolved:n,entrySlug:""}}async createEntryIssue(e,t,r){const n=`${yr.NOTE_ISSUE_PREFIX}${r||`${e}/${t}`}`,i=`This issue tracks notes for entry: \`${e}/${t}\`\n\n---\n*This issue was created automatically by Decap CMS for note management.*`;return await this.request(`${this.repoURL}/issues`,{method:"POST",body:JSON.stringify({title:n,body:i,labels:[yr.NOTES_LABEL,`collection:${e}`]})})}async findEntryIssue(e,t){const r=`repo:${this.repo} label:${yr.NOTES_LABEL} "${e}/${t}" in:body`;try{const e=await this.request("/search/issues",{params:{q:r}});return e.items&&e.items.length>0?e.items[0]:null}catch(e){return console.warn("Failed to search for existing notes issue:",e),null}}async getIssueWithETag(e,t){try{const r={Authorization:`${this.tokenKeyword} ${this.token}`};t&&(r["If-None-Match"]=t);const n=await lr(`${this.apiRoot}${this.repoURL}/issues/${e}`,{headers:r});if(304===n.status)return{status:304};if(200===n.status){const t=await n.json(),i=n.headers.get("ETag"),a=await lr(`${this.apiRoot}${this.repoURL}/issues/${e}/comments`,{headers:r}),o=(await a.json()).map(e=>({id:e.id,body:e.body,user:e.user,created_at:e.created_at,updated_at:e.updated_at}));return{status:200,data:{number:t.number,title:t.title,body:t.body,state:t.state,updated_at:t.updated_at,comments:o,labels:t.labels,html_url:t.html_url},etag:i}}throw new Error(`Unexpected status: ${n.status}`)}catch(e){if(304===e.status)return{status:304};throw e}}async getIssueState(e){const t=await this.getIssueWithETag(e,null);if(200===t.status&&t.data)return t.data;throw new Error("Failed to get issue state")}async getIssueComments(e){try{const t=await this.request(`${this.repoURL}/issues/${e}/comments`);return Array.isArray(t)?t:[]}catch(e){return console.error("Failed to get issue comments:",e),[]}}async createIssueComment(e,t){try{return(await this.request(`${this.repoURL}/issues/${e}/comments`,{method:"POST",body:JSON.stringify({body:this.formatNoteForGithub(t)})})).id.toString()}catch(e){throw console.error("Failed to create issue comment:",e),new E.APIError("Failed to create note",e.status||500,cr)}}async updateIssueComment(e,t){try{await this.request(`${this.repoURL}/issues/comments/${e}`,{method:"PATCH",body:JSON.stringify({body:this.formatNoteForGithub(t)})})}catch(e){throw console.error("Failed to update issue comment:",e),new E.APIError("Failed to update note",e.status||500,cr)}}async deleteIssueComment(e){try{await this.request(`${this.repoURL}/issues/comments/${e}`,{method:"DELETE"})}catch(e){throw console.error("Failed to delete issue comment:",e),new E.APIError("Failed to delete note",e.status||500,cr)}}async closeIssueOnPublish(e,t){try{const r=`repo:${this.repo} label:${yr.NOTES_LABEL} "${e}/${t}" in:body state:open`,n=await this.request("/search/issues",{params:{q:r}});if(n.items&&n.items.length>0){const e=n.items[0];await this.request(`${this.repoURL}/issues/${e.number}`,{method:"PATCH",body:JSON.stringify({state:"closed",labels:[...(e.labels||[]).map(e=>e.name),"entry-published"]})})}}catch(e){console.warn("Failed to close notes issue on publish:",e)}}async reopenIssueOnUnpublish(e,t){try{const r=`repo:${this.repo} label:${yr.NOTES_LABEL} "${e}/${t}" in:body`,n=await this.request("/search/issues",{params:{q:r}});if(n.items&&n.items.length>0){const e=n.items[0],t=(e.labels||[]).map(e=>e.name).filter(e=>"entry-published"!==e&&"entry-deleted"!==e);await this.request(`${this.repoURL}/issues/${e.number}`,{method:"PATCH",body:JSON.stringify({state:"open",labels:t})})}}catch(e){console.warn("Failed to reopen notes issue on unpublish:",e)}}async getEntryNotes(e,t){try{const r=await this.findEntryIssue(e,t);if(!r)return[];const n=await this.getIssueComments(r.number),i=r.html_url;return n.map(e=>({...this.parseCommentToNote(e),issueUrl:i}))}catch(e){return console.error("Failed to get entry notes:",e),[]}}async addNoteToEntry(e,t,r,n){try{let i=await this.findEntryIssue(e,t);return i||(i=await this.createEntryIssue(e,t,n)),{commentId:await this.createIssueComment(i.number,r),issueUrl:i.html_url}}catch(e){throw console.error("Failed to add note to entry:",e),new E.APIError("Failed to create note",e.status||500,cr)}}async updateEntryNote(e,t){try{await this.updateIssueComment(e,t)}catch(e){throw console.error("Failed to update entry note:",e),new E.APIError("Failed to update note",e.status||500,cr)}}async deleteEntryNote(e){try{await this.deleteIssueComment(e)}catch(e){throw console.error("Failed to delete entry note:",e),new E.APIError("Failed to delete note",e.status||500,cr)}}async getEntriesWithNotes(){try{const e=`repo:${this.repo} label:${yr.NOTES_LABEL} state:open`,t=await this.request("/search/issues",{params:{q:e,per_page:100}}),r=[];for(const e of t.items||[]){const t=e.body.match(/entry: `(.+)\/(.+)`/);if(t){const[,n,i]=t;r.push({collection:n,slug:i,noteCount:e.comments})}}return r}catch(e){return console.error("Failed to get entries with notes:",e),[]}}async closeEntryNotesIssue(e,t){try{const r=`repo:${this.repo} label:${yr.NOTES_LABEL} "${e}/${t}" in:body state:open`,n=await this.request("/search/issues",{params:{q:r}});if(n.items&&n.items.length>0){const e=n.items[0];await this.request(`${this.repoURL}/issues/${e.number}`,{method:"PATCH",body:JSON.stringify({state:"closed",labels:[...(e.labels||[]).map(e=>e.name),"entry-deleted"]})})}}catch(e){console.warn("Failed to close notes issue:",e)}}async getPRMetadataFromBranch(e){try{const t=(await this.request(`${this.originRepoURL}/pulls`,{params:{head:await this.getHeadReference(e),state:"open"}}))[0];return t?{id:t.number.toString(),url:t.html_url,author:t.user?.login||"unknown",createdAt:t.created_at}:null}catch(e){return console.error("Failed to get PR metadata:",e),null}}}class vr{currentWatch=null;currentIssueKey=null;pollingInterval=15e3;intervalId=null;isDocumentVisible=!0;isPolling=!1;pendingRetryTimeout=null;constructor(e,t=15e3){this.api=e,this.pollingInterval=t,this.setupVisibilityListener()}setupVisibilityListener(){"undefined"!=typeof document&&document.addEventListener("visibilitychange",()=>{this.isDocumentVisible=!document.hidden,this.isDocumentVisible?(this.startPolling(),this.checkAllIssuesNow()):this.stopPolling()})}async watchIssue(e,t,r,n,i=null){const a=this.getIssueKey(t,r);if(this.currentWatch&&this.stopCurrentWatch(),!i)try{i=await this.api.getIssueState(e)}catch(e){console.error("[DecapNotes Polling] Failed to get initial state:",e)}return this.currentWatch={issueNumber:e,collection:t,slug:r,etag:null,lastState:i,onUpdate:n.onUpdate,onChange:n.onChange,retryCount:0,maxRetries:5},this.currentIssueKey=a,!this.intervalId&&this.isDocumentVisible&&this.startPolling(),this.checkCurrentIssue(),()=>this.stopCurrentWatch()}async watchIssueWithRetry(e,t,r,n=5,i=2e3){const a=this.getIssueKey(e,t);this.currentWatch&&this.stopCurrentWatch();const o=async s=>{try{const u=await this.api.findEntryIssue(e,t);return u?await this.watchIssue(u.number,e,t,r):s<n?new Promise((e,t)=>{this.pendingRetryTimeout=setTimeout(async()=>{this.pendingRetryTimeout=null;try{const t=await o(s+1);e(t)}catch(e){t(e)}},i)}):(console.log(`[DecapNotes Polling] No issue found for ${a} after ${n} attempts. This is expected if there are no notes for this entry yet.`),()=>{})}catch(e){if(console.error(`[DecapNotes Polling] Error finding issue for ${a}:`,e),s<n)return new Promise((e,t)=>{this.pendingRetryTimeout=setTimeout(async()=>{this.pendingRetryTimeout=null;try{const t=await o(s+1);e(t)}catch(e){t(e)}},i)});throw e}};return o(1)}stopCurrentWatch(){this.currentWatch&&(this.pendingRetryTimeout&&(clearTimeout(this.pendingRetryTimeout),this.pendingRetryTimeout=null),this.currentWatch=null,this.currentIssueKey=null,this.stopPolling())}startPolling(){!this.intervalId&&this.isDocumentVisible&&this.currentWatch&&(console.log(`[DecapNotes Polling] Starting polling loop (${this.pollingInterval}ms interval) for ${this.currentIssueKey}`),this.intervalId=setInterval(()=>{this.pollAllIssues()},this.pollingInterval))}stopPolling(){this.intervalId&&(console.log("[DecapNotes Polling] Stopping polling loop"),clearInterval(this.intervalId),this.intervalId=null)}async pollAllIssues(){await this.checkCurrentIssue()}async checkCurrentIssue(){if(this.currentWatch&&!this.isPolling){this.isPolling=!0;try{const e=this.currentWatch,t=await this.api.getIssueWithETag(e.issueNumber,e.etag);if(304===t.status)return;if(200===t.status){const r=t.data,n=t.etag;e.etag=n||null;const i=this.detectChanges(e.lastState,r);if(i.length>0){const t=r.comments.map(e=>({...this.api.parseCommentToNote(e),issueUrl:r.html_url}));e.onUpdate&&e.onUpdate(t,i),e.onChange&&i.forEach(t=>{e.onChange(t)})}e.lastState=r}}catch(e){e&&"object"==typeof e&&"status"in e&&304!==e.status&&console.error(`[DecapNotes Polling] Error checking ${this.currentIssueKey}:`,e)}finally{this.isPolling=!1}}}async checkAllIssuesNow(){await this.checkCurrentIssue()}async checkIssueNow(e,t){const r=this.getIssueKey(e,t);this.currentIssueKey===r?await this.checkCurrentIssue():console.warn(`[DecapNotes Polling] Cannot check ${r} - currently watching ${this.currentIssueKey}`)}detectChanges(e,t){if(!e)return[];const r=[],n=t.comments.filter(t=>!e.comments.some(e=>e.id===t.id));n.forEach(e=>{r.push({type:"comment_added",data:e,timestamp:e.created_at})}),t.comments.forEach(t=>{const n=e.comments.find(e=>e.id===t.id);n&&n.updated_at!==t.updated_at&&r.push({type:"comment_updated",data:t,previousData:n,timestamp:t.updated_at})});const i=e.comments.filter(e=>!t.comments.some(t=>t.id===e.id));return i.forEach(e=>{r.push({type:"comment_deleted",data:e,timestamp:(new Date).toISOString()})}),e.state!==t.state&&r.push({type:"issue_state_changed",data:{from:e.state,to:t.state},timestamp:t.updated_at}),this.hasLabelsChanged(e.labels,t.labels)&&r.push({type:"issue_labels_changed",data:{from:e.labels,to:t.labels},timestamp:t.updated_at}),r}hasLabelsChanged(e,t){if(e.length!==t.length)return!0;const r=e.map(e=>e.name).sort(),n=t.map(e=>e.name).sort();return r.join(",")!==n.join(",")}getIssueKey(e,t){return`${e}/${t}`}getStatus(){return{isPolling:null!==this.intervalId,currentWatch:this.currentIssueKey,watchedCount:this.currentWatch?1:0,pollingInterval:this.pollingInterval,isDocumentVisible:this.isDocumentVisible,hasPendingRetry:null!==this.pendingRetryTimeout}}destroy(){console.log("[DecapNotes Polling] Destroying polling manager"),this.pendingRetryTimeout&&(clearTimeout(this.pendingRetryTimeout),this.pendingRetryTimeout=null),this.stopCurrentWatch()}}var gr=function(e,t){return gr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},gr(e,t)};function br(e,t){function r(){this.constructor=e}gr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var wr=function(){return wr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wr.apply(this,arguments)};function Rr(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}u((n=n.apply(e,t||[])).next())})}function Er(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var kr=u(8048),Sr=function(e,t){return Sr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Sr(e,t)},Or="Invariant Violation",xr=Object.setPrototypeOf,_r=void 0===xr?function(e,t){return e.__proto__=t,e}:xr,Tr=function(e){function t(r){void 0===r&&(r=Or);var n=e.call(this,"number"==typeof r?Or+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Or,_r(n,t.prototype),n}return function(e,t){function r(){this.constructor=e}Sr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);function Pr(e,t){if(!e)throw new Tr(t)}function Ir(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=Ir("warn"),e.error=Ir("error")}(Pr||(Pr={}));var Cr={env:{}};if("object"==typeof process)Cr=process;else try{Function("stub","process = stub")(Cr)}catch(e){}var Ar=function(){return Ar=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ar.apply(this,arguments)};function Nr(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}var qr=u(6075),Fr=u.n(qr),Dr=Object.prototype,$r=Dr.toString,Lr=Dr.hasOwnProperty,Mr=new Map;function jr(e,t){try{return Ur(e,t)}finally{Mr.clear()}}function Ur(e,t){if(e===t)return!0;var r=$r.call(e);if(r!==$r.call(t))return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Br(e,t))return!0;var n=Object.keys(e),i=Object.keys(t),a=n.length;if(a!==i.length)return!1;for(var o=0;o<a;++o)if(!Lr.call(t,n[o]))return!1;for(o=0;o<a;++o){var s=n[o];if(!Ur(e[s],t[s]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Br(e,t))return!0;for(var u=e.entries(),c="[object Map]"===r;;){var l=u.next();if(l.done)break;var h=l.value,p=h[0],f=h[1];if(!t.has(p))return!1;if(c&&!Ur(f,t.get(p)))return!1}return!0}return!1}function Br(e,t){var r=Mr.get(e);if(r){if(r.has(t))return!0}else Mr.set(e,r=new Set);return r.add(t),!1}function Qr(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map(function(e){return Qr(i,e.name,e.value,n)}),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map(function(e){var r={};return Qr(r,t,e,n),r[t.value]});else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new Tr(17);e[t.value]=null}}var Vr=["connection","include","skip","client","rest","export"];function Kr(e,t,r){if(r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i=t,a={};return n.forEach(function(e){a[e]=i[e]}),r.connection.key+"("+JSON.stringify(a)+")"}return r.connection.key}var o=e;if(t){var s=Fr()(t);o+="("+s+")"}return r&&Object.keys(r).forEach(function(e){-1===Vr.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@"+e+"("+JSON.stringify(r[e])+")":o+="@"+e)}),o}function zr(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(e){var n=e.name,i=e.value;return Qr(r,n,i,t)}),r}return null}function Gr(e){return e.alias?e.alias.value:e.name.value}function Wr(e){return"Field"===e.kind}function Hr(e){return"InlineFragment"===e.kind}function Jr(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Yr(e,t){return void 0===t&&(t=!1),Ar({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Xr(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach(function(e){r[e.name.value]=zr(e,t)}),r}return null}function Zr(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(rn).map(function(e){var t=e.arguments;e.name.value,Pr(t&&1===t.length,14);var r=t[0];Pr(r.name&&"if"===r.name.value,15);var n=r.value;return Pr(n&&("Variable"===n.kind||"BooleanValue"===n.kind),16),{directive:e,ifArgument:r}}):[]).every(function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?Pr(void 0!==(i=t[n.value.name.value]),13):i=n.value.value,"skip"===r.name.value?!i:i});var r}function en(e,t){return function(e){var t=[];return(0,kr.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some(function(t){return e.indexOf(t)>-1})}function tn(e){return e&&en(["client"],e)&&en(["export"],e)}function rn(e){var t=e.name.value;return"skip"===t||"include"===t}function nn(e,t){var r=t,n=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new Tr(11);"FragmentDefinition"===e.kind&&n.push(e)}),void 0===r&&(Pr(1===n.length,12),r=n[0].name.value),Ar(Ar({},e),{definitions:Nr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function an(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach(function(t){null!=t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function on(e){return Pr(e&&"Document"===e.kind,2),Pr(e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new Tr(3);return e}).length<=1,4),e}function sn(e){return on(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function un(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null}function cn(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function ln(e){var t;on(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var a=i.operation;if("query"===a||"mutation"===a||"subscription"===a)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw new Tr(10)}function hn(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function pn(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,r=e.defaultValue,n={};return Qr(n,t.name,r),n});return an.apply(void 0,Nr([{}],t))}return{}}function fn(e,t,r){var n=0;return e.forEach(function(r,i){t.call(this,r,i,e)&&(e[n++]=r)},r),e.length=n,e}var dn={kind:"Field",name:{kind:"Name",value:"__typename"}};function mn(e,t){return e.selectionSet.selections.every(function(e){return"FragmentSpread"===e.kind&&mn(t[e.name.value],t)})}function yn(e){return mn(sn(e)||function(e){Pr("Document"===e.kind,7),Pr(e.definitions.length<=1,8);var t=e.definitions[0];return Pr("FragmentDefinition"===t.kind,9),t}(e),hn(cn(e)))?null:e}function vn(e){return function(t){return e.some(function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)})}}function gn(e,t){var r=Object.create(null),n=[],i=Object.create(null),a=[],o=yn((0,kr.visit)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some(function(e){return e.remove})&&t.directives&&t.directives.some(vn(e)))return t.arguments&&t.arguments.forEach(function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})}),t.selectionSet&&wn(t.selectionSet).forEach(function(e){a.push({name:e.name.value})}),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(vn(e)(t))return null}}}));return o&&fn(n,function(e){return!r[e.name]}).length&&(o=function(e,t){var r=function(e){return function(t){return e.some(function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return yn((0,kr.visit)(t,{OperationDefinition:{enter:function(t){return Ar(Ar({},t),{variableDefinitions:t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})})})}},Field:{enter:function(t){if(e.some(function(e){return e.remove})){var n=0;if(t.arguments.forEach(function(e){r(e)&&(n+=1)}),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,o)),o&&fn(a,function(e){return!i[e.name]}).length&&(o=function(e,t){function r(t){if(e.some(function(e){return e.name===t.name.value}))return null}return yn((0,kr.visit)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(a,o)),o}var bn={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some(function(e){return"key"===e.name.value})),t}};function wn(e){var t=[];return e.selections.forEach(function(e){(Wr(e)||Hr(e))&&e.selectionSet?wn(e.selectionSet).forEach(function(e){return t.push(e)}):"FragmentSpread"===e.kind&&t.push(e)}),t}function Rn(e){if("query"===ln(e).operation)return e;var t=(0,kr.visit)(e,{OperationDefinition:{enter:function(e){return Ar(Ar({},e),{operation:"query"})}}});return t}var En="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),kn=Object.prototype.toString;function Sn(e){return On(e,new Map)}function On(e,t){switch(kn.call(e)){case"[object Array]":if(t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(e,n){r[n]=On(e,t)}),r;case"[object Object]":if(t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(r){n[r]=On(e[r],t)}),n;default:return e}}function xn(e){return("undefined"!=typeof process?"production":"development")===e}function _n(e){try{return e()}catch(e){console.error&&console.error(e)}}function Tn(e){return e.errors&&e.errors.length}var Pn=Object.prototype.hasOwnProperty;function In(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Cn(e)}function Cn(e){var t=e[0]||{},r=e.length;if(r>1){var n=[];t=qn(t,n);for(var i=1;i<r;++i)t=Nn(t,e[i],n)}return t}function An(e){return null!==e&&"object"==typeof e}function Nn(e,t,r){return An(t)&&An(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=qn(e,r)),Object.keys(t).forEach(function(n){var i=t[n];if(Pn.call(e,n)){var a=e[n];i!==a&&(e[n]=Nn(qn(a,r),i,r))}else e[n]=i}),e):t}function qn(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):Ar({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({});var Fn=u(8784);const Dn=u.n(Fn)();var $n,Ln=function(e,t){return Ln=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Ln(e,t)},Mn=function(){return Mn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Mn.apply(this,arguments)};function jn(e){return e.request.length<=1}function Un(e){return new Dn(function(t){t.error(e)})}function Bn(e,t){return t?t(e):Dn.of()}function Qn(e){return"function"==typeof e?new Wn(e):e}function Vn(){return new Wn(function(){return Dn.of()})}function Kn(e){return 0===e.length?Vn():e.map(Qn).reduce(function(e,t){return e.concat(t)})}function zn(e,t,r){var n=Qn(t),i=Qn(r||new Wn(Bn));return jn(n)&&jn(i)?new Wn(function(t){return e(t)?n.request(t)||Dn.of():i.request(t)||Dn.of()}):new Wn(function(t,r){return e(t)?n.request(t,r)||Dn.of():i.request(t,r)||Dn.of()})}(function(e,t){function r(){this.constructor=e}Ln(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(function(e,t){var r=$n.call(this,e)||this;return r.link=t,r},$n=Error);var Gn=function(e,t){var r=Qn(e);if(jn(r))return r;var n=Qn(t);return jn(n)?new Wn(function(e){return r.request(e,function(e){return n.request(e)||Dn.of()})||Dn.of()}):new Wn(function(e,t){return r.request(e,function(e){return n.request(e,t)||Dn.of()})||Dn.of()})},Wn=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,r,n){return this.concat(zn(t,r,n||new e(Bn)))},e.prototype.concat=function(e){return Gn(this,e)},e.prototype.request=function(e,t){throw new Tr(1)},e.empty=Vn,e.from=Kn,e.split=zn,e.execute=Hn,e}();function Hn(e,t){return e.request(function(e,t){var r=Mn({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=Mn({},r,"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Mn({},r)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,r=e.variables,n=e.operationName;return JSON.stringify([n,t,r])}(t)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?un(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new Tr(2)}return e}(t))))||Dn.of()}var Jn,Yn=u(1158);function Xn(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Jn||(Jn={}));var Zn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return br(t,e),t.prototype[Yn.A]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(Dn);function ei(e){return Array.isArray(e)&&e.length>0}var ti,ri=function(e){function t(r){var n,i,a=r.graphQLErrors,o=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=a||[],c.networkError=o||null,c.message=s||(i="",ei((n=c).graphQLErrors)&&n.graphQLErrors.forEach(function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"}),n.networkError&&(i+="Network error: "+n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return br(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(ti||(ti={}));var ni=function(e){function t(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,a=void 0===i||i,o=e.call(this,function(e){return o.onSubscribe(e)})||this;o.observers=new Set,o.subscriptions=new Set,o.isTornDown=!1,o.options=n,o.variables=n.variables||{},o.queryId=r.generateQueryId(),o.shouldSubscribe=a;var s=sn(n.query);return o.queryName=s&&s.name&&s.name.value,o.queryManager=r,o}return br(t,e),t.prototype.result=function(){var e=this;return new Promise(function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){i.unsubscribe()},0)},error:r},i=e.subscribe(n)})},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Jn.error}}var t,r,n,i=this.queryManager.getCurrentQueryResult(this),a=i.data,o=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(r=s,void 0===(n=this.options.errorPolicy)&&(n="none"),r&&(r.networkError||"none"===n&&ei(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new ri({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=wr(wr({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:a,loading:Xn(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var h=c||o&&"cache-only"!==u;t={data:a,loading:h,networkStatus:h?Jn.loading:Jn.ready}}return o||this.updateLastResult(wr(wr({},t),{stale:!1})),wr(wr({},t),{partial:o})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&jr(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new Tr(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),jr(this.variables,e)||(this.variables=wr(wr({},this.variables),e)),jr(this.options.variables,this.variables)||(this.options.variables=wr(wr({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,wr(wr({},this.options),{fetchPolicy:t}),ti.refetch))},t.prototype.fetchMore=function(e){var t=this;Pr(e.updateQuery,2);var r=wr(wr({},e.query?e:wr(wr(wr({},this.options),e),{variables:wr(wr({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,ti.normal,this.queryId).then(function(i){return t.updateQuery(function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:r.variables})}),t.queryManager.stopQuery(n),i},function(e){throw t.queryManager.stopQuery(n),e})},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery(function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})})},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=wr(wr({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&jr(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,a=r.document,o=_n(function(){return e(n,{variables:i})});o&&(t.dataStore.markUpdateQueryResult(a,i,o),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){oi(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:Sn(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=ii)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(oi(this),t.startPollingQuery(this.options,r));var n=function(t){e.updateLastResult(wr(wr({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Jn.error,loading:!1})),ai(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,a=i.query,o=i.variables,s=i.fetchPolicy;t.transform(a).hasClientExports?t.getLocalState().addExportedVariables(a,o).then(function(i){var o=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==s&&t.transform(a).serverQuery&&!jr(o,i)?e.refetch():ai(e.observers,"next",r)}):ai(e.observers,"next",r)}},error:n}).catch(n)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Zn);function ii(e){}function ai(e,t,r){var n=[];e.forEach(function(e){return e[t]&&n.push(e)}),n.forEach(function(e){return e[t](r)})}function oi(e){var t=e.options.fetchPolicy;Pr("cache-first"!==t&&"cache-only"!==t,3)}var si=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),ui=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];Pr(!t||t.document===e.document||jr(t.document,e.document),19);var r,n=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Jn.loading&&(jr(t.variables,e.variables)||(n=!0,i=t.variables)),r=n?Jn.setVariables:e.isPoll?Jn.poll:e.isRefetch?Jn.refetch:Jn.loading;var a=[];t&&t.graphQLErrors&&(a=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:a,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Jn.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=ei(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Jn.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=Jn.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Jn.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=Jn.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach(function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=Jn.loading})},e}(),ci=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=In(t.resolvers,e)}):this.resolvers=In(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return Rr(this,void 0,void 0,function(){return Er(this,function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,o).then(function(e){return wr(wr({},r),{data:e.result})})]:[2,r]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return en(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){on(e);var t=gn([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,kr.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every(function(e){return Wr(e)&&"__typename"===e.name.value}))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return wr(wr({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);Pr(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),Rr(this,void 0,void 0,function(){return Er(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then(function(e){return wr(wr({},t),e.exportedVariables)})]:[2,wr({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,kr.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return kr.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Rn(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,a){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),Rr(this,void 0,void 0,function(){var o,s,u,c,l,h,p,f,d;return Er(this,function(m){var y;return o=ln(e),s=cn(e),u=hn(s),c=o.operation,l=c?(y=c).charAt(0).toUpperCase()+y.slice(1):"Query",p=(h=this).cache,f=h.client,d={fragmentMap:u,context:wr(wr({},r),{cache:p,client:f}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(o.selectionSet,t,d).then(function(e){return{result:e,exportedVariables:d.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,r){return Rr(this,void 0,void 0,function(){var n,i,a,o,s,u=this;return Er(this,function(c){return n=r.fragmentMap,i=r.context,a=r.variables,o=[t],s=function(e){return Rr(u,void 0,void 0,function(){var s,u;return Er(this,function(c){return Zr(e,a)?Wr(e)?[2,this.resolveField(e,t,r).then(function(t){var r;void 0!==t&&o.push(((r={})[Gr(e)]=t,r))})]:(Hr(e)?s=e:Pr(s=n[e.name.value],7),s&&s.typeCondition&&(u=s.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then(function(e){o.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(s)).then(function(){return Cn(o)})]})})},e.prototype.resolveField=function(e,t,r){return Rr(this,void 0,void 0,function(){var n,i,a,o,s,u,c,l,h,p=this;return Er(this,function(f){return n=r.variables,i=e.name.value,a=Gr(e),o=i!==a,s=t[a]||t[i],u=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(h=l[o?i:a])&&(u=Promise.resolve(h(t,zr(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,u.then(function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)})}),e.selectionSet?null==t?t:Array.isArray(t)?p.resolveSubSelectedArray(e,t,r):e.selectionSet?p.resolveSelectionSet(e.selectionSet,t,r):void 0:t})]})})},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0}))},e}();function li(e){var t=new Set,r=null;return new Zn(function(n){return t.add(n),r=r||e.subscribe({next:function(e){t.forEach(function(t){return t.next&&t.next(e)})},error:function(e){t.forEach(function(t){return t.error&&t.error(e)})},complete:function(){t.forEach(function(e){return e.complete&&e.complete()})}}),function(){t.delete(n)&&!t.size&&r&&(r.unsubscribe(),r=null)}})}var hi=Object.prototype.hasOwnProperty,pi=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,a=e.onBroadcast,o=void 0===a?function(){}:a,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,h=e.localState,p=e.assumeImmutableResults;this.mutationStore=new si,this.queryStore=new ui,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(En?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=o,this.clientAwareness=l,this.localState=h||new ci({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!p}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.fetchQueryRejectFns.forEach(function(e){e(new Tr(8))})},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,a=e.refetchQueries,o=void 0===a?[]:a,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.errorPolicy,h=void 0===l?"none":l,p=e.fetchPolicy,f=e.context,d=void 0===f?{}:f;return Rr(this,void 0,void 0,function(){var e,a,s,l=this;return Er(this,function(f){switch(f.label){case 0:return Pr(t,9),Pr(!p||"no-cache"===p,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,function(){return{document:t}}),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=f.sent(),f.label=2;case 2:return a=function(){var e={};return i&&l.queries.forEach(function(t,r){var n=t.observableQuery;if(n){var a=n.queryName;a&&hi.call(i,a)&&(e[r]={updater:i[a],query:l.queryStore.get(r)})}}),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:a(),update:c,optimisticResponse:n}),this.broadcastQueries(),s=this,[2,new Promise(function(i,l){var f,m;s.getObservableFromLink(t,wr(wr({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){Tn(n)&&"none"===h?m=new ri({graphQLErrors:n.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==p&&s.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:a(),update:c}),f=n)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),s.setQuery(e,function(){return{document:null}}),l(new ri({networkError:t}))},complete:function(){if(m&&s.mutationStore.markMutationError(e,m),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),m)l(m);else{"function"==typeof o&&(o=o(f));var t=[];ei(o)&&o.forEach(function(e){if("string"==typeof e)s.queries.forEach(function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())});else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(s.query(r))}}),Promise.all(u?t:[]).then(function(){s.setQuery(e,function(){return{document:null}}),"ignore"===h&&f&&Tn(f)&&delete f.errors,i(f)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,r,n){return Rr(this,void 0,void 0,function(){var i,a,o,s,u,c,l,h,p,f,d,m,y,v,g,b,w,R,E=this;return Er(this,function(k){switch(k.label){case 0:return i=t.metadata,a=void 0===i?null:i,o=t.fetchPolicy,s=void 0===o?"cache-first":o,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,h=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,h,c)]:[3,2];case 1:h=k.sent(),k.label=2;case 2:if(t=wr(wr({},t),{variables:h}),d=f="network-only"===s||"no-cache"===s,f||(m=this.dataStore.getCache().diff({query:l,variables:h,returnPartialData:!0,optimistic:!1}),y=m.complete,v=m.result,d=!y||"cache-and-network"===s,p=v),g=d&&"cache-only"!==s&&"standby"!==s,en(["live"],l)&&(g=!0),b=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,function(){return{document:l,lastRequestId:b,invalidated:!0,cancel:w}}),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:g,variables:h,isPoll:r===ti.poll,isRefetch:r===ti.refetch,metadata:a,fetchMoreForQueryId:n}),this.broadcastQueries(),g){if(R=this.fetchRequest({requestId:b,queryId:e,document:l,options:t,fetchMoreForQueryId:n}).catch(function(t){throw t.hasOwnProperty("graphQLErrors")?t:(b>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,n),E.invalidate(e),E.invalidate(n),E.broadcastQueries()),new ri({networkError:t}))}),"cache-and-network"!==s)return[2,R];R.catch(function(){})}return this.queryStore.markQueryResultClient(e,!g),this.invalidate(e),this.invalidate(n),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:p},context:c,variables:h,onlyRunForcedResolvers:!0}).then(function(r){return E.markQueryResult(e,r,t,n),E.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:p}])}})})},e.prototype.markQueryResult=function(e,t,r,n){var i=r.fetchPolicy,a=r.variables,o=r.errorPolicy;"no-cache"===i?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,a,n,"ignore"===o||"all"===o)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function i(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,a){if(n.invalidate(e,!1),r){var o=n.getQuery(e),s=o.observableQuery,u=o.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Xn(r.networkStatus),h=s&&s.getLastResult(),p=!(!h||h.networkStatus===r.networkStatus),f=t.returnPartialData||!a&&r.previousVariables||p&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||f){var d=ei(r.graphQLErrors),m=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&d||r.networkError)return i("error",new ri({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var y=void 0,v=void 0;if(a)"no-cache"!==c&&"network-only"!==c&&n.setQuery(e,function(){return{newData:null}}),y=a.result,v=!a.complete;else{var g=s&&s.getLastError(),b="none"!==m&&(g&&g.graphQLErrors)!==r.graphQLErrors;if(h&&h.data&&!b)y=h.data,v=!1;else{var w=n.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});y=w.result,v=!w.complete}}var R=v&&!(t.returnPartialData||"cache-only"===c),E={data:R?h&&h.data:y,loading:l,networkStatus:r.networkStatus,stale:R};"all"===m&&d&&(E.errors=r.graphQLErrors),i("next",E)}catch(e){i("error",new ri({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.dataStore.getCache(),i=n.transformDocument(e),a=(t=n.transformForLink(i),gn([bn],on(t))),o=this.localState.clientQuery(i),s=this.localState.serverQuery(a),u={document:i,hasClientExports:tn(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:o,serverQuery:s,defaultVars:pn(sn(i))},c=function(e){e&&!r.has(e)&&r.set(e,u)};c(e),c(i),c(o),c(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return wr(wr({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),Pr("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=wr({},e);return new ni({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return Pr(e.query,12),Pr("Document"===e.query.kind,13),Pr(!e.returnPartialData,14),Pr(!e.pollInterval,15),new Promise(function(r,n){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,n),i.result().then(r,n).then(function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)})})},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){return e.listeners.add(t),{invalidated:!1}})},e.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;return i&&i(),this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}})},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,function(){return{observableQuery:null}}),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach(function(e){e(new Tr(16))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach(function(n,i){var a=n.observableQuery;if(a){var o=a.options.fetchPolicy;a.resetLastResults(),"cache-only"===o||!e&&"standby"===o||r.push(a.refetch()),t.setQuery(i,function(){return{newData:null}}),t.invalidate(i)}}),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var a=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),Tn(i))throw new ri({graphQLErrors:i.errors});return i})};if(this.transform(r).hasClientExports){var o=this.localState.addExportedVariables(r,i).then(a);return new Zn(function(e){var t=null;return o.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return a(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,a=r.fetchPolicy,o=r.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===a||"network-only"===a)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:n,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||o?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;Pr(r,17),t=r}else t=e;var n=t.options,i=n.variables,a=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:a}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners.forEach(function(n){n&&n(e.queryStore.get(r),t.newData)})})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,a=this;void 0===n&&(n=this.queryDeduplication);var o=this.transform(e).serverQuery;if(o){var s=this.inFlightLinkObservables,u=this.link,c={query:o,variables:r,operationName:un(o)||void 0,context:this.prepareContext(wr(wr({},t),{forceFetch:!n}))};if(t=c.context,n){var l=s.get(o)||new Map;s.set(o,l);var h=JSON.stringify(r);if(!(i=l.get(h))){l.set(h,i=li(Hn(u,c)));var p=function(){l.delete(h),l.size||s.delete(o),f.unsubscribe()},f=i.subscribe({next:p,error:p,complete:p})}}else i=li(Hn(u,c))}else i=Zn.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e){return new Zn(function(n){var i=n.next,o=n.error,s=n.complete,u=0,c=!1,l={next:function(e){++u,new Promise(function(n){n(function(e){return a.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}(e))}).then(function(e){--u,i&&i.call(n,e),c&&l.complete()},function(e){--u,o&&o.call(n,e)})},error:function(e){o&&o.call(n,e)},complete:function(){c=!0,u||s&&s.call(n)}},h=e.subscribe(l);return function(){return h.unsubscribe()}})}(i)),i},e.prototype.fetchRequest=function(e){var t,r,n=this,i=e.requestId,a=e.queryId,o=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,h=void 0===l?"none":l,p=s.fetchPolicy;return new Promise(function(e,l){var f=n.getObservableFromLink(o,s.context,c),d="fetchRequest:"+a;n.fetchQueryRejectFns.set(d,l);var m=function(){n.fetchQueryRejectFns.delete(d),n.setQuery(a,function(e){e.subscriptions.delete(y)})},y=f.map(function(e){if(i>=n.getQuery(a).lastRequestId&&(n.markQueryResult(a,e,s,u),n.queryStore.markQueryResult(a,e,u),n.invalidate(a),n.invalidate(u),n.broadcastQueries()),"none"===h&&ei(e.errors))return l(new ri({graphQLErrors:e.errors}));if("all"===h&&(r=e.errors),u||"no-cache"===p)t=e.data;else{var f=n.dataStore.getCache().diff({variables:c,query:o,optimistic:!1,returnPartialData:!0}),d=f.result;(f.complete||s.returnPartialData)&&(t=d)}}).subscribe({error:function(e){m(),l(e)},complete:function(){m(),e({data:t,errors:r,loading:!1,networkStatus:Jn.ready,stale:!1})}});n.setQuery(a,function(e){e.subscriptions.add(y)})})},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=wr(wr({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,function(){return{invalidated:t}})},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return wr(wr({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Jn.ready&&t.networkStatus!==Jn.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,i=e.pollInterval;if(Pr(i,18),!this.ssrMode){var a=this.pollingInfoByQueryId.get(t);a||this.pollingInfoByQueryId.set(t,a={}),a.interval=i,a.options=wr(wr({},e),{fetchPolicy:"network-only"});var o=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?s():n.fetchQuery(t,e.options,ti.poll).then(s,s))},s=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(o,e.interval))};r&&this.addQueryListener(t,r),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),fi=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var a=!Tn(e);i&&Tn(e)&&e.data&&(a=!0),!n&&a&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){Tn(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction(function(n){var i=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=i}},e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Tn(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach(function(i){var a=n[i],o=a.query,s=a.updater,u=t.cache.diff({query:o.document,variables:o.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=_n(function(){return s(c,{mutationResult:e.result,queryName:un(o.document)||void 0,queryVariables:o.variables})});l&&r.push({result:l,dataId:"ROOT_QUERY",query:o.document,variables:o.variables})}}),this.cache.performTransaction(function(t){r.forEach(function(e){return t.write(e)});var n=e.update;n&&_n(function(){return n(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),di=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,i=void 0!==n&&n,a=e.ssrForceFetchDelay,o=void 0===a?0:a,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,h=e.assumeImmutableResults,p=void 0!==h&&h,f=e.resolvers,d=e.typeDefs,m=e.fragmentMatcher,y=e.name,v=e.version,g=e.link;if(!g&&f&&(g=Wn.empty()),!g||!r)throw new Tr(4);this.link=g,this.cache=r,this.store=new fi(r),this.disableNetworkFetches=i||o>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,o&&setTimeout(function(){return t.disableNetworkFetches=!1},o),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),void 0!==s&&s&&"undefined"!=typeof window&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new ci({cache:r,client:this,resolvers:f,fragmentMatcher:m}),this.queryManager=new pi({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:y,version:v},localState:this.localState,assumeImmutableResults:p,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=wr(wr({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=wr(wr({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=wr(wr({},this.defaultOptions.query),e)),Pr("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=wr(wr({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=wr(wr({},this.defaultOptions.mutate),e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Hn(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}(),mi=function(e,t){return mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},mi(e,t)};function yi(e,t){function r(){this.constructor=e}mi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var vi=function(){return vi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vi.apply(this,arguments)};function gi(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:bi(e)}]}}function bi(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return bi(e[0]);var t=[];return Object.keys(e).forEach(function(r){var n={kind:"Field",name:{kind:"Name",value:r},selectionSet:bi(e[r])||void 0};t.push(n)}),{kind:"SelectionSet",selections:t}}var wi,Ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},Ei=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:nn(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:nn(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,r,n=e.id,i=e.data;if(void 0!==n){var a=null;try{a=this.read({rootId:n,optimistic:!1,query:Ri})}catch(e){}var o=a&&a.__typename||"__ClientData",s=Object.assign({__typename:o},i);this.writeFragment({id:n,fragment:(t=s,r=o,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:r||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:bi(t)}]}),data:s})}else this.writeQuery({query:gi(i),data:i})},e}();wi||(wi={});var ki=null,Si={},Oi=1,xi="@wry/context:Slot",_i=Array,Ti=_i[xi]||function(){var e=function(){function e(){this.id=["slot",Oi++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=ki;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Si)break;return e!==ki&&(ki.slots[this.id]=t),!0}return ki&&(ki.slots[this.id]=Si),!1},e.prototype.getValue=function(){if(this.hasValue())return ki.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,a=((i={__proto__:null})[this.id]=e,i),o=ki;ki={parent:o,slots:a};try{return t.apply(n,r)}finally{ki=o}},e.bind=function(e){var t=ki;return function(){var r=ki;try{return ki=t,e.apply(this,arguments)}finally{ki=r}}},e.noContext=function(e,t,r){if(!ki)return e.apply(r,t);var n=ki;try{return ki=null,e.apply(r,t)}finally{ki=n}},e}();try{Object.defineProperty(_i,xi,{value:_i[xi]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function Pi(){}Ti.bind,Ti.noContext;var Ii=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Pi),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Ci=new Ti,Ai=[],Ni=[];function qi(e,t){if(!e)throw new Error(t||"assertion failure")}function Fi(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Di=function(){function e(t,r){this.fn=t,this.args=r,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(qi(!this.recomputing,"already recomputing"),function(e){var t=Ci.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Li(e)?Ui(t,e):Bi(t,e),t}(this)||!Vi(this))return Li(this)?(t=Ki(e=this),Ci.withValue(e,$i,[e]),function(e){if("function"==typeof e.subscribe)try{Gi(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){e.dirty=!1,Li(e)||ji(e)}(e),t.forEach(Vi),Fi(e.value)):Fi(this.value);var e,t},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Mi(this),Gi(this))},e.prototype.dispose=function(){var e=this;Ki(this).forEach(Vi),Gi(this),this.parents.forEach(function(t){t.setDirty(),zi(t,e)})},e.count=0,e}();function $i(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function Li(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Mi(e){e.parents.forEach(function(t){return Ui(t,e)})}function ji(e){e.parents.forEach(function(t){return Bi(t,e)})}function Ui(e,t){if(qi(e.childValues.has(t)),qi(Li(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Ni.pop()||new Set;e.dirtyChildren.add(t),Mi(e)}function Bi(e,t){qi(e.childValues.has(t)),qi(!Li(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),Qi(e,t),Li(e)||ji(e)}function Qi(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(Ni.length<100&&Ni.push(r),e.dirtyChildren=null))}function Vi(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function Ki(e){var t=Ai;return e.childValues.size>0&&(t=[],e.childValues.forEach(function(r,n){zi(e,n),t.push(n)})),qi(null===e.dirtyChildren),t}function zi(e,t){t.parents.delete(e),e.childValues.delete(t),Qi(e,t)}function Gi(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Wi=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach(function(e){return t=t.getChildTrie(e)}),t.data||(t.data=Object.create(null))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness)),n},e}(),Hi=new Wi("function"==typeof WeakMap);function Ji(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Hi.lookupArray(e)}var Yi=new Set;function Xi(e,t){void 0===t&&(t=Object.create(null));var r=new Ii(t.max||Math.pow(2,16),function(e){return e.dispose()}),n=!!t.disposable,i=t.makeCacheKey||Ji;function a(){if(!n||Ci.hasValue()){var a=i.apply(null,arguments);if(void 0===a)return e.apply(null,arguments);var o=Array.prototype.slice.call(arguments),s=r.get(a);s?s.args=o:(s=new Di(e,o),r.set(a,s),s.subscribe=t.subscribe,n&&(s.reportOrphan=function(){return r.delete(a)}));var u=s.recompute();return r.set(a,s),Yi.add(r),Ci.hasValue()||(Yi.forEach(function(e){return e.clean()}),Yi.clear()),n?void 0:u}}return a.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&r.get(e);t&&t.setDirty()},a}var Zi=!1;function ea(){var e=!Zi;return!0===xn("test")||(Zi=!0),e}var ta=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var a=n.__typename,o=void 0===a?i&&"Query":a;return o&&o===t||(ea(),"heuristic")},e}(),ra=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){Pr(this.isReady,1);var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var a=n.__typename,o=void 0===a?i&&"Query":a;if(Pr(o,2),o===t)return!0;var s=this.possibleTypesMap[t];return!!(o&&s&&s.indexOf(o)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}(),na=Object.prototype.hasOwnProperty,ia=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Xi(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){na.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){na.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function aa(e){return new ia(e)}var oa=function(){function e(e){var t=this,r=void 0===e?{}:e,n=r.cacheKeyRoot,i=void 0===n?new Wi(En):n,a=r.freezeResults,o=void 0!==a&&a,s=this,u=s.executeStoreQuery,c=s.executeSelectionSet,l=s.executeSubSelectedArray;this.freezeResults=o,this.executeStoreQuery=Xi(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,n=e.contextValue,a=e.variableValues,o=e.fragmentMatcher;if(n.store instanceof ia)return i.lookup(n.store,t,o,JSON.stringify(a),r.id)}}),this.executeSelectionSet=Xi(function(e){return c.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof ia)return i.lookup(n.contextValue.store,t,n.fragmentMatcher,JSON.stringify(n.variableValues),r.id)}}),this.executeSubSelectedArray=Xi(function(e){return l.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.execContext;if(n.contextValue.store instanceof ia)return i.lookup(n.contextValue.store,t,r,JSON.stringify(n.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(vi(vi({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.variables,a=e.previousResult,o=e.returnPartialData,s=void 0===o||o,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,h=e.config;i=an({},pn((Pr((t=sn(n))&&"query"===t.operation,6),t)),i);var p={store:r,dataIdFromObject:h&&h.dataIdFromObject,cacheRedirects:h&&h.cacheRedirects||{}},f=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:p,variableValues:i,fragmentMatcher:l}),d=f.missing&&f.missing.length>0;return d&&!s&&f.missing.forEach(function(e){if(!e.tolerable)throw new Tr(8)}),a&&jr(a,f.result)&&(f.result=a),{result:f.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,r=e.rootValue,n=e.contextValue,i=e.variableValues,a=e.fragmentMatcher,o=void 0===a?ua:a,s=ln(t),u={query:t,fragmentMap:hn(cn(t)),contextValue:n,variableValues:i,fragmentMatcher:o};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:r,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,r=e.selectionSet,n=e.rootValue,i=e.execContext,a=i.fragmentMap,o=i.contextValue,s=i.variableValues,u={result:null},c=[],l=o.store.get(n.id),h=l&&l.__typename||"ROOT_QUERY"===n.id&&"Query"||void 0;function p(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return r.selections.forEach(function(e){var r;if(Zr(e,s))if(Wr(e)){var u=p(t.executeField(l,h,e,i));void 0!==u&&c.push(((r={})[Gr(e)]=u,r))}else{var f=void 0;if(Hr(e))f=e;else if(!(f=a[e.name.value]))throw new Tr(9);var d=f.typeCondition&&f.typeCondition.name.value,m=!d||i.fragmentMatcher(n,d,o);if(m){var y=t.executeSelectionSet({selectionSet:f.selectionSet,rootValue:n,execContext:i});"heuristic"===m&&y.missing&&(y=vi(vi({},y),{missing:y.missing.map(function(e){return vi(vi({},e),{tolerable:!0})})})),c.push(p(y))}}}),u.result=Cn(c),this.freezeResults,u},e.prototype.executeField=function(e,t,r,n){var i=n.variableValues,a=n.contextValue,o=function(e,t,r,n,i,a){var o=a.directives,s=r;(n||o)&&(s=Kr(s,n,o));var u,c=void 0;if(e&&void 0===(c=e[s])&&i.cacheRedirects&&"string"==typeof t){var l=i.cacheRedirects[t];if(l){var h=l[r];h&&(c=h(e,n,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Yr({id:t,typename:e.__typename})}}))}}return void 0===c?{result:c,missing:[{object:e,fieldName:s,tolerable:!1}]}:(null!=(u=c)&&"object"==typeof u&&"json"===u.type&&(c=c.json),{result:c})}(e,t,r.name.value,zr(r,i),a,{resultKey:Gr(r),directives:Xr(r,i)});return Array.isArray(o.result)?this.combineExecResults(o,this.executeSubSelectedArray({field:r,array:o.result,execContext:n})):r.selectionSet?null==o.result?o:this.combineExecResults(o,this.executeSelectionSet({selectionSet:r.selectionSet,rootValue:o.result,execContext:n})):(sa(r,o.result),this.freezeResults,o)},e.prototype.combineExecResults=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.forEach(function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)}),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,r=this,n=e.field,i=e.array,a=e.execContext;function o(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map(function(e){return null===e?null:Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,execContext:a})):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,rootValue:e,execContext:a})):(sa(n,e),e)}),this.freezeResults,{result:i,missing:t}},e}();function sa(e,t){if(!e.selectionSet&&Jr(t))throw new Tr(10)}function ua(){return!0}var ca=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),la=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return yi(t,e),t}(Error),ha=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,r=e.result,n=e.store,i=void 0===n?aa():n,a=e.variables,o=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:r,document:t,store:i,variables:a,dataIdFromObject:o,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,r=e.result,n=e.document,i=e.store,a=void 0===i?aa():i,o=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=sn(n);try{return this.writeSelectionSetToStore({result:r,dataId:t,selectionSet:c.selectionSet,context:{store:a,processedData:{},variables:an({},pn(c),o),dataIdFromObject:s,fragmentMap:hn(cn(n)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var r=new la("Error writing result to store for query:\n "+JSON.stringify(t));return r.message+="\n"+e.message,r.stack=e.stack,r}(e,n)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,r=e.result,n=e.dataId,i=e.selectionSet,a=e.context,o=a.variables,s=a.store,u=a.fragmentMap;return i.selections.forEach(function(e){var i;if(Zr(e,o))if(Wr(e)){var s=Gr(e),c=r[s];if(void 0!==c)t.writeFieldToStore({dataId:n,value:c,field:e,context:a});else{var l=!1,h=!1;e.directives&&e.directives.length&&(l=e.directives.some(function(e){return e.name&&"defer"===e.name.value}),h=e.directives.some(function(e){return e.name&&"client"===e.name.value})),!l&&!h&&a.fragmentMatcherFunction}}else{var p=void 0;Hr(e)?p=e:Pr(p=(u||{})[e.name.value],3);var f=!0;if(a.fragmentMatcherFunction&&p.typeCondition){var d=n||"self",m=Yr({id:d,typename:void 0}),y={store:new ca((i={},i[d]=r,i)),cacheRedirects:{}},v=a.fragmentMatcherFunction(m,p.typeCondition.name.value,y);xn("production"),f=!!v}f&&t.writeSelectionSetToStore({result:r,selectionSet:p.selectionSet,dataId:n,context:a})}}),s},e.prototype.writeFieldToStore=function(e){var t,r,n,i=e.field,a=e.value,o=e.dataId,s=e.context,u=s.variables,c=s.dataIdFromObject,l=s.store,h=function(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var i=n.name,a=n.value;return Qr(r[e.name.value],i,a,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var r=e.name,i=e.value;return Qr(n,r,i,t)})),Kr(e.name.value,n,r)}(i,u);if(i.selectionSet&&null!==a)if(Array.isArray(a)){var p=o+"."+h;r=this.processArrayValue(a,p,i.selectionSet,s)}else{var f=o+"."+h,d=!0;if(pa(f)||(f="$"+f),c){var m=c(a);Pr(!m||!pa(m),4),(m||"number"==typeof m&&0===m)&&(f=m,d=!1)}da(f,i,s.processedData)||this.writeSelectionSetToStore({dataId:f,result:a,selectionSet:i.selectionSet,context:s});var y=a.__typename;r=Yr({id:f,typename:y},d);var v=(n=l.get(o))&&n[h];if(v!==r&&Jr(v)){var g=void 0!==v.typename,b=void 0!==y,w=g&&b&&v.typename!==y;Pr(!d||v.generated||w,5),Pr(!g||b,6),v.generated&&(w?d||l.delete(v.id):fa(v.id,r.id,l))}}else r=null!=a&&"object"==typeof a?{type:"json",json:a}:a;(n=l.get(o))&&jr(r,n[h])||l.set(o,vi(vi({},n),((t={})[h]=r,t)))},e.prototype.processArrayValue=function(e,t,r,n){var i=this;return e.map(function(e,a){if(null===e)return null;var o=t+"."+a;if(Array.isArray(e))return i.processArrayValue(e,o,r,n);var s=!0;if(n.dataIdFromObject){var u=n.dataIdFromObject(e);u&&(o=u,s=!1)}return da(o,r,n.processedData)||i.writeSelectionSetToStore({dataId:o,result:e,selectionSet:r,context:n}),Yr({id:o,typename:e.__typename},s)})},e}();function pa(e){return"$"===e[0]}function fa(e,t,r){if(e===t)return!1;var n=r.get(e),i=r.get(t),a=!1;Object.keys(n).forEach(function(e){var t=n[e],o=i[e];Jr(t)&&pa(t.id)&&Jr(o)&&!jr(t,o)&&fa(t.id,o.id,r)&&(a=!0)}),r.delete(e);var o=vi(vi({},n),i);return jr(o,i)?a:(r.set(t,o),!0)}function da(e,t,r){if(!r)return!1;if(r[e]){if(r[e].indexOf(t)>=0)return!0;r[e].push(t)}else r[e]=[t];return!1}var ma={fragmentMatcher:new ta,dataIdFromObject:ya,addTypename:!0,resultCaching:!0,freezeResults:!1};function ya(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var va=Object.prototype.hasOwnProperty,ga=function(e){function t(t,r,n){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=r,i.transaction=n,i}return yi(t,e),t.prototype.toObject=function(){return vi(vi({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return va.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(ca),ba=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new Wi(En),r.silenceBroadcast=!1,r.config=vi(vi({},ma),t),r.config.customResolvers&&(r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=!!r.config.addTypename,r.data=r.config.resultCaching?new ia:new ca,r.optimisticData=r.data,r.storeWriter=new ha,r.storeReader=new oa({cacheKeyRoot:r.cacheKeyRoot,freezeResults:t.freezeResults});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=Xi(function(e){return i.call(r,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return n.data instanceof ia?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return yi(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new Tr(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],r=0,n=this.optimisticData;n instanceof ga;)n.optimisticId===e?++r:t.push(n),n=n.parent;if(r>0){for(this.optimisticData=n;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var r=this.data,n=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new ga(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=n,this.data=r}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(r=e,t=(0,kr.visit)(on(r),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n&&!n.some(function(e){return Wr(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var i=r;if(!(Wr(i)&&i.directives&&i.directives.some(function(e){return"export"===e.name.value})))return Ar(Ar({},e),{selections:Nr(n,[dn])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}var r;return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(Ei),wa=function(e,t){return wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},wa(e,t)},Ra=function(){return Ra=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ra.apply(this,arguments)},Ea=function(){return Ea=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ea.apply(this,arguments)},ka=u(3230),Sa={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Oa=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},xa=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new Tr(2);throw n.parseError=e,n}return r},_a=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.includeExtensions,a=e.useGETForQueries,o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new Tr(1)}(n),n||(n=fetch);var s={http:{includeExtensions:i},options:o.fetchOptions,credentials:o.credentials,headers:o.headers};return new Wn(function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),o={};if(i.clientAwareness){var u=i.clientAwareness,c=u.name,l=u.version;c&&(o["apollographql-client-name"]=c),l&&(o["apollographql-client-version"]=l)}var h,p=Ra({},o,i.headers),f={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:p},d=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ea({},t.options,{headers:t.headers,credentials:t.credentials}),a=t.http;r.forEach(function(e){i=Ea({},i,e.options,{headers:Ea({},i.headers,e.headers)}),e.credentials&&(i.credentials=e.credentials),a=Ea({},a,e.http)});var o=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=(0,ka.y)(c)),{options:i,body:l}}(e,Sa,s,f),m=d.options,y=d.body;if(!m.signal){var v=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),g=v.controller,b=v.signal;(h=g)&&(m.signal=b)}if(a&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(m.method="GET"),"GET"===m.method){var w=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=xa(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var a=void 0;try{a=xa(t.extensions)}catch(e){return{parseError:e}}n("extensions",a)}var o="",s=e,u=e.indexOf("#");-1!==u&&(o=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+o}}(t,y),R=w.newURI,E=w.parseError;if(E)return Un(E);t=R}else try{m.body=xa(y)}catch(E){return Un(E)}return new Dn(function(r){var i;return n(t,m).then(function(t){return e.setContext({response:t}),t}).then((i=e,function(e){return e.text().then(function(t){try{return JSON.parse(t)}catch(n){var r=n;return r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,Promise.reject(r)}}).then(function(t){return e.status>=300&&Oa(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||Oa(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map(function(e){return e.operationName}):i.operationName)+"'."),t})})).then(function(e){return r.next(e),r.complete(),e}).catch(function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))}),function(){h&&h.abort()}})})};!function(e){!function(e,t){function r(){this.constructor=e}wa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(function(t){return e.call(this,_a(t).request)||this},e)}(Wn);var Ta=u(8244),Pa=u.n(Ta),Ia=function(){return Ia=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ia.apply(this,arguments)};function Ca(e,t){if(!Boolean(e))throw new Error(t)}function Aa(e){return Aa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Aa(e)}Object.create,Object.create,"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var Na="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function qa(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,a=t+1-(r.index+r[0].length);return{line:i,column:a}}function Fa(e){return Da(e.source,qa(e.source,e.start))}function Da(e,t){var r=e.locationOffset.column-1,n=La(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?r:0,u=t.column+s,c="".concat(e.name,":").concat(o,":").concat(u,"\n"),l=n.split(/\r\n|[\n\r]/g),h=l[i];if(h.length>120){for(var p=Math.floor(u/80),f=u%80,d=[],m=0;m<h.length;m+=80)d.push(h.slice(m,m+80));return c+$a([["".concat(o),d[0]]].concat(d.slice(1,p+1).map(function(e){return["",e]}),[[" ",La(f-1)+"^"],["",d[p+1]]]))}return c+$a([["".concat(o-1),l[i-1]],["".concat(o),h],["",La(u-1)+"^"],["".concat(o+1),l[i+1]]])}function $a(e){var t=e.filter(function(e){return e[0],void 0!==e[1]}),r=Math.max.apply(Math,t.map(function(e){return e[0].length}));return t.map(function(e){var t,n=e[0],i=e[1];return La(r-(t=n).length)+t+(i?" | "+i:" |")}).join("\n")}function La(e){return Array(e+1).join(" ")}function Ma(e){return Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ma(e)}function ja(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ua(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ba(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Qa(e,t){return!t||"object"!==Ma(t)&&"function"!=typeof t?Va(e):t}function Va(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ka(e){var t="function"==typeof Map?new Map:void 0;return Ka=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return za(e,arguments,Ha(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Wa(n,e)},Ka(e)}function za(e,t,r){return za=Ga()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Wa(i,r.prototype),i},za.apply(null,arguments)}function Ga(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function Wa(e,t){return Wa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wa(e,t)}function Ha(e){return Ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ha(e)}var Ja=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wa(e,t)}(o,e);var t,r,n,i,a=(t=o,r=Ga(),function(){var e,n=Ha(t);if(r){var i=Ha(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return Qa(this,e)});function o(e,t,r,n,i,s,u){var c,l,h,p;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(p=a.call(this,e)).name="GraphQLError",p.originalError=null!=s?s:void 0,p.nodes=Ya(Array.isArray(t)?t:t?[t]:void 0);for(var f=[],d=0,m=null!==(y=p.nodes)&&void 0!==y?y:[];d<m.length;d++){var y,v=m[d].loc;null!=v&&f.push(v)}f=Ya(f),p.source=null!=r?r:null===(c=f)||void 0===c?void 0:c[0].source,p.positions=null!=n?n:null===(l=f)||void 0===l?void 0:l.map(function(e){return e.start}),p.locations=n&&r?n.map(function(e){return qa(r,e)}):null===(h=f)||void 0===h?void 0:h.map(function(e){return qa(e.source,e.start)}),p.path=null!=i?i:void 0;var g,b=null==s?void 0:s.extensions;return null==u&&"object"==Aa(g=b)&&null!==g?p.extensions=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ja(Object(r),!0).forEach(function(t){Ua(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ja(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},b):p.extensions=null!=u?u:{},Object.defineProperties(Va(p),{message:{enumerable:!0},locations:{enumerable:null!=p.locations},path:{enumerable:null!=p.path},extensions:{enumerable:null!=p.extensions&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(Va(p),"stack",{value:s.stack,writable:!0,configurable:!0}),Qa(p)):(Error.captureStackTrace?Error.captureStackTrace(Va(p),o):Object.defineProperty(Va(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return n=o,i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+Fa(i.loc))}else if(e.source&&e.locations)for(var a=0,o=e.locations;a<o.length;a++){var s=o[a];t+="\n\n"+Da(e.source,s)}return t}(this)}},{key:"toJSON",value:function(){return function(e){var t;e||Ca(0,"Received null or undefined error.");var r=null!==(t=e.message)&&void 0!==t?t:"An unknown error occurred.",n=e.locations,i=e.path,a=e.extensions;return a&&Object.keys(a).length>0?{message:r,locations:n,path:i,extensions:a}:{message:r,locations:n,path:i}}(this)}},{key:Na,get:function(){return"Object"}}],i&&Ba(n.prototype,i),o}(Ka(Error));function Ya(e){return void 0===e||0===e.length?void 0:e}function Xa(e,t,r){return new Ja("Syntax Error: ".concat(r),void 0,e,[t])}var Za=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const eo="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function to(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,eo&&(e.prototype[eo]=t)}var ro=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();to(ro);var no=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();to(no);var io=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function ao(e){return ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ao(e)}function oo(e,t){switch(ao(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(eo)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:oo(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(oo(e[a],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map(function(r){return r+": "+oo(e[r],t)}).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function so(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var uo=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||Ca(0,"Body must be a string. Received: ".concat(oo(e,[]),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||Ca(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ca(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:Na,get:function(){return"Source"}}])&&so(t.prototype,r),e}(),co=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function lo(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:10===e.charCodeAt(o+1)&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===a||i<a)&&(a=i),n=!1}return null!==(t=a)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&ho(t[i]);)++i;for(var a=t.length;a>i&&ho(t[a-1]);)--a;return t.slice(i,a).join("\n")}function ho(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var po=function(){function e(e){var t=new no(io.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==io.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=mo(this,e)}while(e.kind===io.COMMENT);return e},e}();function fo(e){return isNaN(e)?io.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function mo(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a<i;){var o=n.charCodeAt(a),s=e.line,u=1+a-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++e.line,e.lineStart=a;continue;case 13:10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;continue;case 33:return new no(io.BANG,a,a+1,s,u,t);case 35:return vo(r,a,s,u,t);case 36:return new no(io.DOLLAR,a,a+1,s,u,t);case 38:return new no(io.AMP,a,a+1,s,u,t);case 40:return new no(io.PAREN_L,a,a+1,s,u,t);case 41:return new no(io.PAREN_R,a,a+1,s,u,t);case 46:if(46===n.charCodeAt(a+1)&&46===n.charCodeAt(a+2))return new no(io.SPREAD,a,a+3,s,u,t);break;case 58:return new no(io.COLON,a,a+1,s,u,t);case 61:return new no(io.EQUALS,a,a+1,s,u,t);case 64:return new no(io.AT,a,a+1,s,u,t);case 91:return new no(io.BRACKET_L,a,a+1,s,u,t);case 93:return new no(io.BRACKET_R,a,a+1,s,u,t);case 123:return new no(io.BRACE_L,a,a+1,s,u,t);case 124:return new no(io.PIPE,a,a+1,s,u,t);case 125:return new no(io.BRACE_R,a,a+1,s,u,t);case 34:return 34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)?Ro(r,a,s,u,t,e):wo(r,a,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return go(r,a,o,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return So(r,a,s,u,t)}throw Xa(r,a,yo(o))}var c=e.line,l=1+a-e.lineStart;return new no(io.EOF,i,i,c,l,t)}function yo(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(fo(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(fo(e),".")}function vo(e,t,r,n,i){var a,o=e.body,s=t;do{a=o.charCodeAt(++s)}while(!isNaN(a)&&(a>31||9===a));return new no(io.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function go(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw Xa(e,u,"Invalid number, unexpected digit after 0: ".concat(fo(s),"."))}else u=bo(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=bo(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=bo(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Xa(e,u,"Invalid number, expected digit but got: ".concat(fo(s),"."));return new no(c?io.FLOAT:io.INT,t,u,n,i,a,o.slice(t,u))}function bo(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw Xa(e,i,"Invalid number, expected digit but got: ".concat(fo(a),"."))}function wo(e,t,r,n,i){for(var a=e.body,o=t+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&10!==u&&13!==u;){if(34===u)return c+=a.slice(s,o),new no(io.STRING,t,o+1,r,n,i,c);if(u<32&&9!==u)throw Xa(e,o,"Invalid character within String: ".concat(fo(u),"."));if(++o,92===u){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=Eo(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var h=a.slice(o+1,o+5);throw Xa(e,o,"Invalid character escape sequence: \\u".concat(h,"."))}c+=String.fromCharCode(l),o+=4;break;default:throw Xa(e,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}s=++o}}throw Xa(e,o,"Unterminated string.")}function Ro(e,t,r,n,i,a){for(var o=e.body,s=t+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(34===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2))return l+=o.slice(u,s),new no(io.BLOCK_STRING,t,s+3,r,n,i,lo(l));if(c<32&&9!==c&&10!==c&&13!==c)throw Xa(e,s,"Invalid character within String: ".concat(fo(c),"."));10===c?(++s,++a.line,a.lineStart=s):13===c?(10===o.charCodeAt(s+1)?s+=2:++s,++a.line,a.lineStart=s):92===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2)&&34===o.charCodeAt(s+3)?(l+=o.slice(u,s)+'"""',u=s+=4):++s}throw Xa(e,s,"Unterminated string.")}function Eo(e,t,r,n){return ko(e)<<12|ko(t)<<8|ko(r)<<4|ko(n)}function ko(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function So(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new no(io.NAME,t,s,r,n,i,a.slice(t,s))}var Oo=function(){function e(e,t){var r=function(e){return e instanceof uo}(e)?e:new uo(e);this._lexer=new po(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(io.NAME);return{kind:Za.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:Za.DOCUMENT,definitions:this.many(io.SOF,this.parseDefinition,io.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(io.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(io.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(io.BRACE_L))return{kind:Za.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(io.NAME)&&(t=this.parseName()),{kind:Za.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(io.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(io.PAREN_L,this.parseVariableDefinition,io.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:Za.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(io.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(io.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(io.DOLLAR),{kind:Za.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:Za.SELECTION_SET,selections:this.many(io.BRACE_L,this.parseSelection,io.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(io.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(io.COLON)?(e=n,t=this.parseName()):t=n,{kind:Za.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(io.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(io.PAREN_L,t,io.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(io.COLON),{kind:Za.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:Za.ARGUMENT,name:this.parseName(),value:(this.expectToken(io.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(io.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(io.NAME)?{kind:Za.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:Za.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:Za.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:Za.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case io.BRACKET_L:return this.parseList(e);case io.BRACE_L:return this.parseObject(e);case io.INT:return this._lexer.advance(),{kind:Za.INT,value:t.value,loc:this.loc(t)};case io.FLOAT:return this._lexer.advance(),{kind:Za.FLOAT,value:t.value,loc:this.loc(t)};case io.STRING:case io.BLOCK_STRING:return this.parseStringLiteral();case io.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:Za.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:Za.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:Za.NULL,loc:this.loc(t)};default:return{kind:Za.ENUM,value:t.value,loc:this.loc(t)}}case io.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:Za.STRING,value:e.value,block:e.kind===io.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:Za.LIST,values:this.any(io.BRACKET_L,function(){return t.parseValueLiteral(e)},io.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:Za.OBJECT,fields:this.any(io.BRACE_L,function(){return t.parseObjectField(e)},io.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(io.COLON),{kind:Za.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(io.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(io.AT),{kind:Za.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(io.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(io.BRACKET_R),e={kind:Za.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(io.BANG)?{kind:Za.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:Za.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===io.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(io.STRING)||this.peek(io.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(io.BRACE_L,this.parseOperationTypeDefinition,io.BRACE_R);return{kind:Za.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(io.COLON);var r=this.parseNamedType();return{kind:Za.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:Za.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:Za.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(io.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(io.AMP)||this.peek(io.NAME));return t}return this.delimitedMany(io.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(io.BRACE_L)&&this._lexer.lookahead().kind===io.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(io.BRACE_L,this.parseFieldDefinition,io.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(io.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:Za.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(io.PAREN_L,this.parseInputValueDef,io.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(io.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(io.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:Za.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:Za.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:Za.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(io.EQUALS)?this.delimitedMany(io.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:Za.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(io.BRACE_L,this.parseEnumValueDefinition,io.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:Za.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:Za.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(io.BRACE_L,this.parseInputValueDef,io.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===io.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(io.BRACE_L,this.parseOperationTypeDefinition,io.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:Za.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:Za.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:Za.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:Za.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Za.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Za.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Za.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(io.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:Za.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(io.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==co[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new ro(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Xa(this._lexer.source,t.start,"Expected ".concat(_o(e),", found ").concat(xo(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==io.NAME||t.value!==e)throw Xa(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(xo(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===io.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Xa(this._lexer.source,t.start,"Unexpected ".concat(xo(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function xo(e){var t=e.value;return _o(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function _o(e){return function(e){return e===io.BANG||e===io.DOLLAR||e===io.AMP||e===io.PAREN_L||e===io.PAREN_R||e===io.SPREAD||e===io.COLON||e===io.EQUALS||e===io.AT||e===io.BRACKET_L||e===io.BRACKET_R||e===io.BRACE_L||e===io.PIPE||e===io.BRACE_R}(e)?'"'.concat(e,'"'):e}var To=new Map,Po=new Map,Io=!0,Co=!1;function Ao(e){return e.replace(/[\s,]+/g," ").trim()}function No(e){var t,r,n,i=Ao(e);if(!To.has(i)){var a=function(e,t){return new Oo(e,t).parseDocument()}(e,{experimentalFragmentVariables:Co,allowLegacyFragmentVariables:Co,experimentalFragmentArguments:Co});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");To.set(i,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=a,r=new Set,n=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=Ao((o=e.loc).source.body.substring(o.start,o.end)),a=Po.get(t);a&&!a.has(i)?Io&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Po.set(t,a=new Set),a.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var o}),Ia(Ia({},t),{definitions:n}))))}return To.get(i)}function qo(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]}),No(n)}var Fo,Do=qo;(Fo=qo||(qo={})).gql=Do,Fo.resetCaches=function(){To.clear(),Po.clear()},Fo.disableFragmentWarnings=function(){Io=!1},Fo.enableExperimentalFragmentVariables=function(){Co=!0},Fo.disableExperimentalFragmentVariables=function(){Co=!1},qo.default=qo;const $o=qo`
7
7
  fragment RepositoryParts on Repository {
8
8
  id
9
9
  isFork
10
10
  }
11
- `,xo=Ro`
11
+ `,Lo=qo`
12
12
  fragment BlobWithTextParts on Blob {
13
13
  id
14
14
  text
15
15
  is_binary: isBinary
16
16
  }
17
- `,So=Ro`
17
+ `,Mo=qo`
18
18
  fragment ObjectParts on GitObject {
19
19
  id
20
20
  sha: oid
21
21
  }
22
- `,_o=Ro`
22
+ `,jo=qo`
23
23
  fragment BranchParts on Ref {
24
24
  commit: target {
25
25
  ...ObjectParts
@@ -31,9 +31,9 @@
31
31
  ...RepositoryParts
32
32
  }
33
33
  }
34
- ${So}
35
- ${Oo}
36
- `,Io=Ro`
34
+ ${Mo}
35
+ ${$o}
36
+ `,Uo=qo`
37
37
  fragment PullRequestParts on PullRequest {
38
38
  id
39
39
  baseRefName
@@ -61,15 +61,15 @@
61
61
  }
62
62
  }
63
63
  }
64
- ${Oo}
65
- `,To=(Ro`
64
+ ${$o}
65
+ `,Bo=(qo`
66
66
  fragment TreeEntryParts on TreeEntry {
67
67
  path: name
68
68
  sha: oid
69
69
  type
70
70
  mode
71
71
  }
72
- `,Ro`
72
+ `,qo`
73
73
  fragment FileEntryParts on TreeEntry {
74
74
  name
75
75
  sha: oid
@@ -80,15 +80,15 @@
80
80
  }
81
81
  }
82
82
  }
83
- `),Ao=Ro`
83
+ `),Qo=qo`
84
84
  query repoPermission($owner: String!, $name: String!) {
85
85
  repository(owner: $owner, name: $name) {
86
86
  ...RepositoryParts
87
87
  viewerPermission
88
88
  }
89
89
  }
90
- ${Oo}
91
- `,Po=Ro`
90
+ ${$o}
91
+ `,Vo=qo`
92
92
  query {
93
93
  viewer {
94
94
  id
@@ -97,7 +97,7 @@
97
97
  login
98
98
  }
99
99
  }
100
- `,Co=Ro`
100
+ `,Ko=qo`
101
101
  query blob($owner: String!, $name: String!, $expression: String!) {
102
102
  repository(owner: $owner, name: $name) {
103
103
  ...RepositoryParts
@@ -108,9 +108,9 @@
108
108
  }
109
109
  }
110
110
  }
111
- ${Oo}
112
- ${xo}
113
- `,No=Ro`
111
+ ${$o}
112
+ ${Lo}
113
+ `,zo=qo`
114
114
  query statues($owner: String!, $name: String!, $sha: GitObjectID!) {
115
115
  repository(owner: $owner, name: $name) {
116
116
  ...RepositoryParts
@@ -130,14 +130,14 @@
130
130
  }
131
131
  }
132
132
  }
133
- ${Oo}
134
- ${So}
135
- `;function qo(e){return Ro`
133
+ ${$o}
134
+ ${Mo}
135
+ `;function Go(e){return qo`
136
136
  query files($owner: String!, $name: String!, $expression: String!) {
137
137
  repository(owner: $owner, name: $name) {
138
138
  ...RepositoryParts
139
139
  object(expression: $expression) {
140
- ${function(e=1){const t="PLACE_HOLDER";let r=E`
140
+ ${function(e=1){const t="PLACE_HOLDER";let r=w`
141
141
  ...ObjectParts
142
142
  ... on Tree {
143
143
  entries {
@@ -145,7 +145,7 @@
145
145
  ${t}
146
146
  }
147
147
  }
148
- `;for(let n=0;n<e-1;n++)r=r.replace(t,E`
148
+ `;for(let n=0;n<e-1;n++)r=r.replace(t,w`
149
149
  object {
150
150
  ... on Tree {
151
151
  entries {
@@ -158,19 +158,19 @@
158
158
  }
159
159
  }
160
160
  }
161
- ${Oo}
162
- ${So}
163
- ${To}
164
- `}const Fo="\nbranch: ref(qualifiedName: $qualifiedName) {\n ...BranchParts\n}\n",Do=Ro`
161
+ ${$o}
162
+ ${Mo}
163
+ ${Bo}
164
+ `}const Wo="\nbranch: ref(qualifiedName: $qualifiedName) {\n ...BranchParts\n}\n",Ho=qo`
165
165
  query branch($owner: String!, $name: String!, $qualifiedName: String!) {
166
166
  repository(owner: $owner, name: $name) {
167
167
  ...RepositoryParts
168
- ${Fo}
168
+ ${Wo}
169
169
  }
170
170
  }
171
- ${Oo}
172
- ${_o}
173
- `,Bo=Ro`
171
+ ${$o}
172
+ ${jo}
173
+ `,Jo=qo`
174
174
  query openAuthoringBranches($owner: String!, $name: String!, $refPrefix: String!) {
175
175
  repository(owner: $owner, name: $name) {
176
176
  ...RepositoryParts
@@ -181,24 +181,24 @@
181
181
  }
182
182
  }
183
183
  }
184
- ${Oo}
185
- ${_o}
186
- `,Lo=Ro`
184
+ ${$o}
185
+ ${jo}
186
+ `,Yo=qo`
187
187
  query repository($owner: String!, $name: String!) {
188
188
  repository(owner: $owner, name: $name) {
189
189
  ...RepositoryParts
190
190
  }
191
191
  }
192
- ${Oo}
193
- `,Mo="\npullRequest(number: $number) {\n ...PullRequestParts\n}\n",Uo=Ro`
192
+ ${$o}
193
+ `,Xo="\npullRequest(number: $number) {\n ...PullRequestParts\n}\n",Zo=qo`
194
194
  query pullRequest($owner: String!, $name: String!, $number: Int!) {
195
195
  repository(owner: $owner, name: $name) {
196
196
  id
197
- ${Mo}
197
+ ${Xo}
198
198
  }
199
199
  }
200
- ${Io}
201
- `,jo=Ro`
200
+ ${Uo}
201
+ `,es=qo`
202
202
  query pullRequests($owner: String!, $name: String!, $head: String, $states: [PullRequestState!]) {
203
203
  repository(owner: $owner, name: $name) {
204
204
  id
@@ -209,22 +209,22 @@
209
209
  }
210
210
  }
211
211
  }
212
- ${Io}
213
- `,$o=Ro`
212
+ ${Uo}
213
+ `,ts=qo`
214
214
  query pullRequestAndBranch($owner: String!, $name: String!, $originRepoOwner: String!, $originRepoName: String!, $qualifiedName: String!, $number: Int!) {
215
215
  repository(owner: $owner, name: $name) {
216
216
  ...RepositoryParts
217
- ${Fo}
217
+ ${Wo}
218
218
  }
219
219
  origin: repository(owner: $originRepoOwner, name: $originRepoName) {
220
220
  ...RepositoryParts
221
- ${Mo}
221
+ ${Xo}
222
222
  }
223
223
  }
224
- ${Oo}
225
- ${_o}
226
- ${Io}
227
- `,Qo=Ro`
224
+ ${$o}
225
+ ${jo}
226
+ ${Uo}
227
+ `,rs=qo`
228
228
  query fileSha($owner: String!, $name: String!, $expression: String!) {
229
229
  repository(owner: $owner, name: $name) {
230
230
  ...RepositoryParts
@@ -233,9 +233,9 @@
233
233
  }
234
234
  }
235
235
  }
236
- ${Oo}
237
- ${So}
238
- `,Vo=Ro`
236
+ ${$o}
237
+ ${Mo}
238
+ `,ns=qo`
239
239
  mutation updateRef($input: UpdateRefInput!) {
240
240
  updateRef(input: $input) {
241
241
  branch: ref {
@@ -243,31 +243,31 @@
243
243
  }
244
244
  }
245
245
  }
246
- ${_o}
247
- `,zo="\ndeleteRef(input: $deleteRefInput) {\n clientMutationId\n}\n",Ko=Ro`
246
+ ${jo}
247
+ `,is="\ndeleteRef(input: $deleteRefInput) {\n clientMutationId\n}\n",as=qo`
248
248
  mutation deleteRef($deleteRefInput: DeleteRefInput!) {
249
- ${zo}
249
+ ${is}
250
250
  }
251
- `,Go="\nclosePullRequest(input: $closePullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n",Wo=Ro`
251
+ `,os="\nclosePullRequest(input: $closePullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n",ss=qo`
252
252
  mutation closePullRequestAndDeleteBranch($closePullRequestInput: ClosePullRequestInput!) {
253
- ${Go}
253
+ ${os}
254
254
  }
255
- ${Io}
256
- `,Ho=Ro`
255
+ ${Uo}
256
+ `,us=qo`
257
257
  mutation closePullRequestAndDeleteBranch(
258
258
  $closePullRequestInput: ClosePullRequestInput!
259
259
  $deleteRefInput: DeleteRefInput!
260
260
  ) {
261
- ${Go}
262
- ${zo}
261
+ ${os}
262
+ ${is}
263
263
  }
264
- ${Io}
265
- `,Jo="\n createPullRequest(input: $createPullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n ",Yo=Ro`
264
+ ${Uo}
265
+ `,cs="\n createPullRequest(input: $createPullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n ",ls=qo`
266
266
  mutation createPullRequest($createPullRequestInput: CreatePullRequestInput!) {
267
- ${Jo}
267
+ ${cs}
268
268
  }
269
- ${Io}
270
- `,Xo=Ro`
269
+ ${Uo}
270
+ `,hs=qo`
271
271
  mutation createBranch($createRefInput: CreateRefInput!) {
272
272
  createRef(input: $createRefInput) {
273
273
  branch: ref {
@@ -275,8 +275,8 @@
275
275
  }
276
276
  }
277
277
  }
278
- ${_o}
279
- `,Zo=Ro`
278
+ ${jo}
279
+ `,ps=qo`
280
280
  mutation createBranchAndPullRequest(
281
281
  $createRefInput: CreateRefInput!
282
282
  $createPullRequestInput: CreatePullRequestInput!
@@ -286,11 +286,11 @@
286
286
  ...BranchParts
287
287
  }
288
288
  }
289
- ${Jo}
289
+ ${cs}
290
290
  }
291
- ${_o}
292
- ${Io}
293
- `,ea=Ro`
291
+ ${jo}
292
+ ${Uo}
293
+ `,fs=qo`
294
294
  mutation reopenPullRequest($reopenPullRequestInput: ReopenPullRequestInput!) {
295
295
  reopenPullRequest(input: $reopenPullRequestInput) {
296
296
  clientMutationId
@@ -299,8 +299,8 @@
299
299
  }
300
300
  }
301
301
  }
302
- ${Io}
303
- `,ta="no-cache",ra="cache-first",na=new Qn({introspectionQueryResultData:yi()});function ia(e){return{...e,labels:e.labels.nodes,head:{ref:e.headRefName,sha:e.headRefOid,repo:{fork:e.repository.isFork}},base:{ref:e.baseRefName,sha:e.baseRefOid}}}class oa extends it{constructor(e){super(e),this.client=this.getApolloClient()}getApolloClient(){const e=(r=(e,{headers:t})=>({headers:{"Content-Type":"application/json; charset=utf-8",...t,authorization:this.token?`${this.tokenKeyword} ${this.token}`:""}}),new qr(function(e,t){var n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,[]);return new Er(function(i){var o;return Promise.resolve(n).then(function(t){return r(t,e.getContext())}).then(e.setContext).then(function(){o=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)})}).catch(i.error.bind(i)),function(){o&&o.unsubscribe()}})})),t=di({uri:`${this.apiRoot}/graphql`});var r;return new en({link:e.concat(t),cache:new ai({fragmentMatcher:na}),defaultOptions:{watchQuery:{fetchPolicy:ta,errorPolicy:"ignore"},query:{fetchPolicy:ta,errorPolicy:"all"}}})}reset(){return this.client.resetStore()}async getRepository(e,t){const{data:r}=await this.query({query:Lo,variables:{owner:e,name:t},fetchPolicy:ra});return r.repository}query(e){return this.client.query(e).catch(e=>{throw new O.APIError(e.message,500,"GitHub")})}async mutate(e){try{return await this.client.mutate(e)}catch(t){const r=t.graphQLErrors;if(Array.isArray(r)&&r.some(e=>"Ref cannot be created."===e.message)){const t=e?.variables?.createRefInput?.name||"",r=s()(t,"refs/heads/");r&&await(0,O.throwOnConflictingBranches)(r,e=>this.getBranch(e),Ye)}else if(Array.isArray(r)&&r.some(e=>new RegExp(`A ref named "refs/heads/${O.CMS_BRANCH_PREFIX}/.+?" already exists in the repository.`).test(e.message))){const t=e?.variables?.createRefInput?.name||"",r=e?.variables?.createRefInput?.oid||"",n=s()(t,"refs/heads/");if(n&&n.startsWith(`${O.CMS_BRANCH_PREFIX}/`)&&r)try{return await this.backupBranch(n),await this.deleteBranch(n),await this.client.mutate(e)}catch(e){console.log(e)}}throw new O.APIError(t.message,500,"GitHub")}}async hasWriteAccess(){const{repoOwner:e,repoName:t}=this;try{const{data:r}=await this.query({query:Ao,variables:{owner:e,name:t},fetchPolicy:ra}),{viewerPermission:n}=r.repository;return["ADMIN","MAINTAIN","WRITE"].includes(n)}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}async user(){const{data:e}=await this.query({query:Po,fetchPolicy:ra});return e.viewer}async retrieveBlobObject(e,t,r,n={}){const{data:i}=await this.query({query:Co,variables:{owner:e,name:t,expression:r},...n});if(i.repository.object){const{is_binary:e,text:t}=i.repository.object;return{isNull:!1,isBinary:e,text:t}}return{isNull:!0}}getOwnerAndNameFromRepoUrl(e){let{repoOwner:t,repoName:r}=this;return e===this.originRepoURL&&({originRepoOwner:t,originRepoName:r}=this),{owner:t,name:r}}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await(0,O.readFile)(t,()=>this.fetchBlobContent({sha:t,repoURL:n,parseText:i}),O.localForage,i)}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){if(!r)return super.fetchBlobContent({sha:e,repoURL:t,parseText:r});const{owner:n,name:i}=this.getOwnerAndNameFromRepoUrl(t),{isNull:o,isBinary:a,text:s}=await this.retrieveBlobObject(n,i,e,{fetchPolicy:ra});if(o)throw new O.APIError("Not Found",404,"GitHub");return a?super.fetchBlobContent({sha:e,repoURL:t,parseText:r}):s}async getPullRequestAuthor(e){const t=e.user;return t?.name||t?.login}async getPullRequests(e,t,r){const{originRepoOwner:n,originRepoName:i}=this;let o;o=t===et.Open?["OPEN"]:t===et.Closed?["CLOSED","MERGED"]:["OPEN","CLOSED","MERGED"];const{data:a}=await this.query({query:jo,variables:{owner:n,name:i,...e?{head:e}:{},states:o}}),{pullRequests:s}=a.repository;return s.nodes.map(ia).filter(e=>e.head.ref.startsWith(`${O.CMS_BRANCH_PREFIX}/`)&&r(e))}async getOpenAuthoringBranches(){const{repoOwner:e,repoName:t}=this,{data:r}=await this.query({query:Bo,variables:{owner:e,name:t,refPrefix:`refs/heads/cms/${this.repo}/`}});return r.repository.refs.nodes.map(({name:e,prefix:t})=>({ref:`${t}${e}`}))}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha,{originRepoOwner:o,originRepoName:a}=this,{data:s}=await this.query({query:No,variables:{owner:o,name:a,sha:i}});if(s.repository.object){const{status:e}=s.repository.object,{contexts:t}=e||{contexts:[]};return t}return[]}getAllFiles(e,t){return e.reduce((e,r)=>{if("tree"===r.type){const n=r.object?.entries||[];return[...e,...this.getAllFiles(n,`${t}/${r.name}`)]}return"blob"===r.type?[...e,{name:r.name,type:r.type,id:r.sha,path:`${t}/${r.name}`,size:r.blob?r.blob.size:0}]:e},[])}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={}){const{owner:i,name:o}=this.getOwnerAndNameFromRepoUrl(t),a=He()(e,"/"),{data:s}=await this.query({query:qo(n),variables:{owner:i,name:o,expression:`${r}:${a}`}});return s.repository.object?this.getAllFiles(s.repository.object.entries,a):[]}getBranchQualifiedName(e){return`refs/heads/${e}`}getBranchQuery(e,t,r){return{query:Do,variables:{owner:t,name:r,qualifiedName:this.getBranchQualifiedName(e)}}}async getDefaultBranch(){const{data:e}=await this.query({...this.getBranchQuery(this.branch,this.originRepoOwner,this.originRepoName)});return e.repository.branch}async getBranch(e){const{data:t}=await this.query({...this.getBranchQuery(e,this.repoOwner,this.repoName),fetchPolicy:ra});if(!t.repository.branch)throw new O.APIError("Branch not found",404,Ye);return t.repository.branch}async patchRef(e,t,r,n={}){if("heads"!==e)return super.patchRef(e,t,r,n);const i=n.force||!1,o=await this.getBranch(t),{data:a}=await this.mutate({mutation:Vo,variables:{input:{oid:r,refId:o.id,force:i}}});return a.updateRef.branch}async deleteBranch(e){const t=await this.getBranch(e),{data:r}=await this.mutate({mutation:Ko,variables:{deleteRefInput:{refId:t.id}},update:e=>e.data.delete(ni(t))});return r.deleteRef}getPullRequestQuery(e){const{originRepoOwner:t,originRepoName:r}=this;return{query:Uo,variables:{owner:t,name:r,number:e}}}async getPullRequest(e){const{data:t}=await this.query({...this.getPullRequestQuery(e),fetchPolicy:ra}),r="OPEN"===t.repository.pullRequest.state?et.Open:et.Closed;return{...t.repository.pullRequest,state:r}}getPullRequestAndBranchQuery(e,t){const{repoOwner:r,repoName:n}=this,{originRepoOwner:i,originRepoName:o}=this;return{query:$o,variables:{owner:r,name:n,originRepoOwner:i,originRepoName:o,number:t,qualifiedName:this.getBranchQualifiedName(e)}}}async getPullRequestAndBranch(e,t){const{data:r}=await this.query({...this.getPullRequestAndBranchQuery(e,t),fetchPolicy:ra}),{repository:n,origin:i}=r;return{branch:n.branch,pullRequest:i.pullRequest}}async openPR(e){const t=await this.getPullRequest(e),{data:r}=await this.mutate({mutation:ea,variables:{reopenPullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.reopenPullRequest,n={repository:{...r.repository,pullRequest:r}};e.writeQuery({...this.getPullRequestQuery(r.number),data:n})}});return r.reopenPullRequest}async closePR(e){const t=await this.getPullRequest(e),{data:r}=await this.mutate({mutation:Wo,variables:{closePullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.closePullRequest,n={repository:{...r.repository,pullRequest:r}};e.writeQuery({...this.getPullRequestQuery(r.number),data:n})}});return r.closePullRequest}async deleteUnpublishedEntry(e,t){try{const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);if(i.number!==Xe){const{branch:e,pullRequest:t}=await this.getPullRequestAndBranch(n,i.number),{data:r}=await this.mutate({mutation:Ho,variables:{deleteRefInput:{refId:e.id},closePullRequestInput:{pullRequestId:t.id}},update:r=>{r.data.delete(ni(e)),r.data.delete(ni(t))}});return r.closePullRequest}return await this.deleteBranch(n)}catch(e){const{graphQLErrors:t}=e;if(t&&t.length>0){const e=t.some(e=>"NOT_FOUND"===e.type);if(e)return}throw e}}async createPR(e,t){const[r,n]=await Promise.all([this.getRepository(this.originRepoOwner,this.originRepoName),this.useOpenAuthoring?`${(await this.user()).login}:${t}`:t]),{data:i}=await this.mutate({mutation:Yo,variables:{createPullRequestInput:{baseRefName:this.branch,body:O.DEFAULT_PR_BODY,title:e,headRefName:n,repositoryId:r.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.createPullRequest,n={repository:{...r.repository,pullRequest:r}};e.writeQuery({...this.getPullRequestQuery(r.number),data:n})}}),{pullRequest:o}=i.createPullRequest;return{...o,head:{sha:o.headRefOid}}}async createBranch(e,t){const r=this.repoOwner,n=this.repoName,i=await this.getRepository(r,n),{data:o}=await this.mutate({mutation:Xo,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:i.id}},update:(t,{data:i})=>{const{branch:o}=i.createRef,a={repository:{...o.repository,branch:o}};t.writeQuery({...this.getBranchQuery(e,r,n),data:a})}}),{branch:a}=o.createRef;return{...a,ref:`${a.prefix}${a.name}`}}async createBranchAndPullRequest(e,t,r){const n=this.originRepoOwner,i=this.originRepoName,o=await this.getRepository(n,i),{data:a}=await this.mutate({mutation:Zo,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:o.id},createPullRequestInput:{baseRefName:this.branch,body:O.DEFAULT_PR_BODY,title:r,headRefName:e,repositoryId:o.id}},update:(t,{data:r})=>{const{branch:o}=r.createRef,{pullRequest:a}=r.createPullRequest,s={repository:{...o.repository,branch:o}},u={repository:{...a.repository,branch:o},origin:{...a.repository,pullRequest:a}};t.writeQuery({...this.getBranchQuery(e,n,i),data:s}),t.writeQuery({...this.getPullRequestAndBranchQuery(e,a.number),data:u})}}),{pullRequest:s}=a.createPullRequest;return ia(s)}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const{owner:n,name:i}=this.getOwnerAndNameFromRepoUrl(t),{data:o}=await this.query({query:Qo,variables:{owner:n,name:i,expression:`${r}:${e}`}});if(o.repository.file)return o.repository.file.sha;throw new O.APIError("Not Found",404,Ye)}}function aa(){return aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aa.apply(null,arguments)}const{fetchWithTimeout:sa}=O.unsentRequest,ua="https://www.githubstatus.com",ca=`${ua}/api/v2/components.json`,la=["API Requests","Issues, Pull Requests, Projects"],ha={GitHubBackend:class{bypassWriteAccessCheckForAppTokens=!1;constructor(e,t={}){if(this.options={proxied:!1,API:null,initialWorkflowStatus:"",...t},!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitHub backend needs a "repo" in the backend configuration.');if(this.api=this.options.API||null,this.isBranchConfigured=!!e.backend.branch,this.openAuthoringEnabled=e.backend.open_authoring||!1,this.openAuthoringEnabled){if(!this.options.useWorkflow)throw new Error("backend.open_authoring is true but publish_mode is not set to editorial_workflow.");this.originRepo=e.backend.repo||""}else this.repo=this.originRepo=e.backend.repo||"";this.alwaysForkEnabled=e.backend.always_fork||!1,this.branch=e.backend.branch?.trim()||"master",this.apiRoot=e.backend.api_root||"https://api.github.com",this.token="",this.tokenKeyword="token",this.baseUrl=e.backend.base_url,this.squashMerges=e.backend.squash_merges||!1,this.cmsLabelPrefix=e.backend.cms_label_prefix||"",this.useGraphql=e.backend.use_graphql||!1,this.mediaFolder=e.media_folder,this.previewContext=e.backend.preview_context||"",this.lock=(0,O.asyncLock)()}isGitBackend(){return!0}async status(){const e=await sa(ca).then(e=>e.json()).then(e=>e.components.filter(e=>la.includes(e.name)).every(e=>"operational"===e.status)).catch(e=>(console.warn("Failed getting GitHub status",e),!0));let t=!1;return e&&(t=await(this.api?.getUser({token:this.token??""}).then(e=>!!e).catch(e=>(console.warn("Failed getting GitHub user",e),!1)))||!1),{auth:{status:t},api:{status:e,statusPage:ua}}}authComponent(){const e=e=>(0,S.jsx)(re,aa({},e,{backend:this}));return e.displayName="AuthenticationPage",e}restoreUser(e){return this.openAuthoringEnabled?this.authenticateWithFork({userData:e,getPermissionToFork:()=>!0}).then(()=>this.authenticate(e)):this.authenticate(e)}async pollUntilForkExists({repo:e,token:t}){let r=!1;for(;!r;)r=await sa(`${this.apiRoot}/repos/${e}`,{headers:{Authorization:`${this.tokenKeyword} ${t}`}}).then(()=>!0).catch(e=>e&&404===e.status?(console.log("This 404 was expected and handled appropriately."),!1):Promise.reject(e)),r||await new Promise(e=>setTimeout(e,250));return Promise.resolve()}async currentUser({token:e}){return this._currentUserPromise||(this._currentUserPromise=(async()=>{const t=await sa(`${this.apiRoot}/user`,{headers:{Authorization:`${this.tokenKeyword} ${e}`}}),r=await t.json();return{...r,name:r.name||"Unknown"}})()),this._currentUserPromise}async userIsOriginMaintainer({username:e,token:t}){const r=e||(await this.currentUser({token:t})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[r]||(this._userIsOriginMaintainerPromises[r]=sa(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${r}/permission`,{headers:{Authorization:`${this.tokenKeyword} ${t}`}}).then(e=>e.json()).then(({permission:e})=>"admin"===e||"write"===e)),this._userIsOriginMaintainerPromises[r]}async forkExists({token:e}){try{const t=await this.currentUser({token:e}),r=this.originRepo.split("/")[1],n=await sa(`${this.apiRoot}/repos/${t.login}/${r}`,{method:"GET",headers:{Authorization:`${this.tokenKeyword} ${e}`}}).then(e=>e.json());return!0===n.fork&&n.parent&&n.parent.full_name.toLowerCase()===this.originRepo.toLowerCase()}catch{return!1}}async authenticateWithFork({userData:e,getPermissionToFork:t}){if(!this.openAuthoringEnabled)throw new Error("Cannot authenticate with fork; Open Authoring is turned off.");const r=e.token;if(!this.alwaysForkEnabled&&await this.userIsOriginMaintainer({token:r}))return this.repo=this.originRepo,this.useOpenAuthoring=!1,Promise.resolve();const n=await this.currentUser({token:r}),i=this.originRepo.split("/")[1];if(this.repo=`${n.login}/${i}`,this.useOpenAuthoring=!0,await this.forkExists({token:r}))return sa(`${this.apiRoot}/repos/${this.repo}/merge-upstream`,{method:"POST",headers:{Authorization:`${this.tokenKeyword} ${r}`},body:JSON.stringify({branch:this.branch})});{await t();const e=await sa(`${this.apiRoot}/repos/${this.originRepo}/forks`,{method:"POST",headers:{Authorization:`${this.tokenKeyword} ${r}`}}).then(e=>e.json());return this.pollUntilForkExists({repo:e.full_name,token:r})}}async authenticate(e){if(this.token=e.token,!this.isBranchConfigured){const e=await sa(`${this.apiRoot}/repos/${this.originRepo}`,{headers:{Authorization:`token ${this.token}`}}).then(e=>e.json()).catch(()=>null);e&&e.default_branch&&(this.branch=e.default_branch)}const t=this.useGraphql?oa:it;this.api=new t({token:this.token,tokenKeyword:this.tokenKeyword,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot,squashMerges:this.squashMerges,cmsLabelPrefix:this.cmsLabelPrefix,useOpenAuthoring:this.useOpenAuthoring,initialWorkflowStatus:this.options.initialWorkflowStatus,baseUrl:this.baseUrl,getUser:e=>this.currentUser(e)});const r=await this.api.user();if(!await this.api.hasWriteAccess().catch(e=>{throw e.message=k`
302
+ ${Uo}
303
+ `,ds="no-cache",ms="cache-first",ys=new ra({introspectionQueryResultData:Pa()});function vs(e){return{...e,labels:e.labels.nodes,head:{ref:e.headRefName,sha:e.headRefOid,repo:{fork:e.repository.isFork}},base:{ref:e.baseRefName,sha:e.baseRefOid}}}class gs extends yr{constructor(e){super(e),this.client=this.getApolloClient()}getApolloClient(){const e=(r=(e,{headers:t})=>({headers:{"Content-Type":"application/json; charset=utf-8",...t,authorization:this.token?`${this.tokenKeyword} ${this.token}`:""}}),new Wn(function(e,t){var n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,[]);return new Dn(function(i){var a;return Promise.resolve(n).then(function(t){return r(t,e.getContext())}).then(e.setContext).then(function(){a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)})}).catch(i.error.bind(i)),function(){a&&a.unsubscribe()}})})),t=_a({uri:`${this.apiRoot}/graphql`});var r;return new di({link:e.concat(t),cache:new ba({fragmentMatcher:ys}),defaultOptions:{watchQuery:{fetchPolicy:ds,errorPolicy:"ignore"},query:{fetchPolicy:ds,errorPolicy:"all"}}})}reset(){return this.client.resetStore()}async getRepository(e,t){const{data:r}=await this.query({query:Yo,variables:{owner:e,name:t},fetchPolicy:ms});return r.repository}query(e){return this.client.query(e).catch(e=>{throw new E.APIError(e.message,500,"GitHub")})}async mutate(e){try{return await this.client.mutate(e)}catch(t){const r=t.graphQLErrors;if(Array.isArray(r)&&r.some(e=>"Ref cannot be created."===e.message)){const t=e?.variables?.createRefInput?.name||"",r=a()(t,"refs/heads/");r&&await(0,E.throwOnConflictingBranches)(r,e=>this.getBranch(e),"GitHub")}else if(Array.isArray(r)&&r.some(e=>new RegExp(`A ref named "refs/heads/${E.CMS_BRANCH_PREFIX}/.+?" already exists in the repository.`).test(e.message))){const t=e?.variables?.createRefInput?.name||"",r=e?.variables?.createRefInput?.oid||"",n=a()(t,"refs/heads/");if(n&&n.startsWith(`${E.CMS_BRANCH_PREFIX}/`)&&r)try{return await this.backupBranch(n),await this.deleteBranch(n),await this.client.mutate(e)}catch(e){console.log(e)}}throw new E.APIError(t.message,500,"GitHub")}}async hasWriteAccess(){const{repoOwner:e,repoName:t}=this;try{const{data:r}=await this.query({query:Qo,variables:{owner:e,name:t},fetchPolicy:ms}),{viewerPermission:n}=r.repository;return["ADMIN","MAINTAIN","WRITE"].includes(n)}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}async user(){const{data:e}=await this.query({query:Vo,fetchPolicy:ms});return e.viewer}async retrieveBlobObject(e,t,r,n={}){const{data:i}=await this.query({query:Ko,variables:{owner:e,name:t,expression:r},...n});if(i.repository.object){const{is_binary:e,text:t}=i.repository.object;return{isNull:!1,isBinary:e,text:t}}return{isNull:!0}}getOwnerAndNameFromRepoUrl(e){let{repoOwner:t,repoName:r}=this;return e===this.originRepoURL&&({originRepoOwner:t,originRepoName:r}=this),{owner:t,name:r}}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await(0,E.readFile)(t,()=>this.fetchBlobContent({sha:t,repoURL:n,parseText:i}),E.localForage,i)}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){if(!r)return super.fetchBlobContent({sha:e,repoURL:t,parseText:r});const{owner:n,name:i}=this.getOwnerAndNameFromRepoUrl(t),{isNull:a,isBinary:o,text:s}=await this.retrieveBlobObject(n,i,e,{fetchPolicy:ms});if(a)throw new E.APIError("Not Found",404,"GitHub");return o?super.fetchBlobContent({sha:e,repoURL:t,parseText:r}):s}async getPullRequestAuthor(e){const t=e.user;return t?.name||t?.login}async getPullRequests(e,t,r){const{originRepoOwner:n,originRepoName:i}=this;let a;a=t===pr.Open?["OPEN"]:t===pr.Closed?["CLOSED","MERGED"]:["OPEN","CLOSED","MERGED"];const{data:o}=await this.query({query:es,variables:{owner:n,name:i,...e?{head:e}:{},states:a}}),{pullRequests:s}=o.repository;return s.nodes.map(vs).filter(e=>e.head.ref.startsWith(`${E.CMS_BRANCH_PREFIX}/`)&&r(e))}async getOpenAuthoringBranches(){const{repoOwner:e,repoName:t}=this,{data:r}=await this.query({query:Jo,variables:{owner:e,name:t,refPrefix:`refs/heads/cms/${this.repo}/`}});return r.repository.refs.nodes.map(({name:e,prefix:t})=>({ref:`${t}${e}`}))}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,E.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha,{originRepoOwner:a,originRepoName:o}=this,{data:s}=await this.query({query:zo,variables:{owner:a,name:o,sha:i}});if(s.repository.object){const{status:e}=s.repository.object,{contexts:t}=e||{contexts:[]};return t}return[]}getAllFiles(e,t){return e.reduce((e,r)=>{if("tree"===r.type){const n=r.object?.entries||[];return[...e,...this.getAllFiles(n,`${t}/${r.name}`)]}return"blob"===r.type?[...e,{name:r.name,type:r.type,id:r.sha,path:`${t}/${r.name}`,size:r.blob?r.blob.size:0}]:e},[])}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={}){const{owner:i,name:a}=this.getOwnerAndNameFromRepoUrl(t),o=sr()(e,"/"),{data:s}=await this.query({query:Go(n),variables:{owner:i,name:a,expression:`${r}:${o}`}});return s.repository.object?this.getAllFiles(s.repository.object.entries,o):[]}getBranchQualifiedName(e){return`refs/heads/${e}`}getBranchQuery(e,t,r){return{query:Ho,variables:{owner:t,name:r,qualifiedName:this.getBranchQualifiedName(e)}}}async getDefaultBranch(){const{data:e}=await this.query({...this.getBranchQuery(this.branch,this.originRepoOwner,this.originRepoName)});return e.repository.branch}async getBranch(e){const{data:t}=await this.query({...this.getBranchQuery(e,this.repoOwner,this.repoName),fetchPolicy:ms});if(!t.repository.branch)throw new E.APIError("Branch not found",404,"GitHub");return t.repository.branch}async patchRef(e,t,r,n={}){if("heads"!==e)return super.patchRef(e,t,r,n);const i=n.force||!1,a=await this.getBranch(t),{data:o}=await this.mutate({mutation:ns,variables:{input:{oid:r,refId:a.id,force:i}}});return o.updateRef.branch}async deleteBranch(e){const t=await this.getBranch(e),{data:r}=await this.mutate({mutation:as,variables:{deleteRefInput:{refId:t.id}},update:e=>e.data.delete(ya(t))});return r.deleteRef}getPullRequestQuery(e){const{originRepoOwner:t,originRepoName:r}=this;return{query:Zo,variables:{owner:t,name:r,number:e}}}async getPullRequest(e){const{data:t}=await this.query({...this.getPullRequestQuery(e),fetchPolicy:ms}),r="OPEN"===t.repository.pullRequest.state?pr.Open:pr.Closed;return{...t.repository.pullRequest,state:r}}getPullRequestAndBranchQuery(e,t){const{repoOwner:r,repoName:n}=this,{originRepoOwner:i,originRepoName:a}=this;return{query:ts,variables:{owner:r,name:n,originRepoOwner:i,originRepoName:a,number:t,qualifiedName:this.getBranchQualifiedName(e)}}}async getPullRequestAndBranch(e,t){const{data:r}=await this.query({...this.getPullRequestAndBranchQuery(e,t),fetchPolicy:ms}),{repository:n,origin:i}=r;return{branch:n.branch,pullRequest:i.pullRequest}}async openPR(e){const t=await this.getPullRequest(e),{data:r}=await this.mutate({mutation:fs,variables:{reopenPullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.reopenPullRequest,n={repository:{...r.repository,pullRequest:r}};e.writeQuery({...this.getPullRequestQuery(r.number),data:n})}});return r.reopenPullRequest}async closePR(e){const t=await this.getPullRequest(e),{data:r}=await this.mutate({mutation:ss,variables:{closePullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.closePullRequest,n={repository:{...r.repository,pullRequest:r}};e.writeQuery({...this.getPullRequestQuery(r.number),data:n})}});return r.closePullRequest}async deleteUnpublishedEntry(e,t){try{const r=this.generateContentKey(e,t),n=(0,E.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);if(-1!==i.number){const{branch:e,pullRequest:t}=await this.getPullRequestAndBranch(n,i.number),{data:r}=await this.mutate({mutation:us,variables:{deleteRefInput:{refId:e.id},closePullRequestInput:{pullRequestId:t.id}},update:r=>{r.data.delete(ya(e)),r.data.delete(ya(t))}});return r.closePullRequest}return await this.deleteBranch(n)}catch(e){const{graphQLErrors:t}=e;if(t&&t.length>0){const e=t.some(e=>"NOT_FOUND"===e.type);if(e)return}throw e}}async createPR(e,t){const[r,n]=await Promise.all([this.getRepository(this.originRepoOwner,this.originRepoName),this.useOpenAuthoring?`${(await this.user()).login}:${t}`:t]),{data:i}=await this.mutate({mutation:ls,variables:{createPullRequestInput:{baseRefName:this.branch,body:E.DEFAULT_PR_BODY,title:e,headRefName:n,repositoryId:r.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.createPullRequest,n={repository:{...r.repository,pullRequest:r}};e.writeQuery({...this.getPullRequestQuery(r.number),data:n})}}),{pullRequest:a}=i.createPullRequest;return{...a,head:{sha:a.headRefOid}}}async createBranch(e,t){const r=this.repoOwner,n=this.repoName,i=await this.getRepository(r,n),{data:a}=await this.mutate({mutation:hs,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:i.id}},update:(t,{data:i})=>{const{branch:a}=i.createRef,o={repository:{...a.repository,branch:a}};t.writeQuery({...this.getBranchQuery(e,r,n),data:o})}}),{branch:o}=a.createRef;return{...o,ref:`${o.prefix}${o.name}`}}async createBranchAndPullRequest(e,t,r){const n=this.originRepoOwner,i=this.originRepoName,a=await this.getRepository(n,i),{data:o}=await this.mutate({mutation:ps,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:a.id},createPullRequestInput:{baseRefName:this.branch,body:E.DEFAULT_PR_BODY,title:r,headRefName:e,repositoryId:a.id}},update:(t,{data:r})=>{const{branch:a}=r.createRef,{pullRequest:o}=r.createPullRequest,s={repository:{...a.repository,branch:a}},u={repository:{...o.repository,branch:a},origin:{...o.repository,pullRequest:o}};t.writeQuery({...this.getBranchQuery(e,n,i),data:s}),t.writeQuery({...this.getPullRequestAndBranchQuery(e,o.number),data:u})}}),{pullRequest:s}=o.createPullRequest;return vs(s)}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const{owner:n,name:i}=this.getOwnerAndNameFromRepoUrl(t),{data:a}=await this.query({query:rs,variables:{owner:n,name:i,expression:`${r}:${e}`}});if(a.repository.file)return a.repository.file.sha;throw new E.APIError("Not Found",404,"GitHub")}}const{fetchWithTimeout:bs}=E.unsentRequest,ws="https://www.githubstatus.com",Rs=`${ws}/api/v2/components.json`,Es=["API Requests","Issues, Pull Requests, Projects"],ks={GitHubBackend:class{bypassWriteAccessCheckForAppTokens=!1;unwatchFunctions=new Map;constructor(e,t={}){if(this.options={proxied:!1,API:null,initialWorkflowStatus:"",...t},!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitHub backend needs a "repo" in the backend configuration.');if(this.api=this.options.API||null,this.isBranchConfigured=!!e.backend.branch,this.openAuthoringEnabled=e.backend.open_authoring||!1,this.openAuthoringEnabled){if(!this.options.useWorkflow)throw new Error("backend.open_authoring is true but publish_mode is not set to editorial_workflow.");this.originRepo=e.backend.repo||""}else this.repo=this.originRepo=e.backend.repo||"";this.alwaysForkEnabled=e.backend.always_fork||!1,this.branch=e.backend.branch?.trim()||"master",this.apiRoot=e.backend.api_root||"https://api.github.com",this.token="",this.tokenKeyword="token",this.baseUrl=e.backend.base_url,this.squashMerges=e.backend.squash_merges||!1,this.cmsLabelPrefix=e.backend.cms_label_prefix||"",this.useGraphql=e.backend.use_graphql||!1,this.mediaFolder=e.media_folder,this.previewContext=e.backend.preview_context||"",this.lock=(0,E.asyncLock)()}isGitBackend(){return!0}async status(){const e=await bs(Rs).then(e=>e.json()).then(e=>e.components.filter(e=>Es.includes(e.name)).every(e=>"operational"===e.status)).catch(e=>(console.warn("Failed getting GitHub status",e),!0));let t=!1;return e&&(t=await(this.api?.getUser({token:this.token??""}).then(e=>!!e).catch(e=>(console.warn("Failed getting GitHub user",e),!1)))||!1),{auth:{status:t},api:{status:e,statusPage:ws}}}authComponent(){const e=e=>ht(yt,{...e,backend:this});return e.displayName="AuthenticationPage",e}restoreUser(e){return this.openAuthoringEnabled?this.authenticateWithFork({userData:e,getPermissionToFork:()=>!0}).then(()=>this.authenticate(e)):this.authenticate(e)}async pollUntilForkExists({repo:e,token:t}){let r=!1;for(;!r;)r=await bs(`${this.apiRoot}/repos/${e}`,{headers:{Authorization:`${this.tokenKeyword} ${t}`}}).then(()=>!0).catch(e=>e&&404===e.status?(console.log("This 404 was expected and handled appropriately."),!1):Promise.reject(e)),r||await new Promise(e=>setTimeout(e,250));return Promise.resolve()}async currentUser({token:e}){return this._currentUserPromise||(this._currentUserPromise=(async()=>{const t=await bs(`${this.apiRoot}/user`,{headers:{Authorization:`${this.tokenKeyword} ${e}`}}),r=await t.json();return{...r,name:r.name||"Unknown"}})()),this._currentUserPromise}async userIsOriginMaintainer({username:e,token:t}){const r=e||(await this.currentUser({token:t})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[r]||(this._userIsOriginMaintainerPromises[r]=bs(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${r}/permission`,{headers:{Authorization:`${this.tokenKeyword} ${t}`}}).then(e=>e.json()).then(({permission:e})=>"admin"===e||"write"===e)),this._userIsOriginMaintainerPromises[r]}async forkExists({token:e}){try{const t=await this.currentUser({token:e}),r=this.originRepo.split("/")[1],n=await bs(`${this.apiRoot}/repos/${t.login}/${r}`,{method:"GET",headers:{Authorization:`${this.tokenKeyword} ${e}`}}).then(e=>e.json());return!0===n.fork&&n.parent&&n.parent.full_name.toLowerCase()===this.originRepo.toLowerCase()}catch{return!1}}async authenticateWithFork({userData:e,getPermissionToFork:t}){if(!this.openAuthoringEnabled)throw new Error("Cannot authenticate with fork; Open Authoring is turned off.");const r=e.token;if(!this.alwaysForkEnabled&&await this.userIsOriginMaintainer({token:r}))return this.repo=this.originRepo,this.useOpenAuthoring=!1,Promise.resolve();const n=await this.currentUser({token:r}),i=this.originRepo.split("/")[1];if(this.repo=`${n.login}/${i}`,this.useOpenAuthoring=!0,await this.forkExists({token:r}))return bs(`${this.apiRoot}/repos/${this.repo}/merge-upstream`,{method:"POST",headers:{Authorization:`${this.tokenKeyword} ${r}`},body:JSON.stringify({branch:this.branch})});{await t();const e=await bs(`${this.apiRoot}/repos/${this.originRepo}/forks`,{method:"POST",headers:{Authorization:`${this.tokenKeyword} ${r}`}}).then(e=>e.json());return this.pollUntilForkExists({repo:e.full_name,token:r})}}async authenticate(e){if(this.token=e.token,!this.isBranchConfigured){const e=await bs(`${this.apiRoot}/repos/${this.originRepo}`,{headers:{Authorization:`token ${this.token}`}}).then(e=>e.json()).catch(()=>null);e&&e.default_branch&&(this.branch=e.default_branch)}const t=this.useGraphql?gs:yr;this.api=new t({token:this.token,tokenKeyword:this.tokenKeyword,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot,squashMerges:this.squashMerges,cmsLabelPrefix:this.cmsLabelPrefix,useOpenAuthoring:this.useOpenAuthoring,initialWorkflowStatus:this.options.initialWorkflowStatus,baseUrl:this.baseUrl,getUser:e=>this.currentUser(e)});const r=await this.api.user();if(!await this.api.hasWriteAccess().catch(e=>{throw e.message=R`
304
304
  Repo "${this.repo}" not found.
305
305
 
306
306
  Please ensure the repo information is spelled correctly.
@@ -308,5 +308,5 @@
308
308
  If the repo is private, make sure you're logged into a GitHub account with access.
309
309
 
310
310
  If your repo is under an organization, ensure the organization has granted access to Decap CMS.
311
- `,e})&&!this.bypassWriteAccessCheckForAppTokens)throw new Error("Your GitHub user account does not have access to this repo.");return{...r,token:e.token,useOpenAuthoring:this.useOpenAuthoring}}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}getCursorAndFiles=(e,t)=>{const r=e.length,n=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<n&&(i.push("next"),i.push("last")),{cursor:O.Cursor.create({actions:i,meta:{page:t,count:r,pageSize:20,pageCount:n},data:{files:e}}),files:e.slice(20*(t-1),20*t)}};async entriesByFolder(e,t,r){const n=this.api.originRepoURL;let i;const o=await(0,O.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:n,depth:r}).then(e=>{const r=e.filter(e=>(0,O.filterByExtension)(e,t)),n=this.getCursorAndFiles(r,1);return i=n.cursor,n.files}),(e,t)=>this.api.readFile(e,t,{repoURL:n}),this.api.readFileMetadata.bind(this.api),Ye);return o[O.CURSOR_COMPATIBILITY_SYMBOL]=i,o}async allEntriesByFolder(e,t,r,n){const i=this.api.originRepoURL;return await(0,O.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:i,depth:r}).then(e=>e.filter(e=>(!n||n.test(e.path))&&(0,O.filterByExtension)(e,t))),(e,t)=>this.api.readFile(e,t,{repoURL:i}),this.api.readFileMetadata.bind(this.api),Ye)}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return(0,O.entriesByFiles)(e,(e,r)=>this.api.readFile(e,r,{repoURL:t}).catch(()=>""),this.api.readFileMetadata.bind(this.api),Ye)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then(t=>({file:{path:e,id:null},data:t})).catch(()=>({file:{path:e,id:null},data:""}))}getMedia(e=this.mediaFolder){return this.api.listFiles(e).then(e=>e.map(({id:e,name:t,size:r,path:n})=>({id:e,name:t,size:r,displayURL:{id:e,path:n},path:n})))}async getMediaFile(e){const t=await(0,O.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),r=(0,O.basename)(e),n=(0,O.blobToFileObj)(r,t),i=URL.createObjectURL(n);return{id:await(0,O.getBlobSHA)(t),displayURL:i,path:e,name:r,size:n.size,file:n,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||o()(10),(0,O.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return(0,O.runWithLock)(this.lock,()=>this.api.persistFiles(e.dataFiles,e.assets,t),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:r,path:n,fileObj:i}=e,o=i?URL.createObjectURL(i):"";return{id:r,name:i.name,size:i.size,displayURL:o,path:s()(n,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const r=e.meta,n=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(n,1);break;case"last":i=this.getCursorAndFiles(n,r.get("pageCount"));break;case"next":i=this.getCursorAndFiles(n,r.get("page")+1);break;case"prev":i=this.getCursorAndFiles(n,r.get("page")-1)}return{entries:await(0,O.entriesByFiles)(i.files,(e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch(()=>""),this.api.readFileMetadata.bind(this.api),Ye),cursor:i.cursor}}async loadMediaFile(e,t){const r=await(0,O.getMediaAsBlob)(t.path,t.id,(t,r,{parseText:n})=>this.api.readFile(t,r,{branch:e,parseText:n})),n=(0,O.basename)(t.path),i=(0,O.blobToFileObj)(n,r);return{id:t.id,displayURL:URL.createObjectURL(i),path:t.path,name:n,size:i.size,file:i}}async unpublishedEntries(){const e=await(0,O.unpublishedEntries)(()=>this.api.listUnpublishedBranches().then(e=>e.map(e=>(0,O.contentKeyFromBranch)(e))));return e}async unpublishedEntry({id:e,collection:t,slug:r}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&r){const e=this.api.generateContentKey(t,r);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){const r=this.api.generateContentKey(e,t);return(0,O.branchFromContentKey)(r)}async unpublishedEntryDataFile(e,t,r,n){const i=this.getBranch(e,t);return await this.api.readFile(r,n,{branch:i})}async unpublishedEntryMediaFile(e,t,r,n){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:r,id:n})}async getDeployPreview(e,t){try{const r=await this.api.getStatuses(e,t),n=(0,O.getPreviewStatus)(r,this.previewContext);if(n){const{target_url:e,state:t}=n;return{url:e,status:t}}return null}catch(e){return null}}updateUnpublishedEntryStatus(e,t,r){return(0,O.runWithLock)(this.lock,()=>this.api.updateUnpublishedEntryStatus(e,t,r),"Failed to acquire update entry status lock")}deleteUnpublishedEntry(e,t){return(0,O.runWithLock)(this.lock,()=>this.api.deleteUnpublishedEntry(e,t),"Failed to acquire delete entry lock")}publishUnpublishedEntry(e,t){return(0,O.runWithLock)(this.lock,()=>this.api.publishUnpublishedEntry(e,t),"Failed to acquire publish entry lock")}},API:it,AuthenticationPage:re}})(),c.DecapCmsBackendGithub})());
311
+ `,e})&&!this.bypassWriteAccessCheckForAppTokens)throw new Error("Your GitHub user account does not have access to this repo.");return this.api&&!this.pollingManager&&(this.pollingManager=new vr(this.api,15e3)),{...r,token:e.token,useOpenAuthoring:this.useOpenAuthoring}}logout(){if(this.token=null,this.pollingManager&&(this.pollingManager.destroy(),this.pollingManager=void 0),this.unwatchFunctions.clear(),this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}getCursorAndFiles=(e,t)=>{const r=e.length,n=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<n&&(i.push("next"),i.push("last")),{cursor:E.Cursor.create({actions:i,meta:{page:t,count:r,pageSize:20,pageCount:n},data:{files:e}}),files:e.slice(20*(t-1),20*t)}};async entriesByFolder(e,t,r){const n=this.api.originRepoURL;let i;const a=await(0,E.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:n,depth:r}).then(e=>{const r=e.filter(e=>(0,E.filterByExtension)(e,t)),n=this.getCursorAndFiles(r,1);return i=n.cursor,n.files}),(e,t)=>this.api.readFile(e,t,{repoURL:n}),this.api.readFileMetadata.bind(this.api),"GitHub");return a[E.CURSOR_COMPATIBILITY_SYMBOL]=i,a}async allEntriesByFolder(e,t,r,n){const i=this.api.originRepoURL;return await(0,E.entriesByFolder)(()=>this.api.listFiles(e,{repoURL:i,depth:r}).then(e=>e.filter(e=>(!n||n.test(e.path))&&(0,E.filterByExtension)(e,t))),(e,t)=>this.api.readFile(e,t,{repoURL:i}),this.api.readFileMetadata.bind(this.api),"GitHub")}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return(0,E.entriesByFiles)(e,(e,r)=>this.api.readFile(e,r,{repoURL:t}).catch(()=>""),this.api.readFileMetadata.bind(this.api),"GitHub")}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then(t=>({file:{path:e,id:null},data:t})).catch(()=>({file:{path:e,id:null},data:""}))}getMedia(e=this.mediaFolder){return this.api.listFiles(e).then(e=>e.map(({id:e,name:t,size:r,path:n})=>({id:e,name:t,size:r,displayURL:{id:e,path:n},path:n})))}async getMediaFile(e){const t=await(0,E.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),r=(0,E.basename)(e),n=(0,E.blobToFileObj)(r,t),i=URL.createObjectURL(n);return{id:await(0,E.getBlobSHA)(t),displayURL:i,path:e,name:r,size:n.size,file:n,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||n()(10),(0,E.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return(0,E.runWithLock)(this.lock,()=>this.api.persistFiles(e.dataFiles,e.assets,t),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:r,path:n,fileObj:i}=e,o=i?URL.createObjectURL(i):"";return{id:r,name:i.name,size:i.size,displayURL:o,path:a()(n,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const r=e.meta,n=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(n,1);break;case"last":i=this.getCursorAndFiles(n,r.get("pageCount"));break;case"next":i=this.getCursorAndFiles(n,r.get("page")+1);break;case"prev":i=this.getCursorAndFiles(n,r.get("page")-1)}return{entries:await(0,E.entriesByFiles)(i.files,(e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch(()=>""),this.api.readFileMetadata.bind(this.api),"GitHub"),cursor:i.cursor}}async loadMediaFile(e,t){const r=await(0,E.getMediaAsBlob)(t.path,t.id,(t,r,{parseText:n})=>this.api.readFile(t,r,{branch:e,parseText:n})),n=(0,E.basename)(t.path),i=(0,E.blobToFileObj)(n,r);return{id:t.id,displayURL:URL.createObjectURL(i),path:t.path,name:n,size:i.size,file:i}}async unpublishedEntries(){const e=await(0,E.unpublishedEntries)(()=>this.api.listUnpublishedBranches().then(e=>e.map(e=>(0,E.contentKeyFromBranch)(e))));return e}async unpublishedEntry({id:e,collection:t,slug:r}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&r){const e=this.api.generateContentKey(t,r);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){const r=this.api.generateContentKey(e,t);return(0,E.branchFromContentKey)(r)}async unpublishedEntryDataFile(e,t,r,n){const i=this.getBranch(e,t);return await this.api.readFile(r,n,{branch:i})}async unpublishedEntryMediaFile(e,t,r,n){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:r,id:n})}async getDeployPreview(e,t){try{const r=await this.api.getStatuses(e,t),n=(0,E.getPreviewStatus)(r,this.previewContext);if(n){const{target_url:e,state:t}=n;return{url:e,status:t}}return null}catch(e){return null}}updateUnpublishedEntryStatus(e,t,r){return(0,E.runWithLock)(this.lock,()=>this.api.updateUnpublishedEntryStatus(e,t,r),"Failed to acquire update entry status lock")}deleteUnpublishedEntry(e,t){return(0,E.runWithLock)(this.lock,async()=>{await this.api.deleteUnpublishedEntry(e,t);try{await this.api.closeEntryNotesIssue(e,t)}catch(e){console.warn("Failed to close notes issue during entry deletion:",e)}},"Failed to acquire delete entry lock")}publishUnpublishedEntry(e,t){return(0,E.runWithLock)(this.lock,async()=>{await this.api.publishUnpublishedEntry(e,t),await this.api.closeIssueOnPublish(e,t)},"Failed to acquire publish entry lock")}async getNotes(e,t){try{return(await this.api.getEntryNotes(e,t)).map(e=>({...e,entrySlug:t}))}catch(e){return console.error("Failed to get notes:",e),[]}}async addNote(e,t,r){const n=await this.currentUser({token:this.token}),i={...r,id:"temp-"+Date.now(),author:n.login||n.name||"",avatarUrl:n.avatar_url,entrySlug:t,timestamp:r.timestamp||(new Date).toISOString(),resolved:r.resolved||!1,issueUrl:void 0};let a;try{const r=(await this.getEntry(`${e}/${t}.md`)).data.match(/^title:\s*["']?([^"'\n]+)["']?/m);a=r?r[1]:void 0}catch(e){}const{commentId:o,issueUrl:s}=await this.api.addNoteToEntry(e,t,i,a);return{...i,id:o,issueUrl:s}}async updateNote(e,t,r,n){const i=(await this.getNotes(e,t)).find(e=>e.id===r);if(!i)throw new Error(`Note with ID ${r} not found`);const a={...i,...n,id:r,entrySlug:t};return await this.api.updateEntryNote(r,a),a}async deleteNote(e,t,r){if(!(await this.getNotes(e,t)).some(e=>e.id===r))throw new Error(`Note with ID ${r} not found`);await this.api.deleteEntryNote(r)}async toggleNoteResolution(e,t,r){const n=(await this.getNotes(e,t)).find(e=>e.id===r);if(!n)throw new Error(`Note with ID ${r} not found`);return this.updateNote(e,t,r,{resolved:!n.resolved})}async reopenIssueForUnpublishedEntry(e,t){await this.api.reopenIssueOnUnpublish(e,t)}async startNotesPolling(e,t,r){if(!this.pollingManager)return void console.warn("[DecapNotes Polling] Polling manager not initialized");const n=`${e}/${t}`;if(this.pollingManager.getStatus().currentWatch===n)return;const i=this.unwatchFunctions.get(n);i&&(i(),this.unwatchFunctions.delete(n));try{const i=await this.pollingManager.watchIssueWithRetry(e,t,r,5,2e3);this.unwatchFunctions.set(n,i)}catch(e){console.error("[DecapNotes Polling] Failed to start polling after retries:",e)}}async stopNotesPolling(e,t){const r=`${e}/${t}`,n=this.unwatchFunctions.get(r);n?(n(),this.unwatchFunctions.delete(r)):console.log(`[DecapNotes Polling] No active polling found for ${r}`)}async refreshNotesNow(e,t){if(!this.pollingManager)throw new Error("Polling manager not initialized");await this.pollingManager.checkIssueNow(e,t)}},API:yr,AuthenticationPage:yt}})(),c=c.DecapCmsBackendGithub,c})());
312
312
  //# sourceMappingURL=decap-cms-backend-github.js.map