§
    „ßj*
  ã                  ój   — d Z ddlmZ ddlZej        rddlmZ ddlmZ ddlm	Z	  G d„ d¦  «        Z
dS )	aY  
Application Dispatcher
======================

This middleware creates a single WSGI application that dispatches to
multiple other WSGI applications mounted at different URL paths.

A common example is writing a Single Page Application, where you have a
backend API and a frontend written in JavaScript that does the routing
in the browser rather than requesting different pages from the server.
The frontend is a single HTML and JS file that should be served for any
path besides "/api".

This example dispatches to an API app under "/api", an admin app
under "/admin", and an app that serves frontend files for all other
requests::

    app = DispatcherMiddleware(serve_frontend, {
        '/api': api_app,
        '/admin': admin_app,
    })

In production, you might instead handle this at the HTTP server level,
serving files or proxying to application servers based on location. The
API and admin apps would each be deployed with a separate WSGI server,
and the static files would be served directly by the HTTP server.

.. autoclass:: DispatcherMiddleware

:copyright: 2007 Pallets
:license: BSD-3-Clause
é    )ÚannotationsN)ÚStartResponse)ÚWSGIApplication)ÚWSGIEnvironmentc                  ó&   — e Zd ZdZ	 ddd	„Zdd„ZdS )ÚDispatcherMiddlewareaJ  Combine multiple applications as a single WSGI application.
    Requests are dispatched to an application based on the path it is
    mounted under.

    :param app: The WSGI application to dispatch to if the request
        doesn't match a mounted path.
    :param mounts: Maps path prefixes to applications for dispatching.
    NÚappr   Úmountsú!dict[str, WSGIApplication] | NoneÚreturnÚNonec                ó&   — || _         |pi | _        d S ©N)r	   r
   )Úselfr	   r
   s      úQ/var/www/html/venv/lib/python3.11/site-packages/werkzeug/middleware/dispatcher.pyÚ__init__zDispatcherMiddleware.__init__6   s   € ð
 ˆŒØ�l ˆŒˆˆó    Úenvironr   Ústart_responser   út.Iterable[bytes]c                óN  — |                      dd¦  «        }d}d|v r;|| j        v r| j        |         }nD|                     dd¦  «        \  }}d|› |› �}d|v °;| j                              || j        ¦  «        }|                      dd¦  «        }||z   |d<   ||d<    |||¦  «        S )NÚ	PATH_INFOÚ ú/é   ÚSCRIPT_NAME)Úgetr
   Úrsplitr	   )r   r   r   ÚscriptÚ	path_infor	   Ú	last_itemÚoriginal_script_names           r   Ú__call__zDispatcherMiddleware.__call__>   sÎ   € ð —’˜[¨"Ñ-Ô-ˆØˆ	à�VˆmˆmØ˜œÐ$Ð$Ø”k &Ô)�Øà &§¢¨c°1Ñ 5Ô 5ÑˆF�IØ2˜IÐ2 yÐ2Ð2ˆIð �Vˆmˆmð ”+—/’/ &¨$¬(Ñ3Ô3ˆCà&Ÿ{š{¨=¸"Ñ=Ô=ÐØ!5¸Ñ!>ˆ�ÑØ(ˆ�ÑØˆs�7˜NÑ+Ô+Ð+r   r   )r	   r   r
   r   r   r   )r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r#   © r   r   r   r   ,   sP   € € € € € ðð ð 59ð#ð #ð #ð #ð #ð,ð ,ð ,ð ,ð ,ð ,r   r   )r'   Ú
__future__r   ÚtypingÚtÚTYPE_CHECKINGÚ_typeshed.wsgir   r   r   r   r(   r   r   ú<module>r.      s¢   ððð ðB #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð à„?ð /Ø,Ð,Ð,Ð,Ð,Ð,Ø.Ð.Ð.Ð.Ð.Ð.Ø.Ð.Ð.Ð.Ð.Ð.ð%,ð %,ð %,ð %,ð %,ñ %,ô %,ð %,ð %,ð %,r   