
    <i                     6    S SK r S SKrS SKr0 rS rS rSS jrg)    Nc                 D    [        U 5      S:  d   eU S   S-   U SS -   nU$ )z
Convert a python package name representing a STIX version in the form "vXX"
to the dotted style used in the public APIs of this library, "X.X".

:param stix_vid: A package name in the form "vXX"
:return: A STIX version in dotted style
      .   N)len)stix_vidstix_versions     H/home/james-whalen/.local/lib/python3.13/site-packages/stix2/registry.py_stix_vid_to_versionr   
   s5     x=AA;$x|3L    c                  $   [         (       Gd  [        R                  " S5      n U R                  n[	        U R
                  5      S-   n[        R                  " XS9 GH0  u  p4nUR                  S5      S   n[        R                  " SU5      (       a  U(       a  [        U5      n[        R                  " U[	        U R
                  5      5      n0 [         U'   UR                  [         U   S'   UR                  [         U   S'   UR                  [         U   S'   M  [        R                  " S	U5      (       d  M  US
L d  M  [        U5      n[        R                  " U[	        U R
                  5      5      nUR                  [         U   S'   GM3     gg)zNavigate the package once and retrieve all object mapping dicts for each
v2X package. Includes OBJ_MAP, OBJ_MAP_OBSERVABLE, EXT_MAP.stix2r   )pathprefixr   z^stix2\.v2[0-9]$objectsobservables
extensionsz^stix2\.v2[0-9]\.common$FmarkingsN)STIX2_OBJ_MAPS	importlibimport_module__path__str__name__pkgutilwalk_packagessplitrematchr   OBJ_MAPOBJ_MAP_OBSERVABLEEXT_MAPOBJ_MAP_MARKING)	top_level_moduler   r   module_loadernameis_pkgr	   vermods	            r   _collect_stix2_mappingsr+      sC    >$227;((%../#5+2+@+@d+Z'Mzz#q)Hxx+T22v*84--dC8H8Q8Q4RS&(s#14s#I.585K5Ks#M247KKs#L15t<<5*84--dC8H8Q8Q4RS252E2Es#J/ ,[ r   c                 p   Sn[         R                  U5      nU(       a  U(       a+  UR                  U5      nU(       a  UR                  U 5      nU$ US   R                  U 5      =(       dJ    US   R                  U 5      =(       d/    US   R                  U 5      =(       d    US   R                  U 5      nU$ )a%  
Get the registered class which implements a particular STIX type for a
particular STIX version.

:param stix_type: A STIX type as a string, or for extension-definition
    style extensions, the STIX ID of the definition.
:param stix_version: A STIX version as a string, e.g. "2.1"
:param category: An optional "category" value, which is just used directly
    as a second key after the STIX version, and depends on how the types
    are internally categorized.  This would be useful if the same STIX type
    is used to mean two different things within the same STIX version.  So
    it's unlikely to be necessary.  Pass None to just search all the
    categories and return the first class found.
:return: A registered python class which implements the given STIX type, or
    None if one is not found.
Nr   r   r   r   )r   get)	stix_typer
   categoryclscat_map	class_maps         r   class_for_typer3   /   s    " C  .GH-ImmI. J 	"&&y1 5&**955
#''	25 %)))4	  Jr   )N)r   r   r   r   r   r+   r3    r   r   <module>r5      s%      	 F.!r   