PageSourceSearch

https://mmkebabbedminster.co.uk/contact

html mmkebabbedminster.co.uk collected 2026-09-24 11:07:59 UTC 120,023 bytes, 3,296 lines download raw bytes

1
2       
3<!DOCTYPE html>
4<html lang="en" class="wide wow-animation   desktop landscape rd-navbar-static-linked">
5<head>
6 
7  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8  <title>Pizza &amp; Kebab Delivery in Bedminster, Bristol | Order Online  | M&M Kebab Pizza   </title>
9  <meta name="format-detection" content="telephone=no" />
10<meta name="description" content="Order pizza &amp;amp; kebab in Bedminster, Bristol from M&amp;M Kebab Pizza. Fast delivery and collection available.">
11<script type="application/ld+json">
12{"@context":"https://schema.org","@type":"FastFoodRestaurant","name":"M&M Kebab Pizza","url":"https://mmkebabbedminster.co.uk","hasMenu":"https://mmkebabbedminster.co.uk/menu","image":"https://mmkebabbedminster.co.uk/sitelogo/sitelogo.png","telephone":"0117 966 3747","servesCuisine":"Pizza & Kebab","address":{"@type":"PostalAddress","streetAddress":"151 West Street","addressLocality":"Bedminster, Bristol","postalCode":"BS3 3PN","addressCountry":"GB"},"geo":{"@type":"GeoCoordinates","latitude":"51.437130","longitude":"-2.604530"},"openingHoursSpecification":[{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Sunday","opens":"15:00","closes":"00:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Monday","opens":"15:00","closes":"00:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Tuesday","opens":"15:00","closes":"00:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Wednesday","opens":"15:00","closes":"00:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Thursday","opens":"15:00","closes":"00:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Friday","opens":"15:00","closes":"02:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":"https://schema.org/Saturday","opens":"15:00","closes":"02:00"}]}
13</script>
13
14
15
16  <meta name="viewport" content="width=device-width, initial-scale=1">
17  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
18  <meta name="theme-color">
19  <link rel="icon" href="data:;base64,=">
20  <meta charset="utf-8" />
21  <link rel="stylesheet" type="text/css" href="css/style.css" />
22  <link href="css/theme.css?v=5" rel="stylesheet">
23  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,100">
24 
25  <meta name="appleid-signin-client-id" content="com.boostit.appleSignIn">
26  <meta name="appleid-signin-scope" content="name email">
27  <meta name="appleid-signin-redirect-uri" content="https://mmkebabbedminster.co.uk/auth/apple/callback">
28  <meta name="appleid-signin-state" content="origin:web">
29  <meta name="appleid-signin-use-popup" content="true">
30
31  <style>
32
33
34.rowff .col-xs-6{
35width: 50% !important;
36}
37
38.rowff .col-xs-12{
39text-align:center;
40}
41
42    #appleid-signin{
43      width: 235px;
44        height: 50px;
45        text-align: center;
46        display: inline-block;
47
48        width: 235px;
49    height: 51px;
50    text-align: center;
51    display: inline-block;
52    background: black;
53    line-height: 50px;
54    display: -webkit-inline-box;
55    /* margin-top: -10px; */
56    padding: 5px 0px;
57    border-radius: 8px;
58    
59    }
60
61    
62
63    
64    .appleid-signin{
65      width: 235px;
66        height: 50px;
67        text-align: center;
68        display: inline-block;
69
70        width: 235px;
71    height: 51px;
72    text-align: center;
73    display: inline-block;
74    background: black;
75    line-height: 50px;
76    display: -webkit-inline-box;
77    /* margin-top: -10px; */
78    padding: 5px 0px;
79    border-radius: 8px;
80    
81    }
82
83    .appleButton {
84      width: 245px;
85    height: 56px;
86    background: black;
87    border: none;
88    border-radius: 8px;
89    padding: 5px 0;
90    cursor: pointer;
91    display: inline-flex;
92    justify-content: center;
93    align-items: center;
94}
95
96.appleButton img {
97       width: auto;
98    /* height: 58px; */
99    display: block;
100    transform: scale(1.35);
101}
102.s2x1y1{
103  overflow-x: hidden;
104}
105 
106.s2x1y1ios{
107  overflow-x: hidden;
108}
109
110 
111 
112    
113    
114    .social-btn .btn {
115        border: none;
116        margin: 10px 3px 0;
117        opacity: 1;
118        width: 45%;
119        height: 47px;
120        padding: 12px 27px;
121        font-size: 14px;
122        border-radius: 9px;
123    }
124    
125    </style>
126
127</head>
128
129<body>
130
131  <div id="modalArea"></div>
132  <div id="modalArea3"></div>
133 
134 
135  <div class="page">
136    <div class="page-loader" style="background:black;">
137      <div class="page-loader-body">
138        <div class="cssload-container">
139           <img src="/sitelogo/sitelogo.png" style="margin-top:-150px;  ">
140        </div>
141      </div>
142    </div>
143  </div>
144  <header class="page-head">
145    <div class="rd-navbar-wrap rd-navbar-minimal">
146      <nav data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed"
147        data-lg-layout="rd-navbar-static" data-lg-device-layout="rd-navbar-static" data-stick-up-clone="false"
148        data-md-stick-up-offset="100px" data-lg-stick-up-offset="100px" class="rd-navbar">
149        <div class="shell shell-fluid">
150          <div class="rd-navbar-inner">
151            <!-- RD Navbar Panel-->
152            <div class="rd-navbar-panel">
153              <!-- RD Navbar Toggle-->
154              <button data-rd-navbar-toggle=".rd-navbar-nav-wrap" class="rd-navbar-toggle">
155                <span></span>
156              </button>
157              <a href="/menu" class="rd-navbar-brand brand" id="menuhxy">
158                <div class="brand-logo"  > 
159                   <img src="/sitelogo/sitelogo.png" height="90" style="height: 48px;   margin-top: -6px;" class="mainlclass" alt="">
160                </div>
161              </a>
162              <div class=" rd-navbar-brand brand" id="cartdivision" onclick="enableCart();">
163                <div class="shop-cardt">
164                      <!-- <i class="thin-icon-cartShop icon-basket-general"></i> -->
165
166     <svg width="30" height="30" viewBox="0 0 24 24" fill="" stroke="green" stroke-width="2.0" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="margin-right:4px;">
167  <circle cx="9" cy="21" r="1"></circle>
168  <circle cx="20" cy="21" r="1"></circle>
169  <path d="M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.4L23 6H6"></path>
170</svg>
171
172
173 <!-- <svg class="nav-iconx" viewBox="0 0 24 24" aria-hidden="true">
174  <path d="M3 6h18M3 12h18M3 18h18"
175        stroke="currentColor"
176        stroke-width="2.5"
177        stroke-linecap="round"/>
178</svg> -->
179
180
181                    <a id="basketShow" class="basketClass basketxyz" style="display:inline;">0 Items </a>
182                </div>
183              </div> 
184            </div>
185            <div class="rd-navbar-nav-wrap">
186              <ul class="rd-navbar-nav">
187               <li id="menlink">
188  <a href="/menu" class="navbar-iconx">
189    
190<svg class="nav-iconx" viewBox="0 0 24 24" aria-hidden="true">
191  <path d="M6 2v8M9 2v8M6 6h3M7.5 10v12" 
192        stroke="currentColor" 
193        stroke-width="1.8" 
194        stroke-linecap="round"/>
195
196  <path d="M14 2c0 4 4 4 4 8v12" 
197        stroke="currentColor" 
198        stroke-width="1.8" 
199        stroke-linecap="round"/>
200</svg>
201    <span>MENU</span>
202    
203  </a>
204</li>
205               <li>
206 
207
208 
209
210<a href="/checkout" class="navbar-iconx">
211  <span class="checkout-svg-wrap">
212   <svg class="nav-iconx" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
213    <circle cx="9" cy="21" r="1"></circle>
214    <circle cx="20" cy="21" r="1"></circle>
215    <path d="M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.4L23 6H6"></path>
216  </svg>
217  </span>
218  <span class="checkout-text">CHECKOUT</span>
219</a>
220
221  
222</li>
223                
224                <li>
225                  <a class="navbar-icon thin-icon-key" data-toggle="modal" data-target="#loginModal">Login </a>
226                </li>
227                <li>
228                  <a class="navbar-icon thin-icon-layers" data-toggle="modal" data-target="#registerModal">Register </a>
229                </li>
230                
231 
232                 
233                 <li>
234  <a href="/contact" class="navbar-iconx">
235    <span class="checkout-svg-wrap">
236      <svg class="nav-iconx" viewBox="0 0 24 24">
237        <rect x="3" y="5" width="18" height="14" stroke="currentColor" stroke-width="1.8" fill="none"/>
238        <path d="M3 7l9 6 9-6" stroke="currentColor" stroke-width="1.8" fill="none"/>
239      </svg>
240    </span>
241    <span class="checkout-text">Contact</span>
242  </a>
243</li>
244              
245
246 
247                 <li>
248  <a class="navbar-iconx" href="tel:0117 966 3747">
249    <span class="checkout-svg-wrap">
250      <svg class="nav-iconx" viewBox="0 0 24 24">
251        <path d="M22 16.9v3a2 2 0 0 1-2.2 2
252                 19.8 19.8 0 0 1-8.6-3.1
253                 19.5 19.5 0 0 1-6-6
254                 19.8 19.8 0 0 1-3.1-8.7A2 2 0 0 1 4.1 2h3
255                 a2 2 0 0 1 2 1.7c.1.8.3 1.5.6 2.2
256                 a2 2 0 0 1-.5 2.1L8 9
257                 a16 16 0 0 0 6 6l1-1.2
258                 a2 2 0 0 1 2.1-.5c.7.3 1.4.5 2.2.6
259                 a2 2 0 0 1 1.7 2z"
260              stroke="currentColor" stroke-width="1.8" fill="none"/>
261      </svg>
262    </span>
263    <span class="checkout-text">0117 966 3747</span>
264  </a>
265</li>
266                
267                
268                
269              </ul>
270            </div>
271          </div>
272        </div>
273      </nav>
274    </div>
275  </header>
276 
277 
278 
279
280    
281    <style>
282        .select2-selection__rendered {
283            display: none;
284        }
285
286        #mainWrapper {
287            margin-top: 40px;
288        }
289
290        .contactHeader {
291            font-size: 16px;
292            margin-top: 50px !important;
293            padding: 0px 32px 0px 50px;
294        }
295
296        .cheader {
297            font-size: 16px;
298            margin-top: 10px !important;
299            font-weight: 500 !important;
300        }
301
302        input {
303            padding: 0 18px !important;
304        }
305
306        @media (max-width: 767px) {
307            .namec {
308                margin-top: 10px;
309            }
310        }
311
312        body {
313            background: #f4f2ed;
314        }
315
316        .shop-checkout-left {
317            background: #f4f2ed;
318        }
319
320
321        .wrapform {
322            display: inline-block;
323        }
324
325        .callus {
326            color: red;
327            margin: 5px 10px 15px 10px;
328            text-align: center;
329            font-weight: 700;
330        }
331
332        .timeSelect {
333            width: 93%;
334        }
335
336        .inputlabels {
337            width: 94% !important;
338        }
339
340        #messageCustomer {
341            width: 94% !important;
342        }
343    </style>
344    <div class="row" id="mainWrapper">
345        <div class="contactHeader ">
346            <h1 class="cheader"> If you have a problem or question about your order please call the shop</h1>
347           <h1 class="cheader" style="color:red;"> 0117 966 3747   </h1>
348            <br>
349            <!-- <div class="wrapform">
350                <h1 class="cheader text-left" style="margin-top:25px !important;"> <strong> You can alternatively use the form if you have any : </strong>
351                    <li style="margin-top:10px;">payment related questions</li>
352                    <li> website bugs
353                    <li style="margin-bottom:10px;"> ordering recommendations </li>
354                    You can also win free prizes or discounts for bug reports or recommendations.
355                </h1>
356                <h1 class="cheader " style="margin-top:-7px !important; text-align:left; ">We will try to reply your message as soon as possible.</h1>
357            </div> -->
358
359            <br>
360
361        </div>
362         
363        
364                <h4 class="font-default text-center" style="margin-top:40px;">You have to be logged in </h4>
365                <div class="col-xs-12" style="margin-bottom:50px;">
366                    <a class="btn btn-burnt-sienna btn-md btn-shape-circle offset-top-20 addButton" href="#" data-toggle="modal" data-target="#registerModal" style="width: 140px; padding:10px 39px;">Register</a>
367                    <a class="btn btn-burnt-sienna btn-md btn-shape-circle offset-top-20 addButton margin-top:0;" href="#" data-toggle="modal" data-target="#loginModal" style="width: 140px; padding:10px 39px;">Login</a>
368                </div>
369                
370    </div>
371    <!-- End Main -->
372     
373<footer id="footer">
374  <div class="footer-part     text-center"   >
375    <span>
376      <a onclick="window.open('/allergy', '_blank', 'location=no,height=570,width=320,scrollbars=yes,status=yes')" style="color:#fff;">Allergen Information</a>
377    </span>
378      
379    <h6 style="color:red">Open 7 Days A Week</h6>
380 
381    <h6 style="color:white; font-size:16px; font-weight: 400;">Download our applications or use our webpage to place order.</h6>
382<div class="rowff">
383      <div class="col-xs-12"> <a class="btn btn-burnt-sienna btn-md btn-shape-circle offset-top-20 addButton navbar-icon thin-icon-house website" href="/menu">Menu</a> </div><div class="col-xs-6" style="text-align: right;">  <a href="https://play.google.com/store/apps/details?id=com.boost_it.mmbedminster"><img src="https://rookcala.sirv.com/playStore.png"  style="height:43px;"></a></div><div class="col-xs-6" style="text-align: left;">  <a href="https://apps.apple.com/us/app/mm-kebab-bedminster/id6499068367"><img src="https://rookcala.sirv.com/appStore.png"  style="height:43px;"></a></div>  
384</div>
385    <div class="container">
386      <div class="footer-inner">
387        <div class="footer-info">
388          <div class="brand-logo" style="margin-top:10px; margin-bottom:10px;">
389              <img src="/sitelogo/sitelogo.png" height="60px" style="margin-bottom:6px;">
390          </div>
391          <p>151 West Street,Bedminster,BS3 3PN</p>
392          <p>
393            <a href="tel:0117 966 3747" style="font-size:14px;" id="shopTel">0117 966 3747</a>
394          </p>
395        </div>
396      </div>
397      <div class="copy-right">
398        <div class="row">
399          <div class="col-md-12 col-sm-12 col-xs-12  text-center ">
400            <span>
401              <a onclick="window.open('/copyright', '_blank', 'location=no,height=570,width=320,scrollbars=yes,status=yes')">Copyright M&M Kebab Pizza All Rights Reserved.</a>
402            </span>
403            <br>
404            <span>
405              <a onclick="window.open('/terms', '_blank', 'location=no,height=570,width=320,scrollbars=yes,status=yes')" style="color:#fff;">Terms &amp; Conditions</a>
406            </span><br>
407            <span>
408              <a onclick="window.open('/disclaimer', '_blank', 'location=no,height=570,width=320,scrollbars=yes,status=yes')" style="color:#fff;">Service Disclaimer</a>
409            </span>
410          </div>
411        </div>
412      </div>
413    </div>
414  </div>
415  <div id="cookieConsent" style="position: fixed; bottom: 45px; background-color:  #272626; width: 100%; text-align: center; color:#fff;   font-weight: 400; display:none;"> 
416    This website is using cookies for better browsing experience.<button class="cookieConsentOK"  style=" background: #822222; border: none; border-radius: 5px;">I agree.</button>
417    <h>Click here for our  <a href="/terms">Cookie Policy</a></h>
418</div>
419</footer>
420
421  
422    <div class="modal fade " id="popupModal" tabindex="-1" role="dialog" aria-labelledby="popupModal">
423  <div class="modal-dialog modal-sm popupxx" role="dialog">
424    <div class="modal-content" style="margin-top: 5%;  overflow: hidden;">
425      <div class="modal-body modal-bodyxx popupbodyxx" style="background:white;">
426        <button type="button" class="close_new2x" data-dismiss="modal" aria-label="Close" style="top: 10px;">  × </button>
427        <div class="table-title" style="margin-bottom: 0px; margin-top:8px;">
428          <h2 class="cartclass">Shopping Cart </h2>
429
430          <div class="cartwrap">  
431         <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="green" stroke-width="2.0" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="margin-right:4px;">
432  <circle cx="9" cy="21" r="1"></circle>
433  <circle cx="20" cy="21" r="1"></circle>
434  <path d="M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.4L23 6H6"></path>
435</svg>
436          <p id="basketShow2"   class="basketxyz"> </p>
437        </div>
438        </div>
439        <div class="cart-wdrap" id="cart-blogs" style="margin-top:10px;">
440          <div class="cart-blog row " id="cartPopUp" >
441            <div class="cart-btn  col-xs-12" style=" margin-bottom: 20px;  width:100%;">
442              <!-- <a href="javascript:;" onclick="clearCarts();" class="btn-black cartMainButtons"  >Clear Cart</a> -->
443
444
445      
446  <a href="/checkout"  class="btn-main cartMainButtons"> CHECK OUT  <span class="arrow">➜</span></a> 
447
448
449            </div>
450              <div class="cartpopupitems popupxyz" id="cartPopUpx"></div>
451            </div>
452        </div>
453      </div>
454    </div>
455  </div>
456</div>
457
458 
459 
460<div class="modal fade " id="optionmodal" tabindex="-1" role="dialog" aria-labelledby="optionmodal" style="z-index: 99999999999 !important;">
461  <div class="modal-dialog modal-sm" role="dialog">
462    <div class="modal-content" style="margin-top: 5%; padding:46px; background:transparent; border:none;">
463      <div class="modal-body" style="background:white; margin-top: 3px !important;">
464        <div class="cart-wdrap" id="optionsmenu">
465        </div>
466      </div>
467    </div>
468  </div>
469</div>
470
471<div class="modal fade " id="loginModal" tabindex="-1" role="dialog" aria-labelledby="loginModal">
472  <div class="modal-dialog modal-sm loginModalx" role="dialog">
473    <div class="modal-content modal-contentx" style="margin-top: 30%;">
474      <div class="modal-body modal-bodyx modal-logx" style=" padding: 2px 3px 3px 3px;">
475        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
476        <div class="table-title">
477          <h2 class="headersLog">Login</h2>
478          <h6 class="heade-xs btn lpassword" onclick="lostPassword();" style="color:red; margin-bottom: -15px;" id="lostPasswordOpen">Lost your password ? Click Here</h6>
479        </div>
480        <form class="form" id="loginForms">
481          <div class="row" id="loginForm">
482
483
484           <div class="col-md-12 col-sm-12 col-xs-12" style="position:relative;">
485
486  <span class="icony">
487    <svg viewBox="0 0 24 24">
488      <rect x="3" y="5" width="18" height="14"></rect>
489      <path d="M3 7l9 6 9-6"></path>
490    </svg>
491  </span>
492
493  <input type="text"
494         name="username"
495         placeholder="Your E-Mail"
496         class="input-fields with-icon"
497         id="username2"
498         style="text-transform: lowercase;">
499
500</div>
501
502
503      <div class="col-md-12 col-sm-12 col-xs-12" style="position:relative;">
504
505  <!-- LOCK ICON -->
506  <span class="icony">
507    <svg viewBox="0 0 24 24">
508      <rect x="5" y="11" width="14" height="9"></rect>
509      <path d="M8 11V8a4 4 0 0 1 8 0v3"></path>
510    </svg>
511  </span>
512
513  <!-- INPUT -->
514  <input type="text"
515         name="search"
516         placeholder="Password"
517         class="input-fields with-icon passfield"
518         id="password2"
519         onfocus="this.type='password'"
520         autocorrect="off"
521         autocapitalize="none">
522
523  <!-- EYE ICON -->
524  <span class="eye-toggle" onclick="togglePasswordField(this)">
525    <svg viewBox="0 0 24 24">
526      <path d="M1 12s4-6 11-6 11 6 11 6-4 6-11 6-11-6-11-6z"/>
527      <circle cx="12" cy="12" r="3"/>
528    </svg>
529  </span>
530
531</div>
532
533
534
535            
536            <div class="or-left"></div><div class="or-right"></div>
537            <div class="col-md-12 col-sm-12 col-xs-12" style="margin-top:8px;">
538              <input type="submit" name="submit" class="btn-main submitButtons" value="Login" style=" width:100%; margin-bottom:18px;" id="loginButton1">
539            </div>
540
541            <div class="or-seperatorx1" style="  margin: 16px 20px 0 20px !important; font-size:14px;"><i>New Customer? </i></div>
542      
543    
544            <div class="col-xs-12  "  >
545                  <a class="btn  registerB" href="#"  style="font-size:16px; margin-bottom:4px;" onclick="regModal();">  Register</a>
546            </div>
547
548            
549            <div class="col-md-12 col-sm-12 col-xs-12" id="socialLoginsx">
550            <div class="or-seperator" style="margin-top:14px !important;"><i>or</i></div>
551            <p class="text-center xxc" style="height:27px !important;">Login with your social media account</p>
552            <div class="text-center social-btn">
553              <div class="fb-login-button" data-width="" data-size="large" data-button-type="continue_with" data-layout="default" data-auto-logout-link="false" data-use-continue-as="false"></div>
554
555              
556             <div id="appleid-signin" data-color="black" data-border="true" data-type="sign in"></div>
557              
557<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
557 
558              
559
560                <a href="/auth/facebook" class="btn btn-primary"><i class="fa fa-facebook"></i>&nbsp; Facebook</a>
561                <a href="/auth/google" class="btn btn-danger"><i class="fa fa-google-plus"></i>&nbsp; Google</a>
562            </div>
563
564            <h1 class="terms" style="margin-top:10px;"> By logging via social platforms you accept the  <a onclick="termsconditions();">terms &amp; conditions</a></h1>
565    
566          </div>
567          
568          <!--  -->
569          </div>
570        </form>
571      </div>
572    </div>
573  </div>
574</div>
575
576<div class="modal fade " id="fgModal" tabindex="-1" role="dialog" aria-labelledby="fgModal">
577  <div class="modal-dialog modal-sm modal-dialogx" role="dialog">
578    <div class="modal-content modal-contentx" style="margin-top: 30%;">
579      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
580        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
581        <form class="form" id="sendForgottenForm">
582          <h2 class="heade-xs2">Please enter your email and follow the instructions</h2>
583
584          <div id="lostPassword">
585
586            <div class="col-md-12 col-sm-12 col-xs-12">
587              <span class="icony">
588    <svg viewBox="0 0 24 24">
589      <rect x="3" y="5" width="18" height="14"></rect>
590      <path d="M3 7l9 6 9-6"></path>
591    </svg>
592  </span> 
593  
594  
595  <input type="text" name="email" placeholder="Your E-Mail" class="input-fields" id="forgetEmail">
596            </div>
597
598
599            <div class="col-md-12 col-sm-12 col-xs-12">
600              <input type="submit" name="submit" class="btn-main submitButtons" value="Send Reset Link" style="width:100%;" id="resetlinkbutton">
601            </div>
602        </form>
603        <form class="form" id="changefpassword">
604          <div class="col-md-12 col-sm-12 col-xs-12">
605            <h2 class="headersLogx">Enter the code sent to you by email or follow the link in the email to change your password</h2>
606          </div>
607          <div class="col-md-12 col-sm-12 col-xs-12">
608                     <span class="icony">
609    <svg viewBox="0 0 24 24">
610      <rect x="3" y="5" width="18" height="14"></rect>
611      <path d="M3 7l9 6 9-6"></path>
612    </svg>
613  </span> <input type="text" name="email" placeholder="Your E-Mail" class="input-fields" id="forgetEmailxx" required>
614          </div>
615          <div class="col-md-12 col-sm-12 col-xs-12">
616            
617           <span class="icony">
618  <svg viewBox="0 0 24 24">
619    <path d="M10 3L8 21"></path>
620    <path d="M16 3L14 21"></path>
621    <path d="M4 9h17"></path>
622    <path d="M3 15h17"></path>
623  </svg>
624</span>
625            
626            <input type="text" name="number" placeholder="Reset Code" class="input-fields" id="resetcode" required>
627          </div>
628          <div class="col-md-12 col-sm-12 col-xs-12">
629
630
631              <span class="icony">
632    <svg viewBox="0 0 24 24">
633      <rect x="5" y="11" width="14" height="9"></rect>
634      <path d="M8 11V8a4 4 0 0 1 8 0v3"></path>
635    </svg>
636  </span>
637            
638            <input type="text" name="search" placeholder="Password" class="input-fields passfield" id="password1xx" onfocus="this.type='password'" autocorrect="off" autocapitalize="none" required> 
639            
640              <span class="eye-toggle" onclick="togglePasswordField(this)">
641    <svg viewBox="0 0 24 24">
642      <path d="M1 12s4-6 11-6 11 6 11 6-4 6-11 6-11-6-11-6z"/>
643      <circle cx="12" cy="12" r="3"/>
644    </svg>
645  </span>
646          </div>
647          <div class="col-md-12 col-sm-12 col-xs-12">
648             <span class="icony">
649    <svg viewBox="0 0 24 24">
650      <rect x="5" y="11" width="14" height="9"></rect>
651      <path d="M8 11V8a4 4 0 0 1 8 0v3"></path>
652    </svg>
653  </span>
654            
655            
656            <input type="text" name="search" placeholder="Confirm Password" class="input-fields passfield" id="verifypassword1xx" onfocus="this.type='password'" autocorrect="off" autocapitalize="none" required> 
657            
658             <span class="eye-toggle" onclick="togglePasswordField(this)">
659    <svg viewBox="0 0 24 24">
660      <path d="M1 12s4-6 11-6 11 6 11 6-4 6-11 6-11-6-11-6z"/>
661      <circle cx="12" cy="12" r="3"/>
662    </svg>
663  </span>
664
665          </div>
666          <div class="col-md-12 col-sm-12 col-xs-12" style="padding-bottom:20px;">
667            <input type="submit" name="submit" class="btn-main submitButtons" value="Change Password" style="width:100%;" onclik="changefpassword();">
668          </div>
669        </form>
670      </div>
671    </div>
672  </div>
673</div>
674</div>
675
676<div class="modal fade" id="appAlert" tabindex="-1" role="dialog" aria-labelledby="appAlert">
677  <div class="modal-dialog modal-sm" role="dialog">
678    <div class="modal-content" style="background: transparent; border: none;">
679      <div class="modal-body" style="padding: 4px;">
680        <div class="yes-no" style="min-height: 130px;">
681          <h2 class="coolal-title" id="appAlertTitle"></h2>
682          <p class="coolal-text" id="appAlertText"></p>
683
684          <div id="appAlertFooter" class="coolal-btnWrapper">
685            <a href="javascript:;" class="coolal-yes" data-dismiss="modal">OK</a>
686          </div>
687        </div>
688      </div>
689    </div>
690  </div>
691</div>
692
693 
694<div class="modal fade " id="iosAlert" tabindex="-1" role="dialog" aria-labelledby="iosAlert"> 
695  <div class="modal-dialog modal-sm" role="dialog">
696    <div class="modal-content" style="background: transparent; border:none;">
697      <div class="modal-body" style=" padding: 2px 3px 3px 3px;  ">
698        <div id="coolal" class="yes-no" style="height: 154px; opacity: 1; top: 0px;">
699          <h2 class="coolal-title"id="titlex1"></h2>
700          <p class="coolal-text" id="textx1">
701          </p>
702          <div id="coolal-btnWrapper" data-dismiss="modal" aria-label="Close"><a id="coolal-btn" class="coolal-yes-no coolal-yes" href="#" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close">OK</a> </div>
703        </div>
704      </div>
705    </div>
706  </div>
707</div>
708
709<div class="modal fade " id="iosAlertx" tabindex="-1" role="dialog" aria-labelledby="iosAlertx">
710  <div class="modal-dialog modal-sm modal-dialogx" role="dialog">
711    <div class="modal-content modal-contentx" style="background: transparent;">
712      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
713        <div id="coolal" class="yes-no" style="height: 135px; opacity: 1; top: 0px;  height: max-content !important;">
714          <h2 class="coolal-title" id="titlex"></h2>
715          <p class="coolal-text" id="textx"></p>
716          <div id="coolal-btnWrapperx">
717            
718          </div>
719        </div>
720      </div>
721    </div>
722  </div>
723</div>
724
725      
726
727
728<div class="modal fade " id="telephoneModal" tabindex="-1" role="dialog" aria-labelledby="telephoneModal">
729  <div class="modal-dialog modal-sm modal-dialogx profileModalxx" role="dialog">
730    <div class="modal-content modal-contentx contentxx">
731      <div class="modal-body modal-bodyx modal-telx" style=" padding: 2px 3px 3px 3px;">
732        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
733        <form id="telephoneForm">
734          <div class="row">
735
736      
737
738            <div class="col-md-12 col-sm-12 table-titlex">
739              <h6 class="heade-xs2" id="profilxtel">Please update your phone number and name in case we need to contact you regarding to your order</h6>
740              <h6 class="heade-xs2" id="telxtel" style="display:none;">Update your phone number</h6>
741            </div>
742
743            
744 
745
746
747            <div class="col-md-12 col-sm-12 col-xs-12" id="telephoneModalName">
748               <label for="contactName3x" class="field-label">Name</label>
749              <i class="fa fa-icon-name1 icon-classes-general"></i> <input type="text" name="contactName3x" placeholder="Name" class="input-fields" id="contactName3x" required>
750              </div>
751              <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:30px;">
752                 <label for="telephone3x" class="field-label">Telephone</label>
753                <i class="fa fa-icon-telephone1 icon-classes-general"></i> 
754              <input type="tel" name="number3x" placeholder="Telephone (e.g. 07761 111111)" class="input-fields" id="telephone3x"  inputmode="tel" required >
755              </div>
756              <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:15px; margin-top:5px;">
757                <input type="submit" name="submit" class="btn-main submitButtons" value="Save Changes" style="width:100%;"   required>
758                <span class="validity"></span>
759              </div>
760            </div>
761          
762        </form>
763      </div>
764      </div>
765    </div>
766  </div>
767 
768
769 
770 
771
772<div class="modal fade " id="passChangeModal" tabindex="-1" role="dialog" aria-labelledby="passChangeModal">
773  <div class="modal-dialog modal-sm modal-dialogx" role="dialog">
774    <div class="modal-content modal-contentx">
775      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
776        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
777        <div class="table-title">
778          <h6 class="heade-xs2">Change your password</h6>
779        </div>
780        <form id="changePassForm">
781          <div class="row">
782            <div class="col-md-12 col-sm-12 col-xs-12">
783              <div class="col-md-12 col-sm-12 col-xs-12">
784                <label for="password3x" class="form-label form-label-outside chpassword">New Password </label>
785                <input id="password3x" type="search" name="password" required pattern=".{5,30}" title="Min 5, Max 30 Characters" class="form-control"  autocomplete="off" onfocus="this.type='password'" autocorrect="off" autocapitalize="none">
786              </div>
787              <div class="col-md-12 col-sm-12 col-xs-12">
788                <label for="retypex" class="form-label form-label-outside chpassword">Re-Type New Password </label>
789                <input id="retypex" type="search" name="password" required pattern=".{5,30}" title="Min 5, Max 30 Characters" class="form-control" onfocus="this.type='password'" autocorrect="off" autocapitalize="none">
790              </div>
791              <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:25px; margin-top:20px;">
792                <input type="submit" name="submit" class="btn-main submitButtons" value="Change Password" style="width:100%;" id="changesPassword" required>
793                <span class="validity"></span>
794              </div>
795            </div>
796          </div>
797        </form>
798      </div>
799    </div>
800  </div>
801</div>
802 
803
804<div class="modal fade " id="aboutUs" tabindex="-1" role="dialog" aria-labelledby="aboutUs">
805  <div class="modal-dialog modal-sm modal-dialogx" role="dialog">
806    <div class="modal-content modal-contentx">
807      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
808        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
809        <div class="table-title">
810          <h6 class="heade-xs2"></h6>
811          <h6 class="heade-xs2">If you have any questions or inqueries please contact us.</h6>
812        </div>
813        <div class="row">
814          <div class="col-md-12 col-sm-12 col-xs-12">
815            <h6 class="heade-xs23">Opening Days</h6>
816            <h6 class="heade-xs24" id="openingDays"> </h6>
817          </div>
818          <div class="col-md-12 col-sm-12 col-xs-12">
819            <h6 class="heade-xs23">Phone</h6>
820            <h6 class="heade-xs24" id="phoneShop">
821              <li class="navbar-icon thin-icon-phonenav"></li> <a class="telclaz" href="callto:0117 966 3747 ">
822                0117 966 3747
823              </a>
824            </h6>
825          </div>
826          <div class="col-md-12 col-sm-12 col-xs-12">
827            <h6 class="heade-xs23">Address</h6>
828            <h6 class="heade-xs24" id="shopAddressx"> </h6>
829          </div>
830          <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:20px;">
831            <h6 class="heade-xs23">Promotions</h6>
832            <h6 class="heade-xs24" id="promotions"> </h6>
833          </div>
834        </div>
835      </div>
836    </div>
837  </div>
838</div>
839
840<div class="modal fade " id="addressModal" tabindex="-1" role="dialog" aria-labelledby="addressModal">
841  <div class="modal-dialog modal-sm modal-dialogx profileModalxx" role="dialog">
842    <div class="modal-content modal-contentx contentxx">
843      <div class="modal-body modal-bodyx modal-telx" style=" padding: 2px 3px 3px 3px;">
844        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
845        <form id="addressForm3x">
846          <div class="row">
847            <div class="col-md-12 col-sm-12 table-titlex">
848              <h6 class="heade-xs2">Please update your address and postcode for delivery</h6>
849            </div>
850             
851            <div class="col-md-12 col-sm-12 col-xs-12">
852              <i class="fa fa-icon-name1 icon-classes-general"></i> <input type="text" name="contactName2x" placeholder="Name" class="input-fields" id="contactName2x" required>
853              </div>
854              <div class="col-md-12 col-sm-12 col-xs-12">
855                <i class="fa fa-icon-telephone1 icon-classes-general"></i>
856
857<input
858  type="tel"
859  name="number2x"
860  placeholder="Telephone (e.g. 07761 111111)"
861  class="input-fields"
862  id="telephone2x"
863  inputmode="tel"
864  required
865>
866              </div>
867              <div class="row" style="margin:0;" id="postcodeUpdate">
868              <div class="col-md-12 col-sm-12 col-xs-12">
869                <i class="fa fa-icon-address1 icon-classes-general"></i> <input type="text" name="address2x" placeholder="Address" class="input-fields" id="address2x" title="Between 2 -55 charachters" pattern=".{2,75}" required  oninvalid="this.setCustomValidity('Between 2-55 charachters')"
870                onchange="try{setCustomValidity('')}catch(e){}">
871              </div>
872              
873              <div class="col-md-12 col-sm-12 col-xs-12"  >
874                <i class="fa fa-icon-postcode1 icon-classes-general"></i> <input type="text" name="postcode2x" placeholder="Postcode" class="input-fields" id="postcode2x" required   oninvalid="this.setCustomValidity('Use a valid postcode')"
875                onchange="try{setCustomValidity('')}catch(e){}">
876              </div>
877              </div>
878              <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:15px; margin-top:5px;">
879                <input type="submit" name="submit" class="btn-main submitButtons" value="Save Changes" style="width:100%;" required>
880                <span class="validity"></span>
881              </div>
882          
883          </div>
884        </form>
885      </div>
886    </div>
887  </div>
888</div>
889
890
891<div class="modal fade " id="profileModal" tabindex="-1" role="dialog" aria-labelledby="profileModal">
892  <div class="modal-dialog modal-sm modal-dialogx profileModalxx" role="dialog">
893    <div class="modal-content modal-contentx contentxx">
894      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
895        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
896        <div class="table-title">
897          <h6 class="heade-xs2">View or change your details</h6>
898          <h6 class="heade-xs2 " style="display:none;" id="addressWarning">Your delivery address seems incomplete. Please add your house/flat number or house name, then save your details.
899</h6>
900          <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:8px;" id="deleteAccountDiv">
901            <input type="submit" name="submit" class="btn-main submitButtons" value="Delete my Account"   id="deleteAccount" onclick="deleteAccount();">
902            <span class="validity"></span>
903          </div>
904          <h6 class="heade-xs2" id="email-xs2">Please use a valid email address if you would like to get order notifications</h6>
905        </div>
906   <form id="myProfileForm">
907    <input type="hidden" id="profileAddressConfirmed" value="no">
908  <div class="row">
909    <div class="col-md-12 col-sm-12 col-xs-12">
910
911     <!-- NAME -->
912<div class="col-md-12 col-sm-12 col-xs-12" id="profileModalName">
913  <label for="name1x" class="field-label">Name</label>
914
915  <span class="iconx">
916    <svg viewBox="0 0 24 24">
917      <circle cx="12" cy="8" r="4"></circle>
918      <path d="M4 20c0-4 4-6 8-6s8 2 8 6"></path>
919    </svg>
920  </span>
921
922  <input type="text" name="name" placeholder="Name"
923         class="input-fields with-icon" id="name1x" required>
924</div>
925
926<!-- EMAIL -->
927<div class="col-md-12 col-sm-12 col-xs-12" id="profileModalEmail">
928  <label for="email1x" class="field-label">Email</label>
929
930  <span class="iconx">
931    <svg viewBox="0 0 24 24">
932      <rect x="3" y="5" width="18" height="14"></rect>
933      <path d="M3 7l9 6 9-6"></path>
934    </svg>
935  </span>
936
937  <input type="email" name="emails"
938         placeholder="Your E-Mail ( [email protected] )"
939         class="input-fields with-icon" id="email1x" required>
940</div>
941
942<!-- TELEPHONE -->
943<div class="col-md-12 col-sm-12 col-xs-12" id="profileModalTelephone">
944  <label for="telephone1x" class="field-label">Telephone</label>
945
946  <span class="iconx">
947    <svg viewBox="0 0 24 24">
948    <path d="M22 16.9v3a2 2 0 0 1-2.2 2
949                 19.8 19.8 0 0 1-8.6-3.1
950                 19.5 19.5 0 0 1-6-6
951                 19.8 19.8 0 0 1-3.1-8.7A2 2 0 0 1 4.1 2h3
952                 a2 2 0 0 1 2 1.7c.1.8.3 1.5.6 2.2
953                 a2 2 0 0 1-.5 2.1L8 9
954                 a16 16 0 0 0 6 6l1-1.2
955                 a2 2 0 0 1 2.1-.5c.7.3 1.4.5 2.2.6
956                 a2 2 0 0 1 1.7 2z"></path>
957    </svg>
958  </span>
959
960<input
961  type="tel"
962  name="number"
963  placeholder="Telephone (e.g. 07761 111111)"
964  class="input-fields with-icon"
965  id="telephone1x"
966  inputmode="tel"
967  required
968>
969</div>
970
971<!-- ADDRESS + POSTCODE -->
972<div class="row" style="margin:0;" id="postcodeUpdate2">
973
974  <!-- ADDRESS -->
975  <div class="col-md-12 col-sm-12 col-xs-12">
976    <label for="address1x" class="field-label">Address</label>
977
978    <span class="iconx">
979      <svg viewBox="0 0 24 24">
980        <path d="M12 21s6-5.5 6-10a6 6 0 0 0-12 0c0 4.5 6 10 6 10z"></path>
981        <circle cx="12" cy="11" r="2"></circle>
982      </svg>
983    </span>
984
985    <input type="text" name="address"
986           placeholder="Address"
987           class="input-fields with-icon"
988           id="address1x"
989           pattern=".{2,85}" required>
990  </div>
991
992  <!-- POSTCODE -->
993  <div class="col-md-12 col-sm-12 col-xs-12">
994    <label for="postcode1x" class="field-label">Postcode</label>
995
996    <span class="iconx">
997       <svg viewBox="0 0 24 24">
998    <path d="M10 3L8 21"></path>
999    <path d="M16 3L14 21"></path>
1000    <path d="M4 9h17"></path>
1001    <path d="M3 15h17"></path>
1002  </svg>
1003    </span>
1004
1005    <input type="text" name="postcode"
1006           placeholder="Postcode"
1007           class="input-fields with-icon"
1008           id="postcode1x" required>
1009  </div>
1010
1011</div>
1012
1013      <!-- EMAIL NOTIFICATIONS SWITCH (unchanged) -->
1014      <div class="col-md-12 col-sm-12 col-xs-12" style=" margin-top:15px;" id="profileModalNotifications">
1015        <label class="form-switch switchlabel">
1016          <input type="checkbox" id="emailswitch">
1017          <i></i>
1018          Email Notifications
1019        </label>
1020      </div>
1021
1022      <!-- SAVE BUTTON (unchanged) -->
1023      <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:15px;" id="saveChangesMyProfile">
1024        <input type="submit"
1025               name="submit"
1026               class="btn-main submitButtons"
1027               value="Save Changes"
1028               style="width:100%;"
1029               id="saveChanges"
1030               required>
1031        <span class="validity"></span>
1032      </div>
1033
1034    </div>
1035  </div>
1036</form>
1037
1038      </div>
1039    </div>
1040  </div>
1041</div>
1042
1043<div class="modal fade " id="contactModalx" tabindex="-1" role="dialog" aria-labelledby="contactModalx">
1044  <div class="modal-dialog modal-sm modal-dialogx" role="dialog">
1045    <div class="modal-content modal-contentx">
1046      <div class="modal-body modal-bodyx">
1047        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
1048        <div class="table-title" style="padding:35px;">
1049          <h6 class="heade-xs2" style="font-size:18px;">If you have a problem or question about your order please call the shop</h6> 
1050          <h6 class="heade-xs2" style="font-size:20px; color:red;"> 0117 966 3747 </h6>
1051 
1052        </div>
1053        <!-- <form id="contactForms">
1054          <div class="row">
1055            <div class="col-md-12 col-sm-12 col-xs-12">
1056              <h5 class="formInputsx">About*</h5> 
1057            </div>
1058            <div class="col-md-12 col-sm-12 col-xs-12">
1059              <i class="fa fa-icon-arrow-right icon-classes-general" style="top: 14px;"></i>
1060              <select class="timeSelectx input-fields" id="contactTitle" name="subject"  required>
1061              </select>
1062            </div>
1063            <div class="col-md-12 col-sm-12 col-xs-12">
1064              <i class="fa fa-icon-name1 icon-classes-general"></i> <input type="text" name="contactName" placeholder="Name" class="input-fields" id="contactName" required>
1065            </div>
1066            <div class="col-md-12 col-sm-12 col-xs-12">
1067              <i class="fa fa-icon-mailLog icon-classes-general"></i> <input type="email" name="email" placeholder="Your E-Mail ( [email protected])" class="input-fields" id="contactEmail" required>
1068            </div>
1069            <div class="col-md-12 col-sm-12 col-xs-12">
1070              <i class="fa fa-icon-telephone1 icon-classes-general"></i> <input type="tel" name="phone" placeholder="Telephone Ex(:0776 111 11 11)" class="input-fields" id="contactTelephone">
1071            </div>
1072            <div class="col-md-12 col-sm-12 col-xs-12" style="margin-top:10px;">
1073              <textarea placeholder="Your Message" id="messageCustomerx" name="message" required></textarea>
1074            </div>
1075            <div class="col-md-12 col-sm-12 col-xs-12" style="margin:16px 0;">
1076              <input type="submit" name="submit" class="btn-main submitButtons" value="Submit Message" style="width:100%;" id="saveChanges" required>
1077              <span class="validity"></span>
1078            </div>
1079            <input type="text" placeholder="Phone" name="address" class="inputlabels" value="" id="csAddress" style="display:none;" readonly>
1080            <input type="text" placeholder="Phone" name="postcode" class="inputlabels" value="" id="csPostcode" style="display:none;" readonly>
1081          </div>
1082        </form> -->
1083      </div>
1084    </div>
1085  </div>
1086</div>
1087
1088<div class="modal fade " id="messageModal" tabindex="-1" role="dialog" aria-labelledby="messageModal">
1089  <div class="modal-dialog modal-sm" role="dialog">
1090    <div class="modal-content" style="margin-top: 5%; max-width: 470px; overflow: hidden;">
1091      <div class="modal-body" style="background:white;">
1092        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
1093        <div class="table-title" style="margin-bottom: 0px;">
1094          <div id="situation"></div>
1095          <div id="yourMessage"> </div>
1096          <div id="shopReply"></div>
1097          <div id="generic"></div>
1098        </div>
1099      </div>
1100    </div>
1101  </div>
1102</div>
1103
1104<div class="modal fade " id="termsModal" tabindex="-1" role="dialog" aria-labelledby="termsModal">
1105  <div class="modal-dialog modal-sm registerModalx termModalx" role="dialog">
1106    <div class="modal-content modal-contentx term-contentx">
1107      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
1108        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
1109        <div class="table-title">
1110          <h2 class="termsHeader" id="termheader"> </h2>
1111        </div>
1112          <div class="row" id="termsModalBody">
1113          </div>
1114      </div>
1115    </div>
1116  </div>
1117</div>
1118
1119
1120  
1121
1122<div class="modal fade " id="registerModal" tabindex="-1" role="dialog" aria-labelledby="registerModal">
1123  <div class="modal-dialog modal-sm registerModalx" role="dialog">
1124    <div class="modal-content modal-contentx">
1125      <div class="modal-body modal-bodyx" style=" padding: 2px 3px 3px 3px;">
1126        <button type="button" class="close_new fa fa-close" data-dismiss="modal" aria-label="Close"> </button>
1127        <div class="table-title">
1128          <h2 class="headersLog">Register</h2>
1129          <h6 class="heade-xs">Use a valid email and telephone number</h6>
1130        </div>
1131        <form id="registerForm">
1132          <div class="row">
1133              <div class="col-md-12 col-sm-12 col-xs-12">
1134                 <label for="name1" class="field-label">Name</label>
1135              <span class="iconr">
1136    <svg viewBox="0 0 24 24">
1137      <rect x="3" y="5" width="18" height="14"></rect>
1138      <path d="M3 7l9 6 9-6"></path>
1139    </svg>
1140  </span> <input type="text" name="name" placeholder="Name" class="input-fields" id="name1" required>
1141              </div>
1142
1143              <div class="col-md-12 col-sm-12 col-xs-12">
1144                 <label for="email1" class="field-label">Email</label>
1145               <span class="iconr">
1146    <svg viewBox="0 0 24 24">
1147      <rect x="3" y="5" width="18" height="14"></rect>
1148      <path d="M3 7l9 6 9-6"></path>
1149    </svg>
1150  </span><input type="email" name="emails" placeholder="Your E-Mail ( [email protected])" class="input-fields" id="email1" required>
1151              </div>
1152              <div class="col-md-12 col-sm-12 col-xs-12">
1153                 <label for="telephone1" class="field-label">Telephone</label>
1154
1155 <span class="iconr">  
1156                 <svg viewBox="0 0 24 24">
1157        <path d="M22 16.9v3a2 2 0 0 1-2.2 2
1158                 19.8 19.8 0 0 1-8.6-3.1
1159                 19.5 19.5 0 0 1-6-6
1160                 19.8 19.8 0 0 1-3.1-8.7A2 2 0 0 1 4.1 2h3
1161                 a2 2 0 0 1 2 1.7c.1.8.3 1.5.6 2.2
1162                 a2 2 0 0 1-.5 2.1L8 9
1163                 a16 16 0 0 0 6 6l1-1.2
1164                 a2 2 0 0 1 2.1-.5c.7.3 1.4.5 2.2.6
1165                 a2 2 0 0 1 1.7 2z"  ></path>
1166      </svg>
1167</span>
1168                
1169                
1170                
1171                <input type="tel" name="number" placeholder="Telephone Ex(:0776 111 11 11)" class="input-fields" id="telephone1"    required>
1172              </div>
1173              <div class="col-md-12 col-sm-12 col-xs-12">
1174    <label for="address1" class="field-label">Address</label>
1175    <i class="fa fa-icon-address1 icon-classes-general"></i> <input type="text" name="address" placeholder="Address" class="input-fields" id="address1" title="Between 2 -35 charachters" minlength="2" maxlength="35">
1176  </div>
1177  <div class="col-md-12 col-sm-12 col-xs-12">
1178    <label for="postcode1" class="field-label">Postcode</label>
1179    <i class="fa fa-icon-postcode1 icon-classes-general"></i> <input type="text" name="postcode" placeholder="Postcode" class="input-fields" id="postcode1">
1180  </div> 
1181              <div class="col-md-12 col-sm-12 col-xs-12">
1182                 <label for="password1" class="field-label">Password</label>
1183
1184
1185                <span class="iconr">
1186    <svg viewBox="0 0 24 24">
1187      <rect x="5" y="11" width="14" height="9"></rect>
1188      <path d="M8 11V8a4 4 0 0 1 8 0v3"></path>
1189    </svg>
1190  </span>
1191                
1192                <input type="text" name="search" placeholder="password" class="input-fields passfield" id="password1" onfocus="this.type='password'" autocorrect="off" autocapitalize="none" required> <span class="eye-toggler" onclick="togglePasswordField(this)">
1193    <svg viewBox="0 0 24 24">
1194      <path d="M1 12s4-6 11-6 11 6 11 6-4 6-11 6-11-6-11-6z"></path>
1195      <circle cx="12" cy="12" r="3"></circle>
1196    </svg>
1197  </span>
1198              </div>
1199              <div class="col-md-12 col-sm-12 col-xs-12" style="margin-bottom:27px;">
1200                 <label for="verifypassword1" class="field-label">Re-type Password</label>
1201              
1202     <span class="iconr">
1203    <svg viewBox="0 0 24 24">
1204      <rect x="5" y="11" width="14" height="9"></rect>
1205      <path d="M8 11V8a4 4 0 0 1 8 0v3"></path>
1206    </svg>
1207  </span>
1208  <input type="text" name="search" placeholder="confirm password" class="input-fields passfield" id="verifypassword1" onfocus="this.type='password'" autocorrect="off" autocapitalize="none" required> <span class="eye-toggler" onclick="togglePasswordField(this)">
1209    <svg viewBox="0 0 24 24">
1210      <path d="M1 12s4-6 11-6 11 6 11 6-4 6-11 6-11-6-11-6z"></path>
1211      <circle cx="12" cy="12" r="3"></circle>
1212    </svg>
1213  </span>
1214              </div>
1215              <div class="col-md-12 col-sm-12 col-xs-12"  >
1216                <input type="submit" name="submit" class="btn-main submitButtons" value="Register Now" style="width:100%;" id="registerButton" required>
1217                <span class="validity"></span>
1218              </div>
1219
1220              <div class="col-md-12 col-sm-12 col-xs-12" id="privacy">
1221              <!-- <h1 class="terms"> By registering you accept the <a onclick="window.open('/terms', '_blank', 'location=no,height=570,width=320,scrollbars=yes,status=yes')">terms &amp; conditions</a></h1> -->
1222                <h1 class="terms"> By registering you accept the  <a onclick="termsconditions();">terms &amp; conditions</a></h1></h1>
1223              </div>
1224          </div>
1225        </form>
1226      </div>
1227    </div>
1228  </div>
1229</div>
1230
1231
1232 
1233<!-- End Register -->
1234
1235  <div class="bottomAndroidFix" style="    background-color: black;
1236display: -webkit-flex;
1237display: flex;
1238position: fixed;
1239left: 0;
1240/* top: 0; */
1241right: 0;
1242padding: 4px 0px;
1243height: 56px;
1244color: #2b2c2f;
1245z-index: 999;
1246bottom: 4%; display:none; " id="bottomAndroidFix">
1247
1248    <div class="row" style="margin-left:-7px;">
1249      <div class="col-xs-3 mycolxs3"><button class="btn btn-success btn-menu" onclick="location.href='/apphome?ios=android';">Home</button> </div>
1250      <div class="col-xs-3 mycolxs3"><button class="btn btn-success btn-menu" onclick="location.href='/menu?ios=android';">Menu</button> </div>
1251      <div class="col-xs-3 mycolxs3"><button class="btn btn-success btn-menu" onclick="location.href='/checkout?ios=android';">Checkout</button></div>
1252      <div class="col-xs-3 mycolxs3"> <button class="btn btn-success btn-menu" onclick="location.href='/myprofile?ios=android';">Orders</button></div>
1253    </div>
1254  </div>
1255
1256
1257
1258  
1258<script src="https://cdn.trackjs.com/agent/v3/latest/t.js"></script>
1258
1259  
1259<script>
1260
1261    var ete = 0;
1262    window.TrackJS && TrackJS.install({
1263      token: "b611dee257d8438a80caa0c4dc74fa7d",
1264      application: "my-app-prod"
1265    });
1266  </script>
1266
1267
1268  
1268<script src="js/utils/core.min.js"></script>
1268
1269  
1269<script src="js/utils/scripts.js"></script>
1269
1270
1271
1272  <a href="#" class="top-arrow"></a>
1273
1274  
1274<script>
1275
1276    window.addEventListener('load', function () {
1277      try {
1278
1279  window.TrackJS && TrackJS.addMetadata("userx", "none");
1280
1281
1282  } catch (e) {
1283        // swallow – never let this kill the page
1284        console.log('TrackJS/init error', e);
1285      }
1286    });
1287
1288    function checkCookieConsent() {
1289      try {
1290        if (window.sessionStorage && sessionStorage.getItem('999') !== 'Cookies Ok') {
1291          $("#cookieConsent").show();
1292        }
1293      } catch (e) {
1294        // Storage not available – safest is just show banner and move on
1295        $("#cookieConsent").show();
1296      }
1297    }
1298
1299    function regModal() {
1300      $('#loginModal').modal('hide');
1301      $('#registerModal').modal('show');
1302    }
1303
1304    function ajaxHandler(typeA, urlA, sendData, callback) {
1305      $.ajax({
1306        type: typeA,
1307        url: urlA,
1308        data: sendData,
1309        error: function (response) { endEvent(); callback(response); },
1310        success: function (response) { },
1311        complete: function (response) { callback(response); }
1312      });
1313    }
1314
1315    $("#loginButton1x").click(function (e) {
1316      stopForm(e);
1317      var sendUrl = "/logMeIn2"; var sendData = {};
1318      sendData.username = ($("#username2y").val()).toLowerCase().trim();
1319      sendData.password = $("#passworda3y").val();
1320      ajaxHandler("POST", sendUrl, sendData, function (response) {
1321        if (response.responseText == "ACCESS") { window.location.reload(); }
1322        else if (response.responseText == "Password or Username is Wrong") { endEvent(); alertUser("Your password or email is wrong. Please try again or use forget password link."); }
1323        else { endEvent(); alertUser("There has been a problem. Please try again later."); }
1324      });
1325    });
1326
1327    $("#loginForms").submit(function (e) {
1328      stopForm(e);
1329      var sendUrl = "/logMeIn2"; var sendData = {};
1330      sendData.username = ($("#username2").val()).toLowerCase().trim();
1331      sendData.password = $("#password2").val();
1332      ajaxHandler("POST", sendUrl, sendData, function (response) {
1333        if (response.responseText == "ACCESS") { window.location.reload(); }
1334        else if (response.responseText == "Password or Username is Wrong") { endEvent(); alertUser("Your password or email is wrong. Please try again or use forget password link."); }
1335        else { endEvent(); alertUser("There has been a problem. Please try again later."); }
1336      });
1337    });
1338
1339    $(".icon-classes-generalx").click(function (e) {
1340      var pinput = $(this).parent().find('.passfield');
1341      //var pinput= $(this).next().find('.passfield');
1342      if ($(pinput).attr('type') == "password") {
1343        $(pinput).attr('type', 'text');
1344      }
1345      else {
1346        $(pinput).attr('type', 'password');
1347      }
1348    });
1349
1350    function appAlert(options) {
1351 
1352
1353  $('#appAlertTitle').text(options.title || '');
1354  $('#appAlertText').text(options.text || '');
1355
1356  var footerHtml = '';
1357
1358  if (options.buttons && options.buttons.length) {
1359    options.buttons.forEach(function (btn, i) {
1360      footerHtml += `
1361        <a href="javascript:;" 
1362           class="${btn.class || 'coolal-yes'}"
1363           data-btn-index="${i}">
1364           ${btn.text}
1365        </a>
1366      `;
1367    });
1368  } else {
1369    footerHtml = `<a href="javascript:;" class="coolal-yes" data-dismiss="modal">OK</a>`;
1370  }
1371
1372  $('#appAlertFooter').html(footerHtml);
1373
1374  // Attach actions
1375  $('#appAlertFooter a').off('click').on('click', function () {
1376    var index = $(this).data('btn-index');
1377    var btn = options.buttons && options.buttons[index];
1378
1379    $('#appAlert').modal('hide');
1380
1381    if (btn && typeof btn.action === 'function') {
1382      setTimeout(btn.action, 150);
1383    }
1384  });
1385
1386  $('#appAlert').modal('show');
1387}
1388
1389
1390  function deleteAccount() {
1391  appAlert({
1392    title: 'Delete Account',
1393    text: 'Are you sure you would like to proceed?',
1394    buttons: [
1395      {
1396        text: 'Cancel',
1397        class: 'coolal-nox'
1398      },
1399      {
1400        text: 'Remove',
1401        class: 'coolal-yesx',
1402        action: function () {
1403          deleteAccountx();
1404        }
1405      }
1406    ]
1407  });
1408}
1409
1410    function deleteAccountx() {
1411      var sendUrl = "/deleteAccount"; var sendData = {};
1412      //$('#iosAlertx').modal('hide');
1413
1414      ajaxHandler("GET", sendUrl, "", function (response) {
1415        if (response.responseText == "error") { alertUser("An error occured. Please try again."); }
1416
1417        else if (response.responseText == "neworder") {
1418          alertUser("You have recently placed an order, you can not delete your account until you have a live order. Wait until it is completed by the shop. Thanks");
1419          return;
1420        }
1421        else {
1422          alertUser("Your account has been deleted however we have to keep some data for legal requirements related to your account for a certain period time. We would like to remind you that we do not share, sell or use your data for any purposes with any 3rd party.");
1423          setTimeout(function () {
1424            window.location.reload();
1425          }, 3000);
1426        }
1427      });
1428    }
1429    $("#contactForms").submit(function (e) {
1430      stopForm(e);
1431      var fields = $(this).serializeArray();
1432      var sendUrl = "/contact";
1433      ajaxHandler("POST", sendUrl, fields, function (response) {
1434        if (response.responseText == "Sent") { $('#mainWrapper').html("<h1 style='font-size:16px; padding:80px; 35px; height:500px;'>Your message has been sent.We aim to reply you within 24 hours.If it is an urgent issue please call shop. </h1>"); alertIos("Sent", "Your message has been successfully sent. Check your email or here for replies."); $('#contactModalx').modal('hide'); endEvent(); }
1435        else if (response.responseText == "Too Early") { alertUser("You have sent a message recently. You can only send one message in every 5 minutes"); endEvent(); }
1436        else { endEvent(); alertUser("There has been a problem. Please try again later."); }
1437      });
1438    });
1439
1440    $("#formPasswordReset").submit(function (e) {
1441      stopForm(e);
1442      var sendData = {};
1443      var sendUrl = '/resetPassword';
1444      sendData.password = $("#password3").val();
1445      sendData.verifypassword = $("#retype").val();
1446      sendData.username = $("#userEmail").val();
1447      sendData.token = $("#token").val();
1448      if (sendData.password != sendData.verifypassword) {
1449        $("#ajaxMessage3").text("Passwords do not match").fadeIn("slow").delay(1500).fadeOut("slow");
1450        document.getElementById("retype").style.background = "red";
1451        endEvent();
1452        return;
1453      }
1454      ajaxHandler("POST", sendUrl, sendData, function (response) {
1455        if (response.responseText == "success") { window.location.href = "/"; }
1456        else if (response.responseText == "Expired") { alertUser("Your Token Has Been Expired, Please demand a new one."); }
1457        else { alertUser("An error occured please try again;"); }
1458        endEvent();
1459      });
1460    });
1461
1462    $("#sendForgottenForm").submit(function (e) {
1463      stopForm(e);
1464      var sendData = {}; sendData.email = $("#forgetEmail").val().toLowerCase();
1465      var sendUrl = "/forgetPassword";
1466      ajaxHandler("POST", sendUrl, sendData, function (response) {
1467        if (response.responseText == "successfull") {
1468          $("#forgotPass2").html("Please check your email for further instructions. Also check your spam folder.").show().css('color', 'green');
1469          $('#resetlinkbutton').val("Email Sent").css('background', 'green');
1470          alertUser("<h1 style='margin-bottom:-70px;'>Success</h1> <h2 style='color:green; font-size: 20px; padding: 0 25px;'>Password reset email is sent to the registered email address. Please check your email for instructions. Please also check your spam folder as well</h2>");
1471        }
1472        else {
1473          alertUser("The email you entered  does not exist or you need to wait 6 minutes between each email request");
1474          $('#resetlinkbutton').val("Send Reset Link").css('background', '#DC4C46');
1475          endEvent(e);
1476        }
1477      });
1478    });
1479
1480    function checkEmail(emailValue) {
1481      var sendUrl = "/checkEmail";
1482      var sendData = {}; sendData.email = emailValue;
1483      ajaxHandler("POST", sendUrl, sendData, function (response) {
1484        if (response.responseText == 'exist') { alertUser("This email is used before,use a different one"); }
1485      });
1486    }
1487
1488    function isSuspiciousAddress(address, postcode) {
1489  if (!address) return true;
1490
1491  var cleanAddr = address.trim().toUpperCase();
1492  var cleanPc = (postcode || "")
1493    .trim()
1494    .toUpperCase()
1495    .replace(/\s+/g, "");
1496
1497  var compactAddr = cleanAddr.replace(/\s+/g, "");
1498  var hasDigit = /\d/.test(cleanAddr);
1499  var containsPostcode =
1500    cleanPc && compactAddr.indexOf(cleanPc) !== -1;
1501
1502  return !hasDigit || containsPostcode;
1503}
1504
1505
1506
1507    function sendRegisterAjax(data) {
1508      var sendUrl = "/register";
1509      ajaxHandler("POST", sendUrl, data, function (response) {
1510        if (response.status == 429) {
1511          alertNow("You have created too many accounts from this ip, please try again after an hour", endEvent);
1512          return;
1513        }
1514
1515        if (response.responseText == 'success') {
1516          alertNow("You have successfully registered", function () {
1517            window.location.reload();
1518          });
1519        }
1520        else if (response.responseText == "Email used before") {
1521          alertNow("Your email is registered before. Please use forget password link or try different email.", endEvent);
1522        }
1523        else {
1524          alertNow("There has been a problem. Please try again later.", endEvent);
1525        }
1526      });
1527    }
1528
1529    function validateProfilePostcodeAndAddressThenUpdate(data) {
1530      var rawPostcode = (data.postcode || "").trim();
1531
1532      if (!rawPostcode) {
1533        alertUser("Please enter your postcode");
1534        endEvent();
1535        return;
1536      }
1537
1538      var roughPattern = /^[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}$/i;
1539      if (!roughPattern.test(rawPostcode)) {
1540        alertUser("Your postcode doesn't look right. Please check it.");
1541        endEvent();
1542        return;
1543      }
1544
1545      var url = "https://api.postcodes.io/postcodes/" + encodeURIComponent(rawPostcode);
1546
1547      $.ajax({
1548        url: url,
1549        method: "GET",
1550        dataType: "json",
1551        timeout: 7000
1552      })
1553
1554        // ---------- 200 OK ----------
1555        .done(function (resp, status, xhr) {
1556          if (resp && resp.status === 200 && resp.result && resp.result.postcode) {
1557            var formattedPc = resp.result.postcode;
1558            data.postcode = formattedPc;
1559            $('#postcode1x').val(formattedPc);
1560
1561            if (data.addressConfirmed) {
1562              $('#addressConfirmed').val("1");
1563              sendProfileUpdateAjax(data);
1564              return;
1565            }
1566
1567            if (isSuspiciousAddress(data.address, formattedPc)) {
1568              var typedAddr = data.address || "";
1569   fetchAddressSuggestionsFromServer(formattedPc, typedAddr, function (suggestions) {
1570  showAddressIssueModal(
1571    "YOUR ADDRESS IS INCOMPLETE.\n\n" +
1572    "We cannot deliver your order without a house/flat number or house name and postcode.\n\n" +
1573    "Please select your complete address below or press Edit address.",
1574
1575    suggestions,
1576
1577    function onPick(addr) {
1578
1579      const parts = addr.split(',').map(p => p.trim());
1580      const shortAddress = parts.slice(0, 2).join(', ');
1581
1582      $('#address1x').val(shortAddress);
1583      $('#profileAddressConfirmed').val('yes');
1584
1585      data.address = shortAddress;
1586      data.addressConfirmed = true;
1587
1588      sendProfileUpdateAjax(data);
1589    },
1590
1591    null, // Do not allow an incomplete address to be used
1592
1593    function onEdit() {
1594      $('#address1x').focus();
1595      endEvent();
1596    }
1597  );
1598});
1599            } else {
1600              sendProfileUpdateAjax(data);
1601            }
1602            return;
1603          }
1604          sendProfileUpdateAjax(data);
1605        })
1606
1607        // ---------- FAIL (404 / 0 / others) ----------
1608        .fail(function (xhr, status, error) {
1609          if (xhr.status === 404) {
1610            var typedPc = rawPostcode;
1611            var typedAddr = data.address || "";
1612
1613            fetchAddressSuggestionsFromServer(typedPc, typedAddr, function (suggestions) {
1614              showAddressIssueModal(
1615                "We couldn't find this postcode.\n\n" +
1616                "Please pick a suggested address below or edit your address.",
1617                suggestions,
1618            function onPick(addr) {
1619  const parts = addr.split(',').map(p => p.trim());
1620  const shortAddress = parts.slice(0, 2).join(', ');
1621
1622  $('#address1x').val(shortAddress);
1623  $('#profileAddressConfirmed').val('yes');
1624
1625  data.address = shortAddress;
1626  data.addressConfirmed = true;
1627
1628  sendProfileUpdateAjax(data);
1629},
1630                function onUseTyped() {
1631                  $('#profileAddressConfirmed').val('yes');
1632                  data.addressConfirmed = true;
1633                  sendProfileUpdateAjax(data);
1634                },
1635                function onEdit() {
1636                  $('#address1x').focus();
1637                  endEvent();
1638                }
1639              );
1640            });
1641            return;
1642          }
1643
1644          // 0 – network
1645          if (xhr.status === 0) {
1646            if (isSuspiciousAddress(data.address, data.postcode) && !data.addressConfirmed) {
1647              showAddressIssueModal(
1648                "This address looks incomplete (e.g. missing house/flat number).\n\n" +
1649                "Please edit or continue with what you typed.",
1650                [],
1651                function onPick() {
1652                  sendProfileUpdateAjax(data);
1653                },
1654                function onUseTyped() {
1655                  $('#profileAddressConfirmed').val('yes');
1656                  data.addressConfirmed = true;
1657                  sendProfileUpdateAjax(data);
1658                },
1659                function onEdit() {
1660                  $('#address1x').focus();
1661                  endEvent();
1662                }
1663              );
1664            } else {
1665              sendProfileUpdateAjax(data);
1666            }
1667            return;
1668          }
1669          sendProfileUpdateAjax(data);
1670        });
1671    }
1672
1673//profile update
1674    function sendProfileUpdateAjax(data) {
1675      var sendUrl = "/updateInformation";
1676      ajaxHandler("POST", sendUrl, data, function (response) {
1677        if (response.responseText == "Email Same") {
1678          alertUser("Your email  is registered before. Please use forget password link or try  different email.");
1679          endEvent();
1680          return;
1681        }
1682        else if (response.responseText == "error") {
1683          endEvent();
1684          alertUser("There has been a problem. Please try again later.");
1685          return;
1686        }
1687        try {
1688          var y = response.responseJSON;
1689          $('#getDistance').val(y.distance);
1690          $('#profileModal').modal('hide');
1691          alertIos("Success", "You have updated your information");
1692          updateC(data);
1693          endEvent();
1694          return;
1695        } catch (e) {
1696          endEvent();
1697          alertUser("There has been a problem. Please try again later.");
1698          return;
1699        }
1700      });
1701    }
1702
1703     
1704    $('#address1x, #postcode1x').on('input', function () {
1705      $('#profileAddressConfirmed').val('no');
1706    });
1707
1708    function getValidTelephone(inputSelector) {
1709
1710      console.log("input selector",inputSelector);
1711  var telephone = ($(inputSelector).val() || '').trim();
1712
1713  // Remove spaces, brackets, dots and hyphens
1714  telephone = telephone.replace(/[\s().-]/g, '');
1715
1716  // Convert 00 international prefix into +
1717  if (telephone.indexOf('00') === 0) {
1718    telephone = '+' + telephone.substring(2);
1719  }
1720
1721  // Convert UK +44 into leading 0
1722  if (telephone.indexOf('+44') === 0) {
1723    telephone = '0' + telephone.substring(3);
1724  }
1725
1726  var validUkNumber = /^0\d{10}$/.test(telephone);
1727  var validInternationalNumber =
1728    /^\+[1-9]\d{7,14}$/.test(telephone);
1729
1730  if (!validUkNumber && !validInternationalNumber) {
1731    alertUser(
1732      'Please enter an 11-digit UK number (e.g. 07761111111), or an international number including the country code (e.g. +447761111111).'
1733    );
1734
1735    $(inputSelector).focus();
1736    endEvent();
1737
1738    return false;
1739  }
1740
1741  return telephone;
1742}
1743
1744    $("#myProfileForm").submit(function (e) {
1745      stopForm(e);
1746      var data = {};
1747      data.name = $('#name1x').val();
1748      data.email = ($('#email1x').val() || "").toLowerCase();
1749      data.address = $('#address1x').val();
1750      data.postcode = $('#postcode1x').val();
1751      data.telephone = getValidTelephone('#telephone1x');
1752if (!data.telephone) {
1753  endEvent();
1754  return;
1755}
1756      data.addressConfirmed = ($('#profileAddressConfirmed').val() === 'yes');
1757
1758      if (!data.address || data.address.length < 2) {
1759        alertUser("Your address should have more than  2 characters");
1760        endEvent();
1761        return;
1762      }
1763      if (!data.postcode || data.postcode.length < 4) {
1764        alertUser("Your postcode should have more than  4 characters");
1765        endEvent();
1766        return;
1767      }
1768      var emailMe = $('#emailswitch').prop("checked");
1769      data.emailOrder = emailMe ? 1 : 0;
1770      validateProfilePostcodeAndAddressThenUpdate(data);
1771    });
1772
1773    function validatePostcodeAndAddressThenRegister(data) {
1774
1775      console.log("test");
1776      var rawPostcode = (data.postcode || "").trim();
1777      if (!rawPostcode) {
1778        alertNow("Please enter your postcode", endEvent);
1779        return;
1780      }
1781      var roughPattern = /^[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}$/i;
1782      if (!roughPattern.test(rawPostcode)) {
1783        alertNow("Your postcode doesn't look right. Please check it.", endEvent);
1784        return;
1785      }
1786
1787      var url = "https://api.postcodes.io/postcodes/" + encodeURIComponent(rawPostcode);
1788      $.ajax({
1789        url: url,
1790        method: "GET",
1791        dataType: "json",
1792        timeout: 5000
1793      })
1794        .done(function (resp, status, xhr) {
1795          if (resp && resp.status === 200 && resp.result && resp.result.postcode) {
1796            var formattedPc = resp.result.postcode;
1797            data.postcode = formattedPc;
1798            $('#postcode1').val(formattedPc);
1799            if (data.addressConfirmed) {
1800              sendRegisterAjax(data);
1801              return;
1802            }
1803            if (isSuspiciousAddress(data.address, formattedPc)) {
1804              var typedAddr = data.address || "";
1805              fetchAddressSuggestionsFromServer(formattedPc, typedAddr, function (suggestions) {
1806                showAddressIssueModal(
1807                  "This address looks incomplete (e.g. missing house/flat number).\n\n" +
1808                  "Please pick one of the suggestions below or edit your address.",
1809                  suggestions,
1810                  function onPick(addr) {
1811
1812                        const parts = addr.split(',').map(p => p.trim());
1813      const shortAddress = parts.slice(0, 2).join(', ');
1814                    $('#address1').val(shortAddress);
1815                    data.address = shortAddress;
1816                    sendRegisterAjax(data);
1817                  },
1818                  function onUseTyped() {
1819                    sendRegisterAjax(data);
1820                  },
1821                  function onEdit() {
1822                    $('#address1').focus();
1823                    endEvent();
1824                  }
1825                );
1826              });
1827            } else {
1828              sendRegisterAjax(data);
1829            }
1830            return;
1831          }
1832          sendRegisterAjax(data);
1833        })
1834
1835        .fail(function (xhr, status, error) {
1836          if (xhr.status === 404) {
1837            var typedPc = rawPostcode;
1838            var typedAddr = data.address || "";
1839
1840            fetchAddressSuggestionsFromServer(typedPc, typedAddr, function (suggestions) {
1841              showAddressIssueModal(
1842                "We couldn't find this postcode.\n\n" +
1843                "Please pick a suggested address below or edit your address.",
1844                suggestions,
1845                function onPick(addr) {
1846
1847                   const parts = addr.split(',').map(p => p.trim());
1848      const shortAddress = parts.slice(0, 2).join(', ');
1849
1850
1851                  $('#address1').val(shortAddress);
1852                  data.address = shortAddress;
1853                  sendRegisterAjax(data);
1854                },
1855                function onUseTyped() {
1856                  sendRegisterAjax(data);
1857                },
1858                function onEdit() {
1859                  $('#address1').focus();
1860                  endEvent();
1861                }
1862              );
1863            });
1864            return;
1865          }
1866
1867          if (xhr.status === 0) {
1868            if (isSuspiciousAddress(data.address, data.postcode)) {
1869              showAddressIssueModal(
1870                "This address looks incomplete (e.g. missing house/flat number).\n\n" +
1871                "Please edit or continue with what you typed.",
1872                [],
1873                function onPick() {
1874                  sendRegisterAjax(data);
1875                },
1876                function onUseTyped() {
1877                  sendRegisterAjax(data);
1878                },
1879                function onEdit() {
1880                  $('#address1').focus();
1881                  endEvent();
1882                }
1883              );
1884            } else {
1885              sendRegisterAjax(data);
1886            }
1887            return;
1888          }
1889          sendRegisterAjax(data);
1890        });
1891    }
1892function togglePasswordField(el) {
1893  var input = $(el).siblings('input').first();
1894
1895  if (!input.length) return;
1896
1897  if (input.attr('type') === 'password') {
1898    input.attr('type', 'text');
1899  } else {
1900    input.attr('type', 'password');
1901  }
1902}
1903    function fetchAddressSuggestionsFromServer(postcode, typedAddress, cb) {
1904      $.getJSON('/address-suggestions', {
1905        postcode: postcode,
1906        address: typedAddress
1907      })
1908        .done(function (res) {
1909          if (res && Array.isArray(res.suggestions)) {
1910            cb(res.suggestions);
1911          } else {
1912            cb([]);
1913          }
1914        })
1915        .fail(function (xhr, status, error) {
1916          cb([]);
1917        });
1918    }
1919
1920    $("#registerForm").submit(function (e) {
1921      stopForm(e);
1922
1923      var data = {};
1924      data.name = $('#name1').val();
1925      data.username = ($('#email1').val() || "").toLowerCase();
1926      data.password = $('#password1').val();
1927      data.verifypassword = $('#verifypassword1').val();
1928      data.address = $('#address1').val();
1929      data.postcode = $('#postcode1').val();
1930      
1931      data.telephone = getValidTelephone('#telephone1');
1932if (!data.telephone) {
1933  endEvent();
1934  return;
1935}
1936
1937$('#telephone1').val(data.telephone);
1938
1939
1940
1941      if (data.password.length < 5) {
1942        alertNow("Your password can not be lower than 5 characters", endEvent);
1943        return;
1944      }
1945
1946      if (data.password != data.verifypassword) {
1947        alertNow("Passwords don't match", endEvent);
1948        return;
1949      }
1950
1951      if (!data.address || data.address.length < 2) {
1952        alertNow("Your address should have more than 2 characters", endEvent);
1953        return;
1954      }
1955      validatePostcodeAndAddressThenRegister(data);
1956    });
1957
1958    function updateC(data) {
1959      $('#customerName').val(data.name);
1960      $('#emailCustomer').val(data.email);
1961      $('#telCustomer').val(data.telephone);
1962      $('#addressCustomer').val(data.address);
1963      $('#postcodeCustomer').val(data.postcode);
1964    }
1965
1966$("#telephoneModal").submit(function (e) {
1967  stopForm(e);
1968
1969  var data = {};
1970
1971  data.telephone = ($('#telephone3x').val() || '').trim();
1972  data.name = $('#contactName3x').val();
1973
1974   data.telephone = getValidTelephone('#telephone3x');
1975
1976if (!data.telephone) {
1977  endEvent();
1978  return;
1979}
1980
1981  var sendUrl = "/updatePhone";
1982
1983  ajaxHandler("POST", sendUrl, data, function (response) {
1984    if (response.responseText == 'Success') {
1985      $('#telephoneModal').modal('hide');
1986      alertUser("You have updated your information");
1987
1988      // Uses the cleaned number
1989      $('#telCustomer').val(data.telephone);
1990
1991      endEvent();
1992      return;
1993    }
1994
1995    endEvent();
1996    alertUser("There has been a problem. Please try again later.");
1997  });
1998});
1999
2000    $("#addressModal").submit(function (e) {
2001      
2002      stopForm(e);
2003      var data = {};
2004      data.telephone = $('#telephone2x').val();
2005      data.name = $('#contactName2x').val();
2006      data.address = $('#address2x').val();
2007      data.postcode = $('#postcode2x').val();
2008      if (data.address == "" || (data.address).length < 2) { alertUser("Your address should have more than  2 characters"); endEvent(); return; }
2009      if (data.postcode == "" || (data.postcode).length < 4) { alertUser("Your postcode should have more than  4 characters"); endEvent(); return; }
2010
2011data.telephone = getValidTelephone('#telephone2x');
2012
2013if (!data.telephone) {
2014  endEvent();
2015  return;
2016}
2017
2018      var sendUrl = "/updateAddress";
2019      ajaxHandler("POST", sendUrl, data, function (response) {
2020
2021        if (response.responseText == 'error') {
2022          endEvent(); alertUser("There has been a problem. Please try again later."); return;
2023        }
2024        else {
2025          try { var y = response.responseJSON; } catch (e) { endEvent(); alertUser("There has been a problem. Please try again later."); return; }
2026          $('#addressModal').modal('hide'); alertUser("You have updated your information");
2027          $('#addressCustomer').val(data.address);
2028          $('#postcodeCustomer').val(data.postcode);
2029          $('#telCustomer').val(data.telephone);
2030          if (y.distance != "not found") {
2031            $('#getDistance').val(y.distance);
2032          }
2033          else {
2034            alert("Your postcode could not be found. Please make sure you enter a correct UK postcode");
2035          }
2036          endEvent(); return;
2037        }
2038      });
2039    });
2040
2041    $("#changePassForm").submit(function (e) {
2042      stopForm(e);
2043      var data = {};
2044      data.password = $('#password3x').val();
2045      data.verifypassword = $('#retypex').val();
2046      if (data.password.length < 5) { alertUser("Your password can not be lower than 5 characters"); endEvent(); return; }
2047      if (data.password != data.verifypassword) { alertUser("Passwords don't match"); endEvent(); return; }
2048      var sendUrl = "/passwordChange";
2049      ajaxHandler("POST", sendUrl, data, function (response) {
2050        if (response.responseText == 'Successfully Updated') { alertUser("You have successfully updated your password"); endEvent(); $('#passChangeModal').modal('hide'); return; }
2051        else { endEvent(); alertUser("There has been a problem. Please try again later."); }
2052      });
2053    });
2054
2055    $("#changefpassword").submit(function (e) {
2056      stopForm(e);
2057      var data = {};
2058      data.password = $('#password1xx').val();
2059      data.verifypassword = $('#verifypassword1xx').val();
2060      data.reset = $('#resetcode').val();
2061      data.username = $('#forgetEmailxx').val().toLowerCase();
2062      if (data.password.length < 5) { alertUser("Your password can not be lower than 5 characters"); endEvent(); return; }
2063      if (data.password != data.verifypassword) { alertUser("Passwords don't match"); endEvent(); return; }
2064      var sendUrl = "/resetPasswordCode";
2065      ajaxHandler("POST", sendUrl, data, function (response) {
2066        if (response.responseText == 'success') { window.location.reload(); }
2067        else if (response.responseText == "Expired") {
2068          endEvent(); alertIos("Expired", "Your reset code expired. Please visit send reset link again");
2069          return;
2070        }
2071        else {
2072          endEvent(); alertIos("Unsuccessfull", "Please check the reset code or email address and try again.");
2073          return;
2074        }
2075      });
2076    });
2077
2078    function triggerIosCheckout() {
2079      try { window.webkit.messageHandlers["scriptHandler"].postMessage("go checkout"); } catch (e) { window.location.href = "/xx12"; }
2080      $('#popupModal').modal('hide');
2081    }
2082
2083    function alertIos(title, text) {
2084      $('#titlex1').text(title);
2085      $('#textx1').text(text);
2086      $('#iosAlert').modal('show');
2087    }
2088
2089    function alertIosx(title, text, footer) {
2090      $('#titlex').text(title);
2091      $('#textx').text(text);
2092      $('#coolal-btnWrapperx').html(footer);
2093      $('#iosAlertx').modal('show');
2094    }
2095
2096
2097    function iosFbLog() {
2098      try { window.webkit.messageHandlers["scriptHandler"].postMessage("fblog"); } catch (e) { }
2099    }
2100
2101    function iosGLog() {
2102      try { window.webkit.messageHandlers["scriptHandler"].postMessage("glog"); } catch (e) { }
2103    }
2104
2105    function iosAsign() {
2106      try { window.webkit.messageHandlers["scriptHandler"].postMessage("asign"); } catch (e) { }
2107    }
2108
2109
2110    function appleSign(sign) {
2111      var sendUrl = '/auth/apple/callback?id_token=' + sign.id_token;
2112      ajaxHandler("GET", sendUrl, "data", function (response) {
2113        if (response.responseText == "access") {
2114          window.location.reload();
2115        }
2116        else {
2117          alertUser("There has been a problem, please try again or use a different login method");
2118        }
2119      });
2120    }
2121
2122    function faSign(sign) { faSignF(sign.access_token); }
2123    function faSignG(sign) { faSignF(sign); }
2124
2125    function faSignF(sign) {
2126      var sendUrl = '/fsign?access_token=' + sign;
2127      ajaxHandler("GET", sendUrl, "", function (response) {
2128        if (response.responseText == "access") {
2129          window.location.reload();
2130        }
2131        else {
2132          alertUser("There has been a problem, please try again or use a different login method");
2133        }
2134      });
2135    }
2136
2137    function ggSign(sign) { gSignG(sign); }
2138    function gaSign(sign) { gSignG(sign.id_token); }
2139
2140    function ffmessage(messagex) {
2141      var sendUrl = '/ffmessage?id_token=' + messagex;
2142      ajaxHandler("GET", sendUrl, "data", function (response) {
2143        if (response.responseText == "error") {
2144          alertUser("There has been a problem, please try again or use a different login method");
2145        }
2146      });
2147    }
2148
2149    function gSignG(sign) {
2150      var sendUrl = '/gsign?id_token=' + sign;
2151      ajaxHandler("GET", sendUrl, "data", function (response) {
2152        if (response.responseText == "access") {
2153          try { window.webkit.messageHandlers["scriptHandler"].postMessage("refresh"); } catch (e) { window.location.reload(); }
2154        }
2155        else {
2156          alertUser("There has been a problem, please try again or use a different login method");
2157        }
2158      });
2159    }
2160
2161    document.addEventListener('AppleIDSignInOnSuccess', (event) => {
2162
2163    //       console.log("APPLE SUCCESS EVENT", event);
2164
2165    // alert(
2166    //     "APPLE SUCCESS EVENT\n\n" +
2167    //     "Has code: " +
2168    //     !!event?.detail?.authorization?.code
2169    // );
2170
2171      var sendUrl = '/auth/apple/callback?code=' + event.detail.authorization.code;
2172      ajaxHandler("GET", sendUrl, "", function (response) {
2173        if (response.responseText == "access") {
2174          window.location.reload();
2175        }
2176        else {
2177          alertUser("There has been a problem, please try again or use a different login method");
2178          endEvent();
2179        }
2180      });
2181    });
2182
2183//     document.addEventListener("click", function (event) {
2184//     if (event.target.closest("#appleid-signin")) {
2185//         alert(
2186//     "APPLE BUTTON COUNT:" +document.querySelectorAll("#appleid-signin").length
2187// );
2188//     }
2189// });
2190
2191      function startAppleLogin() {
2192        
2193    var btn = document.querySelector("#appleid-signin");
2194
2195    if (btn) {
2196        btn.click();
2197    }
2198}
2199
2200//  document.addEventListener("AppleIDSignInOnSuccess", function (event) {
2201//     alert(
2202//         "APPLE SUCCESS EVENT\n\n" +
2203//         JSON.stringify(event.detail, null, 2)
2204//     );
2205
2206//     if (
2207//         !event.detail ||
2208//         !event.detail.authorization ||
2209//         !event.detail.authorization.code
2210//     ) {
2211//         alert("Apple success event fired, but no code was returned.");
2212//         return;
2213//     }
2214
2215//     var sendUrl =
2216//         "/auth/apple/callback?code=" +
2217//         encodeURIComponent(event.detail.authorization.code);
2218
2219//     ajaxHandler("GET", sendUrl, "", function (response) {
2220//         alert(
2221//             "APPLE AJAX FINISHED\n\n" +
2222//             "Status: " + response.status + "\n" +
2223//             "ReadyState: " + response.readyState + "\n" +
2224//             "Response: " + response.responseText
2225//         );
2226
2227//         if (response.responseText === "access") {
2228//             window.location.reload();
2229//         } else {
2230//             alertUser(
2231//                 "There has been a problem, please try again or use a different login method"
2232//             );
2233//             endEvent();
2234//         }
2235//     });
2236// });
2237
2238// document.addEventListener("AppleIDSignInOnFailure", function (event) {
2239//     alert(
2240//         "APPLE FAILURE EVENT\n\n" +
2241//         JSON.stringify(event.detail, null, 2)
2242//     );
2243// });
2244
2245// (function watchAppleSignIn() {
2246//     var timer = setInterval(function () {
2247//         if (
2248//             window.AppleID &&
2249//             AppleID.auth &&
2250//             typeof AppleID.auth.signIn === "function" &&
2251//             !AppleID.auth.signIn.__watched
2252//         ) {
2253//             clearInterval(timer);
2254
2255//             var originalAppleSignIn = AppleID.auth.signIn.bind(AppleID.auth);
2256
2257//             function watchedAppleSignIn() {
2258//                 alert(
2259//                     "APPLE SIGN-IN CALLED\n\n" +
2260//                     "Time: " + new Date().toISOString() + "\n\n" +
2261//                     "Stack:\n" + new Error().stack
2262//                 );
2263
2264//                 return originalAppleSignIn.apply(null, arguments);
2265//             }
2266
2267//             watchedAppleSignIn.__watched = true;
2268//             AppleID.auth.signIn = watchedAppleSignIn;
2269//         }
2270//     }, 100);
2271// })();
2272
2273// document.addEventListener("click", function (event) {
2274//     var appleButton = event.target.closest(
2275//         "#appleid-signin, .appleid-signin, [data-appleid-signin]"
2276//     );
2277
2278//     if (!appleButton) {
2279//         return;
2280//     }
2281
2282//     alert(
2283//         "APPLE BUTTON CLICK\n\n" +
2284//         "Time: " + new Date().toISOString() + "\n" +
2285//         "Target: " + event.target.tagName + "\n" +
2286//         "Button ID: " + appleButton.id + "\n" +
2287//         "Button class: " + appleButton.className
2288//     );
2289// }, true);
2290
2291// setTimeout(function () {
2292//     var buttons = document.querySelectorAll(
2293//         "#appleid-signin, .appleid-signin, [data-appleid-signin]"
2294//     );
2295
2296//     alert(
2297//         "APPLE BUTTON COUNT: " + buttons.length + "\n\n" +
2298//         Array.from(buttons).map(function (button, index) {
2299//             return (
2300//                 (index + 1) + ": " +
2301//                 button.outerHTML.substring(0, 300)
2302//             );
2303//         }).join("\n\n")
2304//     );
2305// }, 1500); 
2306
2307    document.addEventListener('AppleIDSignInOnFailure', (event) => {
2308      alertUser("An error occured  while signing in with AppleId")
2309    });
2310
2311    function myProfile() {
2312      var sendUrl = "/profilx"; var sendData = {};
2313      ajaxHandler("GET", sendUrl, "", function (response) {
2314        if (response.responseText == "error") { alertUser("An error occured while loading your information from server. Please try again."); }
2315        else {
2316          try { var y = response.responseJSON; } catch (e) { alertUser("An error occured while loading your information from server. Please try again."); return; }
2317          $('#email1x').val(y.email);
2318          $('#name1x').val(y.name);
2319          $('#telephone1x').val(y.telephone);
2320          $('#address1x').val(y.address);
2321          $('#postcode1x').val(y.postcode);
2322          if (y.emailOrder == 1) {
2323            $('#emailswitch').prop('checked', true);
2324          }
2325          $('#profileModal').modal('show');
2326        }
2327      });
2328    }
2329
2330    $("#addressModal").submit(function (e) {
2331  
2332      stopForm(e);
2333      var data = {};
2334      data.name = $('#contactName2x').val();
2335      data.telephone = $('#telephone2x').val();
2336      data.address = $('#address2x').val();
2337      data.postcode = $('#postcode2x').val();
2338      if (data.address == "" || (data.address).length < 2) { alertUser("Your address should have more than  2 characters"); endEvent(); return; }
2339      if (data.postcode == "" || (data.postcode).length < 4) { alertUser("Please enter a valid postcode"); endEvent(); return; }
2340 
2341
2342     data.telephone = getValidTelephone('#telephone2x');
2343
2344if (!data.telephone) {
2345  endEvent();
2346  return;
2347}
2348
2349
2350      var sendUrl = "/updateAddress";
2351      ajaxHandler("POST", sendUrl, data, function (response) {
2352        if (response.responseText == 'Success') {
2353          $('#addressModal').modal('hide'); alertUser("You have updated your information");
2354          $('#addressCustomer').val(data.address);
2355          $('#postcodeCustomer').val(data.postcode);
2356          $('#telCustomer').val(data.telephone);
2357          $('#customerName').val(data.name);
2358          endEvent(); return;
2359        }
2360        else { endEvent(); alertUser("There has been a problem. Please try again later."); }
2361      });
2362    });
2363
2364    function lostPassword() {
2365      $('#loginModal').modal('hide');
2366      $('#fgModal').modal('show');
2367    }
2368
2369    function loginFormOpen() {
2370      $("#lostPassword").hide();
2371      $("#lostPasswordOpen").show();
2372      $("#loginFormOpen").hide();
2373      $("#loginForm").show();
2374      $('#loginHeader').text("Login");
2375      $("#forgotPass2").hide();
2376    }
2377
2378    function showMessage(cmessage, subject, situation, reply) {
2379      var shopTel = $('#shopTel').text();
2380      $('#situation').text(situation);
2381      $('#yourMessage').html("<h1 class='yourMessage'>Your Message</h1>" + "<h1 class='yourMessagex'>" + cmessage + "</h1>");
2382      if (reply) {
2383        $('#shopReply').html("<h1 class='shopReply'>Shop's Reply</h1>" + "<h1 class='shopReplyx'>" + reply + "</h1>");
2384        $('#generic').html("<h1 class='shopGeneric'>If this reply did not satisfy you please  give us a call.  <span style='color:red; width: 100%;'>" + shopTel + "</span></h1>");
2385      }
2386      else {
2387        $('#shopReply').html("<h1 class='shopGeneric'>Your message hos not been replied by shop. Please allow us some time or give us a call</h1>");
2388      }
2389      $('#messageModal').modal('show');
2390    }
2391
2392    $(".cookieConsentOK").on("click", function () {
2393      $("#cookieConsent").css("display", "none");
2394      sessionStorage.setItem("999", "Cookies Ok");
2395      var sendUrl = "/cookie";
2396      ajaxHandler("GET", sendUrl, "noData", function (response) {
2397        if (response.responseText == 'success') { }
2398        else { endEvent(); }
2399      });
2400    });
2401
2402    function repeatOrder(orderId, rtype) {
2403      var sendUrl = '/repeatOrder' + '?id=' + orderId + '&rtype=' + rtype;
2404      ajaxHandler("GET", sendUrl, "noData", function (response) {
2405        if (response.responseText == 'error') { alertUser("Order Could Not be Found"); }
2406        else {
2407          var y = response.responseJSON; var currentLength = "", itemInfo = "";
2408          for (var i = 0; i < y.length; ++i) {
2409            currentLength = localStorage.length + 1; while (localStorage.getItem(currentLength) != null) { ++currentLength; }
2410            y[i].basePrice = parseFloat(y[i].basePrice);
2411            y[i].fullPrice = parseFloat(y[i].fullPrice);
2412            if (y[i].availability == 0) {
2413                  console.log("yi ney",y[i]);
2414              if(y[i].basePrice!=0){
2415 alertUser(y[i].name + " is not available at the moment. The remainder of  your order is added to your basket");
2416              }
2417              
2418            }
2419            else {
2420              localStorage.setItem(currentLength, JSON.stringify(y[i])); 
2421              
2422            }
2423          }
2424           loadPopUp(); 
2425          $('#popupModal').modal('show');
2426        }
2427      });
2428    }
2429
2430    function stopForm(event) {
2431      event.preventDefault();
2432      event.stopPropagation();
2433      event.stopImmediatePropagation();
2434      $('.submitButtons').prop('disabled', true);
2435    }
2436
2437
2438    $("#formAddress").submit(function (e) {
2439      stopForm(e);
2440      var sendData = {};
2441      var sendUrl = '/addressChange';
2442      sendData.address = $('#addressChange1').val();
2443      sendData.postcode = $('#postChange1').val();
2444      ajaxHandler("POST", sendUrl, sendData, function (response) {
2445        if (response.responseText == "Successfully Updated") {
2446          $("#ajaxMessage3").text("Your Address Successfully Updated");
2447          alertUser("Your Address Successfully Updated");
2448        }
2449        else { $("#ajaxMessage3").text("An error occured please try later"); }
2450        endEvent();
2451      });
2452    });
2453
2454    $("#formPassword").submit(function (e) {
2455      stopForm(e);
2456      var sendData = {};
2457      var sendUrl = '/passwordChange';
2458      sendData.password = $("#password3").val();
2459      sendData.verifypassword = $("#retype").val();
2460      if (sendData.password != sendData.verifypassword) {
2461        $("#ajaxMessage2").text("Passwords do not match").fadeIn("slow").delay(1500).fadeOut("slow");
2462        endEvent();
2463        return;
2464      }
2465      ajaxHandler("POST", sendUrl, sendData, function (response) {
2466        if (response.responseText == "Successfully Updated") { alertUser("Your password is updated"); }
2467        else { alertUser("An error occured"); }
2468        endEvent();
2469      });
2470    });
2471
2472    $("#formDetails").submit(function (e) {
2473      stopForm(e);
2474      var sendData = {};
2475      var sendUrl = '/profileUpdate';
2476      var sendData = {};
2477      sendData.name = $("#nameC").val();
2478      sendData.email = $("#emailC").val();
2479      sendData.telephone = $("#telephoneC").val();
2480      var emailMe = document.getElementById("emailPreferences").checked;
2481      if (emailMe == false) { sendData.emailPreferences = 0; } else { sendData.emailPreferences = 1; }
2482      ajaxHandler("POST", sendUrl, sendData, function (response) {
2483        if (response.responseText == "Successfully Updated") {
2484          $("#ajaxMessage1").html('Your Details Successfully Updated');
2485          alertUser("Your details successfully updated");
2486        }
2487        else { $("#ajaxMessage1").html('This Email is Used By Another User.'); }
2488        endEvent();
2489      });
2490    });
2491
2492    function termsconditions() {
2493      $('#termsModalBody').load('/terms?q=pop');
2494      $('#termsModal').modal('show');
2495      $('#termheader').text('Terms and privacy policy  for our applications and website');
2496    }
2497
2498    function allergy() {
2499      $('#termsModalBody').load('/allergy?q=pop');
2500      $('#termsModal').modal('show');
2501      $('#termheader').text('Allergen Information');
2502    }
2503
2504
2505    function triggerAlert(message) { alertUser(message + ' can not be empty.'); }
2506    function endEvent() { $('.submitButtons').removeAttr('disabled'); }
2507
2508    function stripeTokenHandler(token) { var sendData = {}; var form = document.getElementById('payment-form'); var hiddenInput = document.createElement('input'); hiddenInput.setAttribute('type', 'hidden'); hiddenInput.setAttribute('name', 'stripeToken'); hiddenInput.setAttribute('value', token.id); form.appendChild(hiddenInput); form.submit(); $("payment-form").trigger("reset"); }
2509
2510    function clearCarts() {
2511      localStorage.clear();
2512      loadPopUp();
2513      $('.cart-item').remove();
2514      fullPriceTotal = 0;
2515      try { window.location.reload(); } catch (e) { }
2516    }
2517
2518    function modalHide() {
2519      setTimeout(function () {
2520        $('#alertUser').modal('hide');
2521        $('.modal-backdrop').remove();
2522      }, 60);
2523    }
2524
2525    $('#alertUser').on('hidden.bs.modal', function () {
2526      //remove the backdrop
2527      $('.modal-backdrop').remove();
2528    })
2529
2530    function alertUser(message) {
2531      if (message.length < 1) { return; }
2532      var body = '';
2533      body += '<div class="modal fade " id="alertUser" tabindex="-1" role="dialog" aria-labelledby="alertUser" style="z-index: 99999;" ><div class="modal-dialog modal-sm" role="dialog" style="text-align: center;   top: 17%;"><div class="modal-content" style="margin-top: 2%; background: #f4f2ed; border:none;"> <button type="button" class="close_new2x" data-backdrop="" data-dismiss="modal" aria-label="Close" onclick="modalHide();"> × </button><div class="modal-body modal-alertxx" >' + message + '</div> </div></div></div>';
2534      document.getElementById("modalArea3").innerHTML = body;
2535      $('#alertUser').modal('show');
2536    }
2537    $(document).on('hidden.bs.modal', '.modal', function () {
2538      $('.modal:visible').length && $(document.body).addClass('modal-open');
2539    });
2540    document.addEventListener('touchmove', function (event) {
2541      if (event.scale !== 1) { event.preventDefault(); }
2542    }, false);
2543
2544    function enableCart() {
2545      $('#popupModal').modal('show');
2546    }
2547
2548    function notavailable() {
2549      alertUser("Sorry this item is out of stock for today.");
2550    }
2551
2552 
2553     
2554    $(window).ready(function () { loadPopUp(); });
2555 
2556
2557function getCartKeys() {
2558  return Object.keys(localStorage)
2559    .filter(k => /^\d+$/.test(k))               // ONLY numeric keys are cart items
2560    .sort((a, b) => Number(a) - Number(b));
2561}
2562 
2563function normalizeItem(raw) {
2564 
2565  //const item = raw && typeof raw === 'object' ? raw : {};
2566  const item = (raw && typeof raw === 'object' && !Array.isArray(raw)) ? raw : {};
2567  if (!item.rName) item.rName = item.name || '';
2568  item.customization = item.customization || {};
2569  item.customization.additions = item.customization.additions || '';
2570  item.customization.features = item.customization.features || '';
2571  item.customization.extraxyz = item.customization.extraxyz || '';
2572
2573  item.amount = Number(item.amount || 1);
2574  item.basePrice = Number(item.basePrice || 0);
2575  item.fullPrice = Number(item.fullPrice || item.basePrice || 0);
2576
2577  // Keep your existing BOGO model fields stable
2578
2579  if (item.rPrice == null) {
2580  item.rPrice = Number(item.basePrice || item.fullPrice || 0);
2581}
2582
2583  //if (item.rPrice == null) item.rPrice = item.basePrice;
2584  if (item.ePrice == null) {
2585    // extra cost = full - base (never negative)
2586    const ep = Number(item.fullPrice) - Number(item.basePrice);
2587    item.ePrice = ep > 0 ? ep : 0;
2588  }
2589
2590  // Normalize typex
2591  if (item.typex == null) item.typex = 'no';
2592
2593  return item;
2594}
2595
2596// Apply BOGO pricing to items in storage (only if needed)
2597// function applyBogoPricingIfNeeded() {
2598//   const keys = getCartKeys();
2599//   if (!keys.length) return;
2600
2601//   const items = [];
2602//   const rest = [];
2603//   const groupedUnits = {};
2604//   let hasBogo = false;
2605
2606//   for (const key of keys) {
2607//     const raw = localStorage.getItem(key);
2608//     if (!raw) { localStorage.removeItem(key); continue; }
2609
2610//     let temp;
2611//     try { temp = JSON.parse(raw); }
2612//     catch (e) { localStorage.removeItem(key); continue; }
2613
2614//     temp = normalizeItem(temp);
2615//     temp._key = key;
2616
2617//     if (isBogoEligibleClient(temp)) {
2618//       hasBogo = true;
2619//       items.push(temp);
2620
2621//       const groupKey = getPromoGroupKeyClient(temp);
2622//       if (!groupedUnits[groupKey]) groupedUnits[groupKey] = [];
2623
2624//       const amount = parseInt(temp.amount, 10) || 1;
2625//       for (let q = 0; q < amount; q++) {
2626//         groupedUnits[groupKey].push({
2627//           key: key,
2628//           basePrice: Number(temp.rPrice || temp.basePrice || 0)
2629//         });
2630//       }
2631//     } else {
2632//       rest.push(temp);
2633//     }
2634//   }
2635
2636//   if (!hasBogo) return;
2637
2638//   const discountedCounts = {};
2639
2640//   for (const groupKey in groupedUnits) {
2641//     const units = groupedUnits[groupKey];
2642//     units.sort((a, b) => a.basePrice - b.basePrice);
2643
2644//     let divider = parseInt(groupKey.split("|")[0], 10);
2645//     if (!isFinite(divider) || divider <= 0) divider = 2;
2646
2647//     const discountCount = Math.floor(units.length / divider);
2648
2649//     for (let i = 0; i < discountCount; i++) {
2650//       discountedCounts[units[i].key] = (discountedCounts[units[i].key] || 0) + 1;
2651//     }
2652//   }
2653
2654//   for (let i = 0; i < items.length; i++) {
2655//     const it = items[i];
2656
2657//     const amount = parseInt(it.amount, 10) || 1;
2658//     let discountedCount = discountedCounts[it._key] || 0;
2659//     if (discountedCount > amount) discountedCount = amount;
2660
2661//     const normalCount = amount - discountedCount;
2662
2663//     const rawTypex = String(it.typex || '').trim().toLowerCase();
2664//     const pct = Math.max(0, Math.min(100, parseFloat(rawTypex) || 0));
2665
2666//     const normalBase = Number(it.rPrice || it.basePrice || 0);
2667//     const extra = Number(it.ePrice || 0);
2668//     const discountedBase = getDiscountedBaseClient(it);
2669
2670//     it.basePrice = Number(((normalCount * normalBase) + (discountedCount * discountedBase)).toFixed(2));
2671//     it.fullPrice = Number((it.basePrice + (extra * amount)).toFixed(2));
2672
2673//     const originalName = it.rName || it.name || '';
2674//     it.displayName = originalName;
2675//     it.name = originalName;
2676
2677//     if (discountedCount > 0) {
2678//       if (rawTypex === "0") {
2679//         it.displayName = originalName + " (FREE)";
2680//         it.name = originalName + " (FREE)";
2681//       } else if (rawTypex.indexOf("fixed_") === 0) {
2682//         const fixedPrice = getFixedPriceFromTypexClient(it.typex, it.portion);
2683//         if (fixedPrice !== null) {
2684//           it.displayName = originalName + " (£" + fixedPrice.toFixed(2) + ")";
2685//           it.name = originalName + " (£" + fixedPrice.toFixed(2) + ")";
2686//         }
2687//       } else if (pct < 100) {
2688//         it.displayName = originalName + " (" + pct + "% OFF)";
2689//         it.name = originalName + " (" + pct + "% OFF)";
2690//       }
2691//     }
2692//   }
2693
2694//   const all = items.concat(rest).sort((a, b) => Number(a.fullPrice) - Number(b.fullPrice));
2695
2696//   for (const k of keys) localStorage.removeItem(k);
2697
2698//   for (let i = 0; i < all.length; i++) {
2699//     delete all[i]._key;
2700//     localStorage.setItem(String(i + 1), JSON.stringify(all[i]));
2701//   }
2702// }
2703
2704function applyBogoPricingIfNeeded() {
2705  const keys = getCartKeys();
2706  if (!keys.length) return;
2707
2708  const items = [];
2709  const rest = [];
2710  const groupedUnits = {};
2711  let hasBogo = false;
2712
2713  for (const key of keys) {
2714    const raw = localStorage.getItem(key);
2715    if (!raw) { localStorage.removeItem(key); continue; }
2716
2717    let temp;
2718    try { temp = JSON.parse(raw); }
2719    catch (e) { localStorage.removeItem(key); continue; }
2720
2721    temp = normalizeItem(temp);
2722    temp._key = key;
2723
2724    if (isBogoEligibleClient(temp)) {
2725      hasBogo = true;
2726      items.push(temp);
2727
2728      const groupKey = getPromoGroupKeyClient(temp);
2729      if (!groupedUnits[groupKey]) groupedUnits[groupKey] = [];
2730
2731      const amount = parseInt(temp.amount, 10) || 1;
2732      for (let q = 0; q < amount; q++) {
2733        groupedUnits[groupKey].push({
2734          key: key,
2735          basePrice: Number(temp.rPrice || temp.basePrice || 0)
2736        });
2737      }
2738    } else {
2739      rest.push(temp);
2740    }
2741  }
2742
2743  if (!hasBogo) return;
2744
2745const discountedCounts = {};
2746
2747for (const groupKey in groupedUnits) {
2748  const units = groupedUnits[groupKey];
2749
2750 
2751  units.sort((a, b) => b.basePrice - a.basePrice);
2752
2753  let divider = parseInt(groupKey.split("|")[0], 10);
2754  if (!isFinite(divider) || divider <= 0) divider = 2;
2755 
2756  for (let i = divider - 1; i < units.length; i += divider) {
2757    discountedCounts[units[i].key] =
2758      (discountedCounts[units[i].key] || 0) + 1;
2759  }
2760}
2761
2762  for (let i = 0; i < items.length; i++) {
2763    const it = items[i];
2764
2765    const amount = parseInt(it.amount, 10) || 1;
2766    let discountedCount = discountedCounts[it._key] || 0;
2767    if (discountedCount > amount) discountedCount = amount;
2768
2769    const normalCount = amount - discountedCount;
2770
2771    const rawTypex = String(it.typex || '').trim().toLowerCase();
2772    const pct = Math.max(0, Math.min(100, parseFloat(rawTypex) || 0));
2773
2774    const normalBase = Number(it.rPrice || it.basePrice || 0);
2775    const extra = Number(it.ePrice || 0);
2776    const discountedBase = getDiscountedBaseClient(it);
2777
2778    it.basePrice = Number(((normalCount * normalBase) + (discountedCount * discountedBase)).toFixed(2));
2779    it.fullPrice = Number((it.basePrice + (extra * amount)).toFixed(2));
2780
2781    const originalName = it.rName || it.name || '';
2782    it.displayName = originalName;
2783    it.name = originalName;
2784
2785    if (discountedCount > 0) {
2786      if (rawTypex === "0") {
2787        it.displayName = originalName + " (FREE)";
2788        it.name = originalName + " (FREE)";
2789      } else if (rawTypex.indexOf("fixed_") === 0) {
2790        const fixedPrice = getFixedPriceFromTypexClient(it.typex, it.portion);
2791        if (fixedPrice !== null) {
2792          it.displayName = originalName + " (£" + fixedPrice.toFixed(2) + ")";
2793          it.name = originalName + " (£" + fixedPrice.toFixed(2) + ")";
2794        }
2795      } else if (pct < 100) {
2796        it.displayName = originalName + " (" + pct + "% OFF)";
2797        it.name = originalName + " (" + pct + "% OFF)";
2798      }
2799    }
2800  }
2801
2802  const all = items.concat(rest).sort((a, b) => Number(a.fullPrice) - Number(b.fullPrice));
2803
2804  for (const k of keys) localStorage.removeItem(k);
2805
2806  for (let i = 0; i < all.length; i++) {
2807    delete all[i]._key;
2808    localStorage.setItem(String(i + 1), JSON.stringify(all[i]));
2809  }
2810}
2811
2812 
2813
2814function popupNumber() {
2815  const count = getCartKeys().length; // numeric cart keys only
2816  const total = (Number(fullPriceTotal) || 0).toFixed(2);
2817
2818  $('.basketxyz').html(` ${count} Items - £${total}`);
2819   try { window.webkit.messageHandlers["scriptHandler"].postMessage((getCartKeys().length).toString()); } catch (e) { }
2820}
2821
2822
2823// Single entry point: rebuild prices (BOGO if needed) then render from scratch
2824function loadPopUp() {
2825  // clear UI + totals so no duplicates ever
2826
2827    fullPriceTotal = 0;
2828
2829  // clear ALL possible render targets (pick the ones you actually use)
2830  try { $('.popupxyz').html(''); } catch (e) {}
2831 
2832 
2833 
2834
2835  // adjust prices if BOGO items exist
2836  applyBogoPricingIfNeeded();
2837
2838  // render all cart items
2839  const keys = getCartKeys();
2840  for (const key of keys) {
2841    popupCart(key);
2842  }
2843
2844  if (keys.length <= 0) {
2845    $('.basketxyz').html('  0 Items');
2846  } else {
2847    popupNumber();
2848  }
2849}
2850
2851// Remove: simplest + correct for BOGO (full redraw)
2852function removePopUp(removeId, priceId) {
2853  localStorage.removeItem(String(removeId));
2854  loadPopUp();
2855  try { lcheckout(); } catch (e) { }
2856}
2857
2858// Core render for one item (defensive) — based on your normal version :contentReference[oaicite:2]{index=2}
2859var fullPriceTotal = 0;
2860
2861function popupCart(sessionKey) {
2862  const raw = localStorage.getItem(sessionKey);
2863  if (!raw) return;
2864
2865  let itemInfo;
2866  try {
2867    itemInfo = JSON.parse(raw);
2868  } catch (e) {
2869    localStorage.removeItem(sessionKey);
2870    return;
2871  }
2872
2873  itemInfo = normalizeItem(itemInfo);
2874  const itemFeatures = itemInfo.customization;
2875  const additions = itemFeatures.additions || '';
2876  const features = itemFeatures.features || '';
2877
2878  const portion = itemInfo.portion || '';
2879  const amount = Number(itemInfo.amount) || 0;
2880  const fullPrice = Number(itemInfo.fullPrice) || 0;
2881  const image = itemInfo.image || '';
2882  //const name = itemInfo.name || '';
2883  const name = itemInfo.displayName || itemInfo.name || '';
2884
2885
2886  let popupBody = '';
2887
2888  popupBody += '<div class="cart-item col-xs-8 popupId' + sessionKey + '">';
2889  popupBody += '  <div class="cart-item-left">
2889<img src="' + image + '" class="cartItemImages"></div>';
2890  popupBody += '  <div class="cart-item-right">';
2891  popupBody += '    <h6 class="cartItemNames">' + amount + ' x ' + portion + ' - ' + name;
2892  
2893  popupBody += '      <button type="button" class="close_new2" ' +
2894               '              onclick="removePopUp(' + sessionKey + ',' + fullPrice + ')" ' +
2895               '              data-json="' + sessionKey + '" data-pricefull="' + fullPrice + '">' +
2896               ' <svg viewBox="0 0 24 24" class="close_new3 cart-remove-icon"><path d="M3 6h18"></path><path d="M8 6V4h8v2"></path><path d="M6 6l1 15h10l1-15"></path><path d="M10 10v7"></path><path d="M14 10v7"></path></svg>     </button>';
2897  popupBody += '    </h6>';
2898
2899  popupBody += additions + features;
2900
2901  popupBody += '    <h6 class="ptotal">Product Total' +
2902               '      <span style="float:right; right:0; position:absolute; color:black;">' +
2903               '        £' + fullPrice.toFixed(2) +
2904               '      </span>' +
2905               '    </h6>';
2906  popupBody += '  </div>';
2907  popupBody += '</div>';
2908 
2909  // If you also use .popupxyz container in some templates
2910 var el1 = document.getElementById("cartPopUpx");
2911if (el1) el1.innerHTML += popupBody;
2912else { try { $('.popupxyz').append(popupBody); } catch (e) {} }
2913
2914
2915  fullPriceTotal += fullPrice;
2916  fullPriceTotal = Math.round(fullPriceTotal * 100) / 100;
2917}
2918
2919function cartChanged() {
2920  loadPopUp();     // recalculates BOGO + redraws + updates basketxyz
2921  try { lcheckout(); } catch(e) {}
2922}
2923
2924
2925    $(document).on('click', ".wrapItems", function (e) {
2926 var  t=$('#menuHeader1').val();
2927
2928console.log("lasada",t);
2929if(t=="FoldedPizza" || t=="ItalianPizzas"){
2930$('#stuffedCrust24').next('label').hide();
2931$('#stuffedxyz2').next('label').hide();
2932}
2933
2934});
2935
2936
2937    
2938
2939      // Core modal builder
2940      window.showBoostModal = function (opts) {
2941        opts = opts || {};
2942        var id = 'boost-generic-modal-overlay';
2943
2944        // Avoid duplicates
2945        var existing = document.getElementById(id);
2946        if (existing) existing.remove();
2947
2948        var overlay = document.createElement('div');
2949        overlay.id = id;
2950        overlay.style.position = 'fixed';
2951        overlay.style.inset = '0';
2952        overlay.style.background = 'rgba(0, 0, 0, 0.6)';
2953        overlay.style.zIndex = '999999';
2954        overlay.style.display = 'flex';
2955        overlay.style.alignItems = 'center';
2956        overlay.style.justifyContent = 'center';
2957
2958        var box = document.createElement('div');
2959        box.style.background = '#ffffff';
2960        box.style.borderRadius = '10px';
2961        box.style.padding = '18px 16px';
2962        box.style.maxWidth = '320px';
2963        box.style.width = '80%';
2964        box.style.boxShadow = '0 8px 20px rgba(0,0,0,0.3)';
2965        box.style.textAlign = 'center';
2966        box.style.fontFamily = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
2967
2968        var title = document.createElement('div');
2969        title.textContent = opts.title || 'Notice';
2970        title.style.fontWeight = '700';
2971        title.style.fontSize = '18px';
2972        title.style.marginBottom = '8px';
2973
2974        var msg = document.createElement('div');
2975        msg.textContent = opts.message || '';
2976        msg.style.fontSize = '14px';
2977        msg.style.marginBottom = '14px';
2978        msg.style.whiteSpace = 'pre-line';
2979
2980        var buttonsWrap = document.createElement('div');
2981        buttonsWrap.style.display = 'flex';
2982        buttonsWrap.style.justifyContent = opts.showCancel ? 'space-between' : 'center';
2983        buttonsWrap.style.gap = '10px';
2984
2985        function close(result) {
2986          overlay.remove();
2987          if (typeof opts.onResult === 'function') {
2988            opts.onResult(result);
2989          }
2990        }
2991
2992        // OK button
2993        var okBtn = document.createElement('button');
2994        okBtn.textContent = opts.okText || 'OK';
2995        okBtn.style.border = 'none';
2996        okBtn.style.borderRadius = '999px';
2997        okBtn.style.padding = '8px 20px';
2998        okBtn.style.fontSize = '14px';
2999        okBtn.style.fontWeight = '600';
3000        okBtn.style.cursor = 'pointer';
3001        okBtn.style.background = '#e53935';
3002        okBtn.style.color = '#fff';
3003        okBtn.style.flex = '1';
3004        okBtn.onclick = function () { close(true); };
3005
3006        buttonsWrap.appendChild(okBtn);
3007
3008        // Cancel button (for confirm)
3009        if (opts.showCancel) {
3010          var cancelBtn = document.createElement('button');
3011          cancelBtn.textContent = opts.cancelText || 'Cancel';
3012          cancelBtn.style.border = '1px solid #ccc';
3013          cancelBtn.style.borderRadius = '999px';
3014          cancelBtn.style.padding = '8px 20px';
3015          cancelBtn.style.fontSize = '14px';
3016          cancelBtn.style.fontWeight = '500';
3017          cancelBtn.style.cursor = 'pointer';
3018          cancelBtn.style.background = '#f5f5f5';
3019          cancelBtn.style.color = '#333';
3020          cancelBtn.style.flex = '1';
3021          cancelBtn.onclick = function () { close(false); };
3022          buttonsWrap.appendChild(cancelBtn);
3023        }
3024
3025        box.appendChild(title);
3026        box.appendChild(msg);
3027        box.appendChild(buttonsWrap);
3028        overlay.appendChild(box);
3029        document.body.appendChild(overlay);
3030      };
3031
3032    // Simple alert: one button
3033    window.alertNow = function (message, cb) {
3034      window.showBoostModal({
3035        title: 'Notice',
3036        message: message,
3037        showCancel: false,
3038        okText: 'OK',
3039        onResult: function () {
3040          if (typeof cb === 'function') cb();
3041        }
3042      });
3043    };
3044
3045    // Confirm-style: two buttons, callback(true/false)
3046    window.confirmNow = function (message, cb) {
3047      window.showBoostModal({
3048        title: 'Please confirm',
3049        message: message,
3050        showCancel: true,
3051        okText: 'Yes',
3052        cancelText: 'No',
3053        onResult: function (result) {
3054          if (typeof cb === 'function') cb(result);
3055        }
3056      });
3057    };
3058
3059
3060    window.showAddressIssueModal = function (message, suggestions, onPick, onUseTyped, onEdit) {
3061      var id = 'boost-address-issue-overlay';
3062      var existing = document.getElementById(id);
3063      if (existing) existing.remove();
3064
3065      var overlay = document.createElement('div');
3066      overlay.id = id;
3067      overlay.style.position = 'fixed';
3068      overlay.style.inset = '0';
3069      overlay.style.background = 'rgba(0, 0, 0, 0.6)';
3070      overlay.style.zIndex = '999999';
3071      overlay.style.display = 'flex';
3072      overlay.style.alignItems = 'center';
3073      overlay.style.justifyContent = 'center';
3074      overlay.style.color = 'red';
3075
3076      var box = document.createElement('div');
3077      box.style.background = '#ffffff';
3078      box.style.borderRadius = '10px';
3079      box.style.padding = '18px 20px';
3080      box.style.maxWidth = '340px';
3081      box.style.width = '90%';
3082      box.style.boxShadow = '0 8px 20px rgba(0,0,0,0.3)';
3083      box.style.fontFamily = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
3084
3085      var title = document.createElement('div');
3086      title.textContent = 'Address check';
3087      title.style.fontWeight = '700';
3088      title.style.fontSize = '18px';
3089      title.style.marginBottom = '8px';
3090
3091      var msg = document.createElement('div');
3092      msg.textContent = message || 'We could not confirm this address.';
3093      msg.style.fontSize = '14px';
3094      msg.style.marginBottom = '10px';
3095      msg.style.whiteSpace = 'pre-line';
3096
3097      box.appendChild(title);
3098      box.appendChild(msg);
3099
3100
3101      if (suggestions && suggestions.length) {
3102        var listWrap = document.createElement('div');
3103        listWrap.style.maxHeight = '180px';
3104        listWrap.style.overflowY = 'auto';
3105        listWrap.style.marginBottom = '10px';
3106
3107        suggestions.forEach(function (addr) {
3108          var item = document.createElement('button');
3109          item.textContent = addr;
3110          item.style.display = 'block';
3111          item.style.width = '100%';
3112          item.style.textAlign = 'left';
3113          item.style.marginBottom = '6px';
3114          item.style.border = '1px solid #ddd';
3115          item.style.borderRadius = '6px';
3116          item.style.padding = '6px 8px';
3117          item.style.fontSize = '13px';
3118          item.style.cursor = 'pointer';
3119          item.style.background = '#f7f7f7';
3120
3121          item.onclick = function () {
3122            overlay.remove();
3123            if (typeof onPick === 'function') onPick(addr);
3124          };
3125
3126          listWrap.appendChild(item);
3127        });
3128
3129        box.appendChild(listWrap);
3130      }
3131var buttonsWrap = document.createElement('div');
3132buttonsWrap.style.display = 'flex';
3133buttonsWrap.style.justifyContent = 'space-between';
3134buttonsWrap.style.gap = '10px';
3135
3136var hasSuggestions = suggestions && suggestions.length > 0;
3137
3138// Edit button
3139var editBtn = document.createElement('button');
3140editBtn.textContent = 'Edit address';
3141editBtn.style.flex = '1';
3142editBtn.style.border = 'none';
3143editBtn.style.borderRadius = '999px';
3144editBtn.style.padding = '8px 10px';
3145editBtn.style.fontSize = '13px';
3146editBtn.style.cursor = 'pointer';
3147editBtn.style.background = '#e53935';
3148editBtn.style.color = '#fff';
3149
3150editBtn.onclick = function () {
3151  overlay.remove();
3152
3153  if (typeof onEdit === 'function') {
3154    onEdit();
3155  }
3156};
3157
3158buttonsWrap.appendChild(editBtn);
3159
3160// Only allow the typed address when no suggestions were found
3161if (!hasSuggestions) {
3162  var useTypedBtn = document.createElement('button');
3163
3164  useTypedBtn.textContent = 'Use address I typed';
3165  useTypedBtn.style.flex = '1';
3166  useTypedBtn.style.border = '1px solid #ccc';
3167  useTypedBtn.style.borderRadius = '999px';
3168  useTypedBtn.style.padding = '8px 10px';
3169  useTypedBtn.style.fontSize = '13px';
3170  useTypedBtn.style.cursor = 'pointer';
3171  useTypedBtn.style.background = '#f5f5f5';
3172
3173  useTypedBtn.onclick = function () {
3174    overlay.remove();
3175
3176    if (typeof onUseTyped === 'function') {
3177      onUseTyped();
3178    }
3179  };
3180
3181  buttonsWrap.appendChild(useTypedBtn);
3182}
3183
3184var editNote = document.createElement('div');
3185
3186editNote.textContent = hasSuggestions
3187  ? 'Only edit your address if you cannot find it in the list above.'
3188  : 'No matching address was found. Check your details or continue with the address you entered.';
3189
3190editNote.style.fontSize = '13px';
3191editNote.style.fontWeight = '600';
3192editNote.style.textAlign = 'center';
3193editNote.style.color = hasSuggestions ? '#3044c5' : '#e53935';
3194editNote.style.margin = '8px 0';
3195
3196box.appendChild(editNote);
3197box.appendChild(buttonsWrap);
3198      overlay.appendChild(box);
3199      document.body.appendChild(overlay);
3200    };
3201
3202    function getFixedPriceFromTypexClient(typex, portion) {
3203  var rawTypex = String(typex || "").trim().toLowerCase();
3204  var rawPortion = String(portion || "").toLowerCase();
3205
3206  if (rawTypex.indexOf("fixed_") !== 0) return null;
3207
3208  var config = rawTypex.slice(6);
3209
3210  // fixed_1.99
3211  if (config.indexOf(":") === -1 && config.indexOf("|") === -1) {
3212    var fixedOne = parseFloat(config);
3213    if (isFinite(fixedOne)) return +fixedOne.toFixed(2);
3214  }
3215
3216  // fixed_9:1.99|12:2.99
3217  var portionMatch = rawPortion.match(/\d+(\.\d+)?/);
3218  if (!portionMatch) return null;
3219
3220  var portionNumber = portionMatch[0];
3221  var pairs = config.split("|");
3222
3223  for (var i = 0; i < pairs.length; i++) {
3224    var parts = pairs[i].split(":");
3225    if (parts.length !== 2) continue;
3226
3227    var sizeKey = String(parts[0]).trim().toLowerCase();
3228    var price = parseFloat(parts[1]);
3229
3230    if (sizeKey === portionNumber && isFinite(price)) {
3231      return +price.toFixed(2);
3232    }
3233  }
3234
3235  return null;
3236}
3237
3238function isBogoEligibleClient(item) {
3239  if (!item) return false;
3240  if (item.name === "Delivery Fee") return false;
3241  if (item.typex == null) return false;
3242
3243  const rawTypex = String(item.typex).trim().toLowerCase();
3244  if (rawTypex === "" || rawTypex === "no") return false;
3245  if (rawTypex.indexOf("fixed_") === 0) return true;
3246
3247  const pct = parseFloat(rawTypex);
3248  return isFinite(pct) && pct >= 0 && pct <= 100;
3249}
3250
3251// function getPromoGroupKeyClient(item) {
3252//   let divider = parseInt(item.divider, 10);
3253//   if (!isFinite(divider) || divider <= 0) divider = 2;
3254
3255//   const portion = String(item.portion || "").trim().toLowerCase();
3256
3257//   return divider + "|" + portion;
3258// }
3259
3260function getPromoGroupKeyClient(item) {
3261  let divider = parseInt(item.divider, 10);
3262  if (!isFinite(divider) || divider <= 0) divider = 2;
3263
3264  const rawTypex = String(item.typex || "").trim().toLowerCase();
3265  const portion = String(item.portion || "").trim().toLowerCase();
3266
3267  if (rawTypex.indexOf("fixed_") === 0 && rawTypex.indexOf(":") !== -1) {
3268    return divider + "|" + rawTypex + "|" + portion;
3269  }
3270
3271
3272  return divider + "|" + rawTypex;
3273}
3274
3275 
3276
3277function getDiscountedBaseClient(item) {
3278  const rawTypex = String(item.typex || "").trim().toLowerCase();
3279
3280  if (rawTypex.indexOf("fixed_") === 0) {
3281    const fixedPrice = getFixedPriceFromTypexClient(item.typex, item.portion);
3282    if (fixedPrice !== null) return fixedPrice;
3283
3284    return Number(item.rPrice || item.basePrice || 0);
3285  }
3286
3287  const pct = parseFloat(rawTypex);
3288  if (!isFinite(pct)) return Number(item.rPrice || item.basePrice || 0);
3289
3290  return Number((Number(item.rPrice || item.basePrice || 0) * (pct / 100)).toFixed(2));
3291}
3292
3293  </script>
3293
3294
3295<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v31edd6df95cf4e85bb4c19e7a9bdbcba1788362987495" integrity="sha512-iIg7k2xntmwu6/uSb5tpc/hySgZc4eoL31yB29W6tJFo2akwjPWcEqnCEdJvGexCL0KEQwVYv5BlowfhVz26hg==" data-cf-beacon='{"version":"2024.11.0","token":"79020a7c68d3461f8b3e17262b70ea77","r":1,"spa":2}' crossorigin="anonymous"></script>
3295
3296</body></html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.