16#Octopus/Octoplus/Medusa-Frp Tool✅ANNUAL RENEW ACTIVATIONS-1 Year For Box/Dongle
Information
Service description
Install the latest version and renew licence for 1 year 14) {
imei = imei.substring(0, 14);
imeiInput.value = imei;
}
if (imei.length === 14) {
var checkDigit = calculateImeiChecksum(imei);
var fullImei = imei + checkDigit;
console.log('IMEI:', imei, 'Check:', checkDigit, 'Full:', fullImei);
if (lastDigitElement) lastDigitElement.textContent = checkDigit;
if (fullImeiElement) fullImeiElement.value = fullImei;
return fullImei;
} else {
if (lastDigitElement) lastDigitElement.textContent = '0';
if (fullImeiElement) fullImeiElement.value = '';
return '';
}
}
if (imeiInput) {
imeiInput.addEventListener('input', updateFullImei);
imeiInput.addEventListener('change', updateFullImei);
imeiInput.addEventListener('keyup', updateFullImei);
}
// Form submit handler with double-click protection
if (checkoutForm) {
var submitBtn = checkoutForm.querySelector('.btn-submit');
var submitBtnOriginalText = submitBtn ? submitBtn.textContent : '';
var isSubmitting = false;
checkoutForm.addEventListener('submit', function(e) {
// Block if Chimera verification required but not done
if (chimeraRequired && !chimeraVerified) {
e.preventDefault();
alert('Please verify your account with ChimeraTool before submitting.');
return false;
}
// Block duplicate submissions
if (isSubmitting) {
e.preventDefault();
return false;
}
// Validate IMEI if present
if (imeiInput && imeiInput.value.length > 0) {
var fullImei = updateFullImei();
if (!fullImei || fullImei.length !== 15) {
e.preventDefault();
alert('Please enter a valid 14-digit IMEI');
imeiInput.focus();
return false;
}
}
// Lock the form - prevent double submission
isSubmitting = true;
if (submitBtn) {
submitBtn.disabled = true;
submitBtn.innerHTML = ' Submitting...';
}
return true;
});
}
// ===== BULK IMEI HANDLER =====
document.addEventListener('click', function(e) {
var addBtn = e.target.closest('.add-to-bulk');
if (!addBtn) return;
e.preventDefault();
var inputGroup = addBtn.closest('.imei-input-group');
if (!inputGroup) return;
var inputField = inputGroup.querySelector('.imei') || inputGroup.querySelector('.bulk-source-input');
var fullImeiEl = inputGroup.querySelector('.full-imei');
if (!inputField) return;
var valueToAppend = fullImeiEl ? fullImeiEl.value : inputField.value.trim();
if (valueToAppend && (!fullImeiEl || valueToAppend.length === 15)) {
var bulkArea = document.getElementById('bulk_imei') ||
document.getElementById('bulk_device_text') ||
document.querySelector('textarea[name="bulk_device"]');
if (bulkArea) {
bulkArea.value = bulkArea.value ? bulkArea.value + '\n' + valueToAppend : valueToAppend;
inputField.value = '';
if (fullImeiEl) {
fullImeiEl.value = '';
}
var lastDigit = inputGroup.querySelector('.imei-last-digit');
if (lastDigit) lastDigit.textContent = '0';
inputField.focus();
}
} else if (fullImeiEl) {
alert('Please enter a valid 14-digit IMEI');
}
});
// Enter key for bulk
document.addEventListener('keypress', function(e) {
if ((e.target.classList.contains('imei') || e.target.classList.contains('bulk-source-input')) && e.target.classList.contains('no-submit') && e.key === 'Enter') {
e.preventDefault();
var addBtn = e.target.closest('.imei-input-group')?.querySelector('.add-to-bulk');
if (addBtn) addBtn.click();
}
});
// ===== QUANTITY HANDLER =====
var quantityInput = document.getElementById('quantity');
var totalPriceElement = document.getElementById('totalPrice');
var deviceQuantityInput = document.getElementById('device_quantity');
if (quantityInput && totalPriceElement) {
var unitPrice = parseFloat(quantityInput.dataset.unitPrice) || 0;
var minQty = parseInt(quantityInput.min) || 1;
var maxQty = parseInt(quantityInput.max) || 10000;
function updateTotalPrice() {
var quantity = parseInt(quantityInput.value) || 0;
if (quantity < minQty) quantity = minQty;
if (quantity > maxQty) quantity = maxQty;
var total = (unitPrice * quantity).toFixed(2);
totalPriceElement.textContent = AppCurrency.format(total);
if (deviceQuantityInput) deviceQuantityInput.value = quantity;
}
quantityInput.addEventListener('input', updateTotalPrice);
quantityInput.addEventListener('change', updateTotalPrice);
updateTotalPrice();
// ===== QUANTITY STEPPER BUTTONS (- / +) =====
var qtyMinusBtn = document.querySelector('.qty-minus');
var qtyPlusBtn = document.querySelector('.qty-plus');
function stepQuantity(delta) {
var quantity = parseInt(quantityInput.value) || minQty;
quantity += delta;
if (quantity < minQty) quantity = minQty;
if (quantity > maxQty) quantity = maxQty;
quantityInput.value = quantity;
quantityInput.dispatchEvent(new Event('input', { bubbles: true }));
}
if (qtyMinusBtn) qtyMinusBtn.addEventListener('click', function() { stepQuantity(-1); });
if (qtyPlusBtn) qtyPlusBtn.addEventListener('click', function() { stepQuantity(1); });
}
// ===== COUPON CODE =====
(function() {
var toggleBtn = document.getElementById('couponToggle');
var panel = document.getElementById('couponPanel');
var input = document.getElementById('couponInput');
var applyBtn = document.getElementById('couponApplyBtn');
var feedback = document.getElementById('couponFeedback');
var hiddenField = document.getElementById('couponCodeField');
if (!toggleBtn || !panel || !input || !applyBtn) return;
toggleBtn.addEventListener('click', function() {
var willShow = panel.hidden;
panel.hidden = !willShow;
toggleBtn.classList.toggle('active', willShow);
if (willShow) input.focus();
});
function setFeedback(text, state) {
feedback.textContent = text || '';
feedback.className = 'coupon-feedback' + (state ? ' ' + state : '');
}
function applyCoupon() {
var code = input.value.trim();
if (!code) {
setFeedback('Enter coupon code', 'error');
input.focus();
return;
}
var csrfToken = document.querySelector('meta[name="csrf-token"]');
if (!csrfToken) { window.location.href = '/login'; return; }
applyBtn.disabled = true;
applyBtn.classList.add('loading');
applyBtn.textContent = 'Applying...';
setFeedback('', '');
var quantityEl = document.getElementById('quantity');
var body = { coupon_code: code };
if (quantityEl) body.quantity = quantityEl.value;
fetch('https://gsmpromax.eu/checkout/coupon/server/74', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': csrfToken.content,
'Accept': 'application/json'
},
body: JSON.stringify(body)
})
.then(function(r) { return r.json().then(function(data) { data.__status = r.status; return data; }); })
.then(function(data) {
if (data.__status === 401 || data.message === 'Unauthenticated.') { window.location.href = '/login'; return; }
if (data.success) {
hiddenField.value = code;
input.disabled = true;
applyBtn.textContent = '✓';
panel.classList.add('coupon-success');
setFeedback((data.message || 'Coupon applied!') + ' −' + data.discount_formatted, 'success');
} else {
hiddenField.value = '';
applyBtn.disabled = false;
applyBtn.classList.remove('loading');
applyBtn.textContent = 'Apply';
panel.classList.remove('coupon-success');
panel.classList.add('coupon-shake');
setTimeout(function() { panel.classList.remove('coupon-shake'); }, 400);
setFeedback(data.message || 'Invalid coupon code.', 'error');
}
})
.catch(function() {
applyBtn.disabled = false;
applyBtn.classList.remove('loading');
applyBtn.textContent = 'Apply';
setFeedback('Network error, please try again.', 'error');
});
}
applyBtn.addEventListener('click', applyCoupon);
input.addEventListener('keypress', function(e) {
if (e.key === 'Enter') { e.preventDefault(); applyCoupon(); }
});
input.addEventListener('input', function() {
if (hiddenField.value) { hiddenField.value = ''; }
});
})();
// ===== REAL-TIME PRICE POLLING (adaptatif) =====
(function() {
var pollUrl = 'https://gsmpromax.eu/checkout/price/server/74';
var lastKnownPrice = 30.5;
var isQuantityService = true;
var lastChangeTs = 0;
var pollTimer = null;
var normalInterval = 60000; // 60s en temps normal
var fastInterval = 10000; // 10s apres un changement detecte
var currentInterval = normalInterval;
function flashElement(el) {
if (!el) return;
el.classList.remove('price-changed');
void el.offsetWidth;
el.classList.add('price-changed');
el.addEventListener('animationend', function handler() {
el.classList.remove('price-changed');
el.removeEventListener('animationend', handler);
});
}
function updatePriceDisplay(newPriceUsd) {
var formatted = AppCurrency.format(newPriceUsd);
if (isQuantityService) {
var unitPriceEl = document.querySelector('.unit-price');
if (unitPriceEl) {
unitPriceEl.childNodes[0].textContent = formatted + ' ';
flashElement(unitPriceEl);
}
var qtyInput = document.getElementById('quantity');
if (qtyInput) {
qtyInput.dataset.unitPrice = newPriceUsd;
unitPrice = newPriceUsd;
updateTotalPrice();
flashElement(document.getElementById('totalPrice'));
}
} else {
var priceBadge = document.querySelector('.service-price-badge');
if (priceBadge) {
priceBadge.textContent = formatted;
flashElement(priceBadge);
}
}
lastKnownPrice = newPriceUsd;
}
function pollPrice() {
fetch(pollUrl, {
method: 'GET',
headers: { 'Accept': 'application/json', 'X-Requested-With': 'XMLHttpRequest' }
})
.then(function(r) {
if (!r.ok) throw new Error('HTTP ' + r.status);
return r.json();
})
.then(function(data) {
// Detecter si des prix ont change globalement
if (data.t && data.t > lastChangeTs) {
lastChangeTs = data.t;
// Passer en mode rapide temporairement
if (currentInterval !== fastInterval) {
currentInterval = fastInterval;
restartPolling();
// Revenir au mode normal apres 30s
setTimeout(function() {
currentInterval = normalInterval;
restartPolling();
}, 30000);
}
}
if (data.price !== undefined && Math.abs(data.price - lastKnownPrice) > 0.001) {
updatePriceDisplay(data.price);
}
})
.catch(function(err) {
console.warn('Price poll error:', err.message);
});
}
function restartPolling() {
if (pollTimer) clearInterval(pollTimer);
pollTimer = setInterval(pollPrice, currentInterval);
}
function stopPolling() {
if (pollTimer) { clearInterval(pollTimer); pollTimer = null; }
}
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
stopPolling();
} else {
pollPrice();
restartPolling();
}
});
restartPolling();
})();
});
// Étoiles cliquables — redirige vers blog/create pour écrire un avis
document.querySelectorAll('.checkout-stars .checkout-star').forEach(function(star) {
star.addEventListener('click', function() {
var val = parseInt(this.getAttribute('data-value'));
var container = this.closest('.checkout-stars');
container.setAttribute('data-rating', val);
container.querySelectorAll('.checkout-star').forEach(function(s) {
s.classList.toggle('active', parseInt(s.getAttribute('data-value')) <= val);
});
var sid = container.getAttribute('data-service-id');
var stype = container.getAttribute('data-type');
if (sid && stype) {
var reviewServiceType = (stype === 'remote' ? 'file' : stype) + '_service';
setTimeout(function(){
window.location.href = '/blog/create?post_type=review&service_type=' + reviewServiceType + '&service_id=' + sid + '&rating=' + val;
}, 350);
}
});
});
// Hover preview sur les étoiles
document.querySelectorAll('.checkout-stars .checkout-star').forEach(function(star) {
star.addEventListener('mouseenter', function() {
var val = parseInt(this.getAttribute('data-value'));
this.closest('.checkout-stars').querySelectorAll('.checkout-star').forEach(function(s) {
s.classList.toggle('hover-preview', parseInt(s.getAttribute('data-value')) <= val);
});
});
star.addEventListener('mouseleave', function() {
this.closest('.checkout-stars').querySelectorAll('.checkout-star').forEach(function(s) {
s.classList.remove('hover-preview');
});
});
});
/* ═══════════════════════════════════════════
Like + Quick-rate (checkout page)
═══════════════════════════════════════════ */
function toggleCardLike(event, btn) {
event.preventDefault();
event.stopPropagation();
var url = btn.dataset.url;
var csrfToken = document.querySelector('meta[name="csrf-token"]');
if (!csrfToken) { window.location.href = '/login'; return; }
btn.disabled = true;
fetch(url, {
method: 'POST',
headers: { 'X-CSRF-TOKEN': csrfToken.content, 'Accept': 'application/json' }
})
.then(function(r) {
return r.json().catch(function() { return {}; }).then(function(data) {
data.__status = r.status;
return data;
});
})
.then(function(data) {
if (data.login_required || data.__status === 401 || data.message === 'Unauthenticated.') { window.location.href = '/login'; return; }
if (data.success) {
var selector = '[data-id="' + btn.dataset.id + '"][data-type="' + btn.dataset.type + '"].qty-fav-btn';
document.querySelectorAll(selector).forEach(function(b) {
b.classList.toggle('liked', data.liked);
b.setAttribute('aria-label', (data.liked ? 'Unlike' : 'Like') + ' this service');
var lc = b.querySelector('.lc');
if (lc) lc.textContent = data.count > 0 ? data.count : '';
});
}
})
.catch(function() {})
.finally(function() { btn.disabled = false; });
}
var _rateTarget = null;
function openRateModal(event, starsEl) {
event.preventDefault();
event.stopPropagation();
_rateTarget = starsEl;
var name = starsEl.dataset.name || 'this service';
var current = parseInt(starsEl.dataset.rating) || 0;
var overlay = document.createElement('div');
overlay.className = 'qrate-overlay';
overlay.setAttribute('id', 'qrateOverlay');
overlay.innerHTML = [
'
' + escHtml(name) + '
', 'Your quick rating (1-5 stars)
', '