{"version":3,"file":"matchers.cjs","sources":["../../../../src/utils/ident/matchers.js"],"sourcesContent":["/**\n * Regular expression pattern to match a method identifier composed of\n * letters (a-z, A-Z), digits (0-9), and underscores (_)\n */\nconst METHOD_PATTERN = '([a-za-z0-9_]+)';\n\n/**\n * Regular expression pattern to match a hexadecimal identifier that starts with 0x\n * followed by one or more hex characters (0-9, a-f, case insensitive)\n */\nconst HEX_ID_REG_EXP_PATTERN = '(0x[0-9a-fA-F]+)';\n\n/**\n * Regular expression pattern to validate UUIDs in the format:\n * 8 hex digits - 4 hex digits - 4 hex digits - 4 hex digits - 12 hex digits\n */\nconst UUID_PATTERN = '([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})';\n\n/**\n * Regular expression pattern to match ISO 8601 datetime strings in the format:\n * YYYY-MM-DDTHH:mm:ss.SSSZ or with timezone offset (+HH:MM)\n */\nconst DATETIME_PATTERN = '^(\\\\d{4})-(0[1-9]|1[0-2])-'\n  + '(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):'\n  + '([0-5][0-9]):([0-5][0-9]|60)'\n  + '(\\\\.[0-9]+)?(Z|(\\\\+|-)([01][0-9]|2[0-3]):'\n  + '([0-5][0-9]))$';\n\n/**\n * Character set for valid identifier characters: letters, digits, underscores,\n * periods, colons, and hyphens\n */\nconst ID_CHAR = '[a-zA-Z0-9_.-]';\n\n/**\n * Pattern for matching method IDs which consist of one or more ID characters,\n * optionally followed by colon-separated segments of ID characters\n */\nconst METHOD_ID = `(${ID_CHAR}+(:${ID_CHAR}+)*)`;\n\n/**\n * Character set allowed in parameters: letters, digits, underscores,\n * periods, colons, percent signs, and hyphens\n */\nconst PARAM_CHAR = '[a-zA-Z0-9_.:%-]';\n\n/**\n * Pattern for matching a single parameter in the format key=value\n */\nconst PARAM = `;${PARAM_CHAR}+=${PARAM_CHAR}*`;\n\n/**\n * Pattern for matching zero or more parameters\n */\nconst PARAMS = `((${PARAM})*)`;\n\n/**\n * Pattern for matching an optional path segment, starting with a slash\n */\nconst PATH = '(/[^#?]*)?';\n\n/**\n * Pattern for matching an optional query string (starting with ?)\n */\nconst QUERY = '([?][^#]*)?';\n\n/**\n * Pattern for matching an optional fragment identifier (starting with #)\n */\nconst FRAGMENT = '(#.*)?';\n\n/**\n * Regular expression to validate decentralized identifiers (DIDs) in the format:\n * did:method:suffix[:params][path][query][fragment]\n */\nexport const DID_MATCHER = new RegExp(\n  `^did:${METHOD_PATTERN}:${METHOD_ID}${PARAMS}${PATH}${QUERY}${FRAGMENT}$`,\n);\n\n/**\n * Regular expression to match ISO 8601 datetime strings with optional\n * milliseconds and timezone information (case insensitive)\n */\nexport const DATETIME_MATCHER = new RegExp(DATETIME_PATTERN, 'i');\n\n/**\n * Regular expression to match status list IDs in the format:\n * status-list2021:method:testnet|mainnet:uuid or status-list2021:hex-id\n */\nexport const STATUS_LIST_ID_MATCHER = new RegExp(\n  `status-list2021:${METHOD_PATTERN}:((?:testnet|mainnet):${UUID_PATTERN}|${HEX_ID_REG_EXP_PATTERN})(?::${UUID_PATTERN})?`,\n);\n\n/**\n * Regular expression to match private status list IDs in the format:\n * private-Status-list2021:hex-id\n */\nexport const PRIVATE_STATUS_LIST_ID_MATCHER = new RegExp(\n  `^private-status-list2021:${HEX_ID_REG_EXP_PATTERN}$`,\n);\n\n/**\n * Regular expression to validate URIs with scheme, optional slashes,\n * and path (cannot contain whitespace)\n */\nexport const URI_MATCHER = new RegExp('^\\\\w+:\\\\/?\\\\/?[^\\\\s]+$');\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,iBAAiB;;AAExC;AACA;AACA;AACA;AACA,MAAM,sBAAsB,GAAG,kBAAkB;;AAEjD;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,gEAAgE;;AAErF;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAA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