
    ~+h                         d dl Z d ZddZy)    Nc                     t        |d      st        d      t        |      }t        |dd      D ]  }	 |j	                  dd|      } |d| d| S # t        $ r t        d      w xY w)	z6Return the absolute name of the module to be imported.rindexz'package' not set to a string   .r   z2attempted relative import beyond top-level packageN)hasattr
ValueErrorlenranger   )namepackageleveldotxs        F/var/www/html/venv/lib/python3.12/site-packages/webassets/importlib.py_resolve_namer      s    7H%899
g,C5!R  )	)..a-C) dsmT**  	) ( ) )	)s   AA(c                     | j                  d      r2|st        d      d}| D ]  }|dk7  r n|dz  } t        | |d ||      } t        |        t        j
                  |    S )zImport a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.

    r   z/relative imports require the 'package' argumentr   r   N)
startswith	TypeErrorr   
__import__sysmodules)r   r   r   	characters       r   import_moduler      st     sMNN 	ICQJE	 T%&\7E:t;;t    )N)r   r   r    r   r   <module>r      s    +r   