; User: Fruitpay https://www.fruitpay.com.tw
; type: Shopline

; Tags
currencyCode=TWD
tagId=OA-1597cbff
tag_gtag_enabled=true
tag_gtag_id="GTM-TW79K5B"
tag_gtag_gaId="UA-127045625-3"
tag_gtag_bCookieIndex=1
tag_gtag_lazeInfoIndex=2
tag_gtag_downstreams[]=mp
tag_gtag_downstreams[]=official

; Router
router_rules[]='/*'
router_pages[]='all'

router_rules[]='/categories/*'
router_pages[]='category'
router_rules[]='/promotions/*'
router_pages[]='category'

router_rules[]='/products/*'
router_pages[]='detail'
router_rules[]='/cart*'
router_pages[]='checkout'
router_rules[]='/checkout*'
router_pages[]='checkout2'
router_rules[]='/login*'
router_pages[]='officialMember'
router_rules[]='/users/sign_in*'
router_pages[]='shoppingMember'
router_rules[]="/products*"
router_pages[]=search
router_rules[]='/orders/*'
router_pages[]='orders'

; Page
page_all_scripts[]=getUid
page_all_params[]=[]
page_all_secs[]=clickCartIcon
page_all_secs[]=clickCheckout
page_all_secs[]=clickRemoveCart

page_category_scripts[]=initCategory
page_category_params[]=[]
page_category_secs[]=clickProduct
page_category_secs[]=addToCart

page_detail_scripts[]=initDetail
page_detail_params[]=[]
page_detail_secs[]=addToCartInDetail

page_checkout_scripts[]=checkoutLib
page_checkout_params[]=[]
page_checkout_scripts[]=initCheckout
page_checkout_params[]=[]
page_checkout_secs[]=clickConfirmCheckout
page_checkout_secs[]=removeFromCartInCheckout

page_checkout2_scripts[]=checkoutLib
page_checkout2_params[]=[]
page_checkout2_scripts[]=initCheckout2
page_checkout2_params[]=[]

page_officialMember_secs[]=officialMemberSignUp
page_shoppingMember_secs[]=shoppingMemberSignUp

page_search_scripts[]=initSearch
page_search_params[]=[]

page_orders_scripts[]=purchase
page_orders_params[]=[]

; Section

sec_officialMemberSignUp_selects[]='form[name="signupform"] button[type="submit"]'
sec_officialMemberSignUp_types[]=click
sec_officialMemberSignUp_scripts[]=officialMemberSignUp
sec_officialMemberSignUp_params[]=[]

sec_shoppingMemberSignUp_selects[]='form button#submit-btn'
sec_shoppingMemberSignUp_types[]=delegate
sec_shoppingMemberSignUp_scripts[]=shoppingMemberSignUp
sec_shoppingMemberSignUp_params[]=[]

sec_shoppingMemberSignUp_selects[]='div[ng-controller*="Reg"] .btn-line-login'
sec_shoppingMemberSignUp_types[]=delegate
sec_shoppingMemberSignUp_scripts[]=shoppingMemberSignUp
sec_shoppingMemberSignUp_params[]=["line"]

sec_shoppingMemberSignUp_selects[]='div[ng-controller*="Reg"] .btn-facebook-login'
sec_shoppingMemberSignUp_types[]=delegate
sec_shoppingMemberSignUp_scripts[]=shoppingMemberSignUp
sec_shoppingMemberSignUp_params[]=["facebook"]


sec_clickConfirmCheckout_selects[]=".order-summary .btn-success"
sec_clickConfirmCheckout_types[]=click
sec_clickConfirmCheckout_scripts[]=clickConfirmCheckout
sec_clickConfirmCheckout_params[]=[]

sec_addToCartInDetail_selects[]="#btn-add-to-cart"
sec_addToCartInDetail_types[]="click"
sec_addToCartInDetail_scripts[]="addToCartInDetail"
sec_addToCartInDetail_params[]=[]
sec_addToCartInDetail_selects[]="#btn-main-checkout"
sec_addToCartInDetail_types[]="click"
sec_addToCartInDetail_scripts[]="addToCartInDetail"
sec_addToCartInDetail_params[]=[]

; have addOn
sec_addToCartInDetail_selects[]="button#btn-addon-checkout"
sec_addToCartInDetail_types[]="click"
sec_addToCartInDetail_scripts[]="addToCartInDetail"
sec_addToCartInDetail_params[]=[]

; btn change to fixed position when scroll down(right) or mobile(bottom), include addon btn
sec_addToCartInDetail_selects[]=".btn-cart-fixed"
sec_addToCartInDetail_types[]="delegate"
sec_addToCartInDetail_scripts[]="addToCartInDetailFixedBtn"
sec_addToCartInDetail_params[]=[]

sec_clickProduct_selects[]=".product-item"
sec_clickProduct_types[]="click"
sec_clickProduct_scripts[]="clickProduct"
sec_clickProduct_params[]=[]

sec_addToCart_selects[]=".btn-add-to-cart"
sec_addToCart_types[]="click"
sec_addToCart_scripts[]="addToCart"
sec_addToCart_params[]=[]

sec_clickCartIcon_selects[]=".CartPanel-toggleButton"
sec_clickCartIcon_types[]="click"
sec_clickCartIcon_scripts[]="clickCartIcon"
sec_clickCartIcon_params[]=[]
sec_clickCartIcon_selects[]=".CartPanel-toggleButton"
sec_clickCartIcon_types[]="touchstart"
sec_clickCartIcon_scripts[]="clickCartIcon"
sec_clickCartIcon_params[]=[]

sec_clickCheckout_selects[]=".cart-chkt-btn-cont"
sec_clickCheckout_types[]="delegate"
sec_clickCheckout_scripts[]="clickCheckout"
sec_clickCheckout_params[]=[]

sec_clickRemoveCart_selects[]=".cart-item > .remove"
sec_clickRemoveCart_types[]="delegate"
sec_clickRemoveCart_scripts[]="clickRemoveCart"
sec_clickRemoveCart_params[]=[]

sec_removeFromCartInCheckout_selects[]=".btn-confirm"
sec_removeFromCartInCheckout_types[]="click"
sec_removeFromCartInCheckout_scripts[]="removeFromCartInCheckout"
sec_removeFromCartInCheckout_params[]=[]

; Script

script_shoppingMemberSignUp="
<script>
var g = window.i13n;
var get = g.get;
g.dispatch('action', { 
  wait: 0,
  lazyKey: 'CompleteRegistration',
  I13N: {
    action: 'CompleteRegistration'
  },
  i13nCb: function(e, I13N, params) {
    var email = get(e, ['currentTarget', 'form', 'email', 'value']);
    I13N.label={email: email, regType: get(params, [0])};
    return I13N;
  },
});
</script>
"

script_officialMemberSignUp="
<script>
var g = window.i13n;
var get = g.get;
g.dispatch('action', { 
  wait: 0,
  lazyKey: 'CompleteRegistration',
  I13N: {
    action: 'CompleteRegistration'
  },
  i13nCb: function(e, I13N) {
    var t = e.currentTarget;
    var email = get(e, ["currentTarget", "form", "email", "value"]);
    var phone = get(e, ["currentTarget", "form", "mobilePhone", "value"]);
    I13N.label = {
      ...(email && { email }),
      ...(phone && { phone })
    };
    return I13N;
  },
});
</script>
"

script_initDetail="
<script>
var g = window.i13n;
var query = g.query;
var text = g.text;
var getNum = g.getNum;
var allScripts = query.all('script');
var reg = /(\{)(\\)?("Product ID)(\\)?("\:)(\\)?(")([^"\\]*)/;
var id;
allScripts.some(function(s){
  var html = s.innerHTML;
  if (-1 !== html.indexOf('Product ID')) {
    var result = reg.exec(html);
    if (result && result[8]) {
      id = result[8];
    }
    return true;
  } else {
    return false;
  }
});
var name = text(query.one('.Product-title'));
var price = getNum(query.one('.price-sale.price'));
var categorys = query.all('.ProductDetail-breadcrumb .Label');
var category = text(categorys && categorys.length && categorys.slice(-1)[0]);

var pInfo = {
  id: id,
  name: name,
  price: price,
  category: category
};

g.dispatch({
  pInfo: pInfo, 
  i13nPage: {
    detailProducts: [pInfo]
  }
});
</script>
"

script_initCategory="
<script>
var g = window.i13n;
var query = g.query;
var text = g.text;
var getNum = g.getNum;
var objectToArray = g.objectToArray;
var parseJson = g.parseJson;
var getProducts = function() {
  var arr = {};
  var products = query.all('.product-item');
  var category = text(query.one('h1'));
  products.forEach(function(product, key){
    var productDom = product.querySelector("product-item a");
    var data = productDom.getAttribute('ga-product');
    data = parseJson(data);
    var id = data.id;
    var name = data.title;
    var price = getNum(product.querySelector(".price")); 
    arr[id] = {
      name: name,
      id: id,
      category: category,
      position: key,
      price: price,
    };
  });
  return arr;
};
var arrP = getProducts();
g.dispatch({
  i13nPage: {
    impressions: objectToArray(arrP),
  }
});
</script>
"

script_clickProduct="
<script>
var g = window.i13n;
var query = g.query;
var parseJson = g.parseJson;
g.dispatch('action', { 
  wait: 0,
  I13N: {
    action: 'ClickProduct'
  },
  i13nCb: function(e, I13N) {
    var ct = e.currentTarget;
    var t = e.target;
    var addToCartClassName = 'btn-add-to-cart';
    var isAddToCart = query.ancestor(t, '.'+addToCartClassName);
    if (isAddToCart || -1 !== t.className.indexOf(addToCartClassName)) {
      return false;
    }
    var pDom = ct.querySelector("product-item a");
    var data = pDom.getAttribute('ga-product');
    data = parseJson(data);
    I13N.products = [{id: data.id}];
    return I13N;
  },
});
</script>
"

script_addToCart="
<script>
var g = window.i13n;
var query = g.query;
var parseJson = g.parseJson;
var text = g.text;
var getElValue = g.getElValue;
var pId;
var popupAddToCart = function(e) {
    var t = e.currentTarget;
    var pDom = query.ancestor(t, '.product-info');
    var variation = pDom.querySelector('.variation-label--selected');
    var variant = text(variation);
    var quantity = getElValue('input[type="text"]', pDom);
    g.dispatch('action', {
      I13N: {
        action: 'AddToCart',
        products: [{
          id: pId,
          variant: variant,
          quantity: quantity
        }],
      }
    });
};
g.dispatch('action', {
  delay: 1500,
  I13N: {
    action: 'AddToCart'
  },
  i13nCb: function(e, I13N, p) {
    var t = e.currentTarget || p.currentTarget;
    var data;
    var pDom = query.ancestor(t, "a.quick-cart-item") || query.from(t).one("a.quick-cart-item");
    var detectPopup = query.one('.btn-quick-cart-add-to-cart');
    if (pDom) {
      data = pDom.getAttribute('ga-product');
      data = parseJson(data);
    }
    if (detectPopup) {
      pId= data.id;
      detectPopup.addEventListener('click', popupAddToCart);
      return;
    }
    if (pDom) {
      I13N.products = [{id: data.id, quantity: 1}];
      return I13N;
    }
  },
});
</script>
"

script_addToCartInDetail="
<script>
var g = window.i13n;
var query = g.query;
var text = g.text;
var get = g.get;
var getElValue = g.getElValue;
g.dispatch('action', {
  I13N: {
    action: 'AddToCart'
  },
  i13nCb: function(e, I13N, p, state) {
    var t = e.currentTarget || p.currentTarget;
    var pDom = query.ancestor(t, '.ProductDetail-product-info');
    var pInfo = get(state.get('pInfo'));
    var variation = pDom.querySelector('.variation-label--selected');
    var variant = text(variation);
    var quantity = getElValue('input[type="text"]', pDom);
    var pId = pInfo.id;
    I13N.products = [{
        id: pId,
        variant: variant,
        quantity: quantity
    }];
    return I13N;
  },
});
</script>
"

script_addToCartInDetailFixedBtn="
<script>
var g = window.i13n;
var query = g.query;
var text = g.text;
var get = g.get;
var getElValue = g.getElValue;
g.dispatch('action', {
  I13N: {
    action: "AddToCart"
  },
  i13nCb: function(e, I13N, p, state) {
    var t = e.currentTarget || p.currentTarget;
    var pInfo = get(state.get("pInfo"));
    var pId = pInfo.id;

    var pDom = query.one(":not(.ng-hide) > .ProductDetail-product");
    var quantity = getElValue("input[type='text']", pDom);

    var selectionDoms = query.from(pDom).all(".variation-label--selected");
    var variants = selectionDoms.map(v => text(v));

    I13N.products = [{
        id: pId,
        variant: (variants || []).join(","),
        quantity: quantity
    }];
    return I13N;
  },
});
</script>
"

script_checkoutLib="
<script>
var g = window.i13n;
var query = g.query;
var text = g.text;
var getNum = g.getNum;
var getElValue = g.getElValue;

g.getCheckoutProducts = function() {
  var products = [];
  var pRows = query.all('section.shopping-cart .table-row.row'); 
  if (pRows && pRows.length) {
    pRows.forEach(function(row){
      var name = text(row.querySelector(".description")).split('\n')[0]; 
      var id = row.getAttribute("product-id");
      var price = getNum(row.querySelector(".price-label"));
      var quantity = getElValue('.item-quantity input', row);
      if (quantity == null) {
        quantity = getNum(row.querySelector(".item-quantity"));
      }
      var variant = text(row.querySelector('.variant-name'));
      products.push({
        name: name,
        id: id,
        price: price,
        variant: variant,
        quantity: quantity
      });
    });
  }
  return products;
};

</script>
"

script_clickCartIcon="
<script>
var g = window.i13n;
g.dispatch('action', {
  I13N: {
    action: 'ClickCartIcon',
    stepNo: 1,
  }
});
</script>
"

script_clickCheckout="
<script>
var g = window.i13n;
g.dispatch('action', {
  wait: 0,
  I13N: {
    action: 'ClickCheckout',
    stepNo: 2,
  }
});
</script>
"

script_initCheckout="
<script>
var g = window.i13n;
var products = g.getCheckoutProducts(); 
var query = g.query;
var delegate = g.delegate;

g.dispatch({
  i13nPage: {
    stepNo: 3,
    products: products
  }
});

var checkoutCart = query.one(".shopping-cart .cart-items");
if (checkoutCart) {
  delegate(
    checkoutCart, 
    'mouseover',
    ".btn-remove-cart-item",
    function(e){ 
      var t = e.currentTarget;    
      var cartItem = query.ancestor(t, ".cart-item");
      var cartLink = query.from(cartItem).one("a");
      g.lastProdId = cartLink.href.split("/")[4];
    }
  );
}
</script>
"

script_clickConfirmCheckout="
<script>
var g = window.i13n;
g.dispatch('action', {
  wait: 0,
  I13N: {
    stepNo: 4,
    action: 'ClickConfirmCheckout'
  },
  i13nCb: function(e, I13N, p, state) {
    I13N.products = g.getCheckoutProducts(); 
    return I13N;
  },
});
</script>
"

script_initCheckout2="
<script>
var g = window.i13n;
var query = g.query;
var getNum = g.getNum;
var products = g.getCheckoutProducts(); 
g.dispatch({
  i13nPage: {
    stepNo: 5,
    products: products
  }
});
var getShip = function() {
  var dom = query.one('section.delivery-form .pull-right');
  if (dom) {
    return getNum(dom);
  }
};
var getTax = function() {
  var dom = query.one('section.payment-form .pull-right');
  if (dom) {
    return getNum(dom);
  }
};

var revenue = getNum(query.one('#summary-header-total-price'));
var shipping = getShip();
var tax = getTax();

g.dispatch('action', {
  wait: 99,
  stop: true,
  lazyKey: 'Purchase',
  I13N: {
    products: products,
    revenue: revenue,
    shipping: shipping,
    tax: tax,
  },
})
</script>
"

script_purchase="
<script>
var g = window.i13n;
var getRandomId = g.getRandomId;
var query = g.query;
var getNum = g.getNum;
g.dispatch('action', {
  withLazy: 'Purchase',
  I13N: {
    action: 'Purchase'
  },
  i13nCb: function(e, I13N, p, state) {
    var getShip = function() {
      var dom = query.one('section.delivery-form .pull-right');
      if (dom) {
        return getNum(dom);
      }
    };
    var getTax = function() {
      var dom = query.one('section.payment-form .pull-right');
      if (dom) {
        return getNum(dom);
      }
    };
    var getShoplineOrderId = function() {
      var text = g.text;
      var dom = query.one('.confirm-message');
      if (dom) {
        var domText = text(dom);
        var numReg = /(\-)?(\d+)(\.)?(\d+)?/g;
        var matchId = domText.replace(',', '').match(numReg)[0];
        if (matchId) {
          return matchId
        } else {
          return getRandomId()
        }
      }
    };
    I13N.purchaseId = getShoplineOrderId()
    return I13N;
  },
});
</script>
"

script_initSearch="
<script>
var g = window.i13n;
var getUrl = g.getUrl;
var keyword = getUrl('query');
if (keyword) {
  g.dispatch('action', {
    I13N: {
      action: 'Search',
      label: {
        search_string: keyword  
      }
    },
  });
}
</script>
"

script_clickRemoveCart="
<script>
var g = window.i13n;
var query = g.query

if (!g.lastProdId) return;

g.dispatch('action', {
  I13N: {
    action: 'RemoveFromCart',
  },
  i13nCb: function(e, I13N, params) {
    var ancestor = query.ancestor
    var item = ancestor(e.currentTarget, 'div.cart-item')
    I13N.products = [{id: g.lastProdId}];
    return I13N;
  }
});
</script>
";

script_getUid="
<script>
var g = window.i13n;
var query = g.query;
var delegate = g.delegate;
g.dispatch({ siteId: "Fruitpay" });
var memberIcon = query.one('a[href*="/users/"]');
if (memberIcon) {
  var memberLink = query.ancestor(memberIcon, 'a');
  if (memberLink && memberLink.href) {
    var hrefs = memberLink.href.split('/');
    var lastHref = hrefs.slice(-1)[0];
    if (lastHref==='edit') {
      var uid = hrefs.slice(-2)[0];
      g.dispatch({ uid: uid });
    }
  }
}
var dCart = query.one("#cart-panel .cart-items");
if (dCart) {
  delegate(
    dCart, 
    'mouseover',
    ".remove",
    function(e){ 
      var t = e.currentTarget;    
      var cartItem = query.ancestor(t, ".cart-item");
      var cartLink = cartItem && query.from(cartItem).one("a");
      g.lastProdId = cartLink.href.split("/")[4];
    }
  );
}
</script>
"
script_removeFromCartInCheckout="
<script>
var g = window.i13n;
var query = g.query

if (!g.lastProdId) return;

g.dispatch('action', {
  I13N: {
    action: 'RemoveFromCart',
  },
  i13nCb: function(e, I13N, params) {
    I13N.products = [{
      id: g.lastProdId
    }];
    return I13N;
  }
});
</script>
"