chore: stop tracking compiled blade cache

This commit is contained in:
2026-09-23 13:56:51 +07:00
parent 507fc6ccdf
commit edd2f626be
154 changed files with 1149 additions and 12046 deletions
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+142
View File
@@ -0,0 +1,142 @@
(function () {
'use strict';
// Kompatibilitas SweetAlert tanpa CDN eksternal.
window.Swal = window.Swal || {
fire: function (options) {
options = options || {};
if (typeof options === 'string') options = { title: options };
var title = options.title || '';
var rawText = options.text || options.html || '';
var text = String(rawText).replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim();
var message = [title, text].filter(Boolean).join('\n\n');
if (options.showCancelButton) {
var ok = window.confirm(message || 'Lanjutkan?');
return Promise.resolve({ isConfirmed: ok, isDismissed: !ok });
}
if (message) window.alert(message);
return Promise.resolve({ isConfirmed: true });
}
};
// Renderer line chart ringan sebagai pengganti Chart.js CDN untuk chart legacy ILYCats.
if (!window.Chart) {
window.Chart = function SimpleChart(target, config) {
this.canvas = target && target.canvas ? target.canvas : target;
this.config = config || {};
var self = this;
this._resize = function () { self.draw(); };
window.addEventListener('resize', this._resize);
this.draw();
};
window.Chart.prototype.destroy = function () {
window.removeEventListener('resize', this._resize);
};
window.Chart.prototype.draw = function () {
var canvas = this.canvas;
var config = this.config || {};
if (!canvas || !canvas.getContext || config.type !== 'line') return;
var labels = (config.data && config.data.labels) || [];
var datasets = (config.data && config.data.datasets) || [];
if (!labels.length || !datasets.length) return;
var parent = canvas.parentElement;
var width = Math.max(280, (parent && parent.clientWidth) || canvas.clientWidth || 600);
var height = Math.max(220, (parent && parent.clientHeight) || canvas.clientHeight || 300);
var dpr = window.devicePixelRatio || 1;
canvas.width = width * dpr;
canvas.height = height * dpr;
canvas.style.width = width + 'px';
canvas.style.height = height + 'px';
var ctx = canvas.getContext('2d');
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
ctx.clearRect(0, 0, width, height);
var pad = { left: 44, right: 18, top: 16, bottom: 36 };
var chartW = width - pad.left - pad.right;
var chartH = height - pad.top - pad.bottom;
var allValues = [];
datasets.forEach(function (ds) {
(ds.data || []).forEach(function (v) {
if (v !== null && v !== undefined && !isNaN(Number(v))) allValues.push(Number(v));
});
});
if (!allValues.length) return;
var minY = Math.min.apply(Math, allValues);
var maxY = Math.max.apply(Math, allValues);
var beginAtZero = !!(config.options && config.options.scales && config.options.scales.y && config.options.scales.y.beginAtZero === true);
if (beginAtZero) minY = 0;
if (minY === maxY) { minY = Math.max(0, minY - 1); maxY += 1; }
var margin = (maxY - minY) * 0.12;
if (!beginAtZero) minY = Math.max(0, minY - margin);
maxY += margin;
var xAt = function (i) {
return pad.left + (labels.length <= 1 ? chartW / 2 : (i / (labels.length - 1)) * chartW);
};
var yAt = function (v) {
return pad.top + chartH - ((Number(v) - minY) / (maxY - minY)) * chartH;
};
ctx.font = '11px system-ui, -apple-system, Segoe UI, sans-serif';
ctx.textBaseline = 'middle';
for (var i = 0; i <= 4; i++) {
var value = minY + (maxY - minY) * (i / 4);
var y = yAt(value);
ctx.strokeStyle = '#e2e8f0';
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(pad.left, y);
ctx.lineTo(pad.left + chartW, y);
ctx.stroke();
ctx.fillStyle = '#94a3b8';
ctx.textAlign = 'right';
ctx.fillText(value.toFixed(value < 10 ? 1 : 0), pad.left - 7, y);
}
var labelStep = Math.max(1, Math.ceil(labels.length / 6));
labels.forEach(function (label, idx) {
if (idx % labelStep !== 0 && idx !== labels.length - 1) return;
ctx.fillStyle = '#94a3b8';
ctx.textAlign = 'center';
ctx.fillText(String(label), xAt(idx), height - 15);
});
var palette = ['#2563eb', '#059669', '#db2777', '#d97706', '#7c3aed', '#0891b2'];
datasets.forEach(function (ds, index) {
var color = ds.borderColor || palette[index % palette.length];
var values = ds.data || [];
ctx.strokeStyle = color;
ctx.lineWidth = Number(ds.borderWidth || 2.5);
ctx.lineJoin = 'round';
ctx.lineCap = 'round';
ctx.beginPath();
var started = false;
values.forEach(function (v, idx) {
if (v === null || v === undefined) { started = false; return; }
var x = xAt(idx), y = yAt(v);
if (!started) { ctx.moveTo(x, y); started = true; } else { ctx.lineTo(x, y); }
});
ctx.stroke();
values.forEach(function (v, idx) {
if (v === null || v === undefined) return;
ctx.fillStyle = ds.pointBackgroundColor || '#fff';
ctx.strokeStyle = ds.pointBorderColor || color;
ctx.lineWidth = Number(ds.pointBorderWidth || 2);
ctx.beginPath();
ctx.arc(xAt(idx), yAt(v), Number(ds.pointRadius || 3), 0, Math.PI * 2);
ctx.fill();
ctx.stroke();
});
});
};
}
})();