+
    }ij                         ^ RI t ^ RIHt ^ RIHtHtHtHt ^ RIt	^ RI
t
^ RIHt ]! ]4      P                  R,          tR
R R lltR R	 ltR# )    N)Path)DictListOptionalTuple)OS_ARCH_MATRIXzwebgl_data.dbc          
          V ^8  d   QhR\         R\        \         ,          R\        \         ,          R\        \         \         3,          /# )   osvendorrendererreturn)strr   r   )formats   "g/Users/ahmad/.openclaw/workspace/my-crawler/.venv/lib/python3.14/site-packages/camoufox/webgl/sample.py__annotate__r      sB     I( I(I(c]I(5=c]I(	#s(^I(    c                8   V \         9  d   \        RV  R24      h\        P                  ! \        4      pVP                  4       pV'       d   V'       d   VP                  RV  R2W34       VP                  4       pV'       g   \        RV RV R24      hV^,          ^ 8:  da   VP                  RV  R	24       VP                  4       p\        R
V RV RV P                  4        RRP                  R V 4       4       24      hVP                  4        \        P                  ! V^,          4      # VP                  RV  RV  R	24       VP                  4       pVP                  4        V'       g   \        RV  24      h\        \        \!        V!  4      w   rp
\"        P$                  ! V
\"        P&                  R7      pWP)                  4       ,          p\"        P*                  P-                  \/        V4      VR7      p\        P                  ! W,          4      # )a  
Sample a random WebGL vendor/renderer combination and its data based on OS probabilities.
Optionally use a specific vendor/renderer pair.

Args:
    os: Operating system ('win', 'mac', or 'lin')
    vendor: Optional specific vendor to use
    renderer: Optional specific renderer to use (requires vendor to be set)

Returns:
    Dict containing WebGL data including vendor, renderer and additional parameters

Raises:
    ValueError: If invalid OS provided or no data found for OS/vendor/renderer
zInvalid OS: z. Must be one of: win, mac, linzSELECT vendor, renderer, data, z: FROM webgl_fingerprints WHERE vendor = ? AND renderer = ?z No WebGL data found for vendor "z" and renderer ""?SELECT DISTINCT vendor, renderer FROM webgl_fingerprints WHERE z > 0zVendor "z" combination not valid for z.
Possible pairs: z, c              3   8   "   T F  p\        V4      x  K  	  R # 5i)N)r   ).0pairs   & r   	<genexpr>sample_webgl.<locals>.<genexpr><   s     ,R>4SYY>s   z FROM webgl_fingerprints WHERE zNo WebGL data found for OS: )dtype)p)r   
ValueErrorsqlite3connectDB_PATHcursorexecutefetchonefetchalltitlejoincloseorjsonloadsmaplistzipnparrayfloat64sumrandomchoicelen)r   r   r   connr"   resultpossible_pairsresults_	data_strsprobsprobs_arrayidxs   &&&          r   sample_webglr>      s   & 
<t+JKLL ??7#D[[]F(-bT 20 0	

 "?xGWX`Waabcdd!9>NNQRTQUUYZ $__.N6("28*<XY[YaYaYcXd e##'99,R>,R#R"SU 
 	

||F1I&& NN
)"-LRDPTU ooGJJL7t<== !sG}5AqU ((5

3K 11K ))

3{+{

;C <<	''r   c                ~    V ^8  d   QhR\         \        \        \        \        \        3,          ,          3,          /# )r
   r   )r   r   r   r   )r   s   "r   r   r   Z   s*      Dd5c?&;!;< r   c                     \         P                  ! \        4      p V P                  4       p/ p\         F-  pVP                  RV RV R24       VP                  4       W#&   K/  	  V P                  4        V# )z`
Get all possible (vendor, renderer) pairs for all OS, where the probability is greater than 0.
r   z > 0 ORDER BY z DESC)r   r    r!   r"   r   r#   r%   r(   )r5   r"   r6   os_types       r   get_possible_pairsrB   Z   sq    
 ??7#D[[]F 02F!I^G9E;	
 !//+ " 	JJLMr   )NN)r   pathlibr   typingr   r   r   r   numpyr.   r)   camoufox.pkgmanr   __file__parentr!   r>   rB    r   r   <module>rJ      s<      . .   * x.

/
1I(Xr   