/ /   p u b l i c _ h t m l / j s / h o m e . j s 
 
 
 
 / /   C h e c k   A u t h   &   P e r s o n a l i z a t i o n 
 
 l e t   t o k e n   =   l o c a l S t o r a g e . g e t I t e m ( ' t o k e n ' ) ; 
 
 c o n s t   u s e r N a m e   =   l o c a l S t o r a g e . g e t I t e m ( ' u s e r N a m e ' ) ; 
 
 c o n s t   u s e r I d   =   l o c a l S t o r a g e . g e t I t e m ( ' u s e r I d ' ) ; 
 
 
 
 i f   ( u s e r N a m e )   d o c u m e n t . g e t E l e m e n t B y I d ( ' g r e e t i n g ' ) . i n n e r T e x t   =   ` % j%%j% j% j% % j%   $ { u s e r N a m e . s p l i t ( '   ' ) [ 0 ] }   a"  ` ; 
 
 
 
 / /   a"   F e t c h   P r i c i n g   S e t t i n g s 
 
 l e t   p r i c i n g C o n f i g   =   n u l l ; 
 
 a s y n c   f u n c t i o n   f e t c h P r i c i n g C o n f i g ( )   { 
 
         t r y   { 
 
                 c o n s t   r e s   =   a w a i t   f e t c h ( ` $ { A P I _ U R L } / a p i / o r d e r s / p r i c e - c o n f i g ` ,   { 
 
                         h e a d e r s :   {   ' A u t h o r i z a t i o n ' :   ` B e a r e r   $ { t o k e n } `   } 
 
                 } ) ; 
 
                 i f   ( r e s . o k )   { 
 
                         p r i c i n g C o n f i g   =   a w a i t   r e s . j s o n ( ) ; 
 
                         c o n s o l e . l o g ( ' a" %  P r i c i n g   L o a d e d : ' ,   p r i c i n g C o n f i g ) ; 
 
                 } 
 
         }   c a t c h   ( e )   {   c o n s o l e . e r r o r ( ' E r r o r   l o a d i n g   p r i c i n g ' ,   e ) ;   } 
 
 } 
 
 i f   ( t o k e n )   f e t c h P r i c i n g C o n f i g ( ) ; 
 
 
 
 / /   a" Q%)"U%   M a p   I n i t i a l i z a t i o n   &   M o d a l   L o g i c 
 
 l e t   m a p ,   c u r r e n t S e l e c t i o n M o d e ,   m a p I n i t i a l i z e d   =   f a l s e ; 
 
 
 
 f u n c t i o n   o p e n M a p M o d a l ( m o d e )   { 
 
         c u r r e n t S e l e c t i o n M o d e   =   m o d e ; 
 
         c o n s t   t i t l e   =   m o d e   = = =   ' p i c k u p '   ?   ' j% j% j% % j%   % % % j%c%  j% % j% j%%j% % j% % '   :   ' j% j% j% % j%   % j% % j%#  j% % j% j%%% % % ' ; 
 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' m o d a l T i t l e ' ) . i n n e r T e x t   =   t i t l e ; 
 
 
 
         c o n s t   m o d a l E l   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' l o c a t i o n P i c k e r M o d a l ' ) ; 
 
         c o n s t   m o d a l   =   n e w   b o o t s t r a p . M o d a l ( m o d a l E l ) ; 
 
         m o d a l . s h o w ( ) ; 
 
 
 
         / /   R e f r e s h   m a p   o n   m o d a l   s h o w 
 
         i f   ( ! m a p I n i t i a l i z e d )   { 
 
                 s e t T i m e o u t ( i n i t M a p ,   4 0 0 ) ; 
 
         }   e l s e   { 
 
                 s e t T i m e o u t ( ( )   = >   m a p . i n v a l i d a t e S i z e ( ) ,   4 0 0 ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   i n i t M a p ( )   { 
 
         i f   ( m a p I n i t i a l i z e d )   r e t u r n ; 
 
         t r y   { 
 
                 / /   a"   U s e   ' p i c k e r M a p '   I D 
 
                 m a p   =   L . m a p ( ' p i c k e r M a p ' ,   {   z o o m C o n t r o l :   f a l s e ,   a t t r i b u t i o n C o n t r o l :   f a l s e   } ) . s e t V i e w ( [ 1 5 . 5 0 0 7 ,   3 2 . 5 5 9 9 ] ,   1 3 ) ; 
 
 
 
                 c o n s t   d a r k L a y e r   =   L . t i l e L a y e r ( ' h t t p s : / / { s } . b a s e m a p s . c a r t o c d n . c o m / d a r k _ a l l / { z } / { x } / { y } { r } . p n g ' ,   {   m a x Z o o m :   1 9   } ) ; 
 
                 c o n s t   g o o g l e H y b r i d   =   L . t i l e L a y e r ( ' h t t p s : / / { s } . g o o g l e . c o m / v t / l y r s = s , h & x = { x } & y = { y } & z = { z } ' ,   { 
 
                         m a x Z o o m :   2 0 ,   s u b d o m a i n s :   [ ' m t 0 ' ,   ' m t 1 ' ,   ' m t 2 ' ,   ' m t 3 ' ] ,   a t t r i b u t i o n :   ' G o o g l e ' 
 
                 } ) . a d d T o ( m a p ) ; 
 
 
 
                 L . c o n t r o l . l a y e r s ( {   " % % j%%  j%a%% j% j%c%%   a" %)"U% " :   g o o g l e H y b r i d ,   " j% % % j%b%j%c%  j% % % % % %   a"  " :   d a r k L a y e r   } ,   n u l l ,   {   p o s i t i o n :   ' t o p r i g h t '   } ) . a d d T o ( m a p ) ; 
 
 
 
                 m a p I n i t i a l i z e d   =   t r u e ; 
 
                 s e t T i m e o u t ( l o c a t e M e ,   5 0 0 ) ; 
 
         }   c a t c h   ( e r r )   { 
 
                 c o n s o l e . e r r o r ( ' M a p   I n i t   E r r o r : ' ,   e r r ) ; 
 
                 a l e r t ( ' % j%$%%   j% % % j% j%#  j% % j% j%%% j%V%j%#j%   % j%%j% %   j% % % j% j% % % j%#  % j%%j%#  j% j% j%%% ' ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c o n f i r m L o c a t i o n S e l e c t i o n ( )   { 
 
         c o n s t   c e n t e r   =   m a p . g e t C e n t e r ( ) ; 
 
         c o n s t   m o d e   =   c u r r e n t S e l e c t i o n M o d e ; 
 
 
 
         d o c u m e n t . g e t E l e m e n t B y I d ( ` $ { m o d e } - l a t ` ) . v a l u e   =   c e n t e r . l a t ; 
 
         d o c u m e n t . g e t E l e m e n t B y I d ( ` $ { m o d e } - l n g ` ) . v a l u e   =   c e n t e r . l n g ; 
 
         d o c u m e n t . g e t E l e m e n t B y I d ( ` $ { m o d e } - a d d r ` ) . v a l u e   =   ` % % % j%c%  % j% j% j%   ( $ { c e n t e r . l a t . t o F i x e d ( 4 ) } ,   $ { c e n t e r . l n g . t o F i x e d ( 4 ) } ) ` ; 
 
 
 
         / /   A u t o   r e v e r s e   g e o c o d e   f o r   b e t t e r   U I 
 
         f e t c h ( ` h t t p s : / / n o m i n a t i m . o p e n s t r e e t m a p . o r g / r e v e r s e ? f o r m a t = j s o n v 2 & l a t = $ { c e n t e r . l a t } & l o n = $ { c e n t e r . l n g } ` ) 
 
                 . t h e n ( r e s   = >   r e s . j s o n ( ) ) 
 
                 . t h e n ( d a t a   = >   { 
 
                         i f   ( d a t a . d i s p l a y _ n a m e )   { 
 
                                 c o n s t   a d d r   =   d a t a . a d d r e s s . r o a d   | |   d a t a . a d d r e s s . s u b u r b   | |   d a t a . d i s p l a y _ n a m e . s p l i t ( ' , ' ) [ 0 ] ; 
 
                                 d o c u m e n t . g e t E l e m e n t B y I d ( ` $ { m o d e } - a d d r ` ) . v a l u e   =   a d d r ; 
 
                         } 
 
                 } ) . c a t c h ( ( )   = >   {   } ) ; 
 
 
 
         b o o t s t r a p . M o d a l . g e t I n s t a n c e ( d o c u m e n t . g e t E l e m e n t B y I d ( ' l o c a t i o n P i c k e r M o d a l ' ) ) . h i d e ( ) ; 
 
 } 
 
 
 
 f u n c t i o n   l o c a t e M e ( )   { 
 
         i f   ( ! n a v i g a t o r . g e o l o c a t i o n )   r e t u r n ; 
 
         n a v i g a t o r . g e o l o c a t i o n . g e t C u r r e n t P o s i t i o n ( 
 
                 ( p o s )   = >   m a p . s e t V i e w ( [ p o s . c o o r d s . l a t i t u d e ,   p o s . c o o r d s . l o n g i t u d e ] ,   1 6 ) , 
 
                 ( e r r )   = >   c o n s o l e . l o g ( ' G e o l o c a t i o n   d i s a b l e d / f a i l e d ' ) , 
 
                 {   e n a b l e H i g h A c c u r a c y :   t r u e   } 
 
         ) ; 
 
 } 
 
 
 
 / /   a"   U t i l s 
 
 f u n c t i o n   c a l c u l a t e P r i c e ( )   { 
 
         / /   B a s i c   C l i e n t - S i d e   E s t i m a t i o n 
 
         c o n s t   t y p e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' d i s t a n c e - t y p e ' ) . v a l u e ; 
 
         c o n s t   p r i c e I n p u t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p r i c e ' ) ; 
 
         i f   ( t y p e   = = =   ' s h o r t ' )   p r i c e I n p u t . v a l u e   =   3 0 0 0 ; 
 
         e l s e   i f   ( t y p e   = = =   ' m e d i u m ' )   p r i c e I n p u t . v a l u e   =   6 0 0 0 ; 
 
         e l s e   i f   ( t y p e   = = =   ' l o n g ' )   p r i c e I n p u t . v a l u e   =   1 0 0 0 0 ; 
 
 } 
 
 
 
 f u n c t i o n   p r e v i e w I m a g e ( i n p u t )   { 
 
         i f   ( i n p u t . f i l e s   & &   i n p u t . f i l e s [ 0 ] )   { 
 
                 c o n s t   r e a d e r   =   n e w   F i l e R e a d e r ( ) ; 
 
                 r e a d e r . o n l o a d   =   ( e )   = >   { 
 
                         d o c u m e n t . g e t E l e m e n t B y I d ( ' i m g - p r e v i e w ' ) . c l a s s L i s t . r e m o v e ( ' d - n o n e ' ) ; 
 
                         d o c u m e n t . g e t E l e m e n t B y I d ( ' i m g - p r e v i e w ' ) . q u e r y S e l e c t o r ( ' i m g ' ) . s r c   =   e . t a r g e t . r e s u l t ; 
 
                 } 
 
                 r e a d e r . r e a d A s D a t a U R L ( i n p u t . f i l e s [ 0 ] ) ; 
 
         } 
 
 } 
 
 
 
 f u n c t i o n   c l e a r I m a g e ( )   { 
 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' p a r c e l - i m a g e ' ) . v a l u e   =   ' ' ; 
 
         d o c u m e n t . g e t E l e m e n t B y I d ( ' i m g - p r e v i e w ' ) . c l a s s L i s t . a d d ( ' d - n o n e ' ) ; 
 
 } 
 
 
 
 / /   a" ]%)"U%   C l i e n t - S i d e   C o m p r e s s i o n   u s i n g   b r o w s e r - i m a g e - c o m p r e s s i o n 
 
 a s y n c   f u n c t i o n   c o m p r e s s I m a g e ( f i l e )   { 
 
         c o n s t   o p t i o n s   =   { 
 
                 m a x S i z e M B :   0 . 5 ,                     / /   M a x   s i z e   i n   M B   ( v e r y   e f f i c i e n t ) 
 
                 m a x W i d t h O r H e i g h t :   1 2 8 0 ,     / /   G o o d   f o r   m o b i l e   s c r e e n s 
 
                 u s e W e b W o r k e r :   t r u e ,             / /   R u n   i n   b a c k g r o u n d   t o   a v o i d   f r e e z i n g   U I 
 
                 f i l e T y p e :   ' i m a g e / j p e g ' 
 
         } ; 
 
 
 
         t r y   { 
 
                 c o n s t   c o m p r e s s e d F i l e   =   a w a i t   i m a g e C o m p r e s s i o n ( f i l e ,   o p t i o n s ) ; 
 
                 / /   C o n v e r t   B l o b   t o   B a s e 6 4   f o r   t h e   b a c k e n d 
 
                 r e t u r n   a w a i t   i m a g e C o m p r e s s i o n . g e t D a t a U r l F r o m F i l e ( c o m p r e s s e d F i l e ) ; 
 
         }   c a t c h   ( e r r o r )   { 
 
                 c o n s o l e . e r r o r ( ' C o m p r e s s i o n   E r r o r : ' ,   e r r o r ) ; 
 
                 r e t u r n   a w a i t   i m a g e C o m p r e s s i o n . g e t D a t a U r l F r o m F i l e ( f i l e ) ; 
 
         } 
 
 } 
 
 
 
 / /   a"    V a l i d a t i o n   &   S u b m i s s i o n 
 
 f u n c t i o n   v a l i d a t e O r d e r ( )   { 
 
         c o n s t   p L a t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - l a t ' ) . v a l u e ; 
 
         c o n s t   d L a t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - l a t ' ) . v a l u e ; 
 
         c o n s t   p P h o n e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - p h o n e ' ) . v a l u e ; 
 
         c o n s t   d P h o n e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - p h o n e ' ) . v a l u e ; 
 
         c o n s t   p r i c e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p r i c e ' ) . v a l u e ; 
 
 
 
         c o n s t   w a r n   =   ( m s g )   = >   { 
 
                 S w a l . f i r e ( {   i c o n :   ' w a r n i n g ' ,   t e x t :   m s g ,   c o n f i r m B u t t o n T e x t :   ' j% j%%% j% % ' ,   c o n f i r m B u t t o n C o l o r :   ' # 0 a 8 7 5 4 '   } ) ; 
 
                 r e t u r n   f a l s e ; 
 
         } ; 
 
 
 
         i f   ( ! p L a t )   r e t u r n   w a r n ( ' % j%%j% %   j% j% j% % j%   % % % j%c%  j% % j% j%%j% % j% %   % %   j% % j% j%%% j%V%j%#' ) ; 
 
         i f   ( ! d L a t )   r e t u r n   w a r n ( ' % j%%j% %   j% j% j% % j%   % j% % j%#  j% % j% j%%% % %   % %   j% % j% j%%% j%V%j%#' ) ; 
 
         i f   ( ! p P h o n e   | |   p P h o n e . l e n g t h   <   1 0 )   r e t u r n   w a r n ( ' j%%% %   % j% j% %   j% % % j%%j%%%   j%Q%% j%%  j%a%j% % j% ' ) ; 
 
         i f   ( ! d P h o n e   | |   d P h o n e . l e n g t h   <   1 0 )   r e t u r n   w a r n ( ' j%%% %   % j% j% %   j% % % j%%j% % %   j%Q%% j%%  j%a%j% % j% ' ) ; 
 
         i f   ( ! p r i c e   | |   p r i c e   < =   0 )   r e t u r n   w a r n ( ' % j%%j% %   j% j% j% % j%   j%%j%c%j%%  j% % j%c%j%%j%b%' ) ; 
 
 
 
         r e t u r n   t r u e ; 
 
 } 
 
 
 
 a s y n c   f u n c t i o n   c r e a t e O r d e r ( )   { 
 
         / /   G u a r d 
 
         i f   ( ! l o c a l S t o r a g e . g e t I t e m ( ' t o k e n ' ) )   { 
 
                 c o n s t   r e s   =   a w a i t   S w a l . f i r e ( { 
 
                         t i t l e :   ' j% j%%j% % %   j% % j% j% % %   % j%V%% % j% ' , 
 
                         t e x t :   ' j%c%j%$%j% %   j% % j% j%%  j% j%V%% j%   % j% j% j% % j%   % j% j%%%   j% j%%j% %   j% j% % % %   j% % % j% % . ' , 
 
                         i c o n :   ' i n f o ' , 
 
                         s h o w C a n c e l B u t t o n :   t r u e , 
 
                         c o n f i r m B u t t o n T e x t :   ' j% j%%j% % %   j% % j% j% % % ' , 
 
                         c a n c e l B u t t o n T e x t :   ' j% % j%Q%j% j% ' , 
 
                         c o n f i r m B u t t o n C o l o r :   ' # 0 a 8 7 5 4 ' 
 
                 } ) ; 
 
                 i f   ( r e s . i s C o n f i r m e d )   w i n d o w . l o c a t i o n . h r e f   =   ' c l i e n t - l o g i n . h t m l ' ; 
 
                 r e t u r n ; 
 
         } 
 
 
 
         i f   ( ! v a l i d a t e O r d e r ( ) )   r e t u r n ; 
 
 
 
         c o n s t   b t n   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' s u b m i t - b t n ' ) ; 
 
         c o n s t   o r i g i n a l H T M L   =   b t n . i n n e r H T M L ; 
 
         b t n . d i s a b l e d   =   t r u e ; 
 
         b t n . i n n e r H T M L   =   ' < s p a n   c l a s s = " s p i n n e r - b o r d e r   s p i n n e r - b o r d e r - s m " > < / s p a n >   j% j% j%%%   j% % j% j%%j%%j% % . . . ' ; 
 
 
 
         l e t   b a s e 6 4 I m a g e   =   n u l l ; 
 
         c o n s t   f i l e I n p u t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p a r c e l - i m a g e ' ) ; 
 
         i f   ( f i l e I n p u t . f i l e s . l e n g t h   >   0 )   { 
 
                 b a s e 6 4 I m a g e   =   a w a i t   c o m p r e s s I m a g e ( f i l e I n p u t . f i l e s [ 0 ] ) ; 
 
         } 
 
 
 
         c o n s t   d a t a   =   { 
 
                 p i c k u p :   { 
 
                         a d d r e s s :   d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - a d d r ' ) . v a l u e , 
 
                         c o n t a c t N a m e :   d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - n a m e ' ) . v a l u e , 
 
                         c o n t a c t P h o n e :   d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - p h o n e ' ) . v a l u e , 
 
                         l a t :   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - l a t ' ) . v a l u e ) , 
 
                         l n g :   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' p i c k u p - l n g ' ) . v a l u e ) 
 
                 } , 
 
                 d r o p o f f :   { 
 
                         a d d r e s s :   d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - a d d r ' ) . v a l u e , 
 
                         r e c e i v e r N a m e :   d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - n a m e ' ) . v a l u e , 
 
                         r e c e i v e r P h o n e :   d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - p h o n e ' ) . v a l u e , 
 
                         l a t :   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - l a t ' ) . v a l u e ) , 
 
                         l n g :   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' d r o p o f f - l n g ' ) . v a l u e ) 
 
                 } , 
 
                 d e t a i l s :   d o c u m e n t . g e t E l e m e n t B y I d ( ' d e t a i l s ' ) . v a l u e , 
 
                 d i s t a n c e T y p e :   d o c u m e n t . g e t E l e m e n t B y I d ( ' d i s t a n c e - t y p e ' ) . v a l u e , 
 
                 p r i c e :   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' p r i c e ' ) . v a l u e ) , 
 
                 p a r c e l I m a g e :   b a s e 6 4 I m a g e 
 
         } ; 
 
 
 
         t r y   { 
 
                 c o n s t   r e s   =   a w a i t   f e t c h ( ` $ { A P I _ U R L } / a p i / o r d e r s ` ,   { 
 
                         m e t h o d :   ' P O S T ' , 
 
                         h e a d e r s :   {   ' A u t h o r i z a t i o n ' :   ` B e a r e r   $ { l o c a l S t o r a g e . g e t I t e m ( ' t o k e n ' ) } ` ,   ' C o n t e n t - T y p e ' :   ' a p p l i c a t i o n / j s o n '   } , 
 
                         b o d y :   J S O N . s t r i n g i f y ( d a t a ) 
 
                 } ) ; 
 
                 i f   ( r e s . o k )   { 
 
                         S w a l . f i r e ( {   i c o n :   ' s u c c e s s ' ,   t i t l e :   ' j% %   j% % j%V%% j%   j% % j% j% j% !   a"  ' ,   t e x t :   ' j% j% j%%%   j% % j% j% j%   j%c%%   % j% j% j% % . . . ' ,   t i m e r :   3 0 0 0 ,   s h o w C o n f i r m B u t t o n :   f a l s e   } ) ; 
 
                         s e t T i m e o u t ( ( )   = >   w i n d o w . l o c a t i o n . h r e f   =   ' c l i e n t - m y - o r d e r s . h t m l ' ,   3 0 0 0 ) ; 
 
                 }   e l s e   { 
 
                         c o n s t   e r r   =   a w a i t   r e s . j s o n ( ) ; 
 
                         S w a l . f i r e ( {   i c o n :   ' e r r o r ' ,   t e x t :   e r r . m e s s a g e   | |   ' % j%$%%   j% j%%j%%j% %   j% % j%V%% j% '   } ) ; 
 
                         b t n . d i s a b l e d   =   f a l s e ;   b t n . i n n e r H T M L   =   o r i g i n a l H T M L ; 
 
                 } 
 
         }   c a t c h   ( e r r )   { 
 
                 S w a l . f i r e ( {   i c o n :   ' e r r o r ' ,   t e x t :   ' j% j% j%   j% j%V%j%   % %   j% % j% j% j%a%j% %   j% j% % j%%% j%%% j%%'   } ) ; 
 
                 b t n . d i s a b l e d   =   f a l s e ;   b t n . i n n e r H T M L   =   o r i g i n a l H T M L ; 
 
         } 
 
 } 
 
 
 
 / /   N o t i f i c a t i o n   I n i t 
 
 i f   ( u s e r I d   & &   t y p e o f   i n i t N o t i f i c a t i o n S o c k e t   = = =   ' f u n c t i o n ' )   i n i t N o t i f i c a t i o n S o c k e t ( u s e r I d ) ; 
 
 
 
 / /   a"    O f f l i n e   H a n d l i n g 
 
 w i n d o w . a d d E v e n t L i s t e n e r ( ' o n l i n e ' ,   ( )   = >   { 
 
         S w a l . f i r e ( { 
 
                 p o s i t i o n :   ' t o p - e n d ' , 
 
                 i c o n :   ' s u c c e s s ' , 
 
                 t i t l e :   ' j%%j% j%c%  j% % j% % j% j%%% j% !   a"  ' , 
 
                 s h o w C o n f i r m B u t t o n :   f a l s e , 
 
                 t i m e r :   1 5 0 0 , 
 
                 t o a s t :   t r u e 
 
         } ) ; 
 
 } ) ; 
 
 
 
 w i n d o w . a d d E v e n t L i s t e n e r ( ' o f f l i n e ' ,   ( )   = >   { 
 
         S w a l . f i r e ( { 
 
                 p o s i t i o n :   ' t o p - e n d ' , 
 
                 i c o n :   ' w a r n i n g ' , 
 
                 t i t l e :   ' j% % % j%V%j%c%  j% % j% j% j%a%j% %   j% j% % j% % j% j%%% j%     )"U% ' , 
 
                 s h o w C o n f i r m B u t t o n :   f a l s e , 
 
                 t i m e r :   3 0 0 0 , 
 
                 t o a s t :   t r u e 
 
         } ) ; 
 
 } ) ; 
 
 
 
 