
    ɢiQ              
          d dl Z d dlZd dlmZmZ d dlmZ e j                  j                  e j                  j                  e j                  j                  e
            d      Z e ee      d      ZdZdZd	d
ddddd	d	d	d	Zi ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,dd-d.d/d0d1d2iZej#                         D  ci c]  \  } }| |
 c}} Zd3 Zd4 Zd;d5Zd6 Zd<d7Zd;d8Zd;d9Zd=d:Zyc c}} w )>    N)EnvironmentFileSystemLoader)derive_color_harmonics	templatesF)loader
autoescape)nanobananapremiumr   zsite_premium.htmlzsite_sidebar.htmlzsite_magazine.htmlzsite_cinematic.htmlzsite_command.htmlzsite_split.html)	herosidebarmagazine	cinematiccommandsplitz
data-dense
comparisongalleryshieldz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>chartz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>globeaG  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>zapz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>usersa8  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>stara  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>targetz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>clockz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>hearta/  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>checkz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>booka  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>rocketa  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/><path d="M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/><path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"/><path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/></svg>lockz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>geara,  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>	lightningzshield-checkz<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><polyline points="9 12 11 14 15 10"/></svg>cpua  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><line x1="9" y1="1" x2="9" y2="4"/><line x1="15" y1="1" x2="15" y2="4"/><line x1="9" y1="20" x2="9" y2="23"/><line x1="15" y1="20" x2="15" y2="23"/><line x1="20" y1="9" x2="23" y2="9"/><line x1="20" y1="14" x2="23" y2="14"/><line x1="1" y1="9" x2="4" y2="9"/><line x1="1" y1="14" x2="4" y2="14"/></svg>databasea  <svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></svg>c                       j                  d       t               dk(  rdj                  d  D               	 dj                   fddD              S # t        t        f$ r Y yw xY w)	N#    c              3   &   K   | ]	  }|d z    yw)   N ).0cs     >/sites/domain-asset-master/app/services/standalone_renderer.py	<genexpr>z_hex_to_rgb.<locals>.<genexpr>2   s     5aAE5   ,c           	   3   T   K   | ]  }t        t        ||d z    d             ! yw)r*      N)strint)r,   i	hex_colors     r.   r/   z_hex_to_rgb.<locals>.<genexpr>4   s(     J1C	!AaC 0"56Js   %()r   r*      z	79,70,229)lstriplenjoin
ValueError
IndexError)r7   s   `r.   _hex_to_rgbr>   /   sd      %I
9~GG5955	xxJ	JJJ
# s   A A&%A&c                 ^    | r&| j                         t        v r| j                         S t        S N)lowerVALID_TIERSDEFAULT_TIER)tiers    r.   _resolve_tierrE   9   s$    

+zz|    c                 :   t        |      }|j                  dd      }|j                  dd      }|j                  dd      }|j                  d|       }|j                  dd	      }t        |||      }	|| |||||t        |      t        |      t        |      d

|	S )Ncolor_primaryz#4F46E5color_secondaryz#7C3AEDcolor_accent#06B6D4nametagliner(   )
rD   domain
brand_namerM   primary	secondaryaccentprimary_rgbsecondary_rgb
accent_rgb)rE   getr   r>   )
rN   brand
brand_datarD   rP   rQ   rR   rO   rM   	harmonicss
             r.   _base_contextrZ   ?   s    Dnn_i8G0)<I^^NI6F66*Jii	2&G&w	6BI  "7+$Y/!&)  rF   c                    | sy 	 | j                  d      }t        j                  j                  |      rt	        |d      5 }t        j                  |j                               j                  d      }d d d        d|v r#|j                  dd      d   j                         nd}ddd	d
dj                  |d      }d| d S | S # 1 sw Y   SxY w# t        $ r Y y w xY w)N/rbzutf-8.   pngjpegzsvg+xmlwebp)jpgrb   svgrc   zdata:image/z;base64,)r9   ospathexistsopenbase64	b64encodereaddecodersplitrA   rV   	Exception)	image_urlimg_disk_pathimg_fb64extmimes         r.   _resolve_image_to_b64rv   X   s    
!((-77>>-(mT* Ee&&uzz|4;;GDE>A]>R-&&sA.r288:X]C!6)VTXXY\^cdD hse44E E  s0   <C 3C4AC C CC 	CCc	                    t        |      }|xs i }|dk(  rddlm}	  |	| |||||      S t        | |||      }
|j	                  dg       }t        |t              r	d|v r|d   }g }t        |t              r|ng D ]d  }|j	                  dd      }|j                  |j	                  dd      |j	                  d	d      t        j	                  |t        d         d
       f |j	                  d|j	                  dg             }t        |t              r"|j	                  d|j	                  dg             }t        |t              r|ng }|j	                  dg       }t        |t              r|j	                  dg       }t        |t              r|ng }|j	                  d      xs |}t        |      }t        |j	                  d            }t        |j	                  d            }t        |j	                  d            }t        |j	                  d            }g }|rUddlm} |D ]J  }|j                  |j                  |j                  xs d ||j                  |j                        d       L |j	                  dd      }t        |t              r"|j	                  d|j	                  dd            }|j	                  d|j	                  dg             }t        |t              r"|j	                  d|j	                  dg             }t        |t              r|ng }|D ]o  }t        |j	                  d      t              rD|d   j!                  d      D cg c]#  }|j#                         s|j#                         % c}|d<   d|vskd|d<   q |j	                  d|j	                  d g             } t        | t              r"| j	                  d!| j	                  dg             } t        | t              r| ng }!|j	                  d"i       }"t        |"t              r|"}#ni }#|
j%                  i d#|j	                  d#|j	                  d$d            d%|j	                  d%|j	                  d&d            d'|j	                  d'd      d(|j	                  d(d)      d*|j	                  d*d+      d|d,|j	                  d,d      d-|j	                  d-d      d|d|d|d.|d/|d0|d1|d|d|||j	                  d2d      |j	                  d3d      |!|j	                  d4d      |j	                  d5d      |#|j	                  d6d      d7       |d8k(  r|r|t&        v rt&        |   }$d9|$ }%nd:| d;}%	 t(        j+                  |%      }& |&j.                  d=i |
S c c}w # t,        $ r t(        j+                  d<      }&Y 7w xY w)>Nr	   r   )generate_standalone_site_htmlfeaturesiconr   titler(   description)r{   r|   icon_svg	faq_itemsfaqtestimonialsr   logofaviconog_imageabout_image_augment_slugr{   r|   slugabout
about_bodybodypricing_tierspricing_planstiersplansr1   featuredFhow_it_works_steps	how_stepsstepscomparison_tableheadlinerL   subheadlinerM   	hero_bodycta_textzGet Startedabout_titlezAbout Usoffernicheaugmentshero_bg_image
logo_imagefavicon_imagepricing_titlepricing_subtitlehow_it_works_titlehow_it_works_subtitlecomparison_title)r   r   r   r   r   r   r   r   r   zstandalone/zstandalone/site_.htmlzstandalone/site_premium.htmlr+   )rE   app.mainrx   rZ   rV   
isinstancedictlistappendICON_SVG_MAPrv   r   r{   r|   idr4   r   stripupdatePREMIUM_TEMPLATE_VARIANTS_standalone_envget_templatero   render)'rN   rW   rX   	site_copyhero_image_urlr   rD   designationstemplate_type	_nano_genctxfeatures_rawry   ficon_keyfaq_rawr   testimonials_rawr   effective_heror   r   r   r   r   aug_datar   augr   pricing_rawr   pthiw_rawr   comparison_rawr   variant_filetemplate_nametmpls'                                          r.   render_standalone_siter   h   s   D%2Lv~G
I~xXX
z4
8C==R0L,%**D#J/H(t<l" 55(UU7B'553$((<3GH
 	 mmKub)ABG'4 ++k7;;ub+AB.'BC }}^R8"D)+//C'12BD'I#rL!%%f-?N).9M&|'7'7'?@J),*:*:9*EFM$\%5%5j%ABH'(8(8(GHKH* 	COO"4"%cffcii8 	 MM'2&E%		,		&"(=>--PR1STK+t$!oog{w/KL#-k4#@KbM #bffZ(#.13J1E1Ec1JXAaggiaggiXBzNR"BzN	# mm0)--R2PQG'4 ++gw{{3G'LM$.w$=2]]#5r:N.$')JJ IMM*eii.CDy}}]EIIi4LM 	Y]];3 	IMM*m<	
 	y}}]J? 	 	w+ 	w+ 	H 	s 	 	H 	 	j 	  	H!" 	{#$ '";%MM*<bA0'mm,@"E!*/F!K,%MM*<bA3 8 y]}@Y/Y0?%l^4*4&6L++M: 4;;i Yd  L++,JKLs   V-V4V   W Wc                 L
  * t        |
      }
|
dk(  rddlm}  || |||||||||	
      S ddlm} t	        | |||
      }|r|j
                  nd}|r'|j                  r|j                  j                  d      nd}t        d |	D              }t        d	 |	D              }|rt        |      nd}t        |	      }g }|j                  d
       t        d |	D              r|j                  d       |j                  d       |xs g D ]D  } ||j                  |j                        }|j                  d| dd|j                   df       F |rx|j                         D ]e  \  }}|j                  dd      }|j!                         j#                  dd      }|j                  d| d| dd|j                  d|       df       g g }|r|j$                  nd }|rQ|j                  dt&        j(                  j+                  |      dt&        j(                  j+                  |       f       |r|j,                  xs g ng D ]V  }|s|j                  dt&        j(                  j+                  |      dt&        j(                  j+                  |       f       X |xs g D ]X  }|j                  dt&        j(                  j+                  |j                  dd                  }|j                  d |d!| f       Z |xs g D ]C  } | j.                  xs d"}!|j                  d#|! | j0                  d$|! d| j0                   f       E i }"|rn|j                         D ][  \  }}|j                  dd      }|j!                         j#                  dd      }|"j3                  |g       j                  |||f       ] g }#|rO|D ]J  }|#j                  |j                  |j4                  xs d ||j                  |j                        d%       L g }$t7        |	j9                               D ]  *|	*   }%*j;                  d      rd&}&nAt        *fd'd(D              rd)}&n**j=                  d      rd*}&n*j=                  d+      rd,}&nd-}&t?        |%t@              r|%d.d/n
tC        |%      }'|$j                  *|&|'f        |jE                  |||||||||"|#|$d0       d1|
 d}(	 tF        jI                  |(      }) |)jL                  d3i |S # tJ        $ r tF        jI                  d2      })Y 2w xY w)4Nr	   r   )generate_standalone_admin_htmlr   r(   z	%B %d, %YzN/Ac              3   D   K   | ]  }|j                  d       sd  yw)r   r_   Nendswithr,   ks     r.   r/   z*render_standalone_admin.<locals>.<genexpr>   s     PAAJJw<OaPs     c              3   L   K   | ]  t        fd dD              sd  yw)c              3   @   K   | ]  }j                  |        y wr@   r   )r,   rt   r   s     r.   r/   z4render_standalone_admin.<locals>.<genexpr>.<genexpr>   s"       APUXC  AP   z.pngz.jpgz.jpegz.gifz.svgz.webpr_   N)anyr   s    @r.   r/   z*render_standalone_admin.<locals>.<genexpr>   s4       QQS  AP  ]O  AP  >Pq  Qs   $$)z
index.htmlz	Main Sitez	&#127968;c              3   &   K   | ]	  }|d k(    yw)
sales.htmlNr+   r   s     r.   r/   z*render_standalone_admin.<locals>.<genexpr>   s     
>1
>r0   )r   zSales Letterz	&#128176;)z
admin.htmlzSite Admin (This Page)z&#9881;ztools/r   zTool: z&#9889;rD   general -zdocs/r\   zDoc: r{   z	&#128196;z
Hero Imagezimages/zFeature ImagefilenameurlzGraphics Packzimages/graphics/uncategorizedzBrand Kit: zassets/brand-kit/r   HTMLc              3   @   K   | ]  }j                  |        y wr@   r   )r,   rt   fpaths     r.   r/   z*render_standalone_admin.<locals>.<genexpr>  s     c$cr   r   ImageDocumentzassets/AssetOtherr1   z bytes)r   gen_datetotal_pagestotal_images
total_docstotal_files	page_list	img_itemsdocs_by_tierr   manifest_rowszstandalone/admin_zstandalone/admin_premium.htmlr+   )'rE   r   r   r   rZ   chosen_niche
created_atstrftimesumr:   r   r   r   r{   itemsrV   rA   replacer   rf   rg   basenamefeature_imagesclassificationr   
setdefaultr|   sortedkeysr   
startswithr   r5   r4   r   r   r   ro   r   )+rN   rW   rX   r   pkgr   brand_kit_assetsbusiness_docsgraphics_assetsdeployed_files_manifestrD   r   r   r   r   r   r   r   r   r   r   r   r   dkdv	tier_name	tier_slugr   hero_urlfi_urlgafnbkaclsr   r   r   valftypesize_strr   r   r   s+                                             @r.   render_standalone_adminr     s]   Dv~H
IsHN^`mo~  AX  Y  	Y&
z4
8C #CE7:s~~s~~&&{3SXHP!8PPK  Q"9  Q  QL'4]#!J-.KI=>

>&=
>>DEHIB RSVVSYY/F4&.&0DiPQR #))+ 	jFBvy1I!)11#s;Ii["U;uRVVGUWEXDY=Z\ghi	j
 I%(s!!dH,(8(8(BgbggN^N^_gNhMiDjkl033%%+ porww/?/?/G7SUSZSZScScdjSkRlImnop $" IVVJ 0 0r1B CD/21A"/FGHI !&B h  3OKu-s||?PQTPUUVWZWcWcVd=efgh L#))+ 	OFBvy1I!)11#s;I##Ir2992r9:MN	O
 H 	COO"4"%cffcii8 	 M/4467 7%e,>>'"Ec0bccEg&Ei(EE'1#s';c!WF#SeUH567 JJ"$ "$&  (vU3MM++M: 4;;  M++,KLMs   T T#"T#c
                 J   t        |	      }	|	dk(  ry |xs d}t        |||      }
|	| ||||t        |      t        |      t        |      d||||d|
}d|	 d}	 t        j	                  |      } |j                  di |S # t
        $ r t        j	                  d      }Y 2w xY w)	Nr	   rK   r(   )rD   rN   rO   rP   rQ   rR   rS   rT   rU   rM   	doc_titledoc_tierrendered_contenttier_nav_linkszstandalone/doc_r   zstandalone/doc_premium.htmlr+   )rE   r   r>   r   r   ro   r   )rN   rO   rP   rQ   rR   r  r  r  r  rD   rY   r   r   r   s                 r.   render_standalone_docr  ?  s    Dv~ yF&w	6BI  "7+$Y/!&),( C$ &dV51MK++M: 4;;  K++,IJKs   B B"!B"c           	      4   dd l }t        |      }|dk(  rddlm}  || ||||      S ddlm} t        | |||      }	|j                  |j                  xs d|j                         }
|j                  |j                  xs d      }g }|xs g D ]  }|j                  |j                  k7  s|j                  |j                  |j                  xs d|j                          ||j                  |j                  xs d|j                         d        |j                  xs d}|s	d	|	d
    d}|	j                  |
|||d       d| d}	 t        j                  |      } |j                   di |	S # t        $ r t        j                  d      }Y 2w xY w)Nr   r	   ) generate_standalone_augment_htmlr   zTool r(   ztool-)r{   r   a\  <div style="padding:48px;text-align:center;color:#6b7280">
<p style="font-size:3rem;margin-bottom:16px">&#128338;</p>
<h3 style="font-weight:700;color:#374151;margin-bottom:8px">Content Being Generated</h3>
<p>This tool is still being prepared. Check back shortly.</p>
<a href="../index.html" style="display:inline-block;margin-top:24px;background:rP   zm;color:#fff;padding:10px 24px;border-radius:8px;font-weight:600;text-decoration:none">Back to Site</a>
</div>)	aug_titleaug_desccontentother_augmentszstandalone/augment_r   zstandalone/augment_premium.htmlr+   )htmlrE   r   r  r   rZ   escaper{   r   r|   r   html_contentr   r   r   ro   r   )rN   rW   rX   augmentall_augmentsrD   html_modr   r   r   r  r  r  r   r  r   r   s                    r.   render_standalone_augmentr  b  s   Dv~J
G\JJ&
z4
8C E51EFIw228b9HN" 66WZZ!!!)FcffX6FG%cffcii.KU366(;KL#  ""(bGP QTT]P^O_ `	
 JJ(	  *$u5MO++M: 4;;  O++,MNOs   E6 6FF)r   )NNr   NN)Nr   )rf   rj   jinja2r   r   app.services.themer   rg   r;   dirname__file___TEMPLATE_DIRr   rB   rC   r   r   r   ICON_MAPr>   rE   rZ   rv   r   r  r  r  )r   vs   00r.   <module>r'     s   	  0 5RWW__RWW__X-FGU%5m%DQVW+  "$&"%%"
   i  f   ^ 
  l	
   O   d   P   w   F   U   g   h   O   C   l    N!" 
  s#$   u%( *//12TQAqD22 pfaH F+m	 3s   D 