
    Vg                     ^    d dl mZmZ d dlmZ ddlmZ ddlmZ ddl	m
Z
mZ  G d d	e      Zy
)    )ListTuple)RegistrantRule   )BaseProvider   )RULES)SBNSBN9c            	       b    e Zd ZdZdee   fdZededee   de	eef   fd       Z
d
dedefdZy	)ProviderzGenerates fake SBNs. These are the precursor to the ISBN and are
    largely similar to ISBN-10.

    See https://www.isbn-international.org/content/what-isbn for the
    format of ISBNs. SBNs have no EAN prefix or Registration Group.
    returnc                     t         j                  dz
  }| j                  d|z        }t        }| j	                  ||      \  }}||gS )z2Generate the information required to create an SBNr   #)r
   
MAX_LENGTHnumerifyr	   _registrant_publication)selfreg_pub_lenreg_pubrules
registrantpublications         ]/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/faker/providers/sbn/__init__.py_bodyzProvider._body   sP     >>A- }}S;%67 ',"&">">w"N
KK((    r   r   c                     |D ]5  }|j                   | dd cxk  r|j                  k  s&n )|j                  } n t        d      | d| | |d }}||fS )an  Separate the registration from the publication in a given
        string.
        :param reg_pub: A string of digits representing a registration
            and publication.
        :param rules: A list of RegistrantRules which designate where
            to separate the values in the string.
        :returns: A (registrant, publication) tuple of strings.
        Nz9Registrant/Publication not found in registrant rule list.)minmaxregistrant_length	Exception)r   r   rulereg_lenr   r   s         r   r   z Provider._registrant_publication   sn      	\Dxx73B<3488300	\
 Z[[")(7"3WWX5FK
;&&r   	separatorc                 b    | j                         \  }}t        ||      }|j                  |      S )N)r   r   format)r   r%   r   r   sbns        r   sbn9zProvider.sbn92   s-    "&**,
K:{+zz)$$r   N)-)__name__
__module____qualname____doc__r   strr   staticmethodr   r   r   r)    r   r   r   r   
   sc    )tCy ) ' 'T.5I 'eTWY\T\o ' '$%c %C %r   r   N)typingr   r   faker.providers.sbn.rulesr    r   r   r	   r(   r
   r   r   r1   r   r   <module>r5      s      4   +%| +%r   