@timardex/cluemart-shared 1.5.617 → 1.5.618

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.
@@ -64,6 +64,8 @@ __export(sharing_exports, {
64
64
  buildApplicationShareDescription: () => buildApplicationShareDescription,
65
65
  buildFacebookShareQuote: () => buildFacebookShareQuote,
66
66
  buildInvitationShareDescription: () => buildInvitationShareDescription,
67
+ buildPublicEventShareDescription: () => buildPublicEventShareDescription,
68
+ buildPublicVendorShareDescription: () => buildPublicVendorShareDescription,
67
69
  buildShareMessageSections: () => buildShareMessageSections,
68
70
  buildShareOgDescription: () => buildShareOgDescription,
69
71
  buildShareOgDescriptionFromSections: () => buildShareOgDescriptionFromSections,
@@ -156,7 +158,7 @@ var SHARE_DOLLAR_ICON = "$";
156
158
  var SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;
157
159
  var SHARE_CLOCK_ICON = "\u23F0";
158
160
  var SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;
159
- var SHARE_MORE_INFO_LINE = "More info in the ClueMart app";
161
+ var SHARE_MORE_INFO_LINE = "Shared from ClueMart";
160
162
  var DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;
161
163
  var RESOURCE_SHARE_TYPES = [
162
164
  "market",
@@ -204,13 +206,13 @@ function joinShareDescriptionSections(sections) {
204
206
  }
205
207
  function appendShareMoreInfoLine(description) {
206
208
  const trimmed = description.trim();
207
- if (trimmed.endsWith(SHARE_MORE_INFO_LINE)) {
209
+ if (trimmed.startsWith(SHARE_MORE_INFO_LINE)) {
208
210
  return trimmed;
209
211
  }
210
212
  if (trimmed.length === 0) {
211
213
  return SHARE_MORE_INFO_LINE;
212
214
  }
213
- return joinShareDescriptionSections([trimmed, SHARE_MORE_INFO_LINE]);
215
+ return joinShareDescriptionSections([SHARE_MORE_INFO_LINE, trimmed]);
214
216
  }
215
217
 
216
218
  // src/sharing/buildRelationShareDescription.ts
@@ -309,6 +311,21 @@ function buildApplicationShareDescription(vendor, vendorInfo) {
309
311
  return joinShareDescriptionSections(sections);
310
312
  }
311
313
 
314
+ // src/sharing/buildPublicShareDescription.ts
315
+ function buildPublicEventShareDescription(event) {
316
+ return joinShareDescriptionSections([
317
+ formatShareRainOrShineLine(event.rainOrShine),
318
+ formatShareTagsSection(event.tags),
319
+ event.description?.trim()
320
+ ]);
321
+ }
322
+ function buildPublicVendorShareDescription(vendor) {
323
+ return joinShareDescriptionSections([
324
+ formatShareIsFoodTrueLine(vendor.foodTruck),
325
+ vendor.description?.trim()
326
+ ]);
327
+ }
328
+
312
329
  // src/sharing/buildShareUrl.ts
313
330
  var PUBLIC_SHARE_PATH_TYPES = [
314
331
  ...RESOURCE_SHARE_TYPES,
@@ -319,8 +336,8 @@ var SHARE_TYPE_PATH_REGEX = [
319
336
  RELATION_SHARE_APPLICATION,
320
337
  RELATION_SHARE_INVITATION
321
338
  ].join("|");
322
- function buildShareUrl(type, id) {
323
- return `${SHARE_SITE_URL}/share/${type}/${encodeURIComponent(id)}`;
339
+ function buildShareUrl(type, id, utmMedium = "app") {
340
+ return `${SHARE_SITE_URL}/share/${type}/${encodeURIComponent(id)}?utm_source=share&utm_medium=${utmMedium}&utm_campaign=${type}`;
324
341
  }
325
342
 
326
343
  // src/sharing/normalizeShareDescription.ts
@@ -338,12 +355,12 @@ function normalizeShareText(value) {
338
355
  }).join("\n").replace(/\n{3,}/g, "\n\n");
339
356
  }
340
357
  function shareMessageFooterPlacementForType(_shareType) {
341
- return "after-body";
358
+ return "before-body";
342
359
  }
343
360
  function buildShareMessageSections(input) {
344
361
  const title = normalizeShareText(input.title);
345
362
  const description = normalizeShareText(input.description);
346
- return [title, description, SHARE_MORE_INFO_LINE].filter(
363
+ return [SHARE_MORE_INFO_LINE, title, description].filter(
347
364
  (section) => section.length > 0
348
365
  );
349
366
  }
@@ -424,6 +441,8 @@ function buildSharePagePath(resourceType, rawId) {
424
441
  buildApplicationShareDescription,
425
442
  buildFacebookShareQuote,
426
443
  buildInvitationShareDescription,
444
+ buildPublicEventShareDescription,
445
+ buildPublicVendorShareDescription,
427
446
  buildShareMessageSections,
428
447
  buildShareOgDescription,
429
448
  buildShareOgDescriptionFromSections,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sharing/index.ts","../../src/utils/date.ts","../../src/sharing/relationShareTypes.ts","../../src/sharing/constants.ts","../../src/sharing/formatCategoryLabel.ts","../../src/sharing/joinShareDescriptionSections.ts","../../src/sharing/buildRelationShareDescription.ts","../../src/sharing/buildShareUrl.ts","../../src/sharing/normalizeShareDescription.ts","../../src/sharing/normalizeShareRouteId.ts"],"sourcesContent":["export * from \"./buildRelationShareDescription\";\nexport * from \"./shareRelationTypes\";\nexport * from \"./buildShareUrl\";\nexport * from \"./constants\";\nexport * from \"./formatCategoryLabel\";\nexport * from \"./joinShareDescriptionSections\";\nexport * from \"./normalizeShareDescription\";\nexport * from \"./normalizeShareRouteId\";\nexport * from \"./relationShareTypes\";\n","import dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter.js\";\nimport timezone from \"dayjs/plugin/timezone.js\";\nimport utc from \"dayjs/plugin/utc.js\";\n\nexport const dateFormat = \"DD-MM-YYYY\";\nexport const timeFormat = \"HH:mm\";\n\n// Enable custom format parsing\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isSameOrAfter);\n\nconst NZ_TZ = \"Pacific/Auckland\";\n\nexport function toNZTime(date?: Date | string) {\n return date ? dayjs(date).tz(NZ_TZ) : dayjs().tz(NZ_TZ);\n}\n\n/** Start of the calendar day in Pacific/Auckland (daily games, streaks, etc.). */\nexport function nzStartOfDay(\n input?: Date | string | number | null,\n): dayjs.Dayjs {\n if (input == null) {\n return dayjs().tz(NZ_TZ).startOf(\"day\");\n }\n return dayjs.tz(input, NZ_TZ).startOf(\"day\");\n}\n\ntype DateFormat = \"date\" | \"time\" | \"datetime\";\n\n/**\n * Format a date string to a more readable format.\n * @param dateStr - the date string\n * @param timeStr - optional time string\n * @param display - 'date' | 'time' | 'datetime'\n * @returns formatted string based on display option\n */\nexport const formatDate = (\n dateStr: string,\n display: DateFormat = \"datetime\",\n timeStr?: string,\n) => {\n // Combine date and time into a single string if time is provided\n const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;\n\n // Parse with formats\n const dateTime = timeStr\n ? dayjs(dateTimeStr, `${dateFormat} ${timeFormat}`)\n : dayjs(dateStr, dateFormat);\n\n // Format parts\n const formattedDate = dateTime.format(\"dddd, D MMMM, YYYY\");\n const formattedTime = dateTime.format(\"h:mm a\");\n\n // Return based on display option\n switch (display) {\n case \"date\":\n return formattedDate;\n case \"time\":\n return formattedTime;\n case \"datetime\":\n return `${formattedDate} at ${formattedTime}`;\n default:\n return formattedDate;\n }\n};\n\nexport const getCurrentAndFutureDates = <\n T extends { startDate: string; startTime: string },\n>(\n dates: T[],\n): T[] => {\n const now = dayjs(); // current date and time\n\n return dates.filter((dateObj) => {\n const dateTime = dayjs(\n `${dateObj.startDate} ${dateObj.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n return dateTime.isSameOrAfter(now);\n });\n};\n\nexport const isFutureDatesBeforeThreshold = (\n date: {\n startDate: string;\n startTime: string;\n },\n minHoursFromNow: number,\n): boolean => {\n const threshold = minHoursFromNow\n ? dayjs().add(minHoursFromNow, \"hour\")\n : dayjs().startOf(\"day\");\n\n const dateTime = dayjs(\n `${date.startDate} ${date.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n\n return dateTime.isSameOrAfter(threshold);\n};\n\nexport const formatTimestamp = (timestamp: string) => {\n const formattedDate = toNZTime(timestamp).format(dateFormat);\n\n return formatDate(formattedDate, \"date\");\n};\n\nexport const isIsoDateString = (value: unknown): value is string => {\n return typeof value === \"string\" && !isNaN(Date.parse(value));\n};\n\n/**\n * Sort an array of date strings by their proximity to the current date.\n * @param dates - The array of date strings to sort.\n * @returns - The sorted array of date strings.\n */\nexport function sortDatesChronologically<\n T extends { startDate: string; startTime: string },\n>(dates: T[]): T[] {\n if (!dates || !dates.length) {\n return [];\n }\n\n return [...dates].sort((a, b) => {\n const dateTimeFormat = `${dateFormat} ${timeFormat}`;\n const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);\n const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);\n return dateA.valueOf() - dateB.valueOf(); // chronological order\n });\n}\n","/** Path segments for relation share URLs — must match mobile `RelationTitle` values. */\nexport const RELATION_SHARE_INVITATION = \"invitation\" as const;\nexport const RELATION_SHARE_APPLICATION = \"application\" as const;\n\nexport const RELATION_SHARE_RESOURCE_TYPES = [\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_APPLICATION,\n] as const;\n\nexport type RelationShareResourceType =\n (typeof RELATION_SHARE_RESOURCE_TYPES)[number];\n\nexport function isRelationShareResourceType(\n resourceType: string,\n): resourceType is RelationShareResourceType {\n return (RELATION_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_RESOURCE_TYPES,\n isRelationShareResourceType,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport const SHARE_SITE_URL = \"https://cluemart.co.nz\";\n\n/** Calendar marker for invitation market-dates share copy (U+1F4C5 📅). */\nexport const SHARE_CALENDAR_ICON = \"\\u{1F4C5}\";\n\nexport const SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;\n\n/** Check mark for invitation requirements share copy (U+2705 ✅). */\nexport const SHARE_CHECKMARK_ICON = \"\\u{2705}\";\n\nexport const SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;\n\n/** Information marker for tags share copy (U+2139 ℹ️). */\nexport const SHARE_INFO_ICON = \"\\u{2139}\\u{FE0F}\";\n\nexport const SHARE_TAGS_SECTION_HEADING = `${SHARE_INFO_ICON} Tags:`;\n\n/** Standalone line when `rainOrShine` is true (invitation share + OG section parsing). */\nexport const SHARE_RAIN_OR_SHINE_LINE = \"Rain or Shine\";\n\n/** Standalone line when `foodTruck` is true (application share + OG section parsing). */\nexport const SHARE_FOOD_TRUCK_LINE = \"Food Truck\";\n\n/** Prefix for application compliance line (share text + OG section parsing). */\nexport const SHARE_COMPLIANCE_PREFIX = `${SHARE_CHECKMARK_ICON} Compliance:`;\n\n/** Label tag for application categories share copy (U+1F3F7 🏷️). */\nexport const SHARE_CATEGORY_ICON = \"\\u{1F3F7}\\u{FE0F}\";\n\nexport const SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;\n\n/** Straight ruler for application stall-size share copy (U+1F4CF 📏). */\nexport const SHARE_RULER_ICON = \"\\u{1F4CF}\";\n\n/** Prefix for application stall-size line (share text + OG section parsing). */\nexport const SHARE_STALL_SIZE_PREFIX = `${SHARE_RULER_ICON} Stall size:`;\n\n/** Dollar marker for price-range share copy (U+0024 $ — text, not emoji, so it stays black). */\nexport const SHARE_DOLLAR_ICON = \"$\";\n\n/** Prefix for application price-range line (share text + OG section parsing). */\nexport const SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;\n\n/** Alarm clock for invitation application-deadline share copy (U+23F0 ⏰). */\nexport const SHARE_CLOCK_ICON = \"\\u{23F0}\";\n\n/** Prefix for the invitation application-deadline sentence (share text + OG section parsing). */\nexport const SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;\n\n/** Footer on share sheet messages, Facebook SDK quote, and `og:description`. */\nexport const SHARE_MORE_INFO_LINE = \"More info in the ClueMart app\";\n\nexport const DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;\n\nexport const RESOURCE_SHARE_TYPES = [\n \"market\",\n \"stallholder\",\n \"partner\",\n] as const;\n\nexport type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];\n\nexport const POST_SHARE_RESOURCE_TYPES = [\n \"daily_meets\",\n \"daily_tips\",\n \"daily_games\",\n] as const;\n\nexport type PostShareResourceType = (typeof POST_SHARE_RESOURCE_TYPES)[number];\n\nexport type ShareResourceType =\n | ResourceShareType\n | PostShareResourceType\n | RelationShareResourceType;\n\nexport const SHARE_RESOURCE_LABEL: Record<ShareResourceType, string> = {\n [RELATION_SHARE_APPLICATION]: \"Application\",\n [RELATION_SHARE_INVITATION]: \"Invitation\",\n daily_games: \"Daily Game\",\n daily_meets: \"Daily Meet\",\n daily_tips: \"Daily Tip\",\n market: \"Market\",\n partner: \"Partner\",\n stallholder: \"Stallholder\",\n};\n\nexport function isPostShareResourceType(\n resourceType: ShareResourceType,\n): resourceType is PostShareResourceType {\n return (POST_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import type { ShareVendorCategory } from \"./shareRelationTypes\";\n\nexport function formatCategoryLabel(category: ShareVendorCategory): string {\n const subcategoryNames = category.subcategories\n .map((subcategory) => subcategory.name)\n .filter(Boolean);\n\n if (subcategoryNames.length === 0) {\n return category.name;\n }\n\n return `${category.name} (${subcategoryNames.join(\", \")})`;\n}\n","import { SHARE_MORE_INFO_LINE } from \"./constants\";\n\n/** Blank line between share sections — title, address, dates, URL, etc. */\nexport const SHARE_DESCRIPTION_SECTION_BREAK = \"\\n\\n\";\n\n/**\n * Line break for `og:description` meta content. Use instead of `\\n` — Next.js\n * HTML serialisation collapses literal newlines to spaces; Facebook reads `&#10;`.\n */\nexport const OG_DESCRIPTION_LINE_BREAK = \"&#10;\";\n\n/** Joins OG description sections for Facebook link cards (and Twitter). */\nexport function joinShareOgDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .map((section) => (typeof section === \"string\" ? section.trim() : \"\"))\n .filter((section): section is string => section.length > 0)\n .map((section) => section.replace(/\\n/g, OG_DESCRIPTION_LINE_BREAK))\n .join(OG_DESCRIPTION_LINE_BREAK);\n}\n\nexport function joinShareDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .filter((section): section is string => Boolean(section))\n .join(SHARE_DESCRIPTION_SECTION_BREAK);\n}\n\n/** Appends the standard share footer when assembling sheet / SDK quote text. */\nexport function appendShareMoreInfoLine(description: string): string {\n const trimmed = description.trim();\n if (trimmed.endsWith(SHARE_MORE_INFO_LINE)) {\n return trimmed;\n }\n if (trimmed.length === 0) {\n return SHARE_MORE_INFO_LINE;\n }\n return joinShareDescriptionSections([trimmed, SHARE_MORE_INFO_LINE]);\n}\n","import { formatDate } from \"../utils/date\";\n\nimport {\n SHARE_APPLICATION_DEADLINE_PREFIX,\n SHARE_CATEGORIES_SECTION_HEADING,\n SHARE_FOOD_TRUCK_LINE,\n SHARE_MARKET_DATES_SECTION_HEADING,\n SHARE_RAIN_OR_SHINE_LINE,\n SHARE_REQUIREMENTS_SECTION_HEADING,\n SHARE_COMPLIANCE_PREFIX,\n SHARE_PRICE_RANGE_PREFIX,\n SHARE_STALL_SIZE_PREFIX,\n SHARE_TAGS_SECTION_HEADING,\n} from \"./constants\";\nimport { formatCategoryLabel } from \"./formatCategoryLabel\";\nimport { joinShareDescriptionSections } from \"./joinShareDescriptionSections\";\nimport type {\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareStallType,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\nexport type {\n ShareEventDateTime,\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareStallType,\n ShareVendorCategory,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\n/** Formats event `startDate` (`DD-MM-YYYY`) for share copy — same as share preview UI. */\nexport function formatShareMarketDate(dateStr: string): string {\n return formatDate(dateStr, \"date\");\n}\n\nexport function formatStallCapacityLabel(stallCapacity: number): string {\n return stallCapacity > 0 ? ` (${stallCapacity} spaces available)` : \" - Full\";\n}\n\nexport function formatShareStallLine(stall: ShareStallType): string {\n return ` - ${stall.label} — $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;\n}\n\n/** Nested market dates + per-date stall lines for invitation share copy. */\nexport function formatShareInvitationMarketDatesSection(\n dateTime: ShareEventInfoForInvitation[\"dateTime\"],\n): string {\n const dateBlocks = dateTime.map((date) => {\n const formattedDate = formatShareMarketDate(date.startDate);\n const stallLines = date.stallTypes.map(formatShareStallLine);\n return [`- ${formattedDate}`, ...stallLines].join(\"\\n\");\n });\n\n return `${SHARE_MARKET_DATES_SECTION_HEADING}\\n${dateBlocks.join(\"\\n\")}`;\n}\n\nexport function formatShareRainOrShineLine(\n rainOrShine: boolean,\n): string | null {\n return rainOrShine ? SHARE_RAIN_OR_SHINE_LINE : null;\n}\n\nexport function formatShareIsFoodTrueLine(foodTruck: boolean): string | null {\n return foodTruck ? SHARE_FOOD_TRUCK_LINE : null;\n}\n\n/** Bulleted requirements list for invitation share copy. */\nexport function formatShareInvitationRequirementsSection(\n requirementLabels: string[],\n): string {\n const bullets = requirementLabels.map((label) => `- ${label}`);\n return `${SHARE_REQUIREMENTS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\nexport function formatShareTagsSection(tags: string[]): string {\n const bullets = tags.map((tag) => `- ${tag}`);\n return `${SHARE_TAGS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Bulleted categories list for application share copy. */\nexport function formatShareApplicationCategoriesSection(\n categoryLabels: string[],\n): string {\n const bullets = categoryLabels.map((label) => `- ${label}`);\n return `${SHARE_CATEGORIES_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Stall dimensions line for application share copy. */\nexport function formatShareApplicationStallSizeLine(size: {\n width: string;\n depth: string;\n}): string {\n return `${SHARE_STALL_SIZE_PREFIX} ${size.width}m × ${size.depth}m`;\n}\n\n/** Bulleted compliance list for application share copy. */\nexport function formatShareApplicationComplianceSection(\n complianceLabels: string[],\n): string {\n const bullets = complianceLabels.map((label) => `- ${label}`);\n return `${SHARE_COMPLIANCE_PREFIX}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Price range line for application share copy. */\nexport function formatShareApplicationPriceRangeLine(priceRange: {\n min: string;\n max: string;\n}): string {\n return `${SHARE_PRICE_RANGE_PREFIX} $${priceRange.min} – $${priceRange.max}`;\n}\n\n/** Application-deadline sentence for invitation share copy. */\nexport function formatShareInvitationApplicationDeadlineLine(\n applicationDeadlineHours: number,\n): string {\n return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;\n}\n\nexport function buildInvitationShareDescription(\n event: ShareEventForInvitation,\n eventInfo: ShareEventInfoForInvitation | null | undefined,\n): string {\n const stallTypes =\n eventInfo?.dateTime?.flatMap((date) => date.stallTypes) ?? [];\n\n if (!eventInfo || stallTypes.length === 0) {\n return event.description?.trim() || \"\";\n }\n\n const requirementLabels = (eventInfo.requirements ?? [])\n .filter((item) => item.value)\n .map((item) => item.label);\n\n const sections = [\n event.location.fullAddress,\n formatShareRainOrShineLine(event.rainOrShine),\n formatShareTagsSection(event.tags),\n formatShareInvitationMarketDatesSection(eventInfo.dateTime),\n formatShareInvitationApplicationDeadlineLine(\n eventInfo.applicationDeadlineHours,\n ),\n requirementLabels.length > 0 &&\n formatShareInvitationRequirementsSection(requirementLabels),\n ];\n\n return joinShareDescriptionSections(sections);\n}\n\nexport function buildApplicationShareDescription(\n vendor: ShareVendorForApplication,\n vendorInfo: ShareVendorInfoForApplication | null | undefined,\n): string {\n const categoryLabels = vendor.categories.map((category) =>\n formatCategoryLabel(category),\n );\n\n if (!vendorInfo) {\n return vendor.description?.trim() || \"\";\n }\n\n const compliance = vendorInfo.compliance;\n const complianceLabels = [\n compliance?.liabilityInsurance && \"Liability insurance\",\n compliance?.foodBeverageLicense && \"Food & beverage licence\",\n ].filter((label): label is string => Boolean(label));\n\n const profileDescription = vendor.description?.trim();\n\n const sections = [\n formatShareIsFoodTrueLine(vendor.foodTruck),\n categoryLabels.length > 0 &&\n formatShareApplicationCategoriesSection(categoryLabels),\n formatShareApplicationStallSizeLine(vendorInfo.stallInfo.size),\n complianceLabels.length > 0 &&\n formatShareApplicationComplianceSection(complianceLabels),\n formatShareApplicationPriceRangeLine(vendorInfo.product.priceRange),\n profileDescription,\n ];\n\n return joinShareDescriptionSections(sections);\n}\n","import {\n POST_SHARE_RESOURCE_TYPES,\n RESOURCE_SHARE_TYPES,\n SHARE_SITE_URL,\n} from \"./constants\";\nimport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n} from \"./relationShareTypes\";\n\n/** Path segments for public resource share URLs (markets, posts, etc.). */\nexport const PUBLIC_SHARE_PATH_TYPES = [\n ...RESOURCE_SHARE_TYPES,\n ...POST_SHARE_RESOURCE_TYPES,\n] as const;\n\nexport type PublicSharePathType = (typeof PUBLIC_SHARE_PATH_TYPES)[number];\n\nexport type RelationSharePathType =\n | typeof RELATION_SHARE_INVITATION\n | typeof RELATION_SHARE_APPLICATION;\n\nexport type ShareType = PublicSharePathType | RelationSharePathType;\n\n/** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */\nexport const SHARE_TYPE_PATH_REGEX = [\n ...PUBLIC_SHARE_PATH_TYPES,\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n].join(\"|\");\n\nexport function buildShareUrl(type: ShareType, id: string): string {\n return `${SHARE_SITE_URL}/share/${type}/${encodeURIComponent(id)}`;\n}\n","import { SHARE_MORE_INFO_LINE, type ShareResourceType } from \"./constants\";\nimport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n} from \"./joinShareDescriptionSections\";\n\nexport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n};\n\n/** Trims share text and collapses spaces per line; preserves `\\n\\n` section breaks. */\nexport function normalizeShareText(value: string | null | undefined): string {\n if (value == null) {\n return \"\";\n }\n return value\n .trim()\n .split(\"\\n\")\n .map((line) => {\n const match = line.match(/^([ \\t]*)(.*)$/);\n if (!match) {\n return line;\n }\n const [, leading, rest] = match;\n return leading + rest.trim().replace(/[ \\t]{2,}/g, \" \");\n })\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\");\n}\n\n/** Share-sheet footer always follows title and body/caption. */\nexport type ShareMessageFooterPlacement = \"after-body\";\n\nexport function shareMessageFooterPlacementForType(\n _shareType?: ShareResourceType,\n): ShareMessageFooterPlacement {\n return \"after-body\";\n}\n\n/**\n * Ordered sections for share-sheet / Facebook SDK quote text:\n * title → description (full body or post caption) → {@link SHARE_MORE_INFO_LINE}.\n */\nexport function buildShareMessageSections(input: {\n title?: string | null;\n description?: string | null;\n shareType?: ShareResourceType;\n}): string[] {\n const title = normalizeShareText(input.title);\n const description = normalizeShareText(input.description);\n\n return [title, description, SHARE_MORE_INFO_LINE].filter(\n (section) => section.length > 0,\n );\n}\n\nexport function splitShareDescriptionSections(value: string): string[] {\n const trimmed = normalizeShareText(value);\n if (!trimmed) {\n return [];\n }\n\n if (/\\n\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n if (/\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n return [trimmed];\n}\n\n/**\n * Formats share descriptions for Open Graph / Twitter meta tags.\n * Sections are joined with {@link OG_DESCRIPTION_LINE_BREAK} (`&#10;`).\n */\nexport function normalizeShareOgDescription(value: string): string {\n return joinShareOgDescriptionSections(splitShareDescriptionSections(value));\n}\n\n/**\n * Quote text for Facebook ShareDialog on iOS (`ShareLinkContent.quote`).\n *\n * Title + blank lines + body sections. URL is omitted — `contentUrl` supplies\n * the link card (OG on `/share/*` controls card title/image).\n */\nexport function buildFacebookShareQuote(\n title: string,\n description: string,\n shareType?: ShareResourceType,\n): string | undefined {\n const sections = buildShareMessageSections({ title, description, shareType });\n const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();\n return quote.length > 0 ? quote : undefined;\n}\n\n/**\n * Open Graph / Twitter description from pre-built section strings.\n * Prefer {@link joinShareOgDescriptionSections} when sections are already known.\n */\nexport function buildShareOgDescriptionFromSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return joinShareOgDescriptionSections(sections);\n}\n\n/** Open Graph / Twitter description — body sections only (`og:title` is separate). */\nexport function buildShareOgDescription(\n _title: string,\n description: string,\n): string {\n return joinShareOgDescriptionSections(\n splitShareDescriptionSections(description),\n );\n}\n","import type { ShareResourceType } from \"./constants\";\n\nexport function normalizeShareRouteId(id: string): string {\n try {\n return decodeURIComponent(id);\n } catch {\n return id;\n }\n}\n\nexport function buildSharePagePath(\n resourceType: ShareResourceType,\n rawId: string,\n): string {\n return `/share/${resourceType}/${encodeURIComponent(normalizeShareRouteId(rawId))}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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O,mBAAmB,EAAE;AAAA,EAC9B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,mBACd,cACA,OACQ;AACR,SAAO,UAAU,YAAY,IAAI,mBAAmB,sBAAsB,KAAK,CAAC,CAAC;AACnF;","names":["dayjs","customParseFormat","utc","timezone","isSameOrAfter","dayjs"]}
1
+ {"version":3,"sources":["../../src/sharing/index.ts","../../src/utils/date.ts","../../src/sharing/relationShareTypes.ts","../../src/sharing/constants.ts","../../src/sharing/formatCategoryLabel.ts","../../src/sharing/joinShareDescriptionSections.ts","../../src/sharing/buildRelationShareDescription.ts","../../src/sharing/buildPublicShareDescription.ts","../../src/sharing/buildShareUrl.ts","../../src/sharing/normalizeShareDescription.ts","../../src/sharing/normalizeShareRouteId.ts"],"sourcesContent":["export * from \"./buildPublicShareDescription\";\nexport * from \"./buildRelationShareDescription\";\nexport * from \"./shareRelationTypes\";\nexport * from \"./buildShareUrl\";\nexport * from \"./constants\";\nexport * from \"./formatCategoryLabel\";\nexport * from \"./joinShareDescriptionSections\";\nexport * from \"./normalizeShareDescription\";\nexport * from \"./normalizeShareRouteId\";\nexport * from \"./relationShareTypes\";\n","import dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter.js\";\nimport timezone from \"dayjs/plugin/timezone.js\";\nimport utc from \"dayjs/plugin/utc.js\";\n\nexport const dateFormat = \"DD-MM-YYYY\";\nexport const timeFormat = \"HH:mm\";\n\n// Enable custom format parsing\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isSameOrAfter);\n\nconst NZ_TZ = \"Pacific/Auckland\";\n\nexport function toNZTime(date?: Date | string) {\n return date ? dayjs(date).tz(NZ_TZ) : dayjs().tz(NZ_TZ);\n}\n\n/** Start of the calendar day in Pacific/Auckland (daily games, streaks, etc.). */\nexport function nzStartOfDay(\n input?: Date | string | number | null,\n): dayjs.Dayjs {\n if (input == null) {\n return dayjs().tz(NZ_TZ).startOf(\"day\");\n }\n return dayjs.tz(input, NZ_TZ).startOf(\"day\");\n}\n\ntype DateFormat = \"date\" | \"time\" | \"datetime\";\n\n/**\n * Format a date string to a more readable format.\n * @param dateStr - the date string\n * @param timeStr - optional time string\n * @param display - 'date' | 'time' | 'datetime'\n * @returns formatted string based on display option\n */\nexport const formatDate = (\n dateStr: string,\n display: DateFormat = \"datetime\",\n timeStr?: string,\n) => {\n // Combine date and time into a single string if time is provided\n const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;\n\n // Parse with formats\n const dateTime = timeStr\n ? dayjs(dateTimeStr, `${dateFormat} ${timeFormat}`)\n : dayjs(dateStr, dateFormat);\n\n // Format parts\n const formattedDate = dateTime.format(\"dddd, D MMMM, YYYY\");\n const formattedTime = dateTime.format(\"h:mm a\");\n\n // Return based on display option\n switch (display) {\n case \"date\":\n return formattedDate;\n case \"time\":\n return formattedTime;\n case \"datetime\":\n return `${formattedDate} at ${formattedTime}`;\n default:\n return formattedDate;\n }\n};\n\nexport const getCurrentAndFutureDates = <\n T extends { startDate: string; startTime: string },\n>(\n dates: T[],\n): T[] => {\n const now = dayjs(); // current date and time\n\n return dates.filter((dateObj) => {\n const dateTime = dayjs(\n `${dateObj.startDate} ${dateObj.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n return dateTime.isSameOrAfter(now);\n });\n};\n\nexport const isFutureDatesBeforeThreshold = (\n date: {\n startDate: string;\n startTime: string;\n },\n minHoursFromNow: number,\n): boolean => {\n const threshold = minHoursFromNow\n ? dayjs().add(minHoursFromNow, \"hour\")\n : dayjs().startOf(\"day\");\n\n const dateTime = dayjs(\n `${date.startDate} ${date.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n\n return dateTime.isSameOrAfter(threshold);\n};\n\nexport const formatTimestamp = (timestamp: string) => {\n const formattedDate = toNZTime(timestamp).format(dateFormat);\n\n return formatDate(formattedDate, \"date\");\n};\n\nexport const isIsoDateString = (value: unknown): value is string => {\n return typeof value === \"string\" && !isNaN(Date.parse(value));\n};\n\n/**\n * Sort an array of date strings by their proximity to the current date.\n * @param dates - The array of date strings to sort.\n * @returns - The sorted array of date strings.\n */\nexport function sortDatesChronologically<\n T extends { startDate: string; startTime: string },\n>(dates: T[]): T[] {\n if (!dates || !dates.length) {\n return [];\n }\n\n return [...dates].sort((a, b) => {\n const dateTimeFormat = `${dateFormat} ${timeFormat}`;\n const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);\n const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);\n return dateA.valueOf() - dateB.valueOf(); // chronological order\n });\n}\n","/** Path segments for relation share URLs — must match mobile `RelationTitle` values. */\nexport const RELATION_SHARE_INVITATION = \"invitation\" as const;\nexport const RELATION_SHARE_APPLICATION = \"application\" as const;\n\nexport const RELATION_SHARE_RESOURCE_TYPES = [\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_APPLICATION,\n] as const;\n\nexport type RelationShareResourceType =\n (typeof RELATION_SHARE_RESOURCE_TYPES)[number];\n\nexport function isRelationShareResourceType(\n resourceType: string,\n): resourceType is RelationShareResourceType {\n return (RELATION_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_RESOURCE_TYPES,\n isRelationShareResourceType,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport const SHARE_SITE_URL = \"https://cluemart.co.nz\";\n\n/** Calendar marker for invitation market-dates share copy (U+1F4C5 📅). */\nexport const SHARE_CALENDAR_ICON = \"\\u{1F4C5}\";\n\nexport const SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;\n\n/** Check mark for invitation requirements share copy (U+2705 ✅). */\nexport const SHARE_CHECKMARK_ICON = \"\\u{2705}\";\n\nexport const SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;\n\n/** Information marker for tags share copy (U+2139 ℹ️). */\nexport const SHARE_INFO_ICON = \"\\u{2139}\\u{FE0F}\";\n\nexport const SHARE_TAGS_SECTION_HEADING = `${SHARE_INFO_ICON} Tags:`;\n\n/** Standalone line when `rainOrShine` is true (invitation share + OG section parsing). */\nexport const SHARE_RAIN_OR_SHINE_LINE = \"Rain or Shine\";\n\n/** Standalone line when `foodTruck` is true (application share + OG section parsing). */\nexport const SHARE_FOOD_TRUCK_LINE = \"Food Truck\";\n\n/** Prefix for application compliance line (share text + OG section parsing). */\nexport const SHARE_COMPLIANCE_PREFIX = `${SHARE_CHECKMARK_ICON} Compliance:`;\n\n/** Label tag for application categories share copy (U+1F3F7 🏷️). */\nexport const SHARE_CATEGORY_ICON = \"\\u{1F3F7}\\u{FE0F}\";\n\nexport const SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;\n\n/** Straight ruler for application stall-size share copy (U+1F4CF 📏). */\nexport const SHARE_RULER_ICON = \"\\u{1F4CF}\";\n\n/** Prefix for application stall-size line (share text + OG section parsing). */\nexport const SHARE_STALL_SIZE_PREFIX = `${SHARE_RULER_ICON} Stall size:`;\n\n/** Dollar marker for price-range share copy (U+0024 $ — text, not emoji, so it stays black). */\nexport const SHARE_DOLLAR_ICON = \"$\";\n\n/** Prefix for application price-range line (share text + OG section parsing). */\nexport const SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;\n\n/** Alarm clock for invitation application-deadline share copy (U+23F0 ⏰). */\nexport const SHARE_CLOCK_ICON = \"\\u{23F0}\";\n\n/** Prefix for the invitation application-deadline sentence (share text + OG section parsing). */\nexport const SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;\n\n/** First line on share sheet messages, Facebook SDK quote, and `og:description`. */\nexport const SHARE_MORE_INFO_LINE = \"Shared from ClueMart\";\n\nexport const DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;\n\nexport const RESOURCE_SHARE_TYPES = [\n \"market\",\n \"stallholder\",\n \"partner\",\n] as const;\n\nexport type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];\n\nexport const POST_SHARE_RESOURCE_TYPES = [\n \"daily_meets\",\n \"daily_tips\",\n \"daily_games\",\n] as const;\n\nexport type PostShareResourceType = (typeof POST_SHARE_RESOURCE_TYPES)[number];\n\nexport type ShareResourceType =\n | ResourceShareType\n | PostShareResourceType\n | RelationShareResourceType;\n\nexport const SHARE_RESOURCE_LABEL: Record<ShareResourceType, string> = {\n [RELATION_SHARE_APPLICATION]: \"Application\",\n [RELATION_SHARE_INVITATION]: \"Invitation\",\n daily_games: \"Daily Game\",\n daily_meets: \"Daily Meet\",\n daily_tips: \"Daily Tip\",\n market: \"Market\",\n partner: \"Partner\",\n stallholder: \"Stallholder\",\n};\n\nexport function isPostShareResourceType(\n resourceType: ShareResourceType,\n): resourceType is PostShareResourceType {\n return (POST_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import type { ShareVendorCategory } from \"./shareRelationTypes\";\n\nexport function formatCategoryLabel(category: ShareVendorCategory): string {\n const subcategoryNames = category.subcategories\n .map((subcategory) => subcategory.name)\n .filter(Boolean);\n\n if (subcategoryNames.length === 0) {\n return category.name;\n }\n\n return `${category.name} (${subcategoryNames.join(\", \")})`;\n}\n","import { SHARE_MORE_INFO_LINE } from \"./constants\";\n\n/** Blank line between share sections — title, address, dates, URL, etc. */\nexport const SHARE_DESCRIPTION_SECTION_BREAK = \"\\n\\n\";\n\n/**\n * Line break for `og:description` meta content. Use instead of `\\n` — Next.js\n * HTML serialisation collapses literal newlines to spaces; Facebook reads `&#10;`.\n */\nexport const OG_DESCRIPTION_LINE_BREAK = \"&#10;\";\n\n/** Joins OG description sections for Facebook link cards (and Twitter). */\nexport function joinShareOgDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .map((section) => (typeof section === \"string\" ? section.trim() : \"\"))\n .filter((section): section is string => section.length > 0)\n .map((section) => section.replace(/\\n/g, OG_DESCRIPTION_LINE_BREAK))\n .join(OG_DESCRIPTION_LINE_BREAK);\n}\n\nexport function joinShareDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .filter((section): section is string => Boolean(section))\n .join(SHARE_DESCRIPTION_SECTION_BREAK);\n}\n\n/** Prepends the standard share branding line when assembling display text. */\nexport function appendShareMoreInfoLine(description: string): string {\n const trimmed = description.trim();\n if (trimmed.startsWith(SHARE_MORE_INFO_LINE)) {\n return trimmed;\n }\n if (trimmed.length === 0) {\n return SHARE_MORE_INFO_LINE;\n }\n return joinShareDescriptionSections([SHARE_MORE_INFO_LINE, trimmed]);\n}\n","import { formatDate } from \"../utils/date\";\n\nimport {\n SHARE_APPLICATION_DEADLINE_PREFIX,\n SHARE_CATEGORIES_SECTION_HEADING,\n SHARE_FOOD_TRUCK_LINE,\n SHARE_MARKET_DATES_SECTION_HEADING,\n SHARE_RAIN_OR_SHINE_LINE,\n SHARE_REQUIREMENTS_SECTION_HEADING,\n SHARE_COMPLIANCE_PREFIX,\n SHARE_PRICE_RANGE_PREFIX,\n SHARE_STALL_SIZE_PREFIX,\n SHARE_TAGS_SECTION_HEADING,\n} from \"./constants\";\nimport { formatCategoryLabel } from \"./formatCategoryLabel\";\nimport { joinShareDescriptionSections } from \"./joinShareDescriptionSections\";\nimport type {\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareStallType,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\nexport type {\n ShareEventDateTime,\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareStallType,\n ShareVendorCategory,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\n/** Formats event `startDate` (`DD-MM-YYYY`) for share copy — same as share preview UI. */\nexport function formatShareMarketDate(dateStr: string): string {\n return formatDate(dateStr, \"date\");\n}\n\nexport function formatStallCapacityLabel(stallCapacity: number): string {\n return stallCapacity > 0 ? ` (${stallCapacity} spaces available)` : \" - Full\";\n}\n\nexport function formatShareStallLine(stall: ShareStallType): string {\n return ` - ${stall.label} — $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;\n}\n\n/** Nested market dates + per-date stall lines for invitation share copy. */\nexport function formatShareInvitationMarketDatesSection(\n dateTime: ShareEventInfoForInvitation[\"dateTime\"],\n): string {\n const dateBlocks = dateTime.map((date) => {\n const formattedDate = formatShareMarketDate(date.startDate);\n const stallLines = date.stallTypes.map(formatShareStallLine);\n return [`- ${formattedDate}`, ...stallLines].join(\"\\n\");\n });\n\n return `${SHARE_MARKET_DATES_SECTION_HEADING}\\n${dateBlocks.join(\"\\n\")}`;\n}\n\nexport function formatShareRainOrShineLine(\n rainOrShine: boolean,\n): string | null {\n return rainOrShine ? SHARE_RAIN_OR_SHINE_LINE : null;\n}\n\nexport function formatShareIsFoodTrueLine(foodTruck: boolean): string | null {\n return foodTruck ? SHARE_FOOD_TRUCK_LINE : null;\n}\n\n/** Bulleted requirements list for invitation share copy. */\nexport function formatShareInvitationRequirementsSection(\n requirementLabels: string[],\n): string {\n const bullets = requirementLabels.map((label) => `- ${label}`);\n return `${SHARE_REQUIREMENTS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\nexport function formatShareTagsSection(tags: string[]): string {\n const bullets = tags.map((tag) => `- ${tag}`);\n return `${SHARE_TAGS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Bulleted categories list for application share copy. */\nexport function formatShareApplicationCategoriesSection(\n categoryLabels: string[],\n): string {\n const bullets = categoryLabels.map((label) => `- ${label}`);\n return `${SHARE_CATEGORIES_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Stall dimensions line for application share copy. */\nexport function formatShareApplicationStallSizeLine(size: {\n width: string;\n depth: string;\n}): string {\n return `${SHARE_STALL_SIZE_PREFIX} ${size.width}m × ${size.depth}m`;\n}\n\n/** Bulleted compliance list for application share copy. */\nexport function formatShareApplicationComplianceSection(\n complianceLabels: string[],\n): string {\n const bullets = complianceLabels.map((label) => `- ${label}`);\n return `${SHARE_COMPLIANCE_PREFIX}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Price range line for application share copy. */\nexport function formatShareApplicationPriceRangeLine(priceRange: {\n min: string;\n max: string;\n}): string {\n return `${SHARE_PRICE_RANGE_PREFIX} $${priceRange.min} – $${priceRange.max}`;\n}\n\n/** Application-deadline sentence for invitation share copy. */\nexport function formatShareInvitationApplicationDeadlineLine(\n applicationDeadlineHours: number,\n): string {\n return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;\n}\n\nexport function buildInvitationShareDescription(\n event: ShareEventForInvitation,\n eventInfo: ShareEventInfoForInvitation | null | undefined,\n): string {\n const stallTypes =\n eventInfo?.dateTime?.flatMap((date) => date.stallTypes) ?? [];\n\n if (!eventInfo || stallTypes.length === 0) {\n return event.description?.trim() || \"\";\n }\n\n const requirementLabels = (eventInfo.requirements ?? [])\n .filter((item) => item.value)\n .map((item) => item.label);\n\n const sections = [\n event.location.fullAddress,\n formatShareRainOrShineLine(event.rainOrShine),\n formatShareTagsSection(event.tags),\n formatShareInvitationMarketDatesSection(eventInfo.dateTime),\n formatShareInvitationApplicationDeadlineLine(\n eventInfo.applicationDeadlineHours,\n ),\n requirementLabels.length > 0 &&\n formatShareInvitationRequirementsSection(requirementLabels),\n ];\n\n return joinShareDescriptionSections(sections);\n}\n\nexport function buildApplicationShareDescription(\n vendor: ShareVendorForApplication,\n vendorInfo: ShareVendorInfoForApplication | null | undefined,\n): string {\n const categoryLabels = vendor.categories.map((category) =>\n formatCategoryLabel(category),\n );\n\n if (!vendorInfo) {\n return vendor.description?.trim() || \"\";\n }\n\n const compliance = vendorInfo.compliance;\n const complianceLabels = [\n compliance?.liabilityInsurance && \"Liability insurance\",\n compliance?.foodBeverageLicense && \"Food & beverage licence\",\n ].filter((label): label is string => Boolean(label));\n\n const profileDescription = vendor.description?.trim();\n\n const sections = [\n formatShareIsFoodTrueLine(vendor.foodTruck),\n categoryLabels.length > 0 &&\n formatShareApplicationCategoriesSection(categoryLabels),\n formatShareApplicationStallSizeLine(vendorInfo.stallInfo.size),\n complianceLabels.length > 0 &&\n formatShareApplicationComplianceSection(complianceLabels),\n formatShareApplicationPriceRangeLine(vendorInfo.product.priceRange),\n profileDescription,\n ];\n\n return joinShareDescriptionSections(sections);\n}\n","import {\n formatShareIsFoodTrueLine,\n formatShareRainOrShineLine,\n formatShareTagsSection,\n} from \"./buildRelationShareDescription\";\nimport { joinShareDescriptionSections } from \"./joinShareDescriptionSections\";\n\n/** Minimal event fields for public (market) share copy — matches in-app preview. */\nexport type ShareEventForPublic = {\n description?: string | null;\n rainOrShine: boolean;\n tags: string[];\n};\n\n/** Minimal vendor fields for public (stallholder) share copy — matches in-app preview. */\nexport type ShareVendorForPublic = {\n description?: string | null;\n foodTruck: boolean;\n};\n\nexport function buildPublicEventShareDescription(\n event: ShareEventForPublic,\n): string {\n return joinShareDescriptionSections([\n formatShareRainOrShineLine(event.rainOrShine),\n formatShareTagsSection(event.tags),\n event.description?.trim(),\n ]);\n}\n\nexport function buildPublicVendorShareDescription(\n vendor: ShareVendorForPublic,\n): string {\n return joinShareDescriptionSections([\n formatShareIsFoodTrueLine(vendor.foodTruck),\n vendor.description?.trim(),\n ]);\n}\n","import {\n POST_SHARE_RESOURCE_TYPES,\n RESOURCE_SHARE_TYPES,\n SHARE_SITE_URL,\n} from \"./constants\";\nimport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n} from \"./relationShareTypes\";\n\n/** Path segments for public resource share URLs (markets, posts, etc.). */\nexport const PUBLIC_SHARE_PATH_TYPES = [\n ...RESOURCE_SHARE_TYPES,\n ...POST_SHARE_RESOURCE_TYPES,\n] as const;\n\nexport type PublicSharePathType = (typeof PUBLIC_SHARE_PATH_TYPES)[number];\n\nexport type RelationSharePathType =\n | typeof RELATION_SHARE_INVITATION\n | typeof RELATION_SHARE_APPLICATION;\n\nexport type ShareType = PublicSharePathType | RelationSharePathType;\n\n/** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */\nexport const SHARE_TYPE_PATH_REGEX = [\n ...PUBLIC_SHARE_PATH_TYPES,\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n].join(\"|\");\n\nexport function buildShareUrl(\n type: ShareType,\n id: string,\n utmMedium: string = \"app\",\n): string {\n return `${SHARE_SITE_URL}/share/${type}/${encodeURIComponent(id)}?utm_source=share&utm_medium=${utmMedium}&utm_campaign=${type}`;\n}\n","import { SHARE_MORE_INFO_LINE, type ShareResourceType } from \"./constants\";\nimport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n} from \"./joinShareDescriptionSections\";\n\nexport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n};\n\n/** Trims share text and collapses spaces per line; preserves `\\n\\n` section breaks. */\nexport function normalizeShareText(value: string | null | undefined): string {\n if (value == null) {\n return \"\";\n }\n return value\n .trim()\n .split(\"\\n\")\n .map((line) => {\n const match = line.match(/^([ \\t]*)(.*)$/);\n if (!match) {\n return line;\n }\n const [, leading, rest] = match;\n return leading + rest.trim().replace(/[ \\t]{2,}/g, \" \");\n })\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\");\n}\n\n/** Branding line placement — first so Facebook truncation does not drop it. */\nexport type ShareMessageFooterPlacement = \"before-body\";\n\nexport function shareMessageFooterPlacementForType(\n _shareType?: ShareResourceType,\n): ShareMessageFooterPlacement {\n return \"before-body\";\n}\n\n/**\n * Ordered sections for share-sheet / Facebook SDK quote text:\n * {@link SHARE_MORE_INFO_LINE} → title → description (full body or post caption).\n */\nexport function buildShareMessageSections(input: {\n title?: string | null;\n description?: string | null;\n shareType?: ShareResourceType;\n}): string[] {\n const title = normalizeShareText(input.title);\n const description = normalizeShareText(input.description);\n\n return [SHARE_MORE_INFO_LINE, title, description].filter(\n (section) => section.length > 0,\n );\n}\n\nexport function splitShareDescriptionSections(value: string): string[] {\n const trimmed = normalizeShareText(value);\n if (!trimmed) {\n return [];\n }\n\n if (/\\n\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n if (/\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n return [trimmed];\n}\n\n/**\n * Formats share descriptions for Open Graph / Twitter meta tags.\n * Sections are joined with {@link OG_DESCRIPTION_LINE_BREAK} (`&#10;`).\n */\nexport function normalizeShareOgDescription(value: string): string {\n return joinShareOgDescriptionSections(splitShareDescriptionSections(value));\n}\n\n/**\n * Quote text for Facebook ShareDialog on iOS (`ShareLinkContent.quote`).\n *\n * Title + blank lines + body sections. URL is omitted — `contentUrl` supplies\n * the link card (OG on `/share/*` controls card title/image).\n */\nexport function buildFacebookShareQuote(\n title: string,\n description: string,\n shareType?: ShareResourceType,\n): string | undefined {\n const sections = buildShareMessageSections({ title, description, shareType });\n const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();\n return quote.length > 0 ? quote : undefined;\n}\n\n/**\n * Open Graph / Twitter description from pre-built section strings.\n * Prefer {@link joinShareOgDescriptionSections} when sections are already known.\n */\nexport function buildShareOgDescriptionFromSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return joinShareOgDescriptionSections(sections);\n}\n\n/** Open Graph / Twitter description — body sections only (`og:title` is separate). */\nexport function buildShareOgDescription(\n _title: string,\n description: string,\n): string {\n return joinShareOgDescriptionSections(\n splitShareDescriptionSections(description),\n );\n}\n","import type { ShareResourceType } from \"./constants\";\n\nexport function normalizeShareRouteId(id: string): string {\n try {\n return decodeURIComponent(id);\n } catch {\n return id;\n }\n}\n\nexport function buildSharePagePath(\n resourceType: ShareResourceType,\n rawId: string,\n): string {\n return `/share/${resourceType}/${encodeURIComponent(normalizeShareRouteId(rawId))}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAClB,+BAA8B;AAC9B,2BAA0B;AAC1B,sBAAqB;AACrB,iBAAgB;AAET,IAAM,aAAa;AACnB,IAAM,aAAa;AAG1B,aAAAA,QAAM,OAAO,yBAAAC,OAAiB;AAC9B,aAAAD,QAAM,OAAO,WAAAE,OAAG;AAChB,aAAAF,QAAM,OAAO,gBAAAG,OAAQ;AACrB,aAAAH,QAAM,OAAO,qBAAAI,OAAa;AA2BnB,IAAM,aAAa,CACxB,SACA,UAAsB,YACtB,YACG;AAEH,QAAM,cAAc,UAAU,GAAG,OAAO,IAAI,OAAO,KAAK;AAGxD,QAAM,WAAW,cACb,aAAAC,SAAM,aAAa,GAAG,UAAU,IAAI,UAAU,EAAE,QAChD,aAAAA,SAAM,SAAS,UAAU;AAG7B,QAAM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ameOrAfter","dayjs"]}
@@ -1,3 +1,17 @@
1
+ /** Minimal event fields for public (market) share copy — matches in-app preview. */
2
+ type ShareEventForPublic = {
3
+ description?: string | null;
4
+ rainOrShine: boolean;
5
+ tags: string[];
6
+ };
7
+ /** Minimal vendor fields for public (stallholder) share copy — matches in-app preview. */
8
+ type ShareVendorForPublic = {
9
+ description?: string | null;
10
+ foodTruck: boolean;
11
+ };
12
+ declare function buildPublicEventShareDescription(event: ShareEventForPublic): string;
13
+ declare function buildPublicVendorShareDescription(vendor: ShareVendorForPublic): string;
14
+
1
15
  type ShareEventDateTime = {
2
16
  startDate: string;
3
17
  endDate?: string | null;
@@ -105,7 +119,7 @@ type RelationSharePathType = typeof RELATION_SHARE_INVITATION | typeof RELATION_
105
119
  type ShareType = PublicSharePathType | RelationSharePathType;
106
120
  /** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */
107
121
  declare const SHARE_TYPE_PATH_REGEX: string;
108
- declare function buildShareUrl(type: ShareType, id: string): string;
122
+ declare function buildShareUrl(type: ShareType, id: string, utmMedium?: string): string;
109
123
 
110
124
  declare const SHARE_SITE_URL = "https://cluemart.co.nz";
111
125
  /** Calendar marker for invitation market-dates share copy (U+1F4C5 📅). */
@@ -138,8 +152,8 @@ declare const SHARE_PRICE_RANGE_PREFIX = "$ Price range:";
138
152
  declare const SHARE_CLOCK_ICON = "\u23F0";
139
153
  /** Prefix for the invitation application-deadline sentence (share text + OG section parsing). */
140
154
  declare const SHARE_APPLICATION_DEADLINE_PREFIX = "\u23F0 Application deadline:";
141
- /** Footer on share sheet messages, Facebook SDK quote, and `og:description`. */
142
- declare const SHARE_MORE_INFO_LINE = "More info in the ClueMart app";
155
+ /** First line on share sheet messages, Facebook SDK quote, and `og:description`. */
156
+ declare const SHARE_MORE_INFO_LINE = "Shared from ClueMart";
143
157
  declare const DEFAULT_SHARE_OG_IMAGE = "https://cluemart.co.nz/assets/logo.webp";
144
158
  declare const RESOURCE_SHARE_TYPES: readonly ["market", "stallholder", "partner"];
145
159
  type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];
@@ -161,17 +175,17 @@ declare const OG_DESCRIPTION_LINE_BREAK = "&#10;";
161
175
  /** Joins OG description sections for Facebook link cards (and Twitter). */
162
176
  declare function joinShareOgDescriptionSections(sections: ReadonlyArray<string | false | null | undefined>): string;
163
177
  declare function joinShareDescriptionSections(sections: ReadonlyArray<string | false | null | undefined>): string;
164
- /** Appends the standard share footer when assembling sheet / SDK quote text. */
178
+ /** Prepends the standard share branding line when assembling display text. */
165
179
  declare function appendShareMoreInfoLine(description: string): string;
166
180
 
167
181
  /** Trims share text and collapses spaces per line; preserves `\n\n` section breaks. */
168
182
  declare function normalizeShareText(value: string | null | undefined): string;
169
- /** Share-sheet footer always follows title and body/caption. */
170
- type ShareMessageFooterPlacement = "after-body";
183
+ /** Branding line placement first so Facebook truncation does not drop it. */
184
+ type ShareMessageFooterPlacement = "before-body";
171
185
  declare function shareMessageFooterPlacementForType(_shareType?: ShareResourceType): ShareMessageFooterPlacement;
172
186
  /**
173
187
  * Ordered sections for share-sheet / Facebook SDK quote text:
174
- * title → description (full body or post caption) → {@link SHARE_MORE_INFO_LINE}.
188
+ * {@link SHARE_MORE_INFO_LINE} → title → description (full body or post caption).
175
189
  */
176
190
  declare function buildShareMessageSections(input: {
177
191
  title?: string | null;
@@ -202,4 +216,4 @@ declare function buildShareOgDescription(_title: string, description: string): s
202
216
  declare function normalizeShareRouteId(id: string): string;
203
217
  declare function buildSharePagePath(resourceType: ShareResourceType, rawId: string): string;
204
218
 
205
- export { DEFAULT_SHARE_OG_IMAGE, OG_DESCRIPTION_LINE_BREAK, POST_SHARE_RESOURCE_TYPES, PUBLIC_SHARE_PATH_TYPES, type PostShareResourceType, type PublicSharePathType, RELATION_SHARE_APPLICATION, RELATION_SHARE_INVITATION, RELATION_SHARE_RESOURCE_TYPES, RESOURCE_SHARE_TYPES, type RelationSharePathType, type RelationShareResourceType, type ResourceShareType, SHARE_APPLICATION_DEADLINE_PREFIX, SHARE_CALENDAR_ICON, SHARE_CATEGORIES_SECTION_HEADING, SHARE_CATEGORY_ICON, SHARE_CHECKMARK_ICON, SHARE_CLOCK_ICON, SHARE_COMPLIANCE_PREFIX, SHARE_DESCRIPTION_SECTION_BREAK, SHARE_DOLLAR_ICON, SHARE_FOOD_TRUCK_LINE, SHARE_INFO_ICON, SHARE_MARKET_DATES_SECTION_HEADING, SHARE_MORE_INFO_LINE, SHARE_PRICE_RANGE_PREFIX, SHARE_RAIN_OR_SHINE_LINE, SHARE_REQUIREMENTS_SECTION_HEADING, SHARE_RESOURCE_LABEL, SHARE_RULER_ICON, SHARE_SITE_URL, SHARE_STALL_SIZE_PREFIX, SHARE_TAGS_SECTION_HEADING, SHARE_TYPE_PATH_REGEX, type ShareEventDateTime, type ShareEventForInvitation, type ShareEventInfoForInvitation, type ShareMessageFooterPlacement, type ShareResourceType, type ShareStallType, type ShareType, type ShareVendorCategory, type ShareVendorForApplication, type ShareVendorInfoForApplication, appendShareMoreInfoLine, buildApplicationShareDescription, buildFacebookShareQuote, buildInvitationShareDescription, buildShareMessageSections, buildShareOgDescription, buildShareOgDescriptionFromSections, buildSharePagePath, buildShareUrl, formatCategoryLabel, formatShareApplicationCategoriesSection, formatShareApplicationComplianceSection, formatShareApplicationPriceRangeLine, formatShareApplicationStallSizeLine, formatShareInvitationApplicationDeadlineLine, formatShareInvitationMarketDatesSection, formatShareInvitationRequirementsSection, formatShareIsFoodTrueLine, formatShareMarketDate, formatShareRainOrShineLine, formatShareStallLine, formatShareTagsSection, formatStallCapacityLabel, isPostShareResourceType, isRelationShareResourceType, joinShareDescriptionSections, joinShareOgDescriptionSections, normalizeShareOgDescription, normalizeShareRouteId, normalizeShareText, shareMessageFooterPlacementForType, splitShareDescriptionSections };
219
+ export { DEFAULT_SHARE_OG_IMAGE, OG_DESCRIPTION_LINE_BREAK, POST_SHARE_RESOURCE_TYPES, PUBLIC_SHARE_PATH_TYPES, type PostShareResourceType, type PublicSharePathType, RELATION_SHARE_APPLICATION, RELATION_SHARE_INVITATION, RELATION_SHARE_RESOURCE_TYPES, RESOURCE_SHARE_TYPES, type RelationSharePathType, type RelationShareResourceType, type ResourceShareType, SHARE_APPLICATION_DEADLINE_PREFIX, SHARE_CALENDAR_ICON, SHARE_CATEGORIES_SECTION_HEADING, SHARE_CATEGORY_ICON, SHARE_CHECKMARK_ICON, SHARE_CLOCK_ICON, SHARE_COMPLIANCE_PREFIX, SHARE_DESCRIPTION_SECTION_BREAK, SHARE_DOLLAR_ICON, SHARE_FOOD_TRUCK_LINE, SHARE_INFO_ICON, SHARE_MARKET_DATES_SECTION_HEADING, SHARE_MORE_INFO_LINE, SHARE_PRICE_RANGE_PREFIX, SHARE_RAIN_OR_SHINE_LINE, SHARE_REQUIREMENTS_SECTION_HEADING, SHARE_RESOURCE_LABEL, SHARE_RULER_ICON, SHARE_SITE_URL, SHARE_STALL_SIZE_PREFIX, SHARE_TAGS_SECTION_HEADING, SHARE_TYPE_PATH_REGEX, type ShareEventDateTime, type ShareEventForInvitation, type ShareEventForPublic, type ShareEventInfoForInvitation, type ShareMessageFooterPlacement, type ShareResourceType, type ShareStallType, type ShareType, type ShareVendorCategory, type ShareVendorForApplication, type ShareVendorForPublic, type ShareVendorInfoForApplication, appendShareMoreInfoLine, buildApplicationShareDescription, buildFacebookShareQuote, buildInvitationShareDescription, buildPublicEventShareDescription, buildPublicVendorShareDescription, buildShareMessageSections, buildShareOgDescription, buildShareOgDescriptionFromSections, buildSharePagePath, buildShareUrl, formatCategoryLabel, formatShareApplicationCategoriesSection, formatShareApplicationComplianceSection, formatShareApplicationPriceRangeLine, formatShareApplicationStallSizeLine, formatShareInvitationApplicationDeadlineLine, formatShareInvitationMarketDatesSection, formatShareInvitationRequirementsSection, formatShareIsFoodTrueLine, formatShareMarketDate, formatShareRainOrShineLine, formatShareStallLine, formatShareTagsSection, formatStallCapacityLabel, isPostShareResourceType, isRelationShareResourceType, joinShareDescriptionSections, joinShareOgDescriptionSections, normalizeShareOgDescription, normalizeShareRouteId, normalizeShareText, shareMessageFooterPlacementForType, splitShareDescriptionSections };
@@ -1,3 +1,17 @@
1
+ /** Minimal event fields for public (market) share copy — matches in-app preview. */
2
+ type ShareEventForPublic = {
3
+ description?: string | null;
4
+ rainOrShine: boolean;
5
+ tags: string[];
6
+ };
7
+ /** Minimal vendor fields for public (stallholder) share copy — matches in-app preview. */
8
+ type ShareVendorForPublic = {
9
+ description?: string | null;
10
+ foodTruck: boolean;
11
+ };
12
+ declare function buildPublicEventShareDescription(event: ShareEventForPublic): string;
13
+ declare function buildPublicVendorShareDescription(vendor: ShareVendorForPublic): string;
14
+
1
15
  type ShareEventDateTime = {
2
16
  startDate: string;
3
17
  endDate?: string | null;
@@ -105,7 +119,7 @@ type RelationSharePathType = typeof RELATION_SHARE_INVITATION | typeof RELATION_
105
119
  type ShareType = PublicSharePathType | RelationSharePathType;
106
120
  /** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */
107
121
  declare const SHARE_TYPE_PATH_REGEX: string;
108
- declare function buildShareUrl(type: ShareType, id: string): string;
122
+ declare function buildShareUrl(type: ShareType, id: string, utmMedium?: string): string;
109
123
 
110
124
  declare const SHARE_SITE_URL = "https://cluemart.co.nz";
111
125
  /** Calendar marker for invitation market-dates share copy (U+1F4C5 📅). */
@@ -138,8 +152,8 @@ declare const SHARE_PRICE_RANGE_PREFIX = "$ Price range:";
138
152
  declare const SHARE_CLOCK_ICON = "\u23F0";
139
153
  /** Prefix for the invitation application-deadline sentence (share text + OG section parsing). */
140
154
  declare const SHARE_APPLICATION_DEADLINE_PREFIX = "\u23F0 Application deadline:";
141
- /** Footer on share sheet messages, Facebook SDK quote, and `og:description`. */
142
- declare const SHARE_MORE_INFO_LINE = "More info in the ClueMart app";
155
+ /** First line on share sheet messages, Facebook SDK quote, and `og:description`. */
156
+ declare const SHARE_MORE_INFO_LINE = "Shared from ClueMart";
143
157
  declare const DEFAULT_SHARE_OG_IMAGE = "https://cluemart.co.nz/assets/logo.webp";
144
158
  declare const RESOURCE_SHARE_TYPES: readonly ["market", "stallholder", "partner"];
145
159
  type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];
@@ -161,17 +175,17 @@ declare const OG_DESCRIPTION_LINE_BREAK = "&#10;";
161
175
  /** Joins OG description sections for Facebook link cards (and Twitter). */
162
176
  declare function joinShareOgDescriptionSections(sections: ReadonlyArray<string | false | null | undefined>): string;
163
177
  declare function joinShareDescriptionSections(sections: ReadonlyArray<string | false | null | undefined>): string;
164
- /** Appends the standard share footer when assembling sheet / SDK quote text. */
178
+ /** Prepends the standard share branding line when assembling display text. */
165
179
  declare function appendShareMoreInfoLine(description: string): string;
166
180
 
167
181
  /** Trims share text and collapses spaces per line; preserves `\n\n` section breaks. */
168
182
  declare function normalizeShareText(value: string | null | undefined): string;
169
- /** Share-sheet footer always follows title and body/caption. */
170
- type ShareMessageFooterPlacement = "after-body";
183
+ /** Branding line placement first so Facebook truncation does not drop it. */
184
+ type ShareMessageFooterPlacement = "before-body";
171
185
  declare function shareMessageFooterPlacementForType(_shareType?: ShareResourceType): ShareMessageFooterPlacement;
172
186
  /**
173
187
  * Ordered sections for share-sheet / Facebook SDK quote text:
174
- * title → description (full body or post caption) → {@link SHARE_MORE_INFO_LINE}.
188
+ * {@link SHARE_MORE_INFO_LINE} → title → description (full body or post caption).
175
189
  */
176
190
  declare function buildShareMessageSections(input: {
177
191
  title?: string | null;
@@ -202,4 +216,4 @@ declare function buildShareOgDescription(_title: string, description: string): s
202
216
  declare function normalizeShareRouteId(id: string): string;
203
217
  declare function buildSharePagePath(resourceType: ShareResourceType, rawId: string): string;
204
218
 
205
- export { DEFAULT_SHARE_OG_IMAGE, OG_DESCRIPTION_LINE_BREAK, POST_SHARE_RESOURCE_TYPES, PUBLIC_SHARE_PATH_TYPES, type PostShareResourceType, type PublicSharePathType, RELATION_SHARE_APPLICATION, RELATION_SHARE_INVITATION, RELATION_SHARE_RESOURCE_TYPES, RESOURCE_SHARE_TYPES, type RelationSharePathType, type RelationShareResourceType, type ResourceShareType, SHARE_APPLICATION_DEADLINE_PREFIX, SHARE_CALENDAR_ICON, SHARE_CATEGORIES_SECTION_HEADING, SHARE_CATEGORY_ICON, SHARE_CHECKMARK_ICON, SHARE_CLOCK_ICON, SHARE_COMPLIANCE_PREFIX, SHARE_DESCRIPTION_SECTION_BREAK, SHARE_DOLLAR_ICON, SHARE_FOOD_TRUCK_LINE, SHARE_INFO_ICON, SHARE_MARKET_DATES_SECTION_HEADING, SHARE_MORE_INFO_LINE, SHARE_PRICE_RANGE_PREFIX, SHARE_RAIN_OR_SHINE_LINE, SHARE_REQUIREMENTS_SECTION_HEADING, SHARE_RESOURCE_LABEL, SHARE_RULER_ICON, SHARE_SITE_URL, SHARE_STALL_SIZE_PREFIX, SHARE_TAGS_SECTION_HEADING, SHARE_TYPE_PATH_REGEX, type ShareEventDateTime, type ShareEventForInvitation, type ShareEventInfoForInvitation, type ShareMessageFooterPlacement, type ShareResourceType, type ShareStallType, type ShareType, type ShareVendorCategory, type ShareVendorForApplication, type ShareVendorInfoForApplication, appendShareMoreInfoLine, buildApplicationShareDescription, buildFacebookShareQuote, buildInvitationShareDescription, buildShareMessageSections, buildShareOgDescription, buildShareOgDescriptionFromSections, buildSharePagePath, buildShareUrl, formatCategoryLabel, formatShareApplicationCategoriesSection, formatShareApplicationComplianceSection, formatShareApplicationPriceRangeLine, formatShareApplicationStallSizeLine, formatShareInvitationApplicationDeadlineLine, formatShareInvitationMarketDatesSection, formatShareInvitationRequirementsSection, formatShareIsFoodTrueLine, formatShareMarketDate, formatShareRainOrShineLine, formatShareStallLine, formatShareTagsSection, formatStallCapacityLabel, isPostShareResourceType, isRelationShareResourceType, joinShareDescriptionSections, joinShareOgDescriptionSections, normalizeShareOgDescription, normalizeShareRouteId, normalizeShareText, shareMessageFooterPlacementForType, splitShareDescriptionSections };
219
+ export { DEFAULT_SHARE_OG_IMAGE, OG_DESCRIPTION_LINE_BREAK, POST_SHARE_RESOURCE_TYPES, PUBLIC_SHARE_PATH_TYPES, type PostShareResourceType, type PublicSharePathType, RELATION_SHARE_APPLICATION, RELATION_SHARE_INVITATION, RELATION_SHARE_RESOURCE_TYPES, RESOURCE_SHARE_TYPES, type RelationSharePathType, type RelationShareResourceType, type ResourceShareType, SHARE_APPLICATION_DEADLINE_PREFIX, SHARE_CALENDAR_ICON, SHARE_CATEGORIES_SECTION_HEADING, SHARE_CATEGORY_ICON, SHARE_CHECKMARK_ICON, SHARE_CLOCK_ICON, SHARE_COMPLIANCE_PREFIX, SHARE_DESCRIPTION_SECTION_BREAK, SHARE_DOLLAR_ICON, SHARE_FOOD_TRUCK_LINE, SHARE_INFO_ICON, SHARE_MARKET_DATES_SECTION_HEADING, SHARE_MORE_INFO_LINE, SHARE_PRICE_RANGE_PREFIX, SHARE_RAIN_OR_SHINE_LINE, SHARE_REQUIREMENTS_SECTION_HEADING, SHARE_RESOURCE_LABEL, SHARE_RULER_ICON, SHARE_SITE_URL, SHARE_STALL_SIZE_PREFIX, SHARE_TAGS_SECTION_HEADING, SHARE_TYPE_PATH_REGEX, type ShareEventDateTime, type ShareEventForInvitation, type ShareEventForPublic, type ShareEventInfoForInvitation, type ShareMessageFooterPlacement, type ShareResourceType, type ShareStallType, type ShareType, type ShareVendorCategory, type ShareVendorForApplication, type ShareVendorForPublic, type ShareVendorInfoForApplication, appendShareMoreInfoLine, buildApplicationShareDescription, buildFacebookShareQuote, buildInvitationShareDescription, buildPublicEventShareDescription, buildPublicVendorShareDescription, buildShareMessageSections, buildShareOgDescription, buildShareOgDescriptionFromSections, buildSharePagePath, buildShareUrl, formatCategoryLabel, formatShareApplicationCategoriesSection, formatShareApplicationComplianceSection, formatShareApplicationPriceRangeLine, formatShareApplicationStallSizeLine, formatShareInvitationApplicationDeadlineLine, formatShareInvitationMarketDatesSection, formatShareInvitationRequirementsSection, formatShareIsFoodTrueLine, formatShareMarketDate, formatShareRainOrShineLine, formatShareStallLine, formatShareTagsSection, formatStallCapacityLabel, isPostShareResourceType, isRelationShareResourceType, joinShareDescriptionSections, joinShareOgDescriptionSections, normalizeShareOgDescription, normalizeShareRouteId, normalizeShareText, shareMessageFooterPlacementForType, splitShareDescriptionSections };
@@ -33,6 +33,8 @@ import {
33
33
  buildApplicationShareDescription,
34
34
  buildFacebookShareQuote,
35
35
  buildInvitationShareDescription,
36
+ buildPublicEventShareDescription,
37
+ buildPublicVendorShareDescription,
36
38
  buildShareMessageSections,
37
39
  buildShareOgDescription,
38
40
  buildShareOgDescriptionFromSections,
@@ -61,7 +63,7 @@ import {
61
63
  normalizeShareText,
62
64
  shareMessageFooterPlacementForType,
63
65
  splitShareDescriptionSections
64
- } from "../chunk-4RD4XK5S.mjs";
66
+ } from "../chunk-3KPB5BHC.mjs";
65
67
  import "../chunk-X4VPNOHX.mjs";
66
68
  export {
67
69
  DEFAULT_SHARE_OG_IMAGE,
@@ -98,6 +100,8 @@ export {
98
100
  buildApplicationShareDescription,
99
101
  buildFacebookShareQuote,
100
102
  buildInvitationShareDescription,
103
+ buildPublicEventShareDescription,
104
+ buildPublicVendorShareDescription,
101
105
  buildShareMessageSections,
102
106
  buildShareOgDescription,
103
107
  buildShareOgDescriptionFromSections,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timardex/cluemart-shared",
3
- "version": "1.5.617",
3
+ "version": "1.5.618",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -10,7 +10,9 @@
10
10
  "lint": "eslint --ext .ts,.tsx,.mjs,.cjs src scripts",
11
11
  "lint:fix": "eslint --ext .ts,.tsx,.mjs,.cjs --fix src scripts",
12
12
  "typecheck": "tsc --noEmit",
13
- "publish:npm": "npm run build && npm publish --access public"
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "publish:npm": "npm run test && npm run build && npm publish --access public"
14
16
  },
15
17
  "exports": {
16
18
  ".": {
@@ -96,7 +98,8 @@
96
98
  "rimraf": "^6.0.1",
97
99
  "tsup": "^8.3.6",
98
100
  "typescript": "^5.7.3",
99
- "typescript-eslint": "^8.31.1"
101
+ "typescript-eslint": "^8.31.1",
102
+ "vitest": "^3.2.4"
100
103
  },
101
104
  "dependencies": {
102
105
  "@apollo/client": "^3.14.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/sharing/relationShareTypes.ts","../src/sharing/constants.ts","../src/sharing/formatCategoryLabel.ts","../src/sharing/joinShareDescriptionSections.ts","../src/sharing/buildRelationShareDescription.ts","../src/sharing/buildShareUrl.ts","../src/sharing/normalizeShareDescription.ts","../src/sharing/normalizeShareRouteId.ts"],"sourcesContent":["/** Path segments for relation share URLs — must match mobile `RelationTitle` values. */\nexport const RELATION_SHARE_INVITATION = \"invitation\" as const;\nexport const RELATION_SHARE_APPLICATION = \"application\" as const;\n\nexport const RELATION_SHARE_RESOURCE_TYPES = [\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_APPLICATION,\n] as const;\n\nexport type RelationShareResourceType =\n (typeof RELATION_SHARE_RESOURCE_TYPES)[number];\n\nexport function isRelationShareResourceType(\n resourceType: string,\n): resourceType is RelationShareResourceType {\n return (RELATION_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_RESOURCE_TYPES,\n isRelationShareResourceType,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport const SHARE_SITE_URL = \"https://cluemart.co.nz\";\n\n/** Calendar marker for invitation market-dates share copy (U+1F4C5 📅). */\nexport const SHARE_CALENDAR_ICON = \"\\u{1F4C5}\";\n\nexport const SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;\n\n/** Check mark for invitation requirements share copy (U+2705 ✅). */\nexport const SHARE_CHECKMARK_ICON = \"\\u{2705}\";\n\nexport const SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;\n\n/** Information marker for tags share copy (U+2139 ℹ️). */\nexport const SHARE_INFO_ICON = \"\\u{2139}\\u{FE0F}\";\n\nexport const SHARE_TAGS_SECTION_HEADING = `${SHARE_INFO_ICON} Tags:`;\n\n/** Standalone line when `rainOrShine` is true (invitation share + OG section parsing). */\nexport const SHARE_RAIN_OR_SHINE_LINE = \"Rain or Shine\";\n\n/** Standalone line when `foodTruck` is true (application share + OG section parsing). */\nexport const SHARE_FOOD_TRUCK_LINE = \"Food Truck\";\n\n/** Prefix for application compliance line (share text + OG section parsing). */\nexport const SHARE_COMPLIANCE_PREFIX = `${SHARE_CHECKMARK_ICON} Compliance:`;\n\n/** Label tag for application categories share copy (U+1F3F7 🏷️). */\nexport const SHARE_CATEGORY_ICON = \"\\u{1F3F7}\\u{FE0F}\";\n\nexport const SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;\n\n/** Straight ruler for application stall-size share copy (U+1F4CF 📏). */\nexport const SHARE_RULER_ICON = \"\\u{1F4CF}\";\n\n/** Prefix for application stall-size line (share text + OG section parsing). */\nexport const SHARE_STALL_SIZE_PREFIX = `${SHARE_RULER_ICON} Stall size:`;\n\n/** Dollar marker for price-range share copy (U+0024 $ — text, not emoji, so it stays black). */\nexport const SHARE_DOLLAR_ICON = \"$\";\n\n/** Prefix for application price-range line (share text + OG section parsing). */\nexport const SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;\n\n/** Alarm clock for invitation application-deadline share copy (U+23F0 ⏰). */\nexport const SHARE_CLOCK_ICON = \"\\u{23F0}\";\n\n/** Prefix for the invitation application-deadline sentence (share text + OG section parsing). */\nexport const SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;\n\n/** Footer on share sheet messages, Facebook SDK quote, and `og:description`. */\nexport const SHARE_MORE_INFO_LINE = \"More info in the ClueMart app\";\n\nexport const DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;\n\nexport const RESOURCE_SHARE_TYPES = [\n \"market\",\n \"stallholder\",\n \"partner\",\n] as const;\n\nexport type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];\n\nexport const POST_SHARE_RESOURCE_TYPES = [\n \"daily_meets\",\n \"daily_tips\",\n \"daily_games\",\n] as const;\n\nexport type PostShareResourceType = (typeof POST_SHARE_RESOURCE_TYPES)[number];\n\nexport type ShareResourceType =\n | ResourceShareType\n | PostShareResourceType\n | RelationShareResourceType;\n\nexport const SHARE_RESOURCE_LABEL: Record<ShareResourceType, string> = {\n [RELATION_SHARE_APPLICATION]: \"Application\",\n [RELATION_SHARE_INVITATION]: \"Invitation\",\n daily_games: \"Daily Game\",\n daily_meets: \"Daily Meet\",\n daily_tips: \"Daily Tip\",\n market: \"Market\",\n partner: \"Partner\",\n stallholder: \"Stallholder\",\n};\n\nexport function isPostShareResourceType(\n resourceType: ShareResourceType,\n): resourceType is PostShareResourceType {\n return (POST_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import type { ShareVendorCategory } from \"./shareRelationTypes\";\n\nexport function formatCategoryLabel(category: ShareVendorCategory): string {\n const subcategoryNames = category.subcategories\n .map((subcategory) => subcategory.name)\n .filter(Boolean);\n\n if (subcategoryNames.length === 0) {\n return category.name;\n }\n\n return `${category.name} (${subcategoryNames.join(\", \")})`;\n}\n","import { SHARE_MORE_INFO_LINE } from \"./constants\";\n\n/** Blank line between share sections — title, address, dates, URL, etc. */\nexport const SHARE_DESCRIPTION_SECTION_BREAK = \"\\n\\n\";\n\n/**\n * Line break for `og:description` meta content. Use instead of `\\n` — Next.js\n * HTML serialisation collapses literal newlines to spaces; Facebook reads `&#10;`.\n */\nexport const OG_DESCRIPTION_LINE_BREAK = \"&#10;\";\n\n/** Joins OG description sections for Facebook link cards (and Twitter). */\nexport function joinShareOgDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .map((section) => (typeof section === \"string\" ? section.trim() : \"\"))\n .filter((section): section is string => section.length > 0)\n .map((section) => section.replace(/\\n/g, OG_DESCRIPTION_LINE_BREAK))\n .join(OG_DESCRIPTION_LINE_BREAK);\n}\n\nexport function joinShareDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .filter((section): section is string => Boolean(section))\n .join(SHARE_DESCRIPTION_SECTION_BREAK);\n}\n\n/** Appends the standard share footer when assembling sheet / SDK quote text. */\nexport function appendShareMoreInfoLine(description: string): string {\n const trimmed = description.trim();\n if (trimmed.endsWith(SHARE_MORE_INFO_LINE)) {\n return trimmed;\n }\n if (trimmed.length === 0) {\n return SHARE_MORE_INFO_LINE;\n }\n return joinShareDescriptionSections([trimmed, SHARE_MORE_INFO_LINE]);\n}\n","import { formatDate } from \"../utils/date\";\n\nimport {\n SHARE_APPLICATION_DEADLINE_PREFIX,\n SHARE_CATEGORIES_SECTION_HEADING,\n SHARE_FOOD_TRUCK_LINE,\n SHARE_MARKET_DATES_SECTION_HEADING,\n SHARE_RAIN_OR_SHINE_LINE,\n SHARE_REQUIREMENTS_SECTION_HEADING,\n SHARE_COMPLIANCE_PREFIX,\n SHARE_PRICE_RANGE_PREFIX,\n SHARE_STALL_SIZE_PREFIX,\n SHARE_TAGS_SECTION_HEADING,\n} from \"./constants\";\nimport { formatCategoryLabel } from \"./formatCategoryLabel\";\nimport { joinShareDescriptionSections } from \"./joinShareDescriptionSections\";\nimport type {\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareStallType,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\nexport type {\n ShareEventDateTime,\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareStallType,\n ShareVendorCategory,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\n/** Formats event `startDate` (`DD-MM-YYYY`) for share copy — same as share preview UI. */\nexport function formatShareMarketDate(dateStr: string): string {\n return formatDate(dateStr, \"date\");\n}\n\nexport function formatStallCapacityLabel(stallCapacity: number): string {\n return stallCapacity > 0 ? ` (${stallCapacity} spaces available)` : \" - Full\";\n}\n\nexport function formatShareStallLine(stall: ShareStallType): string {\n return ` - ${stall.label} — $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;\n}\n\n/** Nested market dates + per-date stall lines for invitation share copy. */\nexport function formatShareInvitationMarketDatesSection(\n dateTime: ShareEventInfoForInvitation[\"dateTime\"],\n): string {\n const dateBlocks = dateTime.map((date) => {\n const formattedDate = formatShareMarketDate(date.startDate);\n const stallLines = date.stallTypes.map(formatShareStallLine);\n return [`- ${formattedDate}`, ...stallLines].join(\"\\n\");\n });\n\n return `${SHARE_MARKET_DATES_SECTION_HEADING}\\n${dateBlocks.join(\"\\n\")}`;\n}\n\nexport function formatShareRainOrShineLine(\n rainOrShine: boolean,\n): string | null {\n return rainOrShine ? SHARE_RAIN_OR_SHINE_LINE : null;\n}\n\nexport function formatShareIsFoodTrueLine(foodTruck: boolean): string | null {\n return foodTruck ? SHARE_FOOD_TRUCK_LINE : null;\n}\n\n/** Bulleted requirements list for invitation share copy. */\nexport function formatShareInvitationRequirementsSection(\n requirementLabels: string[],\n): string {\n const bullets = requirementLabels.map((label) => `- ${label}`);\n return `${SHARE_REQUIREMENTS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\nexport function formatShareTagsSection(tags: string[]): string {\n const bullets = tags.map((tag) => `- ${tag}`);\n return `${SHARE_TAGS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Bulleted categories list for application share copy. */\nexport function formatShareApplicationCategoriesSection(\n categoryLabels: string[],\n): string {\n const bullets = categoryLabels.map((label) => `- ${label}`);\n return `${SHARE_CATEGORIES_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Stall dimensions line for application share copy. */\nexport function formatShareApplicationStallSizeLine(size: {\n width: string;\n depth: string;\n}): string {\n return `${SHARE_STALL_SIZE_PREFIX} ${size.width}m × ${size.depth}m`;\n}\n\n/** Bulleted compliance list for application share copy. */\nexport function formatShareApplicationComplianceSection(\n complianceLabels: string[],\n): string {\n const bullets = complianceLabels.map((label) => `- ${label}`);\n return `${SHARE_COMPLIANCE_PREFIX}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Price range line for application share copy. */\nexport function formatShareApplicationPriceRangeLine(priceRange: {\n min: string;\n max: string;\n}): string {\n return `${SHARE_PRICE_RANGE_PREFIX} $${priceRange.min} – $${priceRange.max}`;\n}\n\n/** Application-deadline sentence for invitation share copy. */\nexport function formatShareInvitationApplicationDeadlineLine(\n applicationDeadlineHours: number,\n): string {\n return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;\n}\n\nexport function buildInvitationShareDescription(\n event: ShareEventForInvitation,\n eventInfo: ShareEventInfoForInvitation | null | undefined,\n): string {\n const stallTypes =\n eventInfo?.dateTime?.flatMap((date) => date.stallTypes) ?? [];\n\n if (!eventInfo || stallTypes.length === 0) {\n return event.description?.trim() || \"\";\n }\n\n const requirementLabels = (eventInfo.requirements ?? [])\n .filter((item) => item.value)\n .map((item) => item.label);\n\n const sections = [\n event.location.fullAddress,\n formatShareRainOrShineLine(event.rainOrShine),\n formatShareTagsSection(event.tags),\n formatShareInvitationMarketDatesSection(eventInfo.dateTime),\n formatShareInvitationApplicationDeadlineLine(\n eventInfo.applicationDeadlineHours,\n ),\n requirementLabels.length > 0 &&\n formatShareInvitationRequirementsSection(requirementLabels),\n ];\n\n return joinShareDescriptionSections(sections);\n}\n\nexport function buildApplicationShareDescription(\n vendor: ShareVendorForApplication,\n vendorInfo: ShareVendorInfoForApplication | null | undefined,\n): string {\n const categoryLabels = vendor.categories.map((category) =>\n formatCategoryLabel(category),\n );\n\n if (!vendorInfo) {\n return vendor.description?.trim() || \"\";\n }\n\n const compliance = vendorInfo.compliance;\n const complianceLabels = [\n compliance?.liabilityInsurance && \"Liability insurance\",\n compliance?.foodBeverageLicense && \"Food & beverage licence\",\n ].filter((label): label is string => Boolean(label));\n\n const profileDescription = vendor.description?.trim();\n\n const sections = [\n formatShareIsFoodTrueLine(vendor.foodTruck),\n categoryLabels.length > 0 &&\n formatShareApplicationCategoriesSection(categoryLabels),\n formatShareApplicationStallSizeLine(vendorInfo.stallInfo.size),\n complianceLabels.length > 0 &&\n formatShareApplicationComplianceSection(complianceLabels),\n formatShareApplicationPriceRangeLine(vendorInfo.product.priceRange),\n profileDescription,\n ];\n\n return joinShareDescriptionSections(sections);\n}\n","import {\n POST_SHARE_RESOURCE_TYPES,\n RESOURCE_SHARE_TYPES,\n SHARE_SITE_URL,\n} from \"./constants\";\nimport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n} from \"./relationShareTypes\";\n\n/** Path segments for public resource share URLs (markets, posts, etc.). */\nexport const PUBLIC_SHARE_PATH_TYPES = [\n ...RESOURCE_SHARE_TYPES,\n ...POST_SHARE_RESOURCE_TYPES,\n] as const;\n\nexport type PublicSharePathType = (typeof PUBLIC_SHARE_PATH_TYPES)[number];\n\nexport type RelationSharePathType =\n | typeof RELATION_SHARE_INVITATION\n | typeof RELATION_SHARE_APPLICATION;\n\nexport type ShareType = PublicSharePathType | RelationSharePathType;\n\n/** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */\nexport const SHARE_TYPE_PATH_REGEX = [\n ...PUBLIC_SHARE_PATH_TYPES,\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n].join(\"|\");\n\nexport function buildShareUrl(type: ShareType, id: string): string {\n return `${SHARE_SITE_URL}/share/${type}/${encodeURIComponent(id)}`;\n}\n","import { SHARE_MORE_INFO_LINE, type ShareResourceType } from \"./constants\";\nimport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n} from \"./joinShareDescriptionSections\";\n\nexport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n};\n\n/** Trims share text and collapses spaces per line; preserves `\\n\\n` section breaks. */\nexport function normalizeShareText(value: string | null | undefined): string {\n if (value == null) {\n return \"\";\n }\n return value\n .trim()\n .split(\"\\n\")\n .map((line) => {\n const match = line.match(/^([ \\t]*)(.*)$/);\n if (!match) {\n return line;\n }\n const [, leading, rest] = match;\n return leading + rest.trim().replace(/[ \\t]{2,}/g, \" \");\n })\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\");\n}\n\n/** Share-sheet footer always follows title and body/caption. */\nexport type ShareMessageFooterPlacement = \"after-body\";\n\nexport function shareMessageFooterPlacementForType(\n _shareType?: ShareResourceType,\n): ShareMessageFooterPlacement {\n return \"after-body\";\n}\n\n/**\n * Ordered sections for share-sheet / Facebook SDK quote text:\n * title → description (full body or post caption) → {@link SHARE_MORE_INFO_LINE}.\n */\nexport function buildShareMessageSections(input: {\n title?: string | null;\n description?: string | null;\n shareType?: ShareResourceType;\n}): string[] {\n const title = normalizeShareText(input.title);\n const description = normalizeShareText(input.description);\n\n return [title, description, SHARE_MORE_INFO_LINE].filter(\n (section) => section.length > 0,\n );\n}\n\nexport function splitShareDescriptionSections(value: string): string[] {\n const trimmed = normalizeShareText(value);\n if (!trimmed) {\n return [];\n }\n\n if (/\\n\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n if (/\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n return [trimmed];\n}\n\n/**\n * Formats share descriptions for Open Graph / Twitter meta tags.\n * Sections are joined with {@link OG_DESCRIPTION_LINE_BREAK} (`&#10;`).\n */\nexport function normalizeShareOgDescription(value: string): string {\n return joinShareOgDescriptionSections(splitShareDescriptionSections(value));\n}\n\n/**\n * Quote text for Facebook ShareDialog on iOS (`ShareLinkContent.quote`).\n *\n * Title + blank lines + body sections. URL is omitted — `contentUrl` supplies\n * the link card (OG on `/share/*` controls card title/image).\n */\nexport function buildFacebookShareQuote(\n title: string,\n description: string,\n shareType?: ShareResourceType,\n): string | undefined {\n const sections = buildShareMessageSections({ title, description, shareType });\n const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();\n return quote.length > 0 ? quote : undefined;\n}\n\n/**\n * Open Graph / Twitter description from pre-built section strings.\n * Prefer {@link joinShareOgDescriptionSections} when sections are already known.\n */\nexport function buildShareOgDescriptionFromSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return joinShareOgDescriptionSections(sections);\n}\n\n/** Open Graph / Twitter description — body sections only (`og:title` is separate). */\nexport function buildShareOgDescription(\n _title: string,\n description: string,\n): string {\n return joinShareOgDescriptionSections(\n splitShareDescriptionSections(description),\n );\n}\n","import type { ShareResourceType } from \"./constants\";\n\nexport function normalizeShareRouteId(id: string): string {\n try {\n return decodeURIComponent(id);\n } catch {\n return id;\n }\n}\n\nexport function buildSharePagePath(\n resourceType: ShareResourceType,\n rawId: string,\n): string {\n return `/share/${resourceType}/${encodeURIComponent(normalizeShareRouteId(rawId))}`;\n}\n"],"mappings":";;;;;AACO,IAAM,4BAA4B;AAClC,IAAM,6BAA6B;AAEnC,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;AAKO,SAAS,4BACd,cAC2C;AAC3C,SAAQ,8BAAoD;AAAA,IAC1D;AAAA,EACF;AACF;;;ACJO,IAAM,iBAAiB;AAGvB,IAAM,sBAAsB;AAE5B,IAAM,qCAAqC,GAAG,mBAAmB;AAGjE,IAAM,uBAAuB;AAE7B,IAAM,qCAAqC,GAAG,oBAAoB;AAGlE,IAAM,kBAAkB;AAExB,IAAM,6BAA6B,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