// Multideal slopgate fixture — deliberate canary hits for project-specific rules.
import { serverOnlyCanary } from '@/server/canary';

// raw-interactive-element canary (in components/ scope — triggers the AST rule):
export function BadButton() {
  return <button>click</button>;
}

export function DangerousHtmlCanary() {
  return (
    <div
      dangerouslySetInnerHTML={{ __html: '<strong>unsafe</strong>' }}
      dir={locale === 'he' ? 'rtl' : 'ltr'}
    />
  );
}

export function PlatformContactLeakCanary() {
  return (
    <div>
      <a href="mailto:vendor@example.com">email</a>
      <a href="tel:+972501234567">phone</a>
    </div>
  );
}
// physical-tailwind-rtl canary:
const _rtl = 'className="ml-4 text-left"';
// hardcoded-hebrew-jsx canary (tsx file only):
// export const HebrewText = () => <span>שלום</span>;
// agorot-inline-math canary:
const _agorot = 'Math.floor(price / 100)';
// radix-item-empty-value canary:
const _radix = '<Select.Item value="">';
// phone-hint-mask canary:
const _phoneHintMask = 'XXX-XXXX';
// phone-slice-hint canary:
const _phoneSliceHint = 'phone.slice(-3)';
// local-mask-phone canary:
function maskPhone(phone: string) {
  return phone;
}
// e164-inline canary:
const _e164 = '${getDialCode(countryIso)}${digitsOnly}';
// raw-tolocale-datetime canary:
const _rawToLocaleDateTime = 'createdAt.toLocaleString(locale)';
// local-format-date canary:
function formatDate(date: Date) {
  return date.toISOString();
}
// local-format-countdown canary:
function formatCountdown(seconds: number) {
  return String(seconds);
}
// inline-shekel canary:
const _inlineShekel = '₪${amount}';
// commission-split canary:
const _commissionSplit = '(amount * commissionRate).toFixed(2)';
// payment-card-label canary:
const _paymentCardLabel = '•••• 4242';
// bilingual-name-pick canary:
const _bilingualName = locale === 'he' ? vendor.nameHe : vendor.nameEn;
// vendor-error-map canary:
const vendorErrorMap = {
  invalid: 'invalid',
};
// zod-first-issue canary:
const _zodFirstIssue = 'issues[0]?.message';
// legacy-response-json canary:
const _legacyResponseJson = 'new Response(JSON.stringify({ ok: true }))';
// legacy-error-envelope canary:
const _legacyErrorEnvelope = "new Response(JSON.stringify({ ok: false, error: 'bad' }))";
// base64url-decode canary:
const _base64UrlDecode = "token.replace(/-/g, '+').replace(/_/g, '/')";
// bytes-to-hex canary:
const _bytesToHex = "byte.toString(16).padStart(2, '0')";
// israel-tz-hack canary:
const _israelTzHack = "date.toLocaleString('en-US', { timeZone: 'Asia/Jerusalem' })";
// local-initials canary:
function initials(name: string) {
  return name.slice(0, 2);
}
// min-to-time canary:
function minToTime(minutes: number) {
  return String(minutes);
}
// ts-expect-error canary:
// @ts-expect-error proving the rule still fires
const _tsExpectError = serverOnlyCanary;

declare const locale: 'he' | 'en';
declare const vendor: { nameHe: string; nameEn: string };
