Rocky_Mountain_Vending/.pnpm-store/v10/files/50/25dc57f56c27fa75e0c9aefad4d04969f51f563f61ef7f5368669ccf5c76056c95340ea1bbcf5946970ed9bc6882ed30c5a3caf95721c20917ecc90948255a
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
10 KiB
Text

{"version":3,"sources":["../../../src/shared/lib/magic-identifier.ts"],"sourcesContent":["function decodeHex(hexStr: string): string {\n if (hexStr.trim() === '') {\n throw new Error(\"can't decode empty hex\")\n }\n\n const num = parseInt(hexStr, 16)\n if (isNaN(num)) {\n throw new Error(`invalid hex: \\`${hexStr}\\``)\n }\n\n return String.fromCodePoint(num)\n}\n\nconst enum Mode {\n Text,\n Underscore,\n Hex,\n LongHex,\n}\n\nconst DECODE_REGEX = /^__TURBOPACK__([a-zA-Z0-9_$]+)__$/\n\nexport function decodeMagicIdentifier(identifier: string): string {\n const matches = identifier.match(DECODE_REGEX)\n if (!matches) {\n return identifier\n }\n\n const inner = matches[1]\n\n let output = ''\n\n let mode: Mode = Mode.Text\n let buffer = ''\n for (let i = 0; i < inner.length; i++) {\n const char = inner[i]\n\n if (mode === Mode.Text) {\n if (char === '_') {\n mode = Mode.Underscore\n } else if (char === '$') {\n mode = Mode.Hex\n } else {\n output += char\n }\n } else if (mode === Mode.Underscore) {\n if (char === '_') {\n output += ' '\n mode = Mode.Text\n } else if (char === '$') {\n output += '_'\n mode = Mode.Hex\n } else {\n output += char\n mode = Mode.Text\n }\n } else if (mode === Mode.Hex) {\n if (buffer.length === 2) {\n output += decodeHex(buffer)\n buffer = ''\n }\n\n if (char === '_') {\n if (buffer !== '') {\n throw new Error(`invalid hex: \\`${buffer}\\``)\n }\n\n mode = Mode.LongHex\n } else if (char === '$') {\n if (buffer !== '') {\n throw new Error(`invalid hex: \\`${buffer}\\``)\n }\n\n mode = Mode.Text\n } else {\n buffer += char\n }\n } else if (mode === Mode.LongHex) {\n if (char === '_') {\n throw new Error(`invalid hex: \\`${buffer + char}\\``)\n } else if (char === '$') {\n output += decodeHex(buffer)\n buffer = ''\n\n mode = Mode.Text\n } else {\n buffer += char\n }\n }\n }\n\n return output\n}\n\nexport const MAGIC_IDENTIFIER_REGEX = /__TURBOPACK__[a-zA-Z0-9_$]+__/g\n\n/**\n * Cleans up module IDs by removing implementation details.\n * - Replaces [project] with .\n * - Removes content in brackets [], parentheses (), and angle brackets <>\n */\nexport function deobfuscateModuleId(moduleId: string): string {\n return (\n moduleId\n // Replace [project] with .\n .replace(/\\[project\\]/g, '.')\n // Remove content in square brackets (e.g. [app-rsc])\n .replace(/\\s\\[([^\\]]*)\\]/g, '')\n // Remove content in parentheses (e.g. (ecmascript))\n .replace(/\\s\\(([^)]*)\\)/g, '')\n // Remove content in angle brackets (e.g. <locals>)\n .replace(/\\s<([^>]*)>/g, '')\n // Clean up any extra whitespace\n .trim()\n )\n}\n\n/**\n * Removes the free call wrapper pattern (0, expr) from expressions.\n * This is a JavaScript pattern to call a function without binding 'this',\n * but it's noise for developers reading error messages.\n */\nexport function removeFreeCallWrapper(text: string): string {\n // Match (0, <ident>.<ident>) patterns anywhere in the text the beginning\n // Use Unicode property escapes (\\p{ID_Start}, \\p{ID_Continue}) for full JS identifier support\n // Requires the 'u' (unicode) flag in the regex\n return text.replace(\n /\\(0\\s*,\\s*(__TURBOPACK__[a-zA-Z0-9_$]+__\\.[\\p{ID_Start}_$][\\p{ID_Continue}$]*)\\)/u,\n '$1'\n )\n}\n\nexport type TextPartType = 'raw' | 'deobfuscated'\n\n/**\n * Deobfuscates text and returns an array of discriminated parts.\n * Each part is a tuple of [type, string] where type is either 'raw' (unchanged text)\n * or 'deobfuscated' (a magic identifier that was decoded).\n *\n * This is useful when you need to process or display deobfuscated and raw text differently.\n */\nexport function deobfuscateTextParts(\n text: string\n): Array<[TextPartType, string]> {\n // First, remove free call wrappers\n const withoutFreeCall = removeFreeCallWrapper(text)\n\n const parts: Array<[TextPartType, string]> = []\n let lastIndex = 0\n\n // Create a new regex instance for global matching\n const regex = new RegExp(MAGIC_IDENTIFIER_REGEX.source, 'g')\n\n for (\n let match = regex.exec(withoutFreeCall);\n match !== null;\n match = regex.exec(withoutFreeCall)\n ) {\n const matchStart = match.index\n const matchEnd = regex.lastIndex\n const ident = match[0]\n\n // Add raw text before this match (if any)\n if (matchStart > lastIndex) {\n const rawText = withoutFreeCall.substring(lastIndex, matchStart)\n parts.push(['raw', rawText])\n }\n\n // Process and add the deobfuscated part\n try {\n const decoded = decodeMagicIdentifier(ident)\n // If it was a magic identifier, clean up the module ID\n if (decoded !== ident) {\n // Check if this is an \"imported module\" reference\n const importedModuleMatch = decoded.match(/^imported module (.+)$/)\n if (importedModuleMatch) {\n // Clean the entire module path (which includes [app-rsc], etc.)\n const modulePathWithMetadata = importedModuleMatch[1]\n const cleaned = deobfuscateModuleId(modulePathWithMetadata)\n parts.push(['deobfuscated', `{imported module ${cleaned}}`])\n } else {\n const cleaned = deobfuscateModuleId(decoded)\n parts.push(['deobfuscated', `{${cleaned}}`])\n }\n } else {\n // Not actually a magic identifier, treat as raw\n parts.push(['raw', ident])\n }\n } catch (e) {\n parts.push(['deobfuscated', `{${ident} (decoding failed: ${e})}`])\n }\n\n lastIndex = matchEnd\n }\n\n // Add any remaining raw text after the last match\n if (lastIndex < withoutFreeCall.length) {\n const rawText = withoutFreeCall.substring(lastIndex)\n parts.push(['raw', rawText])\n }\n\n return parts\n}\n\n/**\n * Deobfuscates text by:\n * 1. Decoding magic identifiers\n * 2. Cleaning up module IDs\n * 3. Removing free call wrappers\n */\nexport function deobfuscateText(text: string): string {\n const parts = deobfuscateTextParts(text)\n return parts.map((part) => part[1]).join('')\n}\n"],"names":["MAGIC_IDENTIFIER_REGEX","decodeMagicIdentifier","deobfuscateModuleId","deobfuscateText","deobfuscateTextParts","removeFreeCallWrapper","decodeHex","hexStr","trim","Error","num","parseInt","isNaN","String","fromCodePoint","DECODE_REGEX","identifier","matches","match","inner","output","mode","buffer","i","length","char","moduleId","replace","text","withoutFreeCall","parts","lastIndex","regex","RegExp","source","exec","matchStart","index","matchEnd","ident","rawText","substring","push","decoded","importedModuleMatch","modulePathWithMetadata","cleaned","e","map","part","join"],"mappings":";;;;;;;;;;;;;;;;;;;IA8FaA,sBAAsB;eAAtBA;;IAxEGC,qBAAqB;eAArBA;;IA+EAC,mBAAmB;eAAnBA;;IA6GAC,eAAe;eAAfA;;IArEAC,oBAAoB;eAApBA;;IAnBAC,qBAAqB;eAArBA;;;AA1HhB,SAASC,UAAUC,MAAc;IAC/B,IAAIA,OAAOC,IAAI,OAAO,IAAI;QACxB,MAAM,qBAAmC,CAAnC,IAAIC,MAAM,2BAAV,qBAAA;mBAAA;wBAAA;0BAAA;QAAkC;IAC1C;IAEA,MAAMC,MAAMC,SAASJ,QAAQ;IAC7B,IAAIK,MAAMF,MAAM;QACd,MAAM,qBAAuC,CAAvC,IAAID,MAAM,CAAC,eAAe,EAAEF,OAAO,EAAE,CAAC,GAAtC,qBAAA;mBAAA;wBAAA;0BAAA;QAAsC;IAC9C;IAEA,OAAOM,OAAOC,aAAa,CAACJ;AAC9B;AASA,MAAMK,eAAe;AAEd,SAASd,sBAAsBe,UAAkB;IACtD,MAAMC,UAAUD,WAAWE,KAAK,CAACH;IACjC,IAAI,CAACE,SAAS;QACZ,OAAOD;IACT;IAEA,MAAMG,QAAQF,OAAO,CAAC,EAAE;IAExB,IAAIG,SAAS;IAEb,IAAIC;IACJ,IAAIC,SAAS;IACb,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,MAAMK,MAAM,EAAED,IAAK;QACrC,MAAME,OAAON,KAAK,CAACI,EAAE;QAErB,IAAIF,YAAoB;YACtB,IAAII,SAAS,KAAK;gBAChBJ;YACF,OAAO,IAAII,SAAS,KAAK;gBACvB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