part of cohost archive, ran into commit size limitations
This commit is contained in:
1044
cohost-archive/~cohost-dl/dist/artist-alley-DC1Fn39_.js
vendored
Normal file
1044
cohost-archive/~cohost-dl/dist/artist-alley-DC1Fn39_.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
279
cohost-archive/~cohost-dl/dist/artist-alley-listing-Dn2_eERZ.js
vendored
Normal file
279
cohost-archive/~cohost-dl/dist/artist-alley-listing-Dn2_eERZ.js
vendored
Normal file
@@ -0,0 +1,279 @@
|
||||
if (!window.define) {
|
||||
const modules = {};
|
||||
window.__modules = modules;
|
||||
const modulePromises = {};
|
||||
|
||||
const thisScriptSource = document.currentScript.getAttribute('src');
|
||||
const srcDir = thisScriptSource.substring(0, thisScriptSource.lastIndexOf('/'));
|
||||
|
||||
const load = (id) => {
|
||||
if (modules[id]) return modules[id];
|
||||
if (modulePromises[id]) return modulePromises[id];
|
||||
return modulePromises[id] = new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = srcDir + '/' + id + '.js';
|
||||
script.onload = () => modules[id].then(resolve);
|
||||
script.onerror = err => reject(new Error('failed to load ' + id));
|
||||
script.dataset.id = id;
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
const require = (ids, callback) => {
|
||||
Promise.all(ids.map(load)).then(items => {
|
||||
if (items.length === 1) callback(items[0]);
|
||||
else callback(items);
|
||||
});
|
||||
};
|
||||
window.require = require;
|
||||
|
||||
require.context = (dir, useSubdirs) => {
|
||||
if ((dir === "../../images/emoji" || dir === "../images/emoji") && !useSubdirs) {
|
||||
const data = {"chunks.png":"f59b84127fa7b6c48b6c.png","eggbug-classic.png":"41454e429d62b5cb7963.png","eggbug.png":"17aa2d48956926005de9.png","sixty.png":"9a6014af31fb1ca65a1f.png","unyeah.png":"5cf84d596a2c422967de.png","yeah.png":"014b0a8cc35206ef151d.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
} else if ((dir === "../../images/plus-emoji" || dir === "../images/plus-emoji") && !useSubdirs) {
|
||||
const data = {"eggbug-asleep.png":"ebbf360236a95b62bdfc.png","eggbug-devious.png":"c4f3f2c6b9ffb85934e7.png","eggbug-heart-sob.png":"b59709333449a01e3e0a.png","eggbug-nervous.png":"d2753b632211c395538e.png","eggbug-pensive.png":"ae53a8b5de7c919100e6.png","eggbug-pleading.png":"11c5493261064ffa82c0.png","eggbug-relieved.png":"3633c116f0941d94d237.png","eggbug-shocked.png":"b25a9fdf230219087003.png","eggbug-smile-hearts.png":"d7ec7f057e6fb15a94cc.png","eggbug-sob.png":"9559ff8058a895328d76.png","eggbug-tuesday.png":"90058099e741e483208a.png","eggbug-uwu.png":"228d3a13bd5f7796b434.png","eggbug-wink.png":"3bc3a1c5272e2ceb8712.png","host-aww.png":"9bb403f3822c6457baf6.png","host-cry.png":"530f8cf75eac87716702.png","host-evil.png":"cb9a5640d7ef7b361a1a.png","host-frown.png":"99c7fbf98de865cc9726.png","host-joy.png":"53635f5fe850274b1a7d.png","host-love.png":"c45b6d8f9de20f725b98.png","host-nervous.png":"e5d55348f39c65a20148.png","host-plead.png":"fa883e2377fea8945237.png","host-shock.png":"bfa6d6316fd95ae76803.png","host-stare.png":"a09d966cd188c9ebaa4c.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
}
|
||||
throw new Error('not supported: require.context for ' + dir);
|
||||
};
|
||||
|
||||
window.define = (imports, exec) => {
|
||||
if (typeof imports === 'function') {
|
||||
exec = imports;
|
||||
imports = [];
|
||||
}
|
||||
const id = document.currentScript.dataset.id
|
||||
?? './' + document.currentScript.getAttribute('src').split('/').pop().replace(/\.js$/i, '');
|
||||
if (modules[id]) return;
|
||||
const exports = {};
|
||||
modules[id] = Promise.resolve().then(function() {
|
||||
const imported = [];
|
||||
for (const id of imports) {
|
||||
if (id === 'require') imported.push(Promise.resolve(require));
|
||||
else if (id === 'exports') imported.push(Promise.resolve(exports));
|
||||
else imported.push(load(id));
|
||||
}
|
||||
return Promise.all(imported);
|
||||
}).then(function(imported) {
|
||||
const result = exec.apply(window, imported);
|
||||
if (!('default' in exports)) exports.default = result;
|
||||
return exports;
|
||||
});
|
||||
};
|
||||
|
||||
window.process = { env: { NODE_ENV: 'production' } };
|
||||
}
|
||||
|
||||
define(['exports', './post-page'], (function (exports, postPage) { 'use strict';
|
||||
|
||||
const ArtistAlleyFilterProvider = postPage.React.createContext
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
({
|
||||
adultFilterMode: "hide",
|
||||
isAdult: false,
|
||||
categories: new Set(),
|
||||
setAdultFilterMode: () => {},
|
||||
categoryMatch: "any",
|
||||
setCategoryMatch: () => {},
|
||||
sortOrder: "random",
|
||||
setSortOrder: () => {},
|
||||
});
|
||||
|
||||
const useArtistAlleyFilters = () => {
|
||||
return postPage.reactExports.useContext(ArtistAlleyFilterProvider);
|
||||
};
|
||||
|
||||
const ASPECT_RATIO = 300 / 250;
|
||||
|
||||
const ArtistAlleyAttachment
|
||||
|
||||
= ({ attachment }) => {
|
||||
const displayPrefs = postPage.useDisplayPrefs();
|
||||
const [src, setSrc] = postPage.reactExports.useState(
|
||||
displayPrefs.gifsStartPaused
|
||||
? attachment.previewURL
|
||||
: attachment.fileURL
|
||||
);
|
||||
const [isPlaying, setIsPlaying] = postPage.reactExports.useState(!displayPrefs.gifsStartPaused);
|
||||
|
||||
const srcWithDpr = postPage.useImageOptimizer(src, 300, ASPECT_RATIO);
|
||||
|
||||
const handlePause = () => {
|
||||
setIsPlaying(false);
|
||||
setSrc(attachment.previewURL);
|
||||
};
|
||||
|
||||
const handlePlay = () => {
|
||||
setIsPlaying(true);
|
||||
setSrc(attachment.fileURL);
|
||||
};
|
||||
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "group relative" ,}
|
||||
, postPage.React.createElement('img', {
|
||||
src: srcWithDpr(1),
|
||||
srcSet: `
|
||||
${srcWithDpr(1)} 1x,
|
||||
${srcWithDpr(2)} 2x,
|
||||
${srcWithDpr(3)} 3x,
|
||||
`,
|
||||
alt: attachment.altText,
|
||||
className: "co-border aspect-[300/250] w-full border-b object-cover" ,}
|
||||
)
|
||||
|
||||
, attachment.previewURL !== attachment.fileURL && (
|
||||
postPage.React.createElement(postPage.PlayPauseButton, {
|
||||
isPlaying: isPlaying,
|
||||
showPlay: attachment.previewURL !== attachment.fileURL,
|
||||
extraClasses: "absolute bottom-3 right-3 w-12" ,
|
||||
onPlay: handlePlay,
|
||||
onPause: handlePause,}
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ArtistAlleyMeatballMenu = ({
|
||||
listing,
|
||||
}) => {
|
||||
const reportingUIContext = postPage.reactExports.useContext(postPage.ReportingUIContext);
|
||||
|
||||
return (
|
||||
// explicit height is required to vertically align the
|
||||
// meatballs with the rest of the action buttons
|
||||
postPage.React.createElement(postPage.ot, { as: "div", className: "relative h-6" ,}
|
||||
, postPage.React.createElement(postPage.ot.Button, { className: "co-action-button cursor-pointer text-sm font-bold hover:underline" ,}
|
||||
, postPage.React.createElement(postPage.ForwardRef$11, { className: "h-6 w-6 transition-transform ui-open:rotate-90" ,} )
|
||||
)
|
||||
|
||||
, postPage.React.createElement(postPage.ot.Items, { className: "co-meatball-items absolute right-0 top-8 z-30 flex min-w-max flex-col divide-y rounded-lg p-3 focus:!outline-none" ,}
|
||||
, postPage.React.createElement(postPage.ot.Item, null
|
||||
, postPage.React.createElement(postPage.MeatballMenuItem, {
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
reportingUIContext.send({
|
||||
type: "START_REPORT",
|
||||
artistAlleyListingId: listing.id,
|
||||
});
|
||||
},
|
||||
ItemIcon: postPage.ForwardRef$12,
|
||||
text: "report",}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ArtistAlleyListing
|
||||
|
||||
|
||||
= ({ listing, project }) => {
|
||||
const rendered = postPage.reactExports.useMemo(() => {
|
||||
return postPage.renderMarkdownReactNoHTML(listing.body, new Date(), {
|
||||
disableEmbeds: true,
|
||||
externalLinksInNewTab: true,
|
||||
hasCohostPlus: false,
|
||||
renderingContext: "artistAlley",
|
||||
});
|
||||
}, [listing.body]);
|
||||
|
||||
const theme = postPage.useDynamicTheme();
|
||||
|
||||
return (
|
||||
postPage.React.createElement('div', {
|
||||
'data-theme': theme.current,
|
||||
className: "co-themed-box co-artist-alley-listing flex w-full flex-col rounded-lg border" ,}
|
||||
|
||||
, postPage.React.createElement('div', { className: "co-border flex flex-row items-center gap-2 border-b px-2 py-3" ,}
|
||||
, postPage.React.createElement(postPage.ProjectAvatar, { project: project, className: "h-8",} )
|
||||
, postPage.React.createElement('a', {
|
||||
href: postPage.sitemap.public.project
|
||||
.mainAppProfile({ projectHandle: project.handle })
|
||||
.toString(),}
|
||||
, "@"
|
||||
, project.handle
|
||||
)
|
||||
, postPage.React.createElement('div', { className: "flex-1",}, " ")
|
||||
, listing.adultContent ? (
|
||||
postPage.React.createElement('span', { className: "co-18-plus rounded-lg p-1 text-xs " ,}, "18+"
|
||||
|
||||
)
|
||||
) : null
|
||||
, postPage.React.createElement(ArtistAlleyMeatballMenu, { listing: listing,} )
|
||||
)
|
||||
, listing.attachment && (
|
||||
postPage.React.createElement(ArtistAlleyAttachment, { attachment: listing.attachment,} )
|
||||
)
|
||||
, postPage.React.createElement('div', { className: "co-prose prose p-2" ,}, rendered)
|
||||
|
||||
, postPage.React.createElement('div', { className: "mx-2 my-3" ,}
|
||||
, postPage.React.createElement(postPage.BasicButton, {
|
||||
as: "a",
|
||||
buttonColor: "",
|
||||
buttonSize: "regular",
|
||||
href: listing.cta.link,
|
||||
extraClasses: "co-cta-button",
|
||||
target: "_blank",}
|
||||
|
||||
, listing.cta.text
|
||||
)
|
||||
)
|
||||
|
||||
, listing.categories.length > 0 && (
|
||||
postPage.React.createElement(ListingTags, { tags: listing.categories,} )
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ListingTags = ({ tags }) => {
|
||||
const { categories } = useArtistAlleyFilters();
|
||||
const filteredTags = tags.filter((tag) => tag != "");
|
||||
|
||||
return filteredTags.length ? (
|
||||
postPage.React.createElement('div', { className: "w-full max-w-full p-3" ,}
|
||||
, postPage.React.createElement('div', {
|
||||
className: postPage.tw`co-tags relative w-full overflow-y-hidden break-words leading-none`,}
|
||||
|
||||
, postPage.React.createElement('div', null
|
||||
, filteredTags.map((tag) => (
|
||||
postPage.React.createElement('button', {
|
||||
key: tag,
|
||||
className: `mr-2 inline-block text-sm hover:underline ${
|
||||
// bold currently filtered tags
|
||||
categories.has(tag) ? "font-bold" : ""
|
||||
}`,
|
||||
onClick: () => {
|
||||
categories.has(tag)
|
||||
? categories.delete(tag)
|
||||
: categories.add(tag);
|
||||
},}
|
||||
, "#"
|
||||
, tag
|
||||
)
|
||||
))
|
||||
)
|
||||
)
|
||||
)
|
||||
) : null;
|
||||
};
|
||||
|
||||
exports.ArtistAlleyFilterProvider = ArtistAlleyFilterProvider;
|
||||
exports.ArtistAlleyListing = ArtistAlleyListing;
|
||||
exports.useArtistAlleyFilters = useArtistAlleyFilters;
|
||||
|
||||
}));
|
2398
cohost-archive/~cohost-dl/dist/create-pSSzSoZB.js
vendored
Normal file
2398
cohost-archive/~cohost-dl/dist/create-pSSzSoZB.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1342
cohost-archive/~cohost-dl/dist/i18n-BbwvFgY2.js
vendored
Normal file
1342
cohost-archive/~cohost-dl/dist/i18n-BbwvFgY2.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1342
cohost-archive/~cohost-dl/dist/i18n-Ddu9HOeh.js
vendored
Normal file
1342
cohost-archive/~cohost-dl/dist/i18n-Ddu9HOeh.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
274
cohost-archive/~cohost-dl/dist/owner-manage-listings-Dnx1_C61.js
vendored
Normal file
274
cohost-archive/~cohost-dl/dist/owner-manage-listings-Dnx1_C61.js
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
if (!window.define) {
|
||||
const modules = {};
|
||||
window.__modules = modules;
|
||||
const modulePromises = {};
|
||||
|
||||
const thisScriptSource = document.currentScript.getAttribute('src');
|
||||
const srcDir = thisScriptSource.substring(0, thisScriptSource.lastIndexOf('/'));
|
||||
|
||||
const load = (id) => {
|
||||
if (modules[id]) return modules[id];
|
||||
if (modulePromises[id]) return modulePromises[id];
|
||||
return modulePromises[id] = new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = srcDir + '/' + id + '.js';
|
||||
script.onload = () => modules[id].then(resolve);
|
||||
script.onerror = err => reject(new Error('failed to load ' + id));
|
||||
script.dataset.id = id;
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
const require = (ids, callback) => {
|
||||
Promise.all(ids.map(load)).then(items => {
|
||||
if (items.length === 1) callback(items[0]);
|
||||
else callback(items);
|
||||
});
|
||||
};
|
||||
window.require = require;
|
||||
|
||||
require.context = (dir, useSubdirs) => {
|
||||
if ((dir === "../../images/emoji" || dir === "../images/emoji") && !useSubdirs) {
|
||||
const data = {"chunks.png":"f59b84127fa7b6c48b6c.png","eggbug-classic.png":"41454e429d62b5cb7963.png","eggbug.png":"17aa2d48956926005de9.png","sixty.png":"9a6014af31fb1ca65a1f.png","unyeah.png":"5cf84d596a2c422967de.png","yeah.png":"014b0a8cc35206ef151d.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
} else if ((dir === "../../images/plus-emoji" || dir === "../images/plus-emoji") && !useSubdirs) {
|
||||
const data = {"eggbug-asleep.png":"ebbf360236a95b62bdfc.png","eggbug-devious.png":"c4f3f2c6b9ffb85934e7.png","eggbug-heart-sob.png":"b59709333449a01e3e0a.png","eggbug-nervous.png":"d2753b632211c395538e.png","eggbug-pensive.png":"ae53a8b5de7c919100e6.png","eggbug-pleading.png":"11c5493261064ffa82c0.png","eggbug-relieved.png":"3633c116f0941d94d237.png","eggbug-shocked.png":"b25a9fdf230219087003.png","eggbug-smile-hearts.png":"d7ec7f057e6fb15a94cc.png","eggbug-sob.png":"9559ff8058a895328d76.png","eggbug-tuesday.png":"90058099e741e483208a.png","eggbug-uwu.png":"228d3a13bd5f7796b434.png","eggbug-wink.png":"3bc3a1c5272e2ceb8712.png","host-aww.png":"9bb403f3822c6457baf6.png","host-cry.png":"530f8cf75eac87716702.png","host-evil.png":"cb9a5640d7ef7b361a1a.png","host-frown.png":"99c7fbf98de865cc9726.png","host-joy.png":"53635f5fe850274b1a7d.png","host-love.png":"c45b6d8f9de20f725b98.png","host-nervous.png":"e5d55348f39c65a20148.png","host-plead.png":"fa883e2377fea8945237.png","host-shock.png":"bfa6d6316fd95ae76803.png","host-stare.png":"a09d966cd188c9ebaa4c.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
}
|
||||
throw new Error('not supported: require.context for ' + dir);
|
||||
};
|
||||
|
||||
window.define = (imports, exec) => {
|
||||
if (typeof imports === 'function') {
|
||||
exec = imports;
|
||||
imports = [];
|
||||
}
|
||||
const id = document.currentScript.dataset.id
|
||||
?? './' + document.currentScript.getAttribute('src').split('/').pop().replace(/\.js$/i, '');
|
||||
if (modules[id]) return;
|
||||
const exports = {};
|
||||
modules[id] = Promise.resolve().then(function() {
|
||||
const imported = [];
|
||||
for (const id of imports) {
|
||||
if (id === 'require') imported.push(Promise.resolve(require));
|
||||
else if (id === 'exports') imported.push(Promise.resolve(exports));
|
||||
else imported.push(load(id));
|
||||
}
|
||||
return Promise.all(imported);
|
||||
}).then(function(imported) {
|
||||
const result = exec.apply(window, imported);
|
||||
if (!('default' in exports)) exports.default = result;
|
||||
return exports;
|
||||
});
|
||||
};
|
||||
|
||||
window.process = { env: { NODE_ENV: 'production' } };
|
||||
}
|
||||
|
||||
define(['exports', './post-page', './artist-alley-listing-Dn2_eERZ'], (function (exports, postPage, artistAlleyListing) { 'use strict';
|
||||
|
||||
const ApprovalChip = ({ status }) => {
|
||||
const Icon =
|
||||
status === "expired"
|
||||
? postPage.ForwardRef$7
|
||||
: status === "approved"
|
||||
? postPage.ForwardRef$8
|
||||
: status === "rejected"
|
||||
? postPage.ForwardRef$9
|
||||
: postPage.ForwardRef$10;
|
||||
return (
|
||||
postPage.React.createElement('span', {
|
||||
className: `block max-w-max rounded-lg px-3 py-2 ${
|
||||
status === "expired"
|
||||
? "bg-gray-300 text-notBlack"
|
||||
: status === "approved"
|
||||
? "bg-green-600 text-notWhite contrast-more:bg-green-700"
|
||||
: status === "pending"
|
||||
? "bg-longan text-notBlack"
|
||||
: "bg-red-600 text-notWhite contrast-more:bg-red-700"
|
||||
}`,}
|
||||
|
||||
, postPage.React.createElement(Icon, { className: "mr-2 inline-block h-4 w-4" ,} )
|
||||
, status
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ArtistAlleyOwnerListing
|
||||
|
||||
|
||||
= ({ listing, project }) => {
|
||||
const hasExpired =
|
||||
listing.status === "approved" &&
|
||||
new Date(listing.expiresAt) < new Date();
|
||||
const effectiveStatus = hasExpired ? "expired" : listing.status;
|
||||
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "flex w-full min-w-0 flex-row flex-wrap justify-between gap-4 " ,}
|
||||
, postPage.React.createElement('div', { className: "flex-shrink space-y-3" ,}
|
||||
, postPage.React.createElement(ApprovalChip, { status: effectiveStatus,} )
|
||||
, postPage.React.createElement('div', null
|
||||
, postPage.React.createElement('ul', { className: "space-y-3",}
|
||||
, postPage.React.createElement('li', null
|
||||
, postPage.React.createElement('span', { className: "font-bold",}, "purchase date:" ), " "
|
||||
, postPage.DateTime_1.fromISO(listing.createdAt).toLocaleString(
|
||||
postPage.DateTime_1.DATETIME_FULL
|
||||
)
|
||||
)
|
||||
, postPage.React.createElement('li', null
|
||||
, postPage.React.createElement('span', { className: "font-bold",}, "weeks purchased:" ), " "
|
||||
, listing.numWeeks
|
||||
)
|
||||
, listing.status === "approved" && (
|
||||
postPage.React.createElement('li', null
|
||||
, postPage.React.createElement('span', { className: "font-bold",}, "end date:" ), " "
|
||||
, postPage.DateTime_1.fromISO(
|
||||
listing.expiresAt
|
||||
).toLocaleString(postPage.DateTime_1.DATETIME_FULL)
|
||||
)
|
||||
)
|
||||
, listing.receiptUrl && (
|
||||
postPage.React.createElement('li', null
|
||||
, postPage.React.createElement('a', {
|
||||
href: listing.receiptUrl,
|
||||
rel: "noopener",
|
||||
target: "_blank",
|
||||
className: "font-bold underline" ,}
|
||||
, "view receipt"
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
, listing.notes && (
|
||||
postPage.React.createElement('li', null
|
||||
, postPage.React.createElement('span', { className: "font-bold",}, "submission notes:"
|
||||
|
||||
)
|
||||
, postPage.React.createElement('br', null )
|
||||
, postPage.React.createElement('div', { className: "co-prose prose mt-2" ,}
|
||||
, postPage.React.createElement('blockquote', null, listing.notes)
|
||||
)
|
||||
)
|
||||
)
|
||||
, listing.rejectReason && (
|
||||
postPage.React.createElement('li', null
|
||||
, postPage.React.createElement('span', { className: "font-bold",}, "rejection reason:"
|
||||
|
||||
)
|
||||
, postPage.React.createElement('br', null )
|
||||
, postPage.React.createElement('div', { className: "co-prose prose mt-2" ,}
|
||||
, postPage.React.createElement('blockquote', null
|
||||
, listing.rejectReason
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
, postPage.React.createElement('div', { className: "w-full max-w-[300px] basis-[300px]" ,}
|
||||
, postPage.React.createElement(artistAlleyListing.ArtistAlleyListing, { listing: listing, project: project,} )
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ArtistAlleyOwnerListingsPage = () => {
|
||||
postPage.useRequiresLogin();
|
||||
|
||||
const [{ pages }, { hasNextPage, fetchNextPage, isFetching }] =
|
||||
postPage.trpc.artistAlley.getOwnerListings.useSuspenseInfiniteQuery(
|
||||
{},
|
||||
{
|
||||
getNextPageParam: (lastPage) => lastPage.nextCursor,
|
||||
refetchOnMount: false,
|
||||
refetchOnWindowFocus: false,
|
||||
}
|
||||
);
|
||||
|
||||
const flattenedListings = postPage.reactExports.useMemo(() => {
|
||||
return pages.flatMap((page) => page.listings) ?? [];
|
||||
}, [pages]);
|
||||
|
||||
const flattenedProjects = postPage.reactExports.useMemo(() => {
|
||||
const projects = new Map();
|
||||
pages.forEach((page) => {
|
||||
Object.values(page.relevantProjects).forEach((project) => {
|
||||
projects.set(project.projectId, project);
|
||||
});
|
||||
});
|
||||
return projects;
|
||||
}, [pages]);
|
||||
|
||||
const combinedListings = postPage.reactExports.useMemo(() => {
|
||||
const val = flattenedListings
|
||||
.map
|
||||
|
||||
|
||||
((listing) => {
|
||||
const project = flattenedProjects.get(listing.projectId);
|
||||
if (!project) return undefined;
|
||||
return {
|
||||
listing,
|
||||
project,
|
||||
};
|
||||
})
|
||||
.filter(postPage.isDefined);
|
||||
|
||||
return val;
|
||||
}, [flattenedListings, flattenedProjects]);
|
||||
|
||||
const theme = postPage.useDynamicTheme();
|
||||
|
||||
return (
|
||||
postPage.React.createElement('main', { className: "w-full pt-16" ,}
|
||||
, postPage.React.createElement('div', { className: "container mx-auto grid grid-cols-1 gap-16 lg:grid-cols-4" ,}
|
||||
, postPage.React.createElement(postPage.SidebarMenu, null )
|
||||
, postPage.React.createElement('section', { className: " col-span-1 flex flex-col gap-12 lg:col-span-2" ,}
|
||||
, postPage.React.createElement('div', {
|
||||
className: "co-themed-box co-settings rounded-lg p-3" ,
|
||||
'data-theme': theme.current,}
|
||||
|
||||
, postPage.React.createElement('h1', { className: "co-settings-header",}, "manage your listings"
|
||||
|
||||
)
|
||||
, postPage.React.createElement('hr', { className: "mt-6",} )
|
||||
, postPage.React.createElement('div', { className: "my-6 flex flex-col space-y-3" ,}
|
||||
, combinedListings?.map((listing) => (
|
||||
postPage.React.createElement(postPage.React.Fragment, { key: listing.listing.id,}
|
||||
, postPage.React.createElement(ArtistAlleyOwnerListing, {
|
||||
listing: listing.listing,
|
||||
project: listing.project,}
|
||||
)
|
||||
, postPage.React.createElement('hr', null )
|
||||
)
|
||||
))
|
||||
)
|
||||
, postPage.React.createElement(postPage.BasicButton, {
|
||||
as: "button",
|
||||
buttonColor: "theme-sensitive-1",
|
||||
buttonSize: "regular",
|
||||
disabled: isFetching || !hasNextPage,
|
||||
onClick: () => fetchNextPage(),}
|
||||
|
||||
, isFetching
|
||||
? "loading..."
|
||||
: hasNextPage
|
||||
? "load more"
|
||||
: "no more listings"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
exports.ArtistAlleyOwnerListingsPage = ArtistAlleyOwnerListingsPage;
|
||||
exports.default = ArtistAlleyOwnerListingsPage;
|
||||
|
||||
}));
|
110
cohost-archive/~cohost-dl/dist/payment-cancelled-CsIYCkxV.js
vendored
Normal file
110
cohost-archive/~cohost-dl/dist/payment-cancelled-CsIYCkxV.js
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
if (!window.define) {
|
||||
const modules = {};
|
||||
window.__modules = modules;
|
||||
const modulePromises = {};
|
||||
|
||||
const thisScriptSource = document.currentScript.getAttribute('src');
|
||||
const srcDir = thisScriptSource.substring(0, thisScriptSource.lastIndexOf('/'));
|
||||
|
||||
const load = (id) => {
|
||||
if (modules[id]) return modules[id];
|
||||
if (modulePromises[id]) return modulePromises[id];
|
||||
return modulePromises[id] = new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = srcDir + '/' + id + '.js';
|
||||
script.onload = () => modules[id].then(resolve);
|
||||
script.onerror = err => reject(new Error('failed to load ' + id));
|
||||
script.dataset.id = id;
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
const require = (ids, callback) => {
|
||||
Promise.all(ids.map(load)).then(items => {
|
||||
if (items.length === 1) callback(items[0]);
|
||||
else callback(items);
|
||||
});
|
||||
};
|
||||
window.require = require;
|
||||
|
||||
require.context = (dir, useSubdirs) => {
|
||||
if ((dir === "../../images/emoji" || dir === "../images/emoji") && !useSubdirs) {
|
||||
const data = {"chunks.png":"f59b84127fa7b6c48b6c.png","eggbug-classic.png":"41454e429d62b5cb7963.png","eggbug.png":"17aa2d48956926005de9.png","sixty.png":"9a6014af31fb1ca65a1f.png","unyeah.png":"5cf84d596a2c422967de.png","yeah.png":"014b0a8cc35206ef151d.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
} else if ((dir === "../../images/plus-emoji" || dir === "../images/plus-emoji") && !useSubdirs) {
|
||||
const data = {"eggbug-asleep.png":"ebbf360236a95b62bdfc.png","eggbug-devious.png":"c4f3f2c6b9ffb85934e7.png","eggbug-heart-sob.png":"b59709333449a01e3e0a.png","eggbug-nervous.png":"d2753b632211c395538e.png","eggbug-pensive.png":"ae53a8b5de7c919100e6.png","eggbug-pleading.png":"11c5493261064ffa82c0.png","eggbug-relieved.png":"3633c116f0941d94d237.png","eggbug-shocked.png":"b25a9fdf230219087003.png","eggbug-smile-hearts.png":"d7ec7f057e6fb15a94cc.png","eggbug-sob.png":"9559ff8058a895328d76.png","eggbug-tuesday.png":"90058099e741e483208a.png","eggbug-uwu.png":"228d3a13bd5f7796b434.png","eggbug-wink.png":"3bc3a1c5272e2ceb8712.png","host-aww.png":"9bb403f3822c6457baf6.png","host-cry.png":"530f8cf75eac87716702.png","host-evil.png":"cb9a5640d7ef7b361a1a.png","host-frown.png":"99c7fbf98de865cc9726.png","host-joy.png":"53635f5fe850274b1a7d.png","host-love.png":"c45b6d8f9de20f725b98.png","host-nervous.png":"e5d55348f39c65a20148.png","host-plead.png":"fa883e2377fea8945237.png","host-shock.png":"bfa6d6316fd95ae76803.png","host-stare.png":"a09d966cd188c9ebaa4c.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
}
|
||||
throw new Error('not supported: require.context for ' + dir);
|
||||
};
|
||||
|
||||
window.define = (imports, exec) => {
|
||||
if (typeof imports === 'function') {
|
||||
exec = imports;
|
||||
imports = [];
|
||||
}
|
||||
const id = document.currentScript.dataset.id
|
||||
?? './' + document.currentScript.getAttribute('src').split('/').pop().replace(/\.js$/i, '');
|
||||
if (modules[id]) return;
|
||||
const exports = {};
|
||||
modules[id] = Promise.resolve().then(function() {
|
||||
const imported = [];
|
||||
for (const id of imports) {
|
||||
if (id === 'require') imported.push(Promise.resolve(require));
|
||||
else if (id === 'exports') imported.push(Promise.resolve(exports));
|
||||
else imported.push(load(id));
|
||||
}
|
||||
return Promise.all(imported);
|
||||
}).then(function(imported) {
|
||||
const result = exec.apply(window, imported);
|
||||
if (!('default' in exports)) exports.default = result;
|
||||
return exports;
|
||||
});
|
||||
};
|
||||
|
||||
window.process = { env: { NODE_ENV: 'production' } };
|
||||
}
|
||||
|
||||
define(['exports', './post-page'], (function (exports, postPage) { 'use strict';
|
||||
|
||||
const ArtistAlleyPaymentCancelledPage = () => {
|
||||
postPage.useRequiresLogin();
|
||||
const { sessionId } = postPage.useParams();
|
||||
postPage.trpc.artistAlley.getByCheckoutSession.useQuery(
|
||||
{
|
||||
checkoutSessionId: sessionId,
|
||||
},
|
||||
{
|
||||
suspense: true,
|
||||
}
|
||||
);
|
||||
|
||||
const theme = postPage.useDynamicTheme();
|
||||
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "co-themed-box co-static" , 'data-theme': theme.current,}
|
||||
, postPage.React.createElement(postPage.Helmet, { title: "payment cancelled - artist alley" ,} )
|
||||
, postPage.React.createElement('div', { className: "co-prose prose" ,}
|
||||
, postPage.React.createElement('h1', null, "Payment Cancelled" )
|
||||
, postPage.React.createElement('p', null, "you backed out of the payment page! if you didn't mean to do that, you hit your browser's back button."
|
||||
|
||||
|
||||
)
|
||||
, postPage.React.createElement('p', null, "as of this exact moment, there's nothing you can do from here. we'll be adding a page where you can manage listings (including ones you haven't paid for) soon."
|
||||
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
exports.ArtistAlleyPaymentCancelledPage = ArtistAlleyPaymentCancelledPage;
|
||||
exports.default = ArtistAlleyPaymentCancelledPage;
|
||||
|
||||
}));
|
115
cohost-archive/~cohost-dl/dist/payment-success-CwiILBPI.js
vendored
Normal file
115
cohost-archive/~cohost-dl/dist/payment-success-CwiILBPI.js
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
if (!window.define) {
|
||||
const modules = {};
|
||||
window.__modules = modules;
|
||||
const modulePromises = {};
|
||||
|
||||
const thisScriptSource = document.currentScript.getAttribute('src');
|
||||
const srcDir = thisScriptSource.substring(0, thisScriptSource.lastIndexOf('/'));
|
||||
|
||||
const load = (id) => {
|
||||
if (modules[id]) return modules[id];
|
||||
if (modulePromises[id]) return modulePromises[id];
|
||||
return modulePromises[id] = new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = srcDir + '/' + id + '.js';
|
||||
script.onload = () => modules[id].then(resolve);
|
||||
script.onerror = err => reject(new Error('failed to load ' + id));
|
||||
script.dataset.id = id;
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
const require = (ids, callback) => {
|
||||
Promise.all(ids.map(load)).then(items => {
|
||||
if (items.length === 1) callback(items[0]);
|
||||
else callback(items);
|
||||
});
|
||||
};
|
||||
window.require = require;
|
||||
|
||||
require.context = (dir, useSubdirs) => {
|
||||
if ((dir === "../../images/emoji" || dir === "../images/emoji") && !useSubdirs) {
|
||||
const data = {"chunks.png":"f59b84127fa7b6c48b6c.png","eggbug-classic.png":"41454e429d62b5cb7963.png","eggbug.png":"17aa2d48956926005de9.png","sixty.png":"9a6014af31fb1ca65a1f.png","unyeah.png":"5cf84d596a2c422967de.png","yeah.png":"014b0a8cc35206ef151d.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
} else if ((dir === "../../images/plus-emoji" || dir === "../images/plus-emoji") && !useSubdirs) {
|
||||
const data = {"eggbug-asleep.png":"ebbf360236a95b62bdfc.png","eggbug-devious.png":"c4f3f2c6b9ffb85934e7.png","eggbug-heart-sob.png":"b59709333449a01e3e0a.png","eggbug-nervous.png":"d2753b632211c395538e.png","eggbug-pensive.png":"ae53a8b5de7c919100e6.png","eggbug-pleading.png":"11c5493261064ffa82c0.png","eggbug-relieved.png":"3633c116f0941d94d237.png","eggbug-shocked.png":"b25a9fdf230219087003.png","eggbug-smile-hearts.png":"d7ec7f057e6fb15a94cc.png","eggbug-sob.png":"9559ff8058a895328d76.png","eggbug-tuesday.png":"90058099e741e483208a.png","eggbug-uwu.png":"228d3a13bd5f7796b434.png","eggbug-wink.png":"3bc3a1c5272e2ceb8712.png","host-aww.png":"9bb403f3822c6457baf6.png","host-cry.png":"530f8cf75eac87716702.png","host-evil.png":"cb9a5640d7ef7b361a1a.png","host-frown.png":"99c7fbf98de865cc9726.png","host-joy.png":"53635f5fe850274b1a7d.png","host-love.png":"c45b6d8f9de20f725b98.png","host-nervous.png":"e5d55348f39c65a20148.png","host-plead.png":"fa883e2377fea8945237.png","host-shock.png":"bfa6d6316fd95ae76803.png","host-stare.png":"a09d966cd188c9ebaa4c.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
}
|
||||
throw new Error('not supported: require.context for ' + dir);
|
||||
};
|
||||
|
||||
window.define = (imports, exec) => {
|
||||
if (typeof imports === 'function') {
|
||||
exec = imports;
|
||||
imports = [];
|
||||
}
|
||||
const id = document.currentScript.dataset.id
|
||||
?? './' + document.currentScript.getAttribute('src').split('/').pop().replace(/\.js$/i, '');
|
||||
if (modules[id]) return;
|
||||
const exports = {};
|
||||
modules[id] = Promise.resolve().then(function() {
|
||||
const imported = [];
|
||||
for (const id of imports) {
|
||||
if (id === 'require') imported.push(Promise.resolve(require));
|
||||
else if (id === 'exports') imported.push(Promise.resolve(exports));
|
||||
else imported.push(load(id));
|
||||
}
|
||||
return Promise.all(imported);
|
||||
}).then(function(imported) {
|
||||
const result = exec.apply(window, imported);
|
||||
if (!('default' in exports)) exports.default = result;
|
||||
return exports;
|
||||
});
|
||||
};
|
||||
|
||||
window.process = { env: { NODE_ENV: 'production' } };
|
||||
}
|
||||
|
||||
define(['exports', './post-page', './artist-alley-listing-Dn2_eERZ'], (function (exports, postPage, artistAlleyListing) { 'use strict';
|
||||
|
||||
const ArtistAlleyPaymentSuccessPage = () => {
|
||||
postPage.useRequiresLogin();
|
||||
const { sessionId } = postPage.useParams();
|
||||
const listing = postPage.trpc.artistAlley.getByCheckoutSession.useQuery(
|
||||
{
|
||||
checkoutSessionId: sessionId,
|
||||
},
|
||||
{
|
||||
suspense: true,
|
||||
}
|
||||
);
|
||||
|
||||
const theme = postPage.useDynamicTheme();
|
||||
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "co-themed-box co-static" , 'data-theme': theme.current,}
|
||||
, postPage.React.createElement(postPage.Helmet, { title: "payment success - artist alley" ,} )
|
||||
, postPage.React.createElement('div', { className: "co-prose prose" ,}
|
||||
, postPage.React.createElement('h1', null, "Payment Success" )
|
||||
, postPage.React.createElement('p', null, "we got your payment and your listing is now being reviewed! we'll e-mail you if we have any questions about your listing, or to let you know if it's accepted or rejected."
|
||||
|
||||
|
||||
|
||||
)
|
||||
, postPage.React.createElement('p', null, "here's a preview for the road:" )
|
||||
)
|
||||
, postPage.React.createElement('div', { className: "max-w-[300px]",}
|
||||
, listing.data && (
|
||||
postPage.React.createElement(artistAlleyListing.ArtistAlleyListing, {
|
||||
listing: listing.data.listing,
|
||||
project: listing.data.project,}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
exports.ArtistAlleyPaymentSuccessPage = ArtistAlleyPaymentSuccessPage;
|
||||
exports.default = ArtistAlleyPaymentSuccessPage;
|
||||
|
||||
}));
|
101627
cohost-archive/~cohost-dl/dist/post-index.js
vendored
Normal file
101627
cohost-archive/~cohost-dl/dist/post-index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
132316
cohost-archive/~cohost-dl/dist/post-page.js
vendored
Normal file
132316
cohost-archive/~cohost-dl/dist/post-page.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1158
cohost-archive/~cohost-dl/dist/project-settings-mDhFTqi7.js
vendored
Normal file
1158
cohost-archive/~cohost-dl/dist/project-settings-mDhFTqi7.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
355
cohost-archive/~cohost-dl/dist/search-BMpfkuEp.js
vendored
Normal file
355
cohost-archive/~cohost-dl/dist/search-BMpfkuEp.js
vendored
Normal file
@@ -0,0 +1,355 @@
|
||||
if (!window.define) {
|
||||
const modules = {};
|
||||
window.__modules = modules;
|
||||
const modulePromises = {};
|
||||
|
||||
const thisScriptSource = document.currentScript.getAttribute('src');
|
||||
const srcDir = thisScriptSource.substring(0, thisScriptSource.lastIndexOf('/'));
|
||||
|
||||
const load = (id) => {
|
||||
if (modules[id]) return modules[id];
|
||||
if (modulePromises[id]) return modulePromises[id];
|
||||
return modulePromises[id] = new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = srcDir + '/' + id + '.js';
|
||||
script.onload = () => modules[id].then(resolve);
|
||||
script.onerror = err => reject(new Error('failed to load ' + id));
|
||||
script.dataset.id = id;
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
const require = (ids, callback) => {
|
||||
Promise.all(ids.map(load)).then(items => {
|
||||
if (items.length === 1) callback(items[0]);
|
||||
else callback(items);
|
||||
});
|
||||
};
|
||||
window.require = require;
|
||||
|
||||
require.context = (dir, useSubdirs) => {
|
||||
if ((dir === "../../images/emoji" || dir === "../images/emoji") && !useSubdirs) {
|
||||
const data = {"chunks.png":"f59b84127fa7b6c48b6c.png","eggbug-classic.png":"41454e429d62b5cb7963.png","eggbug.png":"17aa2d48956926005de9.png","sixty.png":"9a6014af31fb1ca65a1f.png","unyeah.png":"5cf84d596a2c422967de.png","yeah.png":"014b0a8cc35206ef151d.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
} else if ((dir === "../../images/plus-emoji" || dir === "../images/plus-emoji") && !useSubdirs) {
|
||||
const data = {"eggbug-asleep.png":"ebbf360236a95b62bdfc.png","eggbug-devious.png":"c4f3f2c6b9ffb85934e7.png","eggbug-heart-sob.png":"b59709333449a01e3e0a.png","eggbug-nervous.png":"d2753b632211c395538e.png","eggbug-pensive.png":"ae53a8b5de7c919100e6.png","eggbug-pleading.png":"11c5493261064ffa82c0.png","eggbug-relieved.png":"3633c116f0941d94d237.png","eggbug-shocked.png":"b25a9fdf230219087003.png","eggbug-smile-hearts.png":"d7ec7f057e6fb15a94cc.png","eggbug-sob.png":"9559ff8058a895328d76.png","eggbug-tuesday.png":"90058099e741e483208a.png","eggbug-uwu.png":"228d3a13bd5f7796b434.png","eggbug-wink.png":"3bc3a1c5272e2ceb8712.png","host-aww.png":"9bb403f3822c6457baf6.png","host-cry.png":"530f8cf75eac87716702.png","host-evil.png":"cb9a5640d7ef7b361a1a.png","host-frown.png":"99c7fbf98de865cc9726.png","host-joy.png":"53635f5fe850274b1a7d.png","host-love.png":"c45b6d8f9de20f725b98.png","host-nervous.png":"e5d55348f39c65a20148.png","host-plead.png":"fa883e2377fea8945237.png","host-shock.png":"bfa6d6316fd95ae76803.png","host-stare.png":"a09d966cd188c9ebaa4c.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
}
|
||||
throw new Error('not supported: require.context for ' + dir);
|
||||
};
|
||||
|
||||
window.define = (imports, exec) => {
|
||||
if (typeof imports === 'function') {
|
||||
exec = imports;
|
||||
imports = [];
|
||||
}
|
||||
const id = document.currentScript.dataset.id
|
||||
?? './' + document.currentScript.getAttribute('src').split('/').pop().replace(/\.js$/i, '');
|
||||
if (modules[id]) return;
|
||||
const exports = {};
|
||||
modules[id] = Promise.resolve().then(function() {
|
||||
const imported = [];
|
||||
for (const id of imports) {
|
||||
if (id === 'require') imported.push(Promise.resolve(require));
|
||||
else if (id === 'exports') imported.push(Promise.resolve(exports));
|
||||
else imported.push(load(id));
|
||||
}
|
||||
return Promise.all(imported);
|
||||
}).then(function(imported) {
|
||||
const result = exec.apply(window, imported);
|
||||
if (!('default' in exports)) exports.default = result;
|
||||
return exports;
|
||||
});
|
||||
};
|
||||
|
||||
window.process = { env: { NODE_ENV: 'production' } };
|
||||
}
|
||||
|
||||
define(['exports', './post-page'], (function (exports, postPage) { 'use strict';
|
||||
|
||||
const FollowRequestsContext = postPage.reactExports.createContext
|
||||
|
||||
|
||||
({ onAction: () => {} });
|
||||
|
||||
const FollowRequestButtons
|
||||
|
||||
= ({ requester }) => {
|
||||
const { t } = postPage.useTranslation();
|
||||
const userInfo = postPage.useUserInfo();
|
||||
const { onAction } = postPage.reactExports.useContext(FollowRequestsContext);
|
||||
const utils = postPage.trpc.useContext();
|
||||
|
||||
const createRequestMutationArgs = (action) => {
|
||||
return {
|
||||
onSettled: async () => {
|
||||
onAction(requester.projectId, action);
|
||||
await utils.relationships.countFollowRequests.invalidate();
|
||||
await utils.posts.profilePosts.invalidate();
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const acceptRequestMutation =
|
||||
postPage.trpc.relationships.acceptFollowRequest.useMutation(
|
||||
createRequestMutationArgs("accept")
|
||||
);
|
||||
const onClickAccept = postPage.reactExports.useCallback(async () => {
|
||||
if (!userInfo.projectId) return;
|
||||
|
||||
await acceptRequestMutation.mutateAsync({
|
||||
fromProjectId: requester.projectId,
|
||||
toProjectId: userInfo.projectId,
|
||||
});
|
||||
}, [acceptRequestMutation, requester.projectId, userInfo.projectId]);
|
||||
|
||||
const declineRequestMutation =
|
||||
postPage.trpc.relationships.declineOrCancelFollowRequest.useMutation(
|
||||
createRequestMutationArgs("decline")
|
||||
);
|
||||
|
||||
const onClickDecline = postPage.reactExports.useCallback(async () => {
|
||||
if (!userInfo.projectId) return;
|
||||
|
||||
await declineRequestMutation.mutateAsync({
|
||||
fromProjectId: requester.projectId,
|
||||
toProjectId: userInfo.projectId,
|
||||
});
|
||||
}, [declineRequestMutation, requester.projectId, userInfo.projectId]);
|
||||
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "flex flex-row justify-center gap-2" ,}
|
||||
, postPage.React.createElement(postPage.Button, { buttonStyle: "pill", color: "green", onClick: onClickAccept,}
|
||||
, t(
|
||||
"server:relationships.accept-follow-request-button-text-short",
|
||||
"accept"
|
||||
)
|
||||
)
|
||||
, postPage.React.createElement(postPage.Button, { buttonStyle: "pill", color: "red", onClick: onClickDecline,}
|
||||
, t(
|
||||
"server:relationships.decline-follow-request-button-text-short",
|
||||
"decline"
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ProjectCard = ({
|
||||
project,
|
||||
isFollowRequest = false,
|
||||
}) => {
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "flex flex-row items-center gap-1" ,}
|
||||
, postPage.React.createElement(postPage.ProjectAvatar, { project: project,} )
|
||||
, postPage.React.createElement('div', { className: "min-w-0 flex-shrink justify-center gap-0 lg:flex-row" ,}
|
||||
, postPage.React.createElement('div', { className: "items-left flex flex-shrink flex-row gap-1 lg:flex-col" ,}
|
||||
, postPage.React.createElement(postPage.ProjectReference, { project: project,} )
|
||||
)
|
||||
, postPage.React.createElement('p', null, project.dek)
|
||||
)
|
||||
, postPage.React.createElement('div', { className: "flex-grow",} )
|
||||
, isFollowRequest ? (
|
||||
postPage.React.createElement(FollowRequestButtons, { requester: project,} )
|
||||
) : (
|
||||
postPage.React.createElement(postPage.FollowButton, { project: project, color: "cherry",} )
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const BookmarkTagButton = ({
|
||||
tagName,
|
||||
className,
|
||||
}) => {
|
||||
const { loggedIn } = postPage.useUserInfo();
|
||||
const utils = postPage.trpc.useContext();
|
||||
const { data: isBookmarked, isFetched } =
|
||||
postPage.trpc.bookmarks.tags.isBookmarked.useQuery(
|
||||
{ tagName },
|
||||
{ enabled: loggedIn }
|
||||
);
|
||||
const { t } = postPage.useTranslation();
|
||||
const buttonText = isBookmarked
|
||||
? t("common:unbookmark-tag", "unbookmark this tag")
|
||||
: t("common:bookmark-tag", "bookmark this tag");
|
||||
|
||||
const bookmarkTagMutation = postPage.trpc.bookmarks.tags.create.useMutation({
|
||||
onSettled: () =>
|
||||
Promise.all([
|
||||
utils.bookmarks.tags.isBookmarked.invalidate({ tagName }),
|
||||
utils.bookmarks.tags.list.invalidate(),
|
||||
]),
|
||||
});
|
||||
|
||||
const unbookmarkTagMutation = postPage.trpc.bookmarks.tags.delete.useMutation({
|
||||
onSettled: () =>
|
||||
Promise.all([
|
||||
utils.bookmarks.tags.isBookmarked.invalidate({ tagName }),
|
||||
utils.bookmarks.tags.list.invalidate(),
|
||||
]),
|
||||
});
|
||||
|
||||
const bookmarkTag = postPage.reactExports.useCallback(() => {
|
||||
if (isBookmarked) {
|
||||
unbookmarkTagMutation.mutate({ tagName });
|
||||
} else {
|
||||
bookmarkTagMutation.mutate({ tagName });
|
||||
}
|
||||
}, [isBookmarked, unbookmarkTagMutation, tagName, bookmarkTagMutation]);
|
||||
|
||||
return loggedIn ? (
|
||||
isFetched ? (
|
||||
postPage.React.createElement(postPage.Button, {
|
||||
className: className,
|
||||
buttonStyle: "roundrect",
|
||||
color: "secondary",
|
||||
onClick: bookmarkTag,}
|
||||
|
||||
, buttonText
|
||||
)
|
||||
) : (
|
||||
postPage.React.createElement(postPage.Button, {
|
||||
className: className,
|
||||
buttonStyle: "roundrect",
|
||||
color: "secondary",
|
||||
disabled: true,}
|
||||
|
||||
, t("common:loading")
|
||||
)
|
||||
)
|
||||
) : null;
|
||||
};
|
||||
|
||||
const SearchPage = () => {
|
||||
return (
|
||||
postPage.React.createElement('main', { className: "w-full pt-16" ,}
|
||||
, postPage.React.createElement('div', { className: "container mx-auto grid grid-cols-1 gap-16 lg:grid-cols-4" ,}
|
||||
, postPage.React.createElement(postPage.SidebarMenu, null )
|
||||
, postPage.React.createElement('section', { className: "col-span-1 flex flex-col gap-12 lg:col-span-2" ,}
|
||||
, postPage.React.createElement('div', { className: "rounded-lg bg-notWhite p-3 text-notBlack" ,}
|
||||
, postPage.React.createElement(postPage.reactExports.Suspense, null
|
||||
, postPage.React.createElement(SearchResults, null )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const SearchResults = () => {
|
||||
const [searchParams, setSearchParams] = postPage.useSearchParams();
|
||||
const [query, setQuery] = postPage.reactExports.useState(
|
||||
() => searchParams.get("q") ?? ""
|
||||
);
|
||||
const [searchToken, setSearchToken] = postPage.reactExports.useState(() => query);
|
||||
const [, startTransition] = postPage.reactExports.useTransition();
|
||||
|
||||
const projectResults = postPage.useProjectSearch(searchToken, {});
|
||||
const tagResults = postPage.useTagSearch(searchToken);
|
||||
|
||||
const onChangeQuery = postPage.reactExports.useCallback
|
||||
|
||||
(
|
||||
(e) => {
|
||||
const value = e.currentTarget.value;
|
||||
setQuery(value);
|
||||
startTransition(() => {
|
||||
setSearchToken(value);
|
||||
setSearchParams({ q: value }, { replace: true });
|
||||
});
|
||||
},
|
||||
[setSearchParams]
|
||||
);
|
||||
|
||||
return (
|
||||
postPage.React.createElement(postPage.React.Fragment, null
|
||||
, postPage.React.createElement(postPage.Helmet, { title: `search: ${query}`,} )
|
||||
, postPage.React.createElement('div', { className: "flex flex-col gap-4" ,}
|
||||
, postPage.React.createElement('h1', { className: "h2",}, "search")
|
||||
/* if we've got js, that's great! we're updating on keystrokes
|
||||
anyway. if we don't, the form should still work by changing the
|
||||
query string. */
|
||||
, postPage.React.createElement('form', { method: "get", onSubmit: (e) => e.preventDefault(),}
|
||||
, postPage.React.createElement('input', {
|
||||
type: "text",
|
||||
name: "q",
|
||||
placeholder: "search for pages and tags!" ,
|
||||
className: "w-full",
|
||||
value: query,
|
||||
onChange: onChangeQuery,}
|
||||
)
|
||||
)
|
||||
|
||||
, !searchToken || searchToken.length < 3 ? (
|
||||
postPage.React.createElement('p', { className: "h5",}, "enter a query to see results!" )
|
||||
) : null
|
||||
|
||||
, searchToken && searchToken.length >= 3 ? (
|
||||
postPage.React.createElement(postPage.React.Fragment, null
|
||||
, postPage.React.createElement('div', { className: "mt-4",}
|
||||
, postPage.React.createElement('h2', { className: "h5",}, "pages")
|
||||
, postPage.React.createElement('div', { className: "flex w-full flex-col gap-4" ,}
|
||||
, projectResults.projects?.length ? (
|
||||
projectResults.projects?.map((project) => (
|
||||
postPage.React.createElement(ProjectCard, {
|
||||
project: project,
|
||||
key: project.projectId,}
|
||||
)
|
||||
))
|
||||
) : (
|
||||
postPage.React.createElement('p', { className: "h6",}, "No pages found!" )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
, postPage.React.createElement('hr', { className: "my-4",} )
|
||||
|
||||
, postPage.React.createElement('div', null
|
||||
, postPage.React.createElement('h2', { className: "h5",}, "tags")
|
||||
, tagResults.suggestions?.result.length ? (
|
||||
postPage.React.createElement('div', { className: "mt-4 flex flex-col gap-2" ,}
|
||||
, tagResults.suggestions?.result?.map(
|
||||
(tag) => (
|
||||
postPage.React.createElement('div', {
|
||||
key: tag.content,
|
||||
className: "flex flex-row justify-between gap-3" ,}
|
||||
|
||||
, postPage.React.createElement('a', {
|
||||
href: postPage.sitemap.public
|
||||
.tags({
|
||||
tagSlug:
|
||||
tag.content,
|
||||
})
|
||||
.toString(),
|
||||
className: "underline before:content-['#']" ,}
|
||||
|
||||
, tag.content
|
||||
)
|
||||
, postPage.React.createElement(BookmarkTagButton, {
|
||||
tagName: tag.content,}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
) : (
|
||||
postPage.React.createElement('p', { className: "h6",}, "No tags found!" )
|
||||
)
|
||||
)
|
||||
)
|
||||
) : null
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
exports.SearchPage = SearchPage;
|
||||
exports.default = SearchPage;
|
||||
|
||||
}));
|
203
cohost-archive/~cohost-dl/dist/styled-input-CUFbgPOn.js
vendored
Normal file
203
cohost-archive/~cohost-dl/dist/styled-input-CUFbgPOn.js
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
if (!window.define) {
|
||||
const modules = {};
|
||||
window.__modules = modules;
|
||||
const modulePromises = {};
|
||||
|
||||
const thisScriptSource = document.currentScript.getAttribute('src');
|
||||
const srcDir = thisScriptSource.substring(0, thisScriptSource.lastIndexOf('/'));
|
||||
|
||||
const load = (id) => {
|
||||
if (modules[id]) return modules[id];
|
||||
if (modulePromises[id]) return modulePromises[id];
|
||||
return modulePromises[id] = new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = srcDir + '/' + id + '.js';
|
||||
script.onload = () => modules[id].then(resolve);
|
||||
script.onerror = err => reject(new Error('failed to load ' + id));
|
||||
script.dataset.id = id;
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
const require = (ids, callback) => {
|
||||
Promise.all(ids.map(load)).then(items => {
|
||||
if (items.length === 1) callback(items[0]);
|
||||
else callback(items);
|
||||
});
|
||||
};
|
||||
window.require = require;
|
||||
|
||||
require.context = (dir, useSubdirs) => {
|
||||
if ((dir === "../../images/emoji" || dir === "../images/emoji") && !useSubdirs) {
|
||||
const data = {"chunks.png":"f59b84127fa7b6c48b6c.png","eggbug-classic.png":"41454e429d62b5cb7963.png","eggbug.png":"17aa2d48956926005de9.png","sixty.png":"9a6014af31fb1ca65a1f.png","unyeah.png":"5cf84d596a2c422967de.png","yeah.png":"014b0a8cc35206ef151d.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
} else if ((dir === "../../images/plus-emoji" || dir === "../images/plus-emoji") && !useSubdirs) {
|
||||
const data = {"eggbug-asleep.png":"ebbf360236a95b62bdfc.png","eggbug-devious.png":"c4f3f2c6b9ffb85934e7.png","eggbug-heart-sob.png":"b59709333449a01e3e0a.png","eggbug-nervous.png":"d2753b632211c395538e.png","eggbug-pensive.png":"ae53a8b5de7c919100e6.png","eggbug-pleading.png":"11c5493261064ffa82c0.png","eggbug-relieved.png":"3633c116f0941d94d237.png","eggbug-shocked.png":"b25a9fdf230219087003.png","eggbug-smile-hearts.png":"d7ec7f057e6fb15a94cc.png","eggbug-sob.png":"9559ff8058a895328d76.png","eggbug-tuesday.png":"90058099e741e483208a.png","eggbug-uwu.png":"228d3a13bd5f7796b434.png","eggbug-wink.png":"3bc3a1c5272e2ceb8712.png","host-aww.png":"9bb403f3822c6457baf6.png","host-cry.png":"530f8cf75eac87716702.png","host-evil.png":"cb9a5640d7ef7b361a1a.png","host-frown.png":"99c7fbf98de865cc9726.png","host-joy.png":"53635f5fe850274b1a7d.png","host-love.png":"c45b6d8f9de20f725b98.png","host-nervous.png":"e5d55348f39c65a20148.png","host-plead.png":"fa883e2377fea8945237.png","host-shock.png":"bfa6d6316fd95ae76803.png","host-stare.png":"a09d966cd188c9ebaa4c.png"};
|
||||
const f = (n) => data[n];
|
||||
f.keys = () => Object.keys(data);
|
||||
return f;
|
||||
}
|
||||
throw new Error('not supported: require.context for ' + dir);
|
||||
};
|
||||
|
||||
window.define = (imports, exec) => {
|
||||
if (typeof imports === 'function') {
|
||||
exec = imports;
|
||||
imports = [];
|
||||
}
|
||||
const id = document.currentScript.dataset.id
|
||||
?? './' + document.currentScript.getAttribute('src').split('/').pop().replace(/\.js$/i, '');
|
||||
if (modules[id]) return;
|
||||
const exports = {};
|
||||
modules[id] = Promise.resolve().then(function() {
|
||||
const imported = [];
|
||||
for (const id of imports) {
|
||||
if (id === 'require') imported.push(Promise.resolve(require));
|
||||
else if (id === 'exports') imported.push(Promise.resolve(exports));
|
||||
else imported.push(load(id));
|
||||
}
|
||||
return Promise.all(imported);
|
||||
}).then(function(imported) {
|
||||
const result = exec.apply(window, imported);
|
||||
if (!('default' in exports)) exports.default = result;
|
||||
return exports;
|
||||
});
|
||||
};
|
||||
|
||||
window.process = { env: { NODE_ENV: 'production' } };
|
||||
}
|
||||
|
||||
define(['exports', './post-page'], (function (exports, postPage) { 'use strict';
|
||||
|
||||
const StyledInput = ({
|
||||
style = "light",
|
||||
showValidity = true,
|
||||
name,
|
||||
control,
|
||||
rules,
|
||||
trigger,
|
||||
...props
|
||||
}) => {
|
||||
const { field, fieldState } = postPage.useController({
|
||||
name,
|
||||
control,
|
||||
rules,
|
||||
});
|
||||
const { name: fieldName, onChange } = field;
|
||||
|
||||
// setup our own ref so we can track field value
|
||||
const [directRef, setDirectRef] = postPage.reactExports.useState();
|
||||
postPage.reactExports.useEffect(() => {
|
||||
field.ref(directRef);
|
||||
}, [directRef, field]);
|
||||
|
||||
const {
|
||||
inputStyleClasses,
|
||||
contentDivStyleClasses,
|
||||
validityIconStyleClasses,
|
||||
} = postPage.reactExports.useMemo(() => {
|
||||
switch (style) {
|
||||
case "light":
|
||||
return {
|
||||
inputStyleClasses: `border-gray-600 text-notBlack
|
||||
placeholder:text-gray-600
|
||||
focus:border-notBlack disabled:border-gray-300`,
|
||||
contentDivStyleClasses: `to-notWhite`,
|
||||
validityIconStyleClasses: `bg-notWhite`,
|
||||
};
|
||||
case "dynamic":
|
||||
return {
|
||||
inputStyleClasses: "co-styled-input",
|
||||
contentDivStyleClasses: "co-styled-input-content",
|
||||
validityIconStyleClasses: "co-styled-input-validity-icon",
|
||||
};
|
||||
case "dark":
|
||||
default:
|
||||
return {
|
||||
inputStyleClasses: `border-gray-400 text-notWhite
|
||||
placeholder:text-gray-400
|
||||
focus:border-notWhite read-only:bg-gray-700`,
|
||||
contentDivStyleClasses: `to-notBlack`,
|
||||
validityIconStyleClasses: `bg-notBlack`,
|
||||
};
|
||||
}
|
||||
}, [style]);
|
||||
|
||||
// manually validate when we don't get an input event
|
||||
// can happen on browser autofill
|
||||
postPage.reactExports.useEffect(() => {
|
||||
if (
|
||||
directRef &&
|
||||
directRef.value &&
|
||||
directRef.value !== props.defaultValue &&
|
||||
directRef.value !== field.value &&
|
||||
!fieldState.isTouched
|
||||
) {
|
||||
onChange(directRef.value);
|
||||
void trigger(fieldName, { shouldFocus: true });
|
||||
}
|
||||
}, [
|
||||
directRef,
|
||||
field.value,
|
||||
fieldName,
|
||||
fieldState.isTouched,
|
||||
onChange,
|
||||
props.defaultValue,
|
||||
trigger,
|
||||
]);
|
||||
return (
|
||||
postPage.React.createElement('div', { className: "relative",}
|
||||
, postPage.React.createElement('input', {
|
||||
className: postPage.classNames(
|
||||
`
|
||||
w-full min-w-[15rem] rounded-lg border-2 bg-transparent
|
||||
`,
|
||||
inputStyleClasses
|
||||
),
|
||||
...props,
|
||||
...field,
|
||||
ref: setDirectRef,}
|
||||
)
|
||||
, showValidity && !props.readOnly && fieldState.isTouched ? (
|
||||
postPage.React.createElement(postPage.React.Fragment, null
|
||||
, postPage.React.createElement('div', {
|
||||
className: postPage.classNames(
|
||||
`
|
||||
absolute bottom-0 right-9 top-0 my-auto h-6 w-3
|
||||
bg-gradient-to-r from-transparent
|
||||
`,
|
||||
contentDivStyleClasses
|
||||
),}
|
||||
)
|
||||
, fieldState.invalid ? (
|
||||
postPage.React.createElement(postPage.ForwardRef$5, {
|
||||
className: postPage.classNames(
|
||||
`
|
||||
absolute bottom-0 right-3 top-0 my-auto h-6
|
||||
w-6 text-red
|
||||
`,
|
||||
validityIconStyleClasses
|
||||
),}
|
||||
)
|
||||
) : (
|
||||
postPage.React.createElement(postPage.ForwardRef$6, {
|
||||
className: postPage.classNames(
|
||||
`
|
||||
absolute bottom-0 right-3 top-0 my-auto h-6
|
||||
w-6 bg-notWhite text-green
|
||||
`,
|
||||
validityIconStyleClasses
|
||||
),}
|
||||
)
|
||||
)
|
||||
)
|
||||
) : null
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
exports.StyledInput = StyledInput;
|
||||
|
||||
}));
|
Reference in New Issue
Block a user