From 1e8f90bcf048bbc0891aec7b389b6ee0f6947698 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 2 Oct 2023 11:46:08 -0700 Subject: [PATCH 01/45] gives proper margin-top to sidebar menu on bigger resolutions --- resources/assets/less/overrides.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/assets/less/overrides.less b/resources/assets/less/overrides.less index f5625bd7b4..af922fc080 100644 --- a/resources/assets/less/overrides.less +++ b/resources/assets/less/overrides.less @@ -680,15 +680,15 @@ th.css-accessory > .th-inner::before margin-top:160px; } } -@media screen and (max-width: 771px) and (min-width: 512px){ +@media screen and (max-width: 912px) and (min-width: 512px){ .sidebar-menu { - margin-top:160px + margin-top:100px } } -@media screen and (max-width: 1098px) and (min-width: 772px){ +@media screen and (max-width: 1268px) and (min-width: 912px){ .sidebar-menu { - margin-top:98px + margin-top:50px } } From dee36fc294a9a74d1453cb207b064f7341d8725b Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 3 Oct 2023 12:30:08 -0700 Subject: [PATCH 02/45] adds component checkin to asset tab --- .../Components/ComponentCheckinController.php | 10 +- public/css/build/app.css | 8 +- public/css/build/overrides.css | 8 +- public/css/dist/all.css | 18 +- public/css/dist/bootstrap-table.css | 2 +- public/js/dist/bootstrap-table.js | 601 +++++++++++------- public/mix-manifest.json | 10 +- resources/assets/less/overrides.less | 8 +- resources/views/components/checkin.blade.php | 2 +- resources/views/hardware/view.blade.php | 5 + 10 files changed, 405 insertions(+), 267 deletions(-) diff --git a/app/Http/Controllers/Components/ComponentCheckinController.php b/app/Http/Controllers/Components/ComponentCheckinController.php index 09acee0277..395d75b6ac 100644 --- a/app/Http/Controllers/Components/ComponentCheckinController.php +++ b/app/Http/Controllers/Components/ComponentCheckinController.php @@ -30,6 +30,7 @@ class ComponentCheckinController extends Controller // This could probably be done more cleanly but I am very tired. - @snipe if ($component_assets = DB::table('components_assets')->find($component_asset_id)) { + if (is_null($component = Component::find($component_assets->component_id))) { return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found')); } @@ -42,7 +43,7 @@ class ComponentCheckinController extends Controller return view('components/checkin', compact('component_assets', 'component', 'asset')); } - return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found')); +// return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found')); } /** @@ -56,10 +57,11 @@ class ComponentCheckinController extends Controller * @return \Illuminate\Http\RedirectResponse * @throws \Illuminate\Auth\Access\AuthorizationException */ - public function store(Request $request, $component_asset_id) + public function store(Request $request, $component_asset_id, $backto = null) { if ($component_assets = DB::table('components_assets')->find($component_asset_id)) { if (is_null($component = Component::find($component_assets->component_id))) { + return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found')); } @@ -95,6 +97,10 @@ class ComponentCheckinController extends Controller $asset = Asset::find($component_assets->asset_id); event(new CheckoutableCheckedIn($component, $asset, Auth::user(), $request->input('note'), Carbon::now())); + if($backto == 'asset'){ + return redirect()->route('hardware.view', $asset->id)->with('success', + trans('admin/components/message.checkin.success')); + } return redirect()->route('components.index')->with('success', trans('admin/components/message.checkin.success')); diff --git a/public/css/build/app.css b/public/css/build/app.css index c8fc025597..b82e27befc 100644 --- a/public/css/build/app.css +++ b/public/css/build/app.css @@ -964,14 +964,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { diff --git a/public/css/build/overrides.css b/public/css/build/overrides.css index 5111695ac7..4020194f84 100644 --- a/public/css/build/overrides.css +++ b/public/css/build/overrides.css @@ -597,14 +597,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { diff --git a/public/css/dist/all.css b/public/css/dist/all.css index 3313bdac45..de7c6eb786 100644 --- a/public/css/dist/all.css +++ b/public/css/dist/all.css @@ -22385,7 +22385,7 @@ a.ui-button:active, /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVra28tbGlnaHRib3guY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQ0UsOEJBQXlCLEFBQXpCLHVCQUF5QixBQUN6QixzQkFBb0IsQUFBcEIsbUJBQW9CLEFBQ3BCLHFCQUF3QixBQUF4Qix1QkFBd0IsQUFDeEIseUJBQTZCLENBQzlCLEFBQ0QseUJBQ0UsaUJBQW1CLENBQ3BCLEFBQ0QsZ0RBQ0Usa0JBQW1CLEFBQ25CLE1BQU8sQUFDUCxPQUFRLEFBQ1IsU0FBVSxBQUNWLFFBQVMsQUFDVCxVQUFZLENBQ2IsQUFDRCxzQkFDRSxXQUFZLEFBQ1osV0FBYSxDQUNkLEFBQ0QsMkJBQ0UsVUFBYSxBQUNiLGtCQUFtQixBQUNuQixNQUFPLEFBQ1AsT0FBUSxBQUNSLFdBQVksQUFDWixZQUFhLEFBQ2Isb0JBQWMsQUFBZCxZQUFjLENBQ2YsQUFDRCw2QkFDRSxXQUFRLEFBQVIsT0FBUSxBQUNSLG9CQUFjLEFBQWQsYUFBYyxBQUNkLHNCQUFvQixBQUFwQixtQkFBb0IsQUFDcEIsVUFBVyxBQUNYLHVCQUF5QixBQUN6QixXQUFZLEFBQ1osZUFBZ0IsQUFDaEIsU0FBYSxDQUNkLEFBQ0QsK0JBQ0Usb0JBQWEsQUFBYixXQUFhLENBQ2QsQUFDRCxvQ0FDRSxZQUFjLENBQ2YsQUFDRCxrQ0FDRSxjQUFnQixDQUNqQixBQUNELDZDQUNFLGdCQUFrQixDQUNuQixBQUNELG1DQUNFLG9CQUFzQixDQUN2QixBQUNELG1DQUNFLFlBQWMsQ0FDZixBQUNELHNDQUNFLGVBQWdCLEFBQ2hCLGlCQUFtQixDQUNwQixBQUNELHVCQUNFLFVBQVcsQUFDWCxvQkFBc0IsQ0FDdkIsQUFDRCw2QkFDRSxZQUFjLENBQ2YsQUFDRCw2QkFDRSxlQUFpQixDQUNsQixBQUNELHNCQUNFLGtCQUFtQixBQUNuQixNQUFPLEFBQ1AsT0FBUSxBQUNSLFNBQVUsQUFDVixRQUFTLEFBQ1QsV0FBWSxBQUNaLG9CQUFjLEFBQWQsYUFBYyxBQUVkLDBCQUF1QixBQUF2QixzQkFBdUIsQUFFdkIscUJBQXdCLEFBQXhCLHVCQUF3QixBQUV4QixzQkFBb0IsQUFBcEIsa0JBQW9CLENBQ3JCLEFBQ0QsMEJBQ0UsV0FBWSxBQUNaLFlBQWEsQUFDYixrQkFBbUIsQUFDbkIsaUJBQW1CLENBQ3BCLEFBQ0QsOEJBQ0UsV0FBWSxBQUNaLFlBQWEsQUFDYixrQkFBbUIsQUFDbkIsc0JBQXVCLEFBQ3ZCLFdBQWEsQUFDYixrQkFBbUIsQUFDbkIsTUFBTyxBQUNQLE9BQVEsQUFDUixtQ0FBNkMsQ0FDOUMsQUFDRCx5Q0FDRSxtQkFBcUIsQ0FDdEIsQUFDRCw0Q0FDRSxxQkFBdUIsQ0FDeEIsQUFVRCxhQUNFLE1BRUUsbUJBQW9CLEFBQ3BCLDBCQUE0QixDQUM3QixBQUNELElBQ0UsbUJBQW9CLEFBQ3BCLDBCQUE0QixDQUM3QixDQUNGIiwiZmlsZSI6ImVra28tbGlnaHRib3guY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmVra28tbGlnaHRib3gge1xuICBkaXNwbGF5OiBmbGV4ICFpbXBvcnRhbnQ7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBwYWRkaW5nLXJpZ2h0OiAwcHghaW1wb3J0YW50O1xufVxuLmVra28tbGlnaHRib3gtY29udGFpbmVyIHtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xufVxuLmVra28tbGlnaHRib3gtY29udGFpbmVyID4gZGl2LmVra28tbGlnaHRib3gtaXRlbSB7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICBib3R0b206IDA7XG4gIHJpZ2h0OiAwO1xuICB3aWR0aDogMTAwJTtcbn1cbi5la2tvLWxpZ2h0Ym94IGlmcmFtZSB7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSB7XG4gIHotaW5kZXg6IDEwMDtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB0b3A6IDA7XG4gIGxlZnQ6IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGRpc3BsYXk6IGZsZXg7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhIHtcbiAgZmxleDogMTtcbiAgZGlzcGxheTogZmxleDtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgb3BhY2l0eTogMDtcbiAgdHJhbnNpdGlvbjogb3BhY2l0eSAwLjVzO1xuICBjb2xvcjogI2ZmZjtcbiAgZm9udC1zaXplOiAzMHB4O1xuICB6LWluZGV4OiAxMDA7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhID4gKiB7XG4gIGZsZXgtZ3JvdzogMTtcbn1cbi5la2tvLWxpZ2h0Ym94LW5hdi1vdmVybGF5IGEgPiAqOmZvY3VzIHtcbiAgb3V0bGluZTogbm9uZTtcbn1cbi5la2tvLWxpZ2h0Ym94LW5hdi1vdmVybGF5IGEgc3BhbiB7XG4gIHBhZGRpbmc6IDAgMzBweDtcbn1cbi5la2tvLWxpZ2h0Ym94LW5hdi1vdmVybGF5IGE6bGFzdC1jaGlsZCBzcGFuIHtcbiAgdGV4dC1hbGlnbjogcmlnaHQ7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhOmhvdmVyIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuLmVra28tbGlnaHRib3gtbmF2LW92ZXJsYXkgYTpmb2N1cyB7XG4gIG91dGxpbmU6IG5vbmU7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhLmRpc2FibGVkIHtcbiAgY3Vyc29yOiBkZWZhdWx0O1xuICB2aXNpYmlsaXR5OiBoaWRkZW47XG59XG4uZWtrby1saWdodGJveCBhOmhvdmVyIHtcbiAgb3BhY2l0eTogMTtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuLmVra28tbGlnaHRib3ggLm1vZGFsLWRpYWxvZyB7XG4gIGRpc3BsYXk6IG5vbmU7XG59XG4uZWtrby1saWdodGJveCAubW9kYWwtZm9vdGVyIHtcbiAgdGV4dC1hbGlnbjogbGVmdDtcbn1cbi5la2tvLWxpZ2h0Ym94LWxvYWRlciB7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICBib3R0b206IDA7XG4gIHJpZ2h0OiAwO1xuICB3aWR0aDogMTAwJTtcbiAgZGlzcGxheTogZmxleDtcbiAgLyogZXN0YWJsaXNoIGZsZXggY29udGFpbmVyICovXG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIC8qIG1ha2UgbWFpbiBheGlzIHZlcnRpY2FsICovXG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAvKiBjZW50ZXIgaXRlbXMgdmVydGljYWxseSwgaW4gdGhpcyBjYXNlICovXG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG59XG4uZWtrby1saWdodGJveC1sb2FkZXIgPiBkaXYge1xuICB3aWR0aDogNDBweDtcbiAgaGVpZ2h0OiA0MHB4O1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIHRleHQtYWxpZ246IGNlbnRlcjtcbn1cbi5la2tvLWxpZ2h0Ym94LWxvYWRlciA+IGRpdiA+IGRpdiB7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGJvcmRlci1yYWRpdXM6IDUwJTtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcbiAgb3BhY2l0eTogMC42O1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHRvcDogMDtcbiAgbGVmdDogMDtcbiAgYW5pbWF0aW9uOiBzay1ib3VuY2UgMnMgaW5maW5pdGUgZWFzZS1pbi1vdXQ7XG59XG4uZWtrby1saWdodGJveC1sb2FkZXIgPiBkaXYgPiBkaXY6bGFzdC1jaGlsZCB7XG4gIGFuaW1hdGlvbi1kZWxheTogLTFzO1xufVxuLm1vZGFsLWRpYWxvZyAuZWtrby1saWdodGJveC1sb2FkZXIgPiBkaXYgPiBkaXYge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjMzMzO1xufVxuQC13ZWJraXQta2V5ZnJhbWVzIHNrLWJvdW5jZSB7XG4gIDAlLFxuICAxMDAlIHtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMCk7XG4gIH1cbiAgNTAlIHtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbn1cbkBrZXlmcmFtZXMgc2stYm91bmNlIHtcbiAgMCUsXG4gIDEwMCUge1xuICAgIHRyYW5zZm9ybTogc2NhbGUoMCk7XG4gICAgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDApO1xuICB9XG4gIDUwJSB7XG4gICAgdHJhbnNmb3JtOiBzY2FsZSgxKTtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbn1cbiJdfQ== */ /** * @author zhixin wen - * version: 1.22.0 + * version: 1.22.1 * https://github.com/wenzhixin/bootstrap-table/ */ /* stylelint-disable annotation-no-unknown, max-line-length */ @@ -23730,14 +23730,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { @@ -24968,14 +24968,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { diff --git a/public/css/dist/bootstrap-table.css b/public/css/dist/bootstrap-table.css index c8749ad4b4..301c592a5d 100644 --- a/public/css/dist/bootstrap-table.css +++ b/public/css/dist/bootstrap-table.css @@ -1,6 +1,6 @@ /** * @author zhixin wen - * version: 1.22.0 + * version: 1.22.1 * https://github.com/wenzhixin/bootstrap-table/ */ /* stylelint-disable annotation-no-unknown, max-line-length */ diff --git a/public/js/dist/bootstrap-table.js b/public/js/dist/bootstrap-table.js index 53d6e2d52d..c01fba3e19 100644 --- a/public/js/dist/bootstrap-table.js +++ b/public/js/dist/bootstrap-table.js @@ -2,7 +2,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery)); -})(this, (function ($$o) { 'use strict'; +})(this, (function ($$p) { 'use strict'; function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; @@ -181,7 +181,7 @@ var objectGetOwnPropertyDescriptor = {}; - var fails$u = function (exec) { + var fails$v = function (exec) { try { return !!exec(); } catch (error) { @@ -189,17 +189,17 @@ } }; - var fails$t = fails$u; + var fails$u = fails$v; // Detect IE8's incomplete defineProperty implementation - var descriptors = !fails$t(function () { + var descriptors = !fails$u(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); - var fails$s = fails$u; + var fails$t = fails$v; - var functionBindNative = !fails$s(function () { + var functionBindNative = !fails$t(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe @@ -261,14 +261,14 @@ }; var uncurryThis$y = functionUncurryThis; - var fails$r = fails$u; + var fails$s = fails$v; var classof$7 = classofRaw$2; var $Object$4 = Object; var split = uncurryThis$y(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings - var indexedObject = fails$r(function () { + var indexedObject = fails$s(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object$4('z').propertyIsEnumerable(0); @@ -383,10 +383,10 @@ /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION$2 = engineV8Version; - var fails$q = fails$u; + var fails$r = fails$v; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing - var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$q(function () { + var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$r(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances @@ -511,12 +511,12 @@ // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject - var toObject$9 = function (argument) { + var toObject$a = function (argument) { return $Object$2(requireObjectCoercible$9(argument)); }; var uncurryThis$w = functionUncurryThis; - var toObject$8 = toObject$9; + var toObject$9 = toObject$a; var hasOwnProperty = uncurryThis$w({}.hasOwnProperty); @@ -524,7 +524,7 @@ // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { - return hasOwnProperty(toObject$8(it), key); + return hasOwnProperty(toObject$9(it), key); }; var uncurryThis$v = functionUncurryThis; @@ -604,11 +604,11 @@ }; var DESCRIPTORS$e = descriptors; - var fails$p = fails$u; + var fails$q = fails$v; var createElement = documentCreateElement$2; // Thanks to IE8 for its funny defineProperty - var ie8DomDefine = !DESCRIPTORS$e && !fails$p(function () { + var ie8DomDefine = !DESCRIPTORS$e && !fails$q(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } @@ -641,11 +641,11 @@ var objectDefineProperty = {}; var DESCRIPTORS$c = descriptors; - var fails$o = fails$u; + var fails$p = fails$v; // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 - var v8PrototypeDefineBug = DESCRIPTORS$c && fails$o(function () { + var v8PrototypeDefineBug = DESCRIPTORS$c && fails$p(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, @@ -848,7 +848,7 @@ }; var uncurryThis$t = functionUncurryThis; - var fails$n = fails$u; + var fails$o = fails$v; var isCallable$b = isCallable$j; var hasOwn$7 = hasOwnProperty_1; var DESCRIPTORS$8 = descriptors; @@ -865,7 +865,7 @@ var replace$4 = uncurryThis$t(''.replace); var join = uncurryThis$t([].join); - var CONFIGURABLE_LENGTH = DESCRIPTORS$8 && !fails$n(function () { + var CONFIGURABLE_LENGTH = DESCRIPTORS$8 && !fails$o(function () { return defineProperty$7(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); @@ -1098,7 +1098,7 @@ } }; - var fails$m = fails$u; + var fails$n = fails$v; var isCallable$9 = isCallable$j; var replacement = /#|\.prototype\./; @@ -1107,7 +1107,7 @@ var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false - : isCallable$9(detection) ? fails$m(detection) + : isCallable$9(detection) ? fails$n(detection) : !!detection; }; @@ -1189,11 +1189,11 @@ var DESCRIPTORS$7 = descriptors; var uncurryThis$q = functionUncurryThis; var call$9 = functionCall; - var fails$l = fails$u; + var fails$m = fails$v; var objectKeys$2 = objectKeys$3; var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; var propertyIsEnumerableModule = objectPropertyIsEnumerable; - var toObject$7 = toObject$9; + var toObject$8 = toObject$a; var IndexedObject$2 = indexedObject; // eslint-disable-next-line es/no-object-assign -- safe @@ -1204,7 +1204,7 @@ // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign - var objectAssign = !$assign || fails$l(function () { + var objectAssign = !$assign || fails$m(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS$7 && $assign({ b: 1 }, $assign(defineProperty$6({}, 'a', { enumerable: true, @@ -1225,7 +1225,7 @@ alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` - var T = toObject$7(target); + var T = toObject$8(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; @@ -1243,13 +1243,13 @@ } return T; } : $assign; - var $$n = _export; + var $$o = _export; var assign = objectAssign; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing - $$n({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { + $$o({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { assign: assign }); @@ -1337,7 +1337,7 @@ }; var PROPER_FUNCTION_NAME$2 = functionName.PROPER; - var fails$k = fails$u; + var fails$l = fails$v; var whitespaces$2 = whitespaces$4; var non = '\u200B\u0085\u180E'; @@ -1345,36 +1345,36 @@ // check that a method works with the correct list // of whitespaces and has a correct name var stringTrimForced = function (METHOD_NAME) { - return fails$k(function () { + return fails$l(function () { return !!whitespaces$2[METHOD_NAME]() || non[METHOD_NAME]() !== non || (PROPER_FUNCTION_NAME$2 && whitespaces$2[METHOD_NAME].name !== METHOD_NAME); }); }; - var $$m = _export; + var $$n = _export; var $trim = stringTrim.trim; var forcedStringTrimMethod = stringTrimForced; // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim - $$m({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + $$n({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { trim: function trim() { return $trim(this); } }); - var fails$j = fails$u; + var fails$k = fails$v; var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; - return !!method && fails$j(function () { + return !!method && fails$k(function () { // eslint-disable-next-line no-useless-call -- required for testing method.call(null, argument || function () { return 1; }, 1); }); }; - var $$l = _export; + var $$m = _export; var uncurryThis$o = functionUncurryThis; var IndexedObject$1 = indexedObject; var toIndexedObject$4 = toIndexedObject$8; @@ -1387,7 +1387,7 @@ // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join - $$l({ target: 'Array', proto: true, forced: FORCED$6 }, { + $$m({ target: 'Array', proto: true, forced: FORCED$6 }, { join: function join(separator) { return nativeJoin(toIndexedObject$4(this), separator === undefined ? ',' : separator); } @@ -1411,13 +1411,13 @@ return result; }; - var fails$i = fails$u; + var fails$j = fails$v; var global$a = global$k; // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError var $RegExp$2 = global$a.RegExp; - var UNSUPPORTED_Y$3 = fails$i(function () { + var UNSUPPORTED_Y$3 = fails$j(function () { var re = $RegExp$2('a', 'y'); re.lastIndex = 2; return re.exec('abcd') != null; @@ -1425,11 +1425,11 @@ // UC Browser bug // https://github.com/zloirock/core-js/issues/1008 - var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$i(function () { + var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$j(function () { return !$RegExp$2('a', 'y').sticky; }); - var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$i(function () { + var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$j(function () { // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 var re = $RegExp$2('^r', 'gy'); re.lastIndex = 2; @@ -1554,24 +1554,24 @@ return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; - var fails$h = fails$u; + var fails$i = fails$v; var global$9 = global$k; // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError var $RegExp$1 = global$9.RegExp; - var regexpUnsupportedDotAll = fails$h(function () { + var regexpUnsupportedDotAll = fails$i(function () { var re = $RegExp$1('.', 's'); return !(re.dotAll && re.exec('\n') && re.flags === 's'); }); - var fails$g = fails$u; + var fails$h = fails$v; var global$8 = global$k; // babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError var $RegExp = global$8.RegExp; - var regexpUnsupportedNcg = fails$g(function () { + var regexpUnsupportedNcg = fails$h(function () { var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; @@ -1694,12 +1694,12 @@ var regexpExec$3 = patchedExec; - var $$k = _export; + var $$l = _export; var exec$4 = regexpExec$3; // `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec - $$k({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, { + $$l({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, { exec: exec$4 }); @@ -1729,7 +1729,7 @@ var uncurryThis$l = functionUncurryThisClause; var defineBuiltIn$5 = defineBuiltIn$7; var regexpExec$2 = regexpExec$3; - var fails$f = fails$u; + var fails$g = fails$v; var wellKnownSymbol$f = wellKnownSymbol$j; var createNonEnumerableProperty$4 = createNonEnumerableProperty$7; @@ -1739,14 +1739,14 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol$f(KEY); - var DELEGATES_TO_SYMBOL = !fails$f(function () { + var DELEGATES_TO_SYMBOL = !fails$g(function () { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) != 7; }); - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$f(function () { + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$g(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; @@ -1812,7 +1812,7 @@ }; var uncurryThis$k = functionUncurryThis; - var fails$e = fails$u; + var fails$f = fails$v; var isCallable$7 = isCallable$j; var classof$3 = classof$6; var getBuiltIn$1 = getBuiltIn$5; @@ -1856,7 +1856,7 @@ // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor - var isConstructor$3 = !construct || fails$e(function () { + var isConstructor$3 = !construct || fails$f(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) @@ -2000,7 +2000,7 @@ var callRegExpExec = regexpExecAbstract; var regexpExec = regexpExec$3; var stickyHelpers$1 = regexpStickyHelpers; - var fails$d = fails$u; + var fails$e = fails$v; var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y; var MAX_UINT32 = 0xFFFFFFFF; @@ -2012,7 +2012,7 @@ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper - var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$d(function () { + var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$e(function () { // eslint-disable-next-line regexp/no-empty-group -- required for testing var re = /(?:)/; var originalExec = re.exec; @@ -2177,12 +2177,12 @@ values: createMethod$1(false) }; - var $$j = _export; + var $$k = _export; var $entries = objectToArray.entries; // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries - $$j({ target: 'Object', stat: true }, { + $$k({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } @@ -2209,20 +2209,20 @@ ArrayPrototype[UNSCOPABLES][key] = true; }; - var $$i = _export; + var $$j = _export; var $includes = arrayIncludes.includes; - var fails$c = fails$u; + var fails$d = fails$v; var addToUnscopables$3 = addToUnscopables$4; // FF99+ bug - var BROKEN_ON_SPARSE = fails$c(function () { + var BROKEN_ON_SPARSE = fails$d(function () { // eslint-disable-next-line es/no-array-prototype-includes -- detection return !Array(1).includes(); }); // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes - $$i({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { + $$j({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } @@ -2279,7 +2279,7 @@ return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; - var fails$b = fails$u; + var fails$c = fails$v; var wellKnownSymbol$a = wellKnownSymbol$j; var V8_VERSION$1 = engineV8Version; @@ -2289,7 +2289,7 @@ // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 - return V8_VERSION$1 >= 51 || !fails$b(function () { + return V8_VERSION$1 >= 51 || !fails$c(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES$2] = function () { @@ -2299,11 +2299,11 @@ }); }; - var $$h = _export; - var fails$a = fails$u; + var $$i = _export; + var fails$b = fails$v; var isArray$3 = isArray$5; var isObject$3 = isObject$b; - var toObject$6 = toObject$9; + var toObject$7 = toObject$a; var lengthOfArrayLike$4 = lengthOfArrayLike$7; var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2; var createProperty$2 = createProperty$4; @@ -2317,7 +2317,7 @@ // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/679 - var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$a(function () { + var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$b(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; @@ -2334,10 +2334,10 @@ // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species - $$h({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, { + $$i({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, { // eslint-disable-next-line no-unused-vars -- required for `.length` concat: function concat(arg) { - var O = toObject$6(this); + var O = toObject$7(this); var A = arraySpeciesCreate$2(O, 0); var n = 0; var i, k, length, len, E; @@ -2374,7 +2374,7 @@ var bind = functionBindContext; var uncurryThis$f = functionUncurryThis; var IndexedObject = indexedObject; - var toObject$5 = toObject$9; + var toObject$6 = toObject$a; var lengthOfArrayLike$3 = lengthOfArrayLike$7; var arraySpeciesCreate$1 = arraySpeciesCreate$3; @@ -2390,7 +2390,7 @@ var IS_FILTER_REJECT = TYPE == 7; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { - var O = toObject$5($this); + var O = toObject$6($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that); var length = lengthOfArrayLike$3(self); @@ -2445,7 +2445,7 @@ filterReject: createMethod(7) }; - var $$g = _export; + var $$h = _export; var $find = arrayIteration.find; var addToUnscopables$2 = addToUnscopables$4; @@ -2457,7 +2457,7 @@ // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find - $$g({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { + $$h({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2511,7 +2511,7 @@ } return false; }; - var $$f = _export; + var $$g = _export; var uncurryThis$e = functionUncurryThis; var notARegExp$2 = notARegexp; var requireObjectCoercible$5 = requireObjectCoercible$b; @@ -2522,7 +2522,7 @@ // `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes - $$f({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, { + $$g({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~stringIndexOf$2( toString$9(requireObjectCoercible$5(this)), @@ -2612,7 +2612,7 @@ handlePrototype$1(DOMTokenListPrototype$1); var global$6 = global$k; - var fails$9 = fails$u; + var fails$a = fails$v; var uncurryThis$d = functionUncurryThis; var toString$8 = toString$f; var trim$2 = stringTrim.trim; @@ -2624,7 +2624,7 @@ var ITERATOR$4 = Symbol$2 && Symbol$2.iterator; var FORCED$4 = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols - || (ITERATOR$4 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$4)); })); + || (ITERATOR$4 && !fails$a(function () { $parseFloat$1(Object(ITERATOR$4)); })); // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string @@ -2634,32 +2634,32 @@ return result === 0 && charAt$2(trimmedString, 0) == '-' ? -0 : result; } : $parseFloat$1; - var $$e = _export; + var $$f = _export; var $parseFloat = numberParseFloat; // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string - $$e({ global: true, forced: parseFloat != $parseFloat }, { + $$f({ global: true, forced: parseFloat != $parseFloat }, { parseFloat: $parseFloat }); - var $$d = _export; - var toObject$4 = toObject$9; + var $$e = _export; + var toObject$5 = toObject$a; var nativeKeys = objectKeys$3; - var fails$8 = fails$u; + var fails$9 = fails$v; - var FAILS_ON_PRIMITIVES = fails$8(function () { nativeKeys(1); }); + var FAILS_ON_PRIMITIVES$1 = fails$9(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys - $$d({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + $$e({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, { keys: function keys(it) { - return nativeKeys(toObject$4(it)); + return nativeKeys(toObject$5(it)); } }); /* eslint-disable es/no-array-prototype-indexof -- required for testing */ - var $$c = _export; + var $$d = _export; var uncurryThis$c = functionUncurryThisClause; var $indexOf = arrayIncludes.indexOf; var arrayMethodIsStrict$1 = arrayMethodIsStrict$4; @@ -2671,7 +2671,7 @@ // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof - $$c({ target: 'Array', proto: true, forced: FORCED$3 }, { + $$d({ target: 'Array', proto: true, forced: FORCED$3 }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { var fromIndex = arguments.length > 1 ? arguments[1] : undefined; return NEGATIVE_ZERO @@ -2750,14 +2750,14 @@ var engineWebkitVersion = !!webkit && +webkit[1]; - var $$b = _export; + var $$c = _export; var uncurryThis$b = functionUncurryThis; var aCallable$1 = aCallable$4; - var toObject$3 = toObject$9; + var toObject$4 = toObject$a; var lengthOfArrayLike$2 = lengthOfArrayLike$7; var deletePropertyOrThrow$1 = deletePropertyOrThrow$2; var toString$7 = toString$f; - var fails$7 = fails$u; + var fails$8 = fails$v; var internalSort = arraySort; var arrayMethodIsStrict = arrayMethodIsStrict$4; var FF = engineFfVersion; @@ -2770,17 +2770,17 @@ var push$1 = uncurryThis$b(test$1.push); // IE8- - var FAILS_ON_UNDEFINED = fails$7(function () { + var FAILS_ON_UNDEFINED = fails$8(function () { test$1.sort(undefined); }); // V8 bug - var FAILS_ON_NULL = fails$7(function () { + var FAILS_ON_NULL = fails$8(function () { test$1.sort(null); }); // Old WebKit var STRICT_METHOD = arrayMethodIsStrict('sort'); - var STABLE_SORT = !fails$7(function () { + var STABLE_SORT = !fails$8(function () { // feature detection can be too slow, so check engines versions if (V8) return V8 < 70; if (FF && FF > 3) return; @@ -2828,11 +2828,11 @@ // `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort - $$b({ target: 'Array', proto: true, forced: FORCED$2 }, { + $$c({ target: 'Array', proto: true, forced: FORCED$2 }, { sort: function sort(comparefn) { if (comparefn !== undefined) aCallable$1(comparefn); - var array = toObject$3(this); + var array = toObject$4(this); if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn); @@ -2857,7 +2857,7 @@ }); var uncurryThis$a = functionUncurryThis; - var toObject$2 = toObject$9; + var toObject$3 = toObject$a; var floor = Math.floor; var charAt$1 = uncurryThis$a(''.charAt); @@ -2874,7 +2874,7 @@ var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { - namedCaptures = toObject$2(namedCaptures); + namedCaptures = toObject$3(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return replace$1(replacement, symbols, function (match, ch) { @@ -2906,7 +2906,7 @@ var call$4 = functionCall; var uncurryThis$9 = functionUncurryThis; var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic; - var fails$6 = fails$u; + var fails$7 = fails$v; var anObject$4 = anObject$d; var isCallable$5 = isCallable$j; var isNullOrUndefined$2 = isNullOrUndefined$7; @@ -2947,7 +2947,7 @@ return false; })(); - var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function () { + var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () { var re = /./; re.exec = function () { var result = []; @@ -3039,7 +3039,7 @@ ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); - var $$a = _export; + var $$b = _export; var $filter = arrayIteration.filter; var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5; @@ -3048,7 +3048,7 @@ // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species - $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { + $$b({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -3101,7 +3101,7 @@ }); var global$5 = global$k; - var fails$5 = fails$u; + var fails$6 = fails$v; var uncurryThis$8 = functionUncurryThis; var toString$4 = toString$f; var trim$1 = stringTrim.trim; @@ -3114,7 +3114,7 @@ var exec$1 = uncurryThis$8(hex.exec); var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22 // MS Edge 18- broken with boxed symbols - || (ITERATOR$3 && !fails$5(function () { $parseInt$1(Object(ITERATOR$3)); })); + || (ITERATOR$3 && !fails$6(function () { $parseInt$1(Object(ITERATOR$3)); })); // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix @@ -3123,16 +3123,16 @@ return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10)); } : $parseInt$1; - var $$9 = _export; + var $$a = _export; var $parseInt = numberParseInt; // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix - $$9({ global: true, forced: parseInt != $parseInt }, { + $$a({ global: true, forced: parseInt != $parseInt }, { parseInt: $parseInt }); - var $$8 = _export; + var $$9 = _export; var $map = arrayIteration.map; var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5; @@ -3141,13 +3141,13 @@ // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species - $$8({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { + $$9({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); - var $$7 = _export; + var $$8 = _export; var $findIndex = arrayIteration.findIndex; var addToUnscopables$1 = addToUnscopables$4; @@ -3159,7 +3159,7 @@ // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findindex - $$7({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + $$8({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -3299,7 +3299,7 @@ var stickyHelpers = regexpStickyHelpers; var proxyAccessor = proxyAccessor$1; var defineBuiltIn$3 = defineBuiltIn$7; - var fails$4 = fails$u; + var fails$5 = fails$v; var hasOwn$3 = hasOwnProperty_1; var enforceInternalState = internalState.enforce; var setSpecies = setSpecies$1; @@ -3328,7 +3328,7 @@ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var BASE_FORCED = DESCRIPTORS$3 && - (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$4(function () { + (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$5(function () { re2[MATCH] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; @@ -3480,14 +3480,14 @@ var defineBuiltIn$2 = defineBuiltIn$7; var anObject$1 = anObject$d; var $toString = toString$f; - var fails$3 = fails$u; + var fails$4 = fails$v; var getRegExpFlags = regexpGetFlags; var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; - var NOT_GENERIC = fails$3(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); + var NOT_GENERIC = fails$4(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING; @@ -3506,7 +3506,7 @@ var arraySlice = uncurryThis$5([].slice); - var $$6 = _export; + var $$7 = _export; var isArray$2 = isArray$5; var isConstructor = isConstructor$3; var isObject$1 = isObject$b; @@ -3527,7 +3527,7 @@ // `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects - $$6({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { + $$7({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { slice: function slice(start, end) { var O = toIndexedObject$1(this); var length = lengthOfArrayLike$1(O); @@ -3557,9 +3557,9 @@ var iterators = {}; - var fails$2 = fails$u; + var fails$3 = fails$v; - var correctPrototypeGetter = !fails$2(function () { + var correctPrototypeGetter = !fails$3(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing @@ -3568,9 +3568,9 @@ var hasOwn$2 = hasOwnProperty_1; var isCallable$2 = isCallable$j; - var toObject$1 = toObject$9; + var toObject$2 = toObject$a; var sharedKey = sharedKey$3; - var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; + var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter; var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; @@ -3579,8 +3579,8 @@ // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe - var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { - var object = toObject$1(O); + var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? $Object.getPrototypeOf : function (O) { + var object = toObject$2(O); if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable$2(constructor) && object instanceof constructor) { @@ -3588,7 +3588,7 @@ } return object instanceof $Object ? ObjectPrototype : null; }; - var fails$1 = fails$u; + var fails$2 = fails$v; var isCallable$1 = isCallable$j; var isObject = isObject$b; var getPrototypeOf$1 = objectGetPrototypeOf; @@ -3613,7 +3613,7 @@ } } - var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$1(function () { + var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$2(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$2[ITERATOR$2].call(test) !== test; @@ -3663,7 +3663,7 @@ return IteratorConstructor; }; - var $$5 = _export; + var $$6 = _export; var call$1 = functionCall; var FunctionName = functionName; var isCallable = isCallable$j; @@ -3748,7 +3748,7 @@ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn(IterablePrototype, KEY, methods[KEY]); } - } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } else $$6({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator @@ -3893,8 +3893,8 @@ return O.length = length; }; - var $$4 = _export; - var toObject = toObject$9; + var $$5 = _export; + var toObject$1 = toObject$a; var toAbsoluteIndex = toAbsoluteIndex$4; var toIntegerOrInfinity = toIntegerOrInfinity$5; var lengthOfArrayLike = lengthOfArrayLike$7; @@ -3913,9 +3913,9 @@ // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species - $$4({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + $$5({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice(start, deleteCount /* , ...items */) { - var O = toObject(this); + var O = toObject$1(this); var len = lengthOfArrayLike(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; @@ -3970,7 +3970,7 @@ // https://tc39.es/ecma262/#sec-thisnumbervalue var thisNumberValue$1 = uncurryThis$4(1.0.valueOf); - var $$3 = _export; + var $$4 = _export; var IS_PURE = isPure; var DESCRIPTORS = descriptors; var global$1 = global$k; @@ -3982,7 +3982,7 @@ var isPrototypeOf = objectIsPrototypeOf; var isSymbol = isSymbol$3; var toPrimitive = toPrimitive$2; - var fails = fails$u; + var fails$1 = fails$v; var getOwnPropertyNames = objectGetOwnPropertyNames.f; var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; var defineProperty = objectDefineProperty.f; @@ -4038,7 +4038,7 @@ var calledWithNew = function (dummy) { // includes check on 1..constructor(foo) case - return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); }); + return isPrototypeOf(NumberPrototype, dummy) && fails$1(function () { thisNumberValue(dummy); }); }; // `Number` constructor @@ -4051,7 +4051,7 @@ NumberWrapper.prototype = NumberPrototype; if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper; - $$3({ global: true, constructor: true, wrap: true, forced: FORCED }, { + $$4({ global: true, constructor: true, wrap: true, forced: FORCED }, { Number: NumberWrapper }); @@ -4072,7 +4072,7 @@ }; if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber); - var $$2 = _export; + var $$3 = _export; var uncurryThis$2 = functionUncurryThis; var isArray = isArray$5; @@ -4083,7 +4083,7 @@ // https://tc39.es/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 - $$2({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { + $$3({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { reverse: function reverse() { // eslint-disable-next-line no-self-assign -- dirty hack if (isArray(this)) this.length = this.length; @@ -4091,6 +4091,22 @@ } }); + var $$2 = _export; + var fails = fails$v; + var toObject = toObject$a; + var nativeGetPrototypeOf = objectGetPrototypeOf; + var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; + + var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); }); + + // `Object.getPrototypeOf` method + // https://tc39.es/ecma262/#sec-object.getprototypeof + $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { + getPrototypeOf: function getPrototypeOf(it) { + return nativeGetPrototypeOf(toObject(it)); + } + }); + var call = functionCall; var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic; var anObject = anObject$d; @@ -4215,7 +4231,7 @@ getBootstrapVersion: function getBootstrapVersion() { var bootstrapVersion = 5; try { - var rawVersion = $$o.fn.dropdown.Constructor.VERSION; + var rawVersion = $$p.fn.dropdown.Constructor.VERSION; // Only try to parse VERSION if it is defined. // It is undefined in older versions of Bootstrap (tested with 3.1.1). @@ -4320,7 +4336,7 @@ }, getSearchInput: function getSearchInput(that) { if (typeof that.options.searchSelector === 'string') { - return $$o(that.options.searchSelector); + return $$p(that.options.searchSelector); } return that.$toolbar.find('.search input'); }, @@ -4416,7 +4432,14 @@ return flag ? str : ''; }, isObject: function isObject(obj) { - return _typeof(obj) === 'object' && obj !== null && !Array.isArray(obj); + if (_typeof(obj) !== 'object' || obj === null) { + return false; + } + var proto = obj; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + return Object.getPrototypeOf(obj) === proto; }, isEmptyObject: function isEmptyObject() { var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -4579,10 +4602,10 @@ }, getScrollBarWidth: function getScrollBarWidth() { if (this.cachedWidth === undefined) { - var $inner = $$o('
').addClass('fixed-table-scroll-inner'); - var $outer = $$o('
').addClass('fixed-table-scroll-outer'); + var $inner = $$p('
').addClass('fixed-table-scroll-inner'); + var $outer = $$p('
').addClass('fixed-table-scroll-outer'); $outer.append($inner); - $$o('body').append($outer); + $$p('body').append($outer); var w1 = $inner[0].offsetWidth; $outer.css('overflow', 'scroll'); var w2 = $inner[0].offsetWidth; @@ -4738,7 +4761,7 @@ var data = []; var m = []; $els.each(function (y, el) { - var $el = $$o(el); + var $el = $$p(el); var row = {}; // save tr's id, class and data-* attributes @@ -4747,7 +4770,7 @@ row._data = _this2.getRealDataAttr($el.data()); row._style = $el.attr('style'); $el.find('>td,>th').each(function (_x, el) { - var $el = $$o(el); + var $el = $$p(el); var cspan = +$el.attr('colspan') || 1; var rspan = +$el.attr('rowspan') || 1; var x = _x; @@ -4882,7 +4905,7 @@ } }; - var VERSION = '1.22.0'; + var VERSION = '1.22.1'; var bootstrapVersion = Utils.getBootstrapVersion(); var CONSTANTS = { 3: { @@ -5522,7 +5545,7 @@ function BootstrapTable(el, options) { _classCallCheck(this, BootstrapTable); this.options = options; - this.$el = $$o(el); + this.$el = $$p(el); this.$el_ = this.$el.clone(); this.timeoutId_ = 0; this.timeoutFooter_ = 0; @@ -5548,17 +5571,17 @@ value: function initConstants() { var opts = this.options; this.constants = Constants.CONSTANTS; - this.constants.theme = $$o.fn.bootstrapTable.theme; + this.constants.theme = $$p.fn.bootstrapTable.theme; this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle'; // init iconsPrefix and icons - var iconsPrefix = Utils.getIconsPrefix($$o.fn.bootstrapTable.theme); + var iconsPrefix = Utils.getIconsPrefix($$p.fn.bootstrapTable.theme); var icons = Utils.getIcons(iconsPrefix); if (typeof opts.icons === 'string') { opts.icons = Utils.calculateObjectValue(null, opts.icons); } - opts.iconsPrefix = opts.iconsPrefix || $$o.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix; - opts.icons = Object.assign(icons, $$o.fn.bootstrapTable.defaults.icons, opts.icons); + opts.iconsPrefix = opts.iconsPrefix || $$p.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix; + opts.icons = Object.assign(icons, $$p.fn.bootstrapTable.defaults.icons, opts.icons); // init buttons class var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : ''; @@ -5572,7 +5595,7 @@ key: "initLocale", value: function initLocale() { if (this.options.locale) { - var locales = $$o.fn.bootstrapTable.locales; + var locales = $$p.fn.bootstrapTable.locales; var parts = this.options.locale.split(/-|_/); parts[0] = parts[0].toLowerCase(); if (parts[1]) { @@ -5603,7 +5626,7 @@ var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '
' : ''; var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '
' : ''; var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]); - this.$container = $$o("\n
\n
\n ").concat(topPagination, "\n
\n
\n
\n
\n ").concat(loadingTemplate, "\n
\n
\n
\n
\n ").concat(bottomPagination, "\n
\n ")); + this.$container = $$p("\n
\n
\n ").concat(topPagination, "\n
\n
\n
\n
\n ").concat(loadingTemplate, "\n
\n
\n
\n
\n ").concat(bottomPagination, "\n
\n ")); this.$container.insertAfter(this.$el); this.$tableContainer = this.$container.find('.fixed-table-container'); this.$tableHeader = this.$container.find('.fixed-table-header'); @@ -5612,7 +5635,7 @@ this.$tableFooter = this.$el.find('tfoot'); // checking if custom table-toolbar exists or not if (this.options.buttonsToolbar) { - this.$toolbar = $$o('body').find(this.options.buttonsToolbar); + this.$toolbar = $$p('body').find(this.options.buttonsToolbar); } else { this.$toolbar = this.$container.find('.fixed-table-toolbar'); } @@ -5641,17 +5664,17 @@ var columns = []; this.$header = this.$el.find('>thead'); if (!this.$header.length) { - this.$header = $$o("")).appendTo(this.$el); + this.$header = $$p("")).appendTo(this.$el); } else if (this.options.theadClasses) { this.$header.addClass(this.options.theadClasses); } this._headerTrClasses = []; this._headerTrStyles = []; this.$header.find('tr').each(function (i, el) { - var $tr = $$o(el); + var $tr = $$p(el); var column = []; $tr.find('th').each(function (i, el) { - var $th = $$o(el); + var $th = $$p(el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not if (typeof $th.data('field') !== 'undefined') { @@ -5659,7 +5682,7 @@ } var _data = Object.assign({}, $th.data()); for (var key in _data) { - if ($$o.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) { + if ($$p.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) { delete _data[key]; } } @@ -5840,10 +5863,10 @@ }); this.$header.html(headerHtml.join('')); this.$header.find('th[data-field]').each(function (i, el) { - $$o(el).data(visibleColumns[$$o(el).data('field')]); + $$p(el).data(visibleColumns[$$p(el).data('field')]); }); this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) { - var $this = $$o(e.currentTarget); + var $this = $$p(e.currentTarget); if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) { if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) { return false; @@ -5854,7 +5877,7 @@ } }); var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id')); - $$o(window).off(resizeEvent); + $$p(window).off(resizeEvent); if (!this.options.showHeader || this.options.cardView) { this.$header.hide(); this.$tableHeader.hide(); @@ -5865,14 +5888,14 @@ this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow this.getCaret(); - $$o(window).on(resizeEvent, function () { + $$p(window).on(resizeEvent, function () { return _this2.resetView(); }); } this.$selectAll = this.$header.find('[name="btSelectAll"]'); this.$selectAll.off('click').on('click', function (e) { e.stopPropagation(); - var checked = $$o(e.currentTarget).prop('checked'); + var checked = $$p(e.currentTarget).prop('checked'); _this2[checked ? 'checkAll' : 'uncheckAll'](); _this2.updateSelected(); }); @@ -5956,7 +5979,7 @@ value: function onSort(_ref) { var type = _ref.type, currentTarget = _ref.currentTarget; - var $this = type === 'keypress' ? $$o(currentTarget) : $$o(currentTarget).parent(); + var $this = type === 'keypress' ? $$p(currentTarget) : $$p(currentTarget).parent(); var $this_ = this.$header.find('th').eq($this.index()); this.$header.add(this.$header_).find('span.order').remove(); if (this.options.sortName === $this.data('field')) { @@ -6012,11 +6035,11 @@ var $keepOpen; var switchableCount = 0; if (this.$toolbar.find('.bs-bars').children().length) { - $$o('body').append($$o(opts.toolbar)); + $$p('body').append($$p(opts.toolbar)); } this.$toolbar.html(''); if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') { - $$o(Utils.sprintf('
', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$o(opts.toolbar)); + $$p(Utils.sprintf('
', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$p(opts.toolbar)); } // showColumns, showToggle, showRefresh @@ -6218,7 +6241,7 @@ }); $checkboxes.off('click').on('click', function (_ref2) { var currentTarget = _ref2.currentTarget; - var $this = $$o(currentTarget); + var $this = $$p(currentTarget); _this4._toggleColumn($this.val(), $this.prop('checked'), false); _this4.trigger('column-switch', $this.data('field'), $this.prop('checked')); $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) { @@ -6227,19 +6250,19 @@ }); $toggleAll.off('click').on('click', function (_ref3) { var currentTarget = _ref3.currentTarget; - _this4._toggleAllColumns($$o(currentTarget).prop('checked')); - _this4.trigger('column-switch-all', $$o(currentTarget).prop('checked')); + _this4._toggleAllColumns($$p(currentTarget).prop('checked')); + _this4.trigger('column-switch-all', $$p(currentTarget).prop('checked')); }); if (opts.showColumnsSearch) { var $columnsSearch = $keepOpen.find('[name="columnsSearch"]'); var $listItems = $keepOpen.find('.dropdown-item-marker'); $columnsSearch.on('keyup paste change', function (_ref4) { var currentTarget = _ref4.currentTarget; - var $this = $$o(currentTarget); + var $this = $$p(currentTarget); var searchValue = $this.val().toLowerCase(); $listItems.show(); $checkboxes.each(function (i, el) { - var $checkbox = $$o(el); + var $checkbox = $$p(el); var $listItem = $checkbox.parents('.dropdown-item-marker'); var text = $listItem.text().toLowerCase(); if (!text.includes(searchValue)) { @@ -6313,16 +6336,16 @@ currentTarget = _ref5.currentTarget, firedByInitSearchText = _ref5.firedByInitSearchText; var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - if (currentTarget !== undefined && $$o(currentTarget).length && overwriteSearchText) { - var text = $$o(currentTarget).val().trim(); - if (this.options.trimOnSearch && $$o(currentTarget).val() !== text) { - $$o(currentTarget).val(text); + if (currentTarget !== undefined && $$p(currentTarget).length && overwriteSearchText) { + var text = $$p(currentTarget).val().trim(); + if (this.options.trimOnSearch && $$p(currentTarget).val() !== text) { + $$p(currentTarget).val(text); } if (this.searchText === text) { return; } var $searchInput = Utils.getSearchInput(this); - var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$o(currentTarget); + var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$p(currentTarget); if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) { this.searchText = text; this.options.searchText = text; @@ -6673,7 +6696,7 @@ key: "updatePagination", value: function updatePagination(event) { // Fix #171: IE disabled button can be clicked bug. - if (event && $$o(event.currentTarget).hasClass('disabled')) { + if (event && $$p(event.currentTarget).hasClass('disabled')) { return; } if (!this.options.maintainMetaData) { @@ -6691,7 +6714,7 @@ key: "onPageListChange", value: function onPageListChange(event) { event.preventDefault(); - var $this = $$o(event.currentTarget); + var $this = $$p(event.currentTarget); $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive); this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text(); this.$toolbar.find('.page-size').text(this.options.pageSize); @@ -6701,7 +6724,7 @@ }, { key: "onPagePre", value: function onPagePre(event) { - if ($$o(event.target).hasClass('disabled')) { + if ($$p(event.target).hasClass('disabled')) { return; } event.preventDefault(); @@ -6716,7 +6739,7 @@ }, { key: "onPageNext", value: function onPageNext(event) { - if ($$o(event.target).hasClass('disabled')) { + if ($$p(event.target).hasClass('disabled')) { return; } event.preventDefault(); @@ -6732,10 +6755,10 @@ key: "onPageNumber", value: function onPageNumber(event) { event.preventDefault(); - if (this.options.pageNumber === +$$o(event.currentTarget).text()) { + if (this.options.pageNumber === +$$p(event.currentTarget).text()) { return; } - this.options.pageNumber = +$$o(event.currentTarget).text(); + this.options.pageNumber = +$$p(event.currentTarget).text(); this.updatePagination(event); return false; } @@ -6945,7 +6968,7 @@ this.trigger('pre-body', data); this.$body = this.$el.find('>tbody'); if (!this.$body.length) { - this.$body = $$o('').appendTo(this.$el); + this.$body = $$p('').appendTo(this.$el); } // Fix #389 Bootstrap-table-flatJSON is not working @@ -6954,7 +6977,7 @@ this.pageTo = data.length; } var rows = []; - var trFragments = $$o(document.createDocumentFragment()); + var trFragments = $$p(document.createDocumentFragment()); var hasTr = false; var toExpand = []; this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo)); @@ -7026,13 +7049,13 @@ var _this9 = this; // click to select by column this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) { - var $td = $$o(e.currentTarget); + var $td = $$p(e.currentTarget); if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) { return; } var $tr = $td.parent(); - var $cardViewArr = $$o(e.target).parents('.card-views').children(); - var $cardViewTarget = $$o(e.target).parents('.card-view'); + var $cardViewArr = $$p(e.target).parents('.card-views').children(); + var $cardViewTarget = $$p(e.target).parents('.card-view'); var rowIndex = $tr.data('index'); var item = _this9.data[rowIndex]; var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex; @@ -7060,13 +7083,13 @@ }); this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) { e.preventDefault(); - _this9.toggleDetailView($$o(e.currentTarget).parent().parent().data('index')); + _this9.toggleDetailView($$p(e.currentTarget).parent().parent().data('index')); return false; }); this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName)); this.$selectItem.off('click').on('click', function (e) { e.stopImmediatePropagation(); - var $this = $$o(e.currentTarget); + var $this = $$p(e.currentTarget); _this9._toggleCheck($this.prop('checked'), $this.data('index')); }); this.header.events.forEach(function (_events, i) { @@ -7093,7 +7116,7 @@ } var event = events[key]; _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) { - var $tr = $$o(tr); + var $tr = $$p(tr); var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex); var index = key.indexOf(' '); var name = key.substring(0, index); @@ -7223,7 +7246,7 @@ this._xhrAbort = true; this._xhr.abort(); } - this._xhr = $$o.ajax(request); + this._xhr = $$p.ajax(request); } return data; } @@ -7247,7 +7270,7 @@ value: function getCaret() { var _this11 = this; this.$header.find('th').each(function (i, th) { - $$o(th).find('.sortable').removeClass('desc asc').addClass($$o(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both'); + $$p(th).find('.sortable').removeClass('desc asc').addClass($$p(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both'); }); } }, { @@ -7256,7 +7279,7 @@ var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length; this.$selectAll.add(this.$selectAll_).prop('checked', checkAll); this.$selectItem.each(function (i, el) { - $$o(el).closest('tr')[$$o(el).prop('checked') ? 'addClass' : 'removeClass']('selected'); + $$p(el).closest('tr')[$$p(el).prop('checked') ? 'addClass' : 'removeClass']('selected'); }); } }, { @@ -7264,7 +7287,7 @@ value: function updateRows() { var _this12 = this; this.$selectItem.each(function (i, el) { - _this12.data[$$o(el).data('index')][_this12.header.stateField] = $$o(el).prop('checked'); + _this12.data[$$p(el).data('index')][_this12.header.stateField] = $$p(el).prop('checked'); }); } }, { @@ -7297,11 +7320,11 @@ args[_key4 - 1] = arguments[_key4]; } (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this])); - this.$el.trigger($$o.Event(name, { + this.$el.trigger($$p.Event(name, { sender: this }), args); (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this]))); - this.$el.trigger($$o.Event('all.bs.table', { + this.$el.trigger($$p.Event('all.bs.table', { sender: this }), [name, args]); } @@ -7346,7 +7369,7 @@ this.$selectAll_ = this.$header_.find('[name="btSelectAll"]'); this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_); this.$tableLoading.css('width', this.$el.outerWidth()); - var focusedTemp = $$o('.focus-temp:visible:eq(0)'); + var focusedTemp = $$p('.focus-temp:visible:eq(0)'); if (focusedTemp.length > 0) { focusedTemp.focus(); this.$header.find('.focus-temp').removeClass('focus-temp'); @@ -7354,7 +7377,7 @@ // fix bug: $.data() is not working as expected after $.append() this.$header.find('th[data-field]').each(function (i, el) { - _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$o(el).data('field'))).data($$o(el).data()); + _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$p(el).data('field'))).data($$p(el).data()); }); var visibleFields = this.getVisibleFields(); var $ths = this.$header_.find('th'); @@ -7364,7 +7387,7 @@ } var trLength = $tr.find('> *').length; $tr.find('> *').each(function (i, el) { - var $this = $$o(el); + var $this = $$p(el); if (Utils.hasDetailViewIcon(_this14.options)) { if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') { var $thDetail = $ths.filter('.detail'); @@ -7376,7 +7399,7 @@ var index = i - Utils.getDetailViewIndexOffset(_this14.options); var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index])); if ($th.length > 1) { - $th = $$o($ths[$this[0].cellIndex]); + $th = $$p($ths[$this[0].cellIndex]); } var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width(); $th.find('.fht-cell').width($this.innerWidth() - zoomWidth); @@ -7489,7 +7512,7 @@ } var trLength = $tr.find('> *').length; $tr.find('> *').each(function (i, el) { - var $this = $$o(el); + var $this = $$p(el); if (Utils.hasDetailViewIcon(_this15.options)) { if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') { var $thDetail = $ths.filter('.detail'); @@ -7821,7 +7844,7 @@ return; } fieldIndex += Utils.getDetailViewIndexOffset(this.options); - this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$o(rowHtml).find(">td:eq(".concat(fieldIndex, ")"))); + this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$p(rowHtml).find(">td:eq(".concat(fieldIndex, ")"))); this.initBodyEvent(); this.initFooter(); this.resetView(); @@ -8026,7 +8049,7 @@ } else { $items.get().reverse().forEach(function (item) { if ($items.filter(':checked').length > _this23.options.minimumCountColumns) { - $$o(item).prop('checked', visible); + $$p(item).prop('checked', visible); } }); } @@ -8088,7 +8111,7 @@ var $items = this.$selectItem.filter(':enabled'); var checked = $items.filter(':checked'); $items.each(function (i, el) { - $$o(el).prop('checked', !$$o(el).prop('checked')); + $$p(el).prop('checked', !$$p(el).prop('checked')); }); this.updateRows(); this.updateSelected(); @@ -8202,13 +8225,13 @@ key: "destroy", value: function destroy() { this.$el.insertBefore(this.$container); - $$o(this.options.toolbar).insertBefore(this.$el); + $$p(this.options.toolbar).insertBefore(this.$el); this.$container.next().remove(); this.$container.remove(); this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id')); - $$o(window).off(resizeEvent); + $$p(window).off(resizeEvent); } }, { key: "resetView", @@ -8355,7 +8378,7 @@ if (options.unit === 'rows') { scrollTo = 0; this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) { - scrollTo += $$o(el).outerHeight(true); + scrollTo += $$p(el).outerHeight(true); }); } this.$tableBody.scrollTop(scrollTo); @@ -8457,7 +8480,7 @@ value: function expandAllRows() { var trs = this.$body.find('> tr[data-index][data-has-detail-view]'); for (var i = 0; i < trs.length; i++) { - this.expandRow($$o(trs[i]).data('index')); + this.expandRow($$p(trs[i]).data('index')); } } }, { @@ -8465,7 +8488,7 @@ value: function collapseAllRows() { var trs = this.$body.find('> tr[data-index][data-has-detail-view]'); for (var i = 0; i < trs.length; i++) { - this.collapseRow($$o(trs[i]).data('index')); + this.collapseRow($$p(trs[i]).data('index')); } } }, { @@ -8477,8 +8500,8 @@ this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(params.title) : params.title; if (this.columns[this.fieldsColumnsIndex[params.field]].visible) { this.$header.find('th[data-field]').each(function (i, el) { - if ($$o(el).data('field') === params.field) { - $$o($$o(el).find('.th-inner')[0]).text(params.title); + if ($$p(el).data('field') === params.field) { + $$p($$p(el).find('.th-inner')[0]).text(params.title); return false; } }); @@ -8515,14 +8538,14 @@ // BOOTSTRAP TABLE PLUGIN DEFINITION // ======================= - $$o.BootstrapTable = BootstrapTable; - $$o.fn.bootstrapTable = function (option) { + $$p.BootstrapTable = BootstrapTable; + $$p.fn.bootstrapTable = function (option) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) { args[_key5 - 1] = arguments[_key5]; } var value; this.each(function (i, el) { - var data = $$o(el).data('bootstrap.table'); + var data = $$p(el).data('bootstrap.table'); if (typeof option === 'string') { var _data2; if (!Constants.METHODS.includes(option)) { @@ -8533,7 +8556,7 @@ } value = (_data2 = data)[option].apply(_data2, args); if (option === 'destroy') { - $$o(el).removeData('bootstrap.table'); + $$p(el).removeData('bootstrap.table'); } return; } @@ -8541,28 +8564,28 @@ console.warn('You cannot initialize the table more than once!'); return; } - var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$o(el).data(), _typeof(option) === 'object' && option); - data = new $$o.BootstrapTable(el, options); - $$o(el).data('bootstrap.table', data); + var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$p(el).data(), _typeof(option) === 'object' && option); + data = new $$p.BootstrapTable(el, options); + $$p(el).data('bootstrap.table', data); data.init(); }); return typeof value === 'undefined' ? this : value; }; - $$o.fn.bootstrapTable.Constructor = BootstrapTable; - $$o.fn.bootstrapTable.theme = Constants.THEME; - $$o.fn.bootstrapTable.VERSION = Constants.VERSION; - $$o.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS; - $$o.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS; - $$o.fn.bootstrapTable.events = BootstrapTable.EVENTS; - $$o.fn.bootstrapTable.locales = BootstrapTable.LOCALES; - $$o.fn.bootstrapTable.methods = BootstrapTable.METHODS; - $$o.fn.bootstrapTable.utils = Utils; + $$p.fn.bootstrapTable.Constructor = BootstrapTable; + $$p.fn.bootstrapTable.theme = Constants.THEME; + $$p.fn.bootstrapTable.VERSION = Constants.VERSION; + $$p.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS; + $$p.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS; + $$p.fn.bootstrapTable.events = BootstrapTable.EVENTS; + $$p.fn.bootstrapTable.locales = BootstrapTable.LOCALES; + $$p.fn.bootstrapTable.methods = BootstrapTable.METHODS; + $$p.fn.bootstrapTable.utils = Utils; // BOOTSTRAP TABLE INIT // ======================= - $$o(function () { - $$o('[data-toggle="table"]').bootstrapTable(); + $$p(function () { + $$p('[data-toggle="table"]').bootstrapTable(); }); return BootstrapTable; @@ -16733,19 +16756,123 @@ jQuery.base64 = (function($) { }; }(jQuery)); -/** - * @preserve tableExport.jquery.plugin - * - * Version 1.27.0 - * - * Copyright (c) 2015-2023 hhurz, - * https://github.com/hhurz/tableExport.jquery.plugin - * - * Based on https://github.com/kayalshri/tableExport.jquery.plugin - * - * Licensed under the MIT License - **/ -"use strict";(function($){$.fn.tableExport=function(options){let docData;const defaults={csvEnclosure:'"',csvSeparator:",",csvUseBOM:true,date:{html:"dd/mm/yyyy"},displayTableName:false,escape:false,exportHiddenCells:false,fileName:"tableExport",htmlContent:false,htmlHyperlink:"content",ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},onDocCreated:null,autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"inherit",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"inherit",valign:"middle"},alternateRowStyles:{fillColor:245},tableExport:{doc:null,onAfterAutotable:null,onBeforeAutotable:null,onAutotableText:null,onTable:null,outputImages:true}}},mso:{fileFormat:"xlshtml",onMsoNumberFormat:null,pageFormat:"a4",pageOrientation:"portrait",rtl:false,styles:[],worksheetName:"",xlsx:{formatId:{date:14,numbers:2,currency:164},format:{currency:"$#,##0.00;[Red]-$#,##0.00"},onHyperlink:null}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onAfterSaveToFile:null,onBeforeSaveToFile:null,onCellData:null,onCellHtmlData:null,onCellHtmlHyperlink:null,onIgnoreRow:null,onTableExportBegin:null,onTableExportEnd:null,outputMode:"file",pdfmake:{enabled:false,docDefinition:{pageSize:"A4",pageOrientation:"portrait",styles:{header:{background:"#34495E",color:"#FFFFFF",bold:true,alignment:"center",fillColor:"#34495E"},alternateRow:{fillColor:"#f5f5f5"}},defaultStyle:{color:"#000000",fontSize:8,font:"Roboto"}},fonts:{}},preserve:{leadingWS:false,trailingWS:false},preventInjection:true,sql:{tableEnclosure:"`",columnEnclosure:"`"},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"Table",type:"csv"};const pageFormats={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};const jsPdfThemes={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal",fillStyle:"F"},header:{textColor:255,fillColor:[41,128,185],rowHeight:23,fontStyle:"bold"},body:{},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1,fillStyle:"DF"},header:{textColor:255,fillColor:[26,188,156],rowHeight:23,fillStyle:"F",fontStyle:"bold"},body:{},alternateRow:{}},plain:{header:{fontStyle:"bold"}}};let jsPdfDefaultStyles={cellPadding:5,fontSize:10,fontName:"helvetica",lineColor:200,lineWidth:.1,fontStyle:"normal",overflow:"ellipsize",fillColor:255,textColor:20,halign:"left",valign:"top",fillStyle:"F",rowHeight:20,columnWidth:"auto"};const FONT_ROW_RATIO=1.15;const el=this;let DownloadEvt=null;let $head_rows=[];let $rows=[];let rowIndex=0;let trData="";let colNames=[];let ranges=[];let blob;let $hiddenTableElements=[];let checkCellVisibility=false;$.extend(true,defaults,options);if(defaults.type==="xlsx"){defaults.mso.fileFormat=defaults.type;defaults.type="excel"}if(typeof defaults.excelFileFormat!=="undefined"&&typeof defaults.mso.fileFormat==="undefined")defaults.mso.fileFormat=defaults.excelFileFormat;if(typeof defaults.excelPageFormat!=="undefined"&&typeof defaults.mso.pageFormat==="undefined")defaults.mso.pageFormat=defaults.excelPageFormat;if(typeof defaults.excelPageOrientation!=="undefined"&&typeof defaults.mso.pageOrientation==="undefined")defaults.mso.pageOrientation=defaults.excelPageOrientation;if(typeof defaults.excelRTL!=="undefined"&&typeof defaults.mso.rtl==="undefined")defaults.mso.rtl=defaults.excelRTL;if(typeof defaults.excelstyles!=="undefined"&&typeof defaults.mso.styles==="undefined")defaults.mso.styles=defaults.excelstyles;if(typeof defaults.onMsoNumberFormat!=="undefined"&&typeof defaults.mso.onMsoNumberFormat==="undefined")defaults.mso.onMsoNumberFormat=defaults.onMsoNumberFormat;if(typeof defaults.worksheetName!=="undefined"&&typeof defaults.mso.worksheetName==="undefined")defaults.mso.worksheetName=defaults.worksheetName;if(typeof defaults.mso.xslx!=="undefined"&&typeof defaults.mso.xlsx==="undefined")defaults.mso.xlsx=defaults.mso.xslx;defaults.mso.pageOrientation=defaults.mso.pageOrientation.substr(0,1)==="l"?"landscape":"portrait";defaults.date.html=defaults.date.html||"";if(defaults.date.html.length){const patt=[];patt["dd"]="(3[01]|[12][0-9]|0?[1-9])";patt["mm"]="(1[012]|0?[1-9])";patt["yyyy"]="((?:1[6-9]|2[0-2])\\d{2})";patt["yy"]="(\\d{2})";const separator=defaults.date.html.match(/[^a-zA-Z0-9]/)[0];const formatItems=defaults.date.html.toLowerCase().split(separator);defaults.date.regex="^\\s*";defaults.date.regex+=patt[formatItems[0]];defaults.date.regex+="(.)";defaults.date.regex+=patt[formatItems[1]];defaults.date.regex+="\\2";defaults.date.regex+=patt[formatItems[2]];defaults.date.regex+="\\s*$";defaults.date.pattern=new RegExp(defaults.date.regex,"g");let f=formatItems.indexOf("dd")+1;defaults.date.match_d=f+(f>1?1:0);f=formatItems.indexOf("mm")+1;defaults.date.match_m=f+(f>1?1:0);f=(formatItems.indexOf("yyyy")>=0?formatItems.indexOf("yyyy"):formatItems.indexOf("yy"))+1;defaults.date.match_y=f+(f>1?1:0)}colNames=GetColumnNames(el);if(typeof defaults.onTableExportBegin==="function")defaults.onTableExportBegin();if(defaults.type==="csv"||defaults.type==="tsv"||defaults.type==="txt"){let csvData="";let rowLength=0;ranges=[];rowIndex=0;const csvString=function(cell,rowIndex,colIndex){let result="";if(cell!==null){const dataString=parseString(cell,rowIndex,colIndex);const csvValue=dataString===null||dataString===""?"":dataString.toString();if(defaults.type==="tsv"){if(dataString instanceof Date)dataString.toLocaleString();result=replaceAll(csvValue,"\t"," ")}else{if(dataString instanceof Date)result=defaults.csvEnclosure+dataString.toLocaleString()+defaults.csvEnclosure;else{result=preventInjection(csvValue);result=replaceAll(result,defaults.csvEnclosure,defaults.csvEnclosure+defaults.csvEnclosure);if(result.indexOf(defaults.csvSeparator)>=0||/[\r\n ]/g.test(result))result=defaults.csvEnclosure+result+defaults.csvEnclosure}}}return result};const CollectCsvData=function($rows,rowselector,length){$rows.each(function(){trData="";ForEachVisibleCell(this,rowselector,rowIndex,length+$rows.length,function(cell,row,col){trData+=csvString(cell,row,col)+(defaults.type==="tsv"?"\t":defaults.csvSeparator)});trData=$.trim(trData).substring(0,trData.length-1);if(trData.length>0){if(csvData.length>0)csvData+="\n";csvData+=trData}rowIndex++});return $rows.length};rowLength+=CollectCsvData($(el).find("thead").first().find(defaults.theadSelector),"th,td",rowLength);findTableElements($(el),"tbody").each(function(){rowLength+=CollectCsvData(findTableElements($(this),defaults.tbodySelector),"td,th",rowLength)});if(defaults.tfootSelector.length)CollectCsvData($(el).find("tfoot").first().find(defaults.tfootSelector),"td,th",rowLength);csvData+="\n";if(defaults.outputMode==="string")return csvData;if(defaults.outputMode==="base64")return base64encode(csvData);if(defaults.outputMode==="window"){downloadFile(false,"data:text/"+(defaults.type==="csv"?"csv":"plain")+";charset=utf-8,",csvData);return}saveToFile(csvData,defaults.fileName+"."+defaults.type,"text/"+(defaults.type==="csv"?"csv":"plain"),"utf-8","",defaults.type==="csv"&&defaults.csvUseBOM)}else if(defaults.type==="sql"){rowIndex=0;ranges=[];let tdData="INSERT INTO "+defaults.sql.tableEnclosure+defaults.tableName+defaults.sql.tableEnclosure+" (";$head_rows=collectHeadRows($(el));$($head_rows).each(function(){ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){let colName=parseString(cell,row,col)||"";if(colName.indexOf(defaults.sql.columnEnclosure)>-1)colName=replaceAll(colName.toString(),defaults.sql.columnEnclosure,defaults.sql.columnEnclosure+defaults.sql.columnEnclosure);tdData+=defaults.sql.columnEnclosure+colName+defaults.sql.columnEnclosure+","});rowIndex++;tdData=$.trim(tdData).substring(0,tdData.length-1)});tdData+=") VALUES ";$rows=collectRows($(el));$($rows).each(function(){trData="";ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){let dataString=parseString(cell,row,col)||"";if(dataString.indexOf("'")>-1)dataString=replaceAll(dataString.toString(),"'","''");trData+="'"+dataString+"',"});if(trData.length>3){tdData+="("+trData;tdData=$.trim(tdData).substring(0,tdData.length-1);tdData+="),"}rowIndex++});tdData=$.trim(tdData).substring(0,tdData.length-1);tdData+=";";if(defaults.outputMode==="string")return tdData;if(defaults.outputMode==="base64")return base64encode(tdData);saveToFile(tdData,defaults.fileName+".sql","application/sql","utf-8","",false)}else if(defaults.type==="json"){const jsonHeaderArray=[];ranges=[];$head_rows=collectHeadRows($(el));$($head_rows).each(function(){const jsonArrayTd=[];ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){jsonArrayTd.push(parseString(cell,row,col))});jsonHeaderArray.push(jsonArrayTd)});const jsonArray=[];$rows=collectRows($(el));$($rows).each(function(){const jsonObjectTd={};let colIndex=0;ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){if(jsonHeaderArray.length){jsonObjectTd[jsonHeaderArray[jsonHeaderArray.length-1][colIndex]]=parseString(cell,row,col)}else{jsonObjectTd[colIndex]=parseString(cell,row,col)}colIndex++});if($.isEmptyObject(jsonObjectTd)===false)jsonArray.push(jsonObjectTd);rowIndex++});let save_data;if(defaults.jsonScope==="head")save_data=JSON.stringify(jsonHeaderArray);else if(defaults.jsonScope==="data")save_data=JSON.stringify(jsonArray);else save_data=JSON.stringify({header:jsonHeaderArray,data:jsonArray});if(defaults.outputMode==="string")return save_data;if(defaults.outputMode==="base64")return base64encode(save_data);saveToFile(save_data,defaults.fileName+".json","application/json","utf-8","base64",false)}else if(defaults.type==="xml"){rowIndex=0;ranges=[];let xml='';xml+="";$head_rows=collectHeadRows($(el));$($head_rows).each(function(){ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){xml+=""+parseString(cell,row,col)+""});rowIndex++});xml+="";let rowCount=1;$rows=collectRows($(el));$($rows).each(function(){let colCount=1;trData="";ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){trData+=""+parseString(cell,row,col)+"";colCount++});if(trData.length>0&&trData!==""){xml+=''+trData+"";rowCount++}rowIndex++});xml+="";if(defaults.outputMode==="string")return xml;if(defaults.outputMode==="base64")return base64encode(xml);saveToFile(xml,defaults.fileName+".xml","application/xml","utf-8","base64",false)}else if(defaults.type==="excel"&&defaults.mso.fileFormat==="xmlss"){const sheetData=[];const docNames=[];$(el).filter(function(){return isVisible($(this))}).each(function(){const $table=$(this);let ssName="";if(typeof defaults.mso.worksheetName==="string"&&defaults.mso.worksheetName.length)ssName=defaults.mso.worksheetName+" "+(docNames.length+1);else if(typeof defaults.mso.worksheetName[docNames.length]!=="undefined")ssName=defaults.mso.worksheetName[docNames.length];if(!ssName.length)ssName=$table.find("caption").text()||"";if(!ssName.length)ssName="Table "+(docNames.length+1);ssName=$.trim(ssName.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));docNames.push($("
").text(ssName).html());if(defaults.exportHiddenCells===false){$hiddenTableElements=$table.find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}rowIndex=0;colNames=GetColumnNames(this);docData="\r";function CollectXmlssData($rows,rowselector,length){const spans=[];$($rows).each(function(){let ssIndex=0;let nCols=0;trData="";ForEachVisibleCell(this,"td,th",rowIndex,length+$rows.length,function(cell,row,col){if(cell!==null){let style="";let data=parseString(cell,row,col);let type="String";if(jQuery.isNumeric(data)!==false){type="Number"}else{const number=parsePercent(data);if(number!==false){data=number;type="Number";style+=' ss:StyleID="pct1"'}}if(type!=="Number")data=data.replace(/\n/g,"
");let colspan=getColspan(cell);let rowspan=getRowspan(cell);$.each(spans,function(){const range=this;if(rowIndex>=range.s.r&&rowIndex<=range.e.r&&nCols>=range.s.c&&nCols<=range.e.c){for(let i=0;i<=range.e.c-range.s.c;++i){nCols++;ssIndex++}}});if(rowspan||colspan){rowspan=rowspan||1;colspan=colspan||1;spans.push({s:{r:rowIndex,c:nCols},e:{r:rowIndex+rowspan-1,c:nCols+colspan-1}})}if(colspan>1){style+=' ss:MergeAcross="'+(colspan-1)+'"';nCols+=colspan-1}if(rowspan>1){style+=' ss:MergeDown="'+(rowspan-1)+'" ss:StyleID="rsp1"'}if(ssIndex>0){style+=' ss:Index="'+(nCols+1)+'"';ssIndex=0}trData+="'+$("
").text(data).html()+"\r";nCols++}});if(trData.length>0)docData+='\r'+trData+"\r";rowIndex++});return $rows.length}const rowLength=CollectXmlssData(collectHeadRows($table),"th,td",0);CollectXmlssData(collectRows($table),"td,th",rowLength);docData+="
\r";sheetData.push(docData)});const count={};const firstOccurrences={};let item,itemCount;for(let n=0,c=docNames.length;n1)docNames[n]=docNames[n].substring(0,29)+"-"+count[item];else firstOccurrences[item]=n}const CreationDate=(new Date).toISOString();let xmlssDocFile='\r'+'\r'+'\r'+'\r'+" "+CreationDate+"\r"+"\r"+'\r'+" \r"+"\r"+'\r'+" 9000\r"+" 13860\r"+" 0\r"+" 0\r"+" False\r"+" False\r"+"\r"+"\r"+' \r"+' \r"+' \r"+"\r";for(let j=0;j\r'+sheetData[j];if(defaults.mso.rtl){xmlssDocFile+='\r'+"\r"+"\r"}else xmlssDocFile+='\r';xmlssDocFile+="\r"}xmlssDocFile+="\r";if(defaults.outputMode==="string")return xmlssDocFile;if(defaults.outputMode==="base64")return base64encode(xmlssDocFile);saveToFile(xmlssDocFile,defaults.fileName+".xml","application/xml","utf-8","base64",false)}else if(defaults.type==="excel"&&defaults.mso.fileFormat==="xlsx"){const sheetNames=[];const workbook=XLSX.utils.book_new();$(el).filter(function(){return isVisible($(this))}).each(function(){const $table=$(this);const ws=xlsxTableToSheet(this);let sheetName="";if(typeof defaults.mso.worksheetName==="string"&&defaults.mso.worksheetName.length)sheetName=defaults.mso.worksheetName+" "+(sheetNames.length+1);else if(typeof defaults.mso.worksheetName[sheetNames.length]!=="undefined")sheetName=defaults.mso.worksheetName[sheetNames.length];if(!sheetName.length)sheetName=$table.find("caption").text()||"";if(!sheetName.length)sheetName="Table "+(sheetNames.length+1);sheetName=$.trim(sheetName.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));sheetNames.push(sheetName);XLSX.utils.book_append_sheet(workbook,ws,sheetName)});const wbData=XLSX.write(workbook,{type:"binary",bookType:defaults.mso.fileFormat,bookSST:false});saveToFile(xlsxWorkbookToArrayBuffer(wbData),defaults.fileName+"."+defaults.mso.fileFormat,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","UTF-8","",false)}else if(defaults.type==="excel"||defaults.type==="xls"||defaults.type==="word"||defaults.type==="doc"){const MSDocType=defaults.type==="excel"||defaults.type==="xls"?"excel":"word";const MSDocExt=MSDocType==="excel"?"xls":"doc";const MSDocSchema='xmlns:x="urn:schemas-microsoft-com:office:'+MSDocType+'"';docData="";let docName="";$(el).filter(function(){return isVisible($(this))}).each(function(){const $table=$(this);if(docName===""){docName=defaults.mso.worksheetName||$table.find("caption").text()||"Table";docName=$.trim(docName.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31))}if(defaults.exportHiddenCells===false){$hiddenTableElements=$table.find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}rowIndex=0;ranges=[];colNames=GetColumnNames(this);docData+="";$head_rows=collectHeadRows($table);$($head_rows).each(function(){const $row=$(this);trData="";ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){if(cell!==null){let thStyle="";trData+="0)trData+=' colspan="'+tdColspan+'"';const tdRowspan=getRowspan(cell);if(tdRowspan>0)trData+=' rowspan="'+tdRowspan+'"';trData+=">"+parseString(cell,row,col)+""}});if(trData.length>0)docData+=""+trData+"";rowIndex++});docData+="";$rows=collectRows($table);$($rows).each(function(){const $row=$(this);trData="";ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){if(cell!==null){let tdValue=parseString(cell,row,col);let tdStyle="";let tdCss=$(cell).attr("data-tableexport-msonumberformat");if(typeof tdCss==="undefined"&&typeof defaults.mso.onMsoNumberFormat==="function")tdCss=defaults.mso.onMsoNumberFormat(cell,row,col);if(typeof tdCss!=="undefined"&&tdCss!=="")tdStyle="style=\"mso-number-format:'"+tdCss+"'";if(defaults.mso.styles.length){const cellStyles=document.defaultView.getComputedStyle(cell,null);const rowStyles=document.defaultView.getComputedStyle($row[0],null);for(let cssStyle in defaults.mso.styles){tdCss=cellStyles[defaults.mso.styles[cssStyle]];if(tdCss==="")tdCss=rowStyles[defaults.mso.styles[cssStyle]];if(tdCss!==""&&tdCss!=="0px none rgb(0, 0, 0)"&&tdCss!=="rgba(0, 0, 0, 0)"){tdStyle+=tdStyle===""?'style="':";";tdStyle+=defaults.mso.styles[cssStyle]+":"+tdCss}}}trData+="0)trData+=' colspan="'+tdColspan+'"';const tdRowspan=getRowspan(cell);if(tdRowspan>0)trData+=' rowspan="'+tdRowspan+'"';if(typeof tdValue==="string"&&tdValue!==""){tdValue=preventInjection(tdValue);tdValue=tdValue.replace(/\n/g,"
")}trData+=">"+tdValue+""}});if(trData.length>0)docData+="
"+trData+"";rowIndex++});if(defaults.displayTableName)docData+="";docData+="
"+parseString($("

"+defaults.tableName+"

"))+"
"});let docFile='';docFile+='';docFile+="";if(MSDocType==="excel"){docFile+="\x3c!--[if gte mso 9]>";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+=docName;docFile+="";docFile+="";docFile+="";if(defaults.mso.rtl)docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="@page { size:"+defaults.mso.pageOrientation+"; mso-page-orientation:"+defaults.mso.pageOrientation+"; }";docFile+="@page Section1 {size:"+pageFormats[defaults.mso.pageFormat][0]+"pt "+pageFormats[defaults.mso.pageFormat][1]+"pt";docFile+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";docFile+="div.Section1 {page:Section1;}";docFile+="@page Section2 {size:"+pageFormats[defaults.mso.pageFormat][1]+"pt "+pageFormats[defaults.mso.pageFormat][0]+"pt";docFile+=";mso-page-orientation:"+defaults.mso.pageOrientation+";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";docFile+="div.Section2 {page:Section2;}";docFile+="br {mso-data-placement:same-cell;}";docFile+="";docFile+="";docFile+="";docFile+='
';docFile+=docData;docFile+="
";docFile+="";docFile+="";if(defaults.outputMode==="string")return docFile;if(defaults.outputMode==="base64")return base64encode(docFile);saveToFile(docFile,defaults.fileName+"."+MSDocExt,"application/vnd.ms-"+MSDocType,"","base64",false)}else if(defaults.type==="png"){html2canvas($(el)[0]).then(function(canvas){const image=canvas.toDataURL();const byteString=atob(image.substring(22));const buffer=new ArrayBuffer(byteString.length);const intArray=new Uint8Array(buffer);for(let i=0;i1||rowspan>1){cellContent["colSpan"]=colspan||1;cellContent["rowSpan"]=rowspan||1}}else cellContent={text:" "};if(colselector.indexOf("th")>=0)cellContent["style"]="header";r.push(cellContent)});if(r.length)body.push(r);if(rLengthmw){if(w>pageFormats.a0[0]){rk="a0";ro="l"}for(let key in pageFormats){if(pageFormats.hasOwnProperty(key)){if(pageFormats[key][1]>w){rk=key;ro="l";if(pageFormats[key][0]>w)ro="p"}}}mw=w}}});defaults.jspdf.format=rk===""?"a4":rk;defaults.jspdf.orientation=ro===""?"w":ro}if(teOptions.doc==null){teOptions.doc=new jspdf.jsPDF(defaults.jspdf.orientation,defaults.jspdf.unit,defaults.jspdf.format);teOptions.wScaleFactor=1;teOptions.hScaleFactor=1;if(typeof defaults.jspdf.onDocCreated==="function")defaults.jspdf.onDocCreated(teOptions.doc)}jsPdfDefaultStyles.fontName=teOptions.doc.getFont().fontName;if(teOptions.outputImages===true)teOptions.images={};if(typeof teOptions.images!=="undefined"){$(el).filter(function(){return isVisible($(this))}).each(function(){let rowCount=0;ranges=[];if(defaults.exportHiddenCells===false){$hiddenTableElements=$(this).find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}$head_rows=collectHeadRows($(this));$rows=collectRows($(this));$($rows).each(function(){ForEachVisibleCell(this,"td,th",$head_rows.length+rowCount,$head_rows.length+$rows.length,function(cell){collectImages(cell,$(cell).children(),teOptions)});rowCount++})});$head_rows=[];$rows=[]}loadImages(teOptions,function(){$(el).filter(function(){return isVisible($(this))}).each(function(){let colKey;rowIndex=0;ranges=[];if(defaults.exportHiddenCells===false){$hiddenTableElements=$(this).find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}colNames=GetColumnNames(this);teOptions.columns=[];teOptions.rows=[];teOptions.teCells={};if(typeof teOptions.onTable==="function")if(teOptions.onTable($(this),defaults)===false)return true;defaults.jspdf.autotable.tableExport=null;const atOptions=$.extend(true,{},defaults.jspdf.autotable);defaults.jspdf.autotable.tableExport=teOptions;atOptions.margin={};$.extend(true,atOptions.margin,defaults.jspdf.margins);atOptions.tableExport=teOptions;if(typeof atOptions.createdHeaderCell!=="function"){atOptions.createdHeaderCell=function(cell,data){if(typeof teOptions.columns[data.column.dataKey]!=="undefined"){const col=teOptions.columns[data.column.dataKey];if(typeof col.rect!=="undefined"){let rh;cell.contentWidth=col.rect.width;if(typeof teOptions.heightRatio==="undefined"||teOptions.heightRatio===0){if(data.row.raw[data.column.dataKey].rowspan)rh=data.row.raw[data.column.dataKey].rect.height/data.row.raw[data.column.dataKey].rowspan;else rh=data.row.raw[data.column.dataKey].rect.height;teOptions.heightRatio=cell.styles.rowHeight/rh}rh=data.row.raw[data.column.dataKey].rect.height*teOptions.heightRatio;if(rh>cell.styles.rowHeight)cell.styles.rowHeight=rh}cell.styles.halign=atOptions.headerStyles.halign==="inherit"?"center":atOptions.headerStyles.halign;cell.styles.valign=atOptions.headerStyles.valign;if(typeof col.style!=="undefined"&&col.style.hidden!==true){if(atOptions.headerStyles.halign==="inherit")cell.styles.halign=col.style.align;if(atOptions.styles.fillColor==="inherit")cell.styles.fillColor=col.style.bcolor;if(atOptions.styles.textColor==="inherit")cell.styles.textColor=col.style.color;if(atOptions.styles.fontStyle==="inherit")cell.styles.fontStyle=col.style.fstyle}}}}if(typeof atOptions.createdCell!=="function"){atOptions.createdCell=function(cell,data){const tecell=teOptions.teCells[data.row.index+":"+data.column.dataKey];cell.styles.halign=atOptions.styles.halign==="inherit"?"center":atOptions.styles.halign;cell.styles.valign=atOptions.styles.valign;if(typeof tecell!=="undefined"&&typeof tecell.style!=="undefined"&&tecell.style.hidden!==true){if(atOptions.styles.halign==="inherit")cell.styles.halign=tecell.style.align;if(atOptions.styles.fillColor==="inherit")cell.styles.fillColor=tecell.style.bcolor;if(atOptions.styles.textColor==="inherit")cell.styles.textColor=tecell.style.color;if(atOptions.styles.fontStyle==="inherit")cell.styles.fontStyle=tecell.style.fstyle}}}if(typeof atOptions.drawHeaderCell!=="function"){atOptions.drawHeaderCell=function(cell,data){const colopt=teOptions.columns[data.column.dataKey];if((colopt.style.hasOwnProperty("hidden")!==true||colopt.style.hidden!==true)&&colopt.rowIndex>=0)return prepareAutoTableText(cell,data,colopt);else return false}}if(typeof atOptions.drawCell!=="function"){atOptions.drawCell=function(cell,data){const teCell=teOptions.teCells[data.row.index+":"+data.column.dataKey];const draw2canvas=typeof teCell!=="undefined"&&teCell.isCanvas;if(draw2canvas!==true){if(prepareAutoTableText(cell,data,teCell)){teOptions.doc.rect(cell.x,cell.y,cell.width,cell.height,cell.styles.fillStyle);if(typeof teCell!=="undefined"&&(typeof teCell.hasUserDefText==="undefined"||teCell.hasUserDefText!==true)&&typeof teCell.elements!=="undefined"&&teCell.elements.length){const hScale=cell.height/teCell.rect.height;if(hScale>teOptions.hScaleFactor)teOptions.hScaleFactor=hScale;teOptions.wScaleFactor=cell.width/teCell.rect.width;const ySave=cell.textPos.y;drawAutotableElements(cell,teCell.elements,teOptions);cell.textPos.y=ySave;drawAutotableText(cell,teCell.elements,teOptions)}else drawAutotableText(cell,{},teOptions)}}else{const container=teCell.elements[0];const imgId=$(container).attr("data-tableexport-canvas");const r=container.getBoundingClientRect();cell.width=r.width*teOptions.wScaleFactor;cell.height=r.height*teOptions.hScaleFactor;data.row.height=cell.height;jsPdfDrawImage(cell,container,imgId,teOptions)}return false}}teOptions.headerrows=[];$head_rows=collectHeadRows($(this));$($head_rows).each(function(){colKey=0;teOptions.headerrows[rowIndex]=[];ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){const obj=getCellStyles(cell);obj.title=parseString(cell,row,col);obj.key=colKey++;obj.rowIndex=rowIndex;teOptions.headerrows[rowIndex].push(obj)});rowIndex++});if(rowIndex>0){let lastrow=rowIndex-1;while(lastrow>=0){$.each(teOptions.headerrows[lastrow],function(){let obj=this;if(lastrow>0&&this.rect===null)obj=teOptions.headerrows[lastrow-1][this.key];if(obj!==null&&obj.rowIndex>=0&&(obj.style.hasOwnProperty("hidden")!==true||obj.style.hidden!==true))teOptions.columns.push(obj)});lastrow=teOptions.columns.length>0?-1:lastrow-1}}let rowCount=0;$rows=[];$rows=collectRows($(this));$($rows).each(function(){const rowData=[];colKey=0;ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){let obj;if(typeof teOptions.columns[colKey]==="undefined"){obj={title:"",key:colKey,style:{hidden:true}};teOptions.columns.push(obj)}rowData.push(parseString(cell,row,col));if(typeof cell!=="undefined"&&cell!==null){obj=getCellStyles(cell);obj.isCanvas=cell.hasAttribute("data-tableexport-canvas");obj.elements=obj.isCanvas?$(cell):$(cell).children();if(typeof $(cell).data("teUserDefText")!=="undefined")obj.hasUserDefText=true;teOptions.teCells[rowCount+":"+colKey++]=obj}else{obj=$.extend(true,{},teOptions.teCells[rowCount+":"+(colKey-1)]);obj.colspan=-1;teOptions.teCells[rowCount+":"+colKey++]=obj}});if(rowData.length){teOptions.rows.push(rowData);rowCount++}rowIndex++});if(typeof teOptions.onBeforeAutotable==="function")teOptions.onBeforeAutotable($(this),teOptions.columns,teOptions.rows,atOptions);jsPdfAutoTable(atOptions.tableExport.doc,teOptions.columns,teOptions.rows,atOptions);if(typeof teOptions.onAfterAutotable==="function")teOptions.onAfterAutotable($(this),atOptions);defaults.jspdf.autotable.startY=jsPdfAutoTableEndPosY()+atOptions.margin.top});jsPdfOutput(teOptions.doc,typeof teOptions.images!=="undefined"&&jQuery.isEmptyObject(teOptions.images)===false);if(typeof teOptions.headerrows!=="undefined")teOptions.headerrows.length=0;if(typeof teOptions.columns!=="undefined")teOptions.columns.length=0;if(typeof teOptions.rows!=="undefined")teOptions.rows.length=0;delete teOptions.doc;teOptions.doc=null})}}function collectHeadRows($table){const result=[];findTableElements($table,"thead").each(function(){result.push.apply(result,findTableElements($(this),defaults.theadSelector).toArray())});return result}function collectRows($table){const result=[];findTableElements($table,"tbody").each(function(){result.push.apply(result,findTableElements($(this),defaults.tbodySelector).toArray())});if(defaults.tfootSelector.length){findTableElements($table,"tfoot").each(function(){result.push.apply(result,findTableElements($(this),defaults.tfootSelector).toArray())})}return result}function findTableElements($parent,selector){const parentSelector=$parent[0].tagName;const parentLevel=$parent.parents(parentSelector).length;return $parent.find(selector).filter(function(){return parentLevel===$(this).closest(parentSelector).parents(parentSelector).length})}function GetColumnNames(table){const result=[];let maxCols=0;let row=0;let col=0;$(table).find("thead").first().find("th").each(function(index,el){const hasDataField=$(el).attr("data-field")!==undefined;if(typeof el.parentNode.rowIndex!=="undefined"&&row!==el.parentNode.rowIndex){row=el.parentNode.rowIndex;col=0;maxCols=0}const colSpan=getColspan(el);maxCols+=colSpan?colSpan:1;while(col0){if($.inArray(colIndex,defaults.ignoreColumn)!==-1||$.inArray(colIndex-rowLength,defaults.ignoreColumn)!==-1||colNames.length>colIndex&&typeof colNames[colIndex]!=="undefined"&&$.inArray(colNames[colIndex],defaults.ignoreColumn)!==-1)result=true}}else result=true;return result}function ForEachVisibleCell(tableRow,selector,rowIndex,rowCount,cellcallback){if(typeof cellcallback==="function"){let ignoreRow=false;if(typeof defaults.onIgnoreRow==="function")ignoreRow=defaults.onIgnoreRow($(tableRow),rowIndex);if(ignoreRow===false&&(defaults.ignoreRow.length===0||$.inArray(rowIndex,defaults.ignoreRow)===-1&&$.inArray(rowIndex-rowCount,defaults.ignoreRow)===-1)&&isVisible($(tableRow))){const $cells=findTableElements($(tableRow),selector);let cellsCount=$cells.length;let colCount=0;let colIndex=0;$cells.each(function(){const $cell=$(this);let colspan=getColspan(this);let rowspan=getRowspan(this);let c;$.each(ranges,function(){const range=this;if(rowIndex>range.s.r&&rowIndex<=range.e.r&&colCount>=range.s.c&&colCount<=range.e.c){for(c=0;c<=range.e.c-range.s.c;++c){cellsCount++;colIndex++;cellcallback(null,rowIndex,colCount++)}}});if(rowspan||colspan){rowspan=rowspan||1;colspan=colspan||1;ranges.push({s:{r:rowIndex,c:colCount},e:{r:rowIndex+rowspan-1,c:colCount+colspan-1}})}if(isColumnIgnored($cell,cellsCount,colIndex++)===false){cellcallback(this,rowIndex,colCount++)}if(colspan>1){for(c=0;c=range.s.r&&rowIndex<=range.e.r&&colCount>=range.s.c&&colCount<=range.e.c){for(let c=0;c<=range.e.c-range.s.c;++c){cellcallback(null,rowIndex,colCount++)}}})}}}function jsPdfDrawImage(cell,container,imgId,teOptions){if(typeof teOptions.images!=="undefined"){const image=teOptions.images[imgId];if(typeof image!=="undefined"){const r=container.getBoundingClientRect();const arCell=cell.width/cell.height;const arImg=r.width/r.height;let imgWidth=cell.width;let imgHeight=cell.height;const px2pt=.264583*72/25.4;let uy=0;if(arImg<=arCell){imgHeight=Math.min(cell.height,r.height);imgWidth=r.width*imgHeight/r.height}else if(arImg>arCell){imgWidth=Math.min(cell.width,r.width);imgHeight=r.height*imgWidth/r.width}imgWidth*=px2pt;imgHeight*=px2pt;if(imgHeight=0){let cellWidth=cell.width;let textPosX=cell.textPos.x;const i=data.table.columns.indexOf(data.column);for(let c=1;c1){if(cell.styles.halign==="right")textPosX=cell.textPos.x+cellWidth-cell.width;else if(cell.styles.halign==="center")textPosX=cell.textPos.x+(cellWidth-cell.width)/2}cell.width=cellWidth;cell.textPos.x=textPosX;if(typeof cellopt!=="undefined"&&cellopt.rowspan>1)cell.height=cell.height*cellopt.rowspan;if(cell.styles.valign==="middle"||cell.styles.valign==="bottom"){const splittedText=typeof cell.text==="string"?cell.text.split(/\r\n|\r|\n/g):cell.text;const lineCount=splittedText.length||1;if(lineCount>2)cell.textPos.y-=(2-FONT_ROW_RATIO)/2*data.row.styles.fontSize*(lineCount-2)/3}return true}else return false}function collectImages(cell,elements,teOptions){if(typeof cell!=="undefined"&&cell!==null){if(cell.hasAttribute("data-tableexport-canvas")){const imgId=(new Date).getTime();$(cell).attr("data-tableexport-canvas",imgId);teOptions.images[imgId]={url:'[data-tableexport-canvas="'+imgId+'"]',src:null}}else if(elements!=="undefined"&&elements!=null){elements.each(function(){if($(this).is("img")){const imgId=strHashCode(this.src);teOptions.images[imgId]={url:this.src,src:this.src}}collectImages(cell,$(this).children(),teOptions)})}}}function loadImages(teOptions,callback){let imageCount=0;let pendingCount=0;function done(){callback(imageCount)}function loadImage(image){if(image.url){if(!image.src){const $imgContainer=$(image.url);if($imgContainer.length){imageCount=++pendingCount;html2canvas($imgContainer[0]).then(function(canvas){image.src=canvas.toDataURL("image/png");if(!--pendingCount)done()})}}else{const img=new Image;imageCount=++pendingCount;img.crossOrigin="Anonymous";img.onerror=img.onload=function(){if(img.complete){if(img.src.indexOf("data:image/")===0){img.width=image.width||img.width||0;img.height=image.height||img.height||0}if(img.width+img.height){const canvas=document.createElement("canvas");const ctx=canvas.getContext("2d");canvas.width=img.width;canvas.height=img.height;ctx.drawImage(img,0,0);image.src=canvas.toDataURL("image/png")}}if(!--pendingCount)done()};img.src=image.url}}}if(typeof teOptions.images!=="undefined"){for(let i in teOptions.images)if(teOptions.images.hasOwnProperty(i))loadImage(teOptions.images[i])}return pendingCount||done()}function drawAutotableElements(cell,elements,teOptions){elements.each(function(){if($(this).is("div")){const bColor=rgb2array(getStyle(this,"background-color"),[255,255,255]);const lColor=rgb2array(getStyle(this,"border-top-color"),[0,0,0]);const lWidth=getPropertyUnitValue(this,"border-top-width",defaults.jspdf.unit);const r=this.getBoundingClientRect();const ux=this.offsetLeft*teOptions.wScaleFactor;const uy=this.offsetTop*teOptions.hScaleFactor;const uw=r.width*teOptions.wScaleFactor;const uh=r.height*teOptions.hScaleFactor;teOptions.doc.setDrawColor.apply(undefined,lColor);teOptions.doc.setFillColor.apply(undefined,bColor);teOptions.doc.setLineWidth(lWidth);teOptions.doc.rect(cell.x+ux,cell.y+uy,uw,uh,lWidth?"FD":"F")}else if($(this).is("img")){const imgId=strHashCode(this.src);jsPdfDrawImage(cell,this,imgId,teOptions)}drawAutotableElements(cell,$(this).children(),teOptions)})}function drawAutotableText(cell,texttags,teOptions){if(typeof teOptions.onAutotableText==="function"){teOptions.onAutotableText(teOptions.doc,cell,texttags)}else{let x=cell.textPos.x;let y=cell.textPos.y;const style={halign:cell.styles.halign,valign:cell.styles.valign};if(texttags.length){let tag=texttags[0];while(tag.previousSibling)tag=tag.previousSibling;let b=false,i=false;while(tag){let txt=tag.innerText||tag.textContent||"";const leadingSpace=txt.length&&txt[0]===" "?" ":"";const trailingSpace=txt.length>1&&txt[txt.length-1]===" "?" ":"";if(defaults.preserve.leadingWS!==true)txt=leadingSpace+trimLeft(txt);if(defaults.preserve.trailingWS!==true)txt=trimRight(txt)+trailingSpace;if($(tag).is("br")){x=cell.textPos.x;y+=teOptions.doc.internal.getFontSize()}if($(tag).is("b"))b=true;else if($(tag).is("i"))i=true;if(b||i)teOptions.doc.setFont("undefined ",b&&i?"bolditalic":b?"bold":"italic");let w=teOptions.doc.getStringUnitWidth(txt)*teOptions.doc.internal.getFontSize();if(w){if(cell.styles.overflow==="linebreak"&&x>cell.textPos.x&&x+w>cell.textPos.x+cell.width){const chars=".,!%*;:=-";if(chars.indexOf(txt.charAt(0))>=0){const s=txt.charAt(0);w=teOptions.doc.getStringUnitWidth(s)*teOptions.doc.internal.getFontSize();if(x+w<=cell.textPos.x+cell.width){jsPdfAutoTableText(s,x,y,style);txt=txt.substring(1,txt.length)}w=teOptions.doc.getStringUnitWidth(txt)*teOptions.doc.internal.getFontSize()}x=cell.textPos.x;y+=teOptions.doc.internal.getFontSize()}if(cell.styles.overflow!=="visible"){while(txt.length&&x+w>cell.textPos.x+cell.width){txt=txt.substring(0,txt.length-1);w=teOptions.doc.getStringUnitWidth(txt)*teOptions.doc.internal.getFontSize()}}jsPdfAutoTableText(txt,x,y,style);x+=w}if(b||i){if($(tag).is("b"))b=false;else if($(tag).is("i"))i=false;teOptions.doc.setFont("undefined ",!b&&!i?"normal":b?"bold":"italic")}tag=tag.nextSibling}cell.textPos.x=x;cell.textPos.y=y}else{jsPdfAutoTableText(cell.text,cell.textPos.x,cell.textPos.y,style)}}}function escapeRegExp(string){return string==null?"":string.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function replaceAll(string,find,replace){return string==null?"":string.toString().replace(new RegExp(escapeRegExp(find),"g"),replace)}function trimLeft(string){return string==null?"":string.toString().replace(/^\s+/,"")}function trimRight(string){return string==null?"":string.toString().replace(/\s+$/,"")}function parseDateUTC(s){if(defaults.date.html.length===0)return false;defaults.date.pattern.lastIndex=0;const match=defaults.date.pattern.exec(s);if(match==null)return false;const y=+match[defaults.date.match_y];if(y<0||y>8099)return false;const m=match[defaults.date.match_m]*1;const d=match[defaults.date.match_d]*1;if(!isFinite(d))return false;const o=new Date(y,m-1,d,0,0,0);if(o.getFullYear()===y&&o.getMonth()===m-1&&o.getDate()===d)return new Date(Date.UTC(y,m-1,d,0,0,0));else return false}function parseNumber(value){value=value||"0";if(""!==defaults.numbers.html.thousandsSeparator)value=replaceAll(value,defaults.numbers.html.thousandsSeparator,"");if("."!==defaults.numbers.html.decimalMark)value=replaceAll(value,defaults.numbers.html.decimalMark,".");return typeof value==="number"||jQuery.isNumeric(value)!==false?value:false}function parsePercent(value){if(value.indexOf("%")>-1){value=parseNumber(value.replace(/%/g,""));if(value!==false)value=value/100}else value=false;return value}function parseString(cell,rowIndex,colIndex,cellInfo){let result="";let cellType="text";if(cell!==null){const $cell=$(cell);let htmlData;$cell.removeData("teUserDefText");if($cell[0].hasAttribute("data-tableexport-canvas")){htmlData=""}else if($cell[0].hasAttribute("data-tableexport-value")){htmlData=$cell.attr("data-tableexport-value");htmlData=htmlData?htmlData+"":"";$cell.data("teUserDefText",1)}else{htmlData=$cell.html();if(typeof defaults.onCellHtmlData==="function"){htmlData=defaults.onCellHtmlData($cell,rowIndex,colIndex,htmlData);$cell.data("teUserDefText",1)}else if(htmlData!==""){const html=$.parseHTML("
"+htmlData+"
",null,false);let inputIndex=0;let selectIndex=0;htmlData="";$.each(html,function(){if($(this).is("input")){htmlData+=$cell.find("input").eq(inputIndex++).val()}else if($(this).is("select")){htmlData+=$cell.find("select option:selected").eq(selectIndex++).text()}else if($(this).is("br")){htmlData+="
"}else{if(typeof $(this).html()==="undefined")htmlData+=$(this).text();else if(jQuery().bootstrapTable===undefined||$(this).hasClass("fht-cell")===false&&$(this).hasClass("filterControl")===false&&$cell.parents(".detail-view").length===0)htmlData+=$(this).html();if($(this).is("a")){const href=$cell.find("a").attr("href")||"";if(typeof defaults.onCellHtmlHyperlink==="function"){result+=defaults.onCellHtmlHyperlink($cell,rowIndex,colIndex,href,htmlData)}else if(defaults.htmlHyperlink==="href"){result+=href}else{result+=htmlData}htmlData=""}}})}}if(htmlData&&htmlData!==""&&defaults.htmlContent===true){result=$.trim(htmlData)}else if(htmlData&&htmlData!==""){const cellFormat=$cell.attr("data-tableexport-cellformat");if(cellFormat!==""){let text=htmlData.replace(/\n/g,"\u2028").replace(/(<\s*br([^>]*)>)/gi,"⁠");const obj=$("
").html(text).contents();let number=false;text="";$.each(obj.text().split("\u2028"),function(i,v){if(i>0)text+=" ";if(defaults.preserve.leadingWS!==true)v=trimLeft(v);text+=defaults.preserve.trailingWS!==true?trimRight(v):v});$.each(text.split("⁠"),function(i,v){if(i>0)result+="\n";if(defaults.preserve.leadingWS!==true)v=trimLeft(v);if(defaults.preserve.trailingWS!==true)v=trimRight(v);result+=v.replace(/\u00AD/g,"")});result=result.replace(/\u00A0/g," ");if(defaults.type==="json"||defaults.type==="excel"&&defaults.mso.fileFormat==="xmlss"||defaults.numbers.output===false){number=parseNumber(result);if(number!==false){cellType="number";result=Number(number)}}else if(defaults.numbers.html.decimalMark!==defaults.numbers.output.decimalMark||defaults.numbers.html.thousandsSeparator!==defaults.numbers.output.thousandsSeparator){number=parseNumber(result);if(number!==false){const frac=(""+number.substr(number<0?1:0)).split(".");if(frac.length===1)frac[1]="";const mod=frac[0].length>3?frac[0].length%3:0;cellType="number";result=(number<0?"-":"")+(defaults.numbers.output.thousandsSeparator?(mod?frac[0].substr(0,mod)+defaults.numbers.output.thousandsSeparator:"")+frac[0].substr(mod).replace(/(\d{3})(?=\d)/g,"$1"+defaults.numbers.output.thousandsSeparator):frac[0])+(frac[1].length?defaults.numbers.output.decimalMark+frac[1]:"")}}}else result=htmlData}if(defaults.escape===true){result=escape(result)}if(typeof defaults.onCellData==="function"){result=defaults.onCellData($cell,rowIndex,colIndex,result,cellType);$cell.data("teUserDefText",1)}}if(cellInfo!==undefined)cellInfo.type=cellType;return result}function preventInjection(str){if(str.length>0&&defaults.preventInjection===true){const chars="=+-@";if(chars.indexOf(str.charAt(0))>=0)return"'"+str}return str}function hyphenate(a,b,c){return b+"-"+c.toLowerCase()}function rgb2array(rgb_string,default_result){const re=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/;const bits=re.exec(rgb_string);let result=default_result;if(bits)result=[parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3])];return result}function getCellStyles(cell){let a=getStyle(cell,"text-align");const fw=getStyle(cell,"font-weight");const fs=getStyle(cell,"font-style");let f="";if(a==="start")a=getStyle(cell,"direction")==="rtl"?"right":"left";if(fw>=700)f="bold";if(fs==="italic")f+=fs;if(f==="")f="normal";const result={style:{align:a,bcolor:rgb2array(getStyle(cell,"background-color"),[255,255,255]),color:rgb2array(getStyle(cell,"color"),[0,0,0]),fstyle:f},colspan:getColspan(cell),rowspan:getRowspan(cell)};if(cell!==null){const r=cell.getBoundingClientRect();result.rect={width:r.width,height:r.height}}return result}function getColspan(cell){let result=$(cell).attr("data-tableexport-colspan");if(typeof result==="undefined"&&$(cell).is("[colspan]"))result=$(cell).attr("colspan");return parseInt(result)||0}function getRowspan(cell){let result=$(cell).attr("data-tableexport-rowspan");if(typeof result==="undefined"&&$(cell).is("[rowspan]"))result=$(cell).attr("rowspan");return parseInt(result)||0}function getStyle(target,prop){try{if(window.getComputedStyle){prop=prop.replace(/([a-z])([A-Z])/,hyphenate);return window.getComputedStyle(target,null).getPropertyValue(prop)}if(target.currentStyle){return target.currentStyle[prop]}return target.style[prop]}catch(e){}return""}function getUnitValue(parent,value,unit){const baseline=100;const temp=document.createElement("div");temp.style.overflow="hidden";temp.style.visibility="hidden";parent.appendChild(temp);temp.style.width=baseline+unit;const factor=baseline/temp.offsetWidth;parent.removeChild(temp);return value*factor}function getPropertyUnitValue(target,prop,unit){const value=getStyle(target,prop);let numeric=value.match(/\d+/);if(numeric!==null){numeric=numeric[0];return getUnitValue(target.parentElement,numeric,unit)}return 0}function xlsxWorkbookToArrayBuffer(s){const buf=new ArrayBuffer(s.length);const view=new Uint8Array(buf);for(let i=0;i!==s.length;++i)view[i]=s.charCodeAt(i)&255;return buf}function xlsxTableToSheet(table){let ssfId;const ws={};const rows=table.getElementsByTagName("tr");const sheetRows=Math.min(1e7,rows.length);const range={s:{r:0,c:0},e:{r:0,c:0}};let merges=[],midx=0;let _R=0,R=0,_C=0,C=0,RS=0,CS=0;let elt;const ssfTable=XLSX.SSF.get_table();for(;_R0||CS>1)merges.push({s:{r:R,c:C},e:{r:R+(RS||1)-1,c:C+CS-1}});const cellInfo={type:""};let v=parseString(elt,_R,_C+CSOffset,cellInfo);let o={t:"s",v:v};let _t="";const cellFormat=$(elt).attr("data-tableexport-cellformat")||undefined;if(cellFormat!==""){ssfId=parseInt($(elt).attr("data-tableexport-xlsxformatid")||0);if(ssfId===0&&typeof defaults.mso.xlsx.formatId.numbers==="function")ssfId=defaults.mso.xlsx.formatId.numbers($(elt),_R,_C+CSOffset);if(ssfId===0&&typeof defaults.mso.xlsx.formatId.date==="function")ssfId=defaults.mso.xlsx.formatId.date($(elt),_R,_C+CSOffset);if(ssfId===49||ssfId==="@")_t="s";else if(cellInfo.type==="number"||ssfId>0&&ssfId<14||ssfId>36&&ssfId<41||ssfId===48)_t="n";else if(cellInfo.type==="date"||ssfId>13&&ssfId<37||ssfId>44&&ssfId<48||ssfId===56)_t="d"}else _t="s";if(v!=null){let vd;if(v.length===0){o.t="z"}else if(v.trim().length===0){}else if(_t==="s"){}else if(cellInfo.type==="function"){o={f:v}}else if(v==="TRUE"){o={t:"b",v:true}}else if(v==="FALSE"){o={t:"b",v:false}}else if(_t==="n"||isFinite(xlsxToNumber(v,defaults.numbers.output))){const vn=xlsxToNumber(v,defaults.numbers.output);if(ssfId===0&&typeof defaults.mso.xlsx.formatId.numbers!=="function"){ssfId=defaults.mso.xlsx.formatId.numbers}if(isFinite(vn)||isFinite(v))o={t:"n",v:isFinite(vn)?vn:v,z:typeof ssfId==="string"?ssfId:ssfId in ssfTable?ssfTable[ssfId]:ssfId===defaults.mso.xlsx.formatId.currency?defaults.mso.xlsx.format.currency:"0.00"}}else if((vd=parseDateUTC(v))!==false||_t==="d"){if(ssfId===0&&typeof defaults.mso.xlsx.formatId.date!=="function"){ssfId=defaults.mso.xlsx.formatId.date}o={t:"d",v:vd!==false?vd:v,z:typeof ssfId==="string"?ssfId:ssfId in ssfTable?ssfTable[ssfId]:"m/d/yy"}}const $aTag=$(elt).find("a");if($aTag&&$aTag.length){const href=$aTag[0].hasAttribute("href")?$aTag.attr("href"):"";const content=defaults.htmlHyperlink!=="href"||href===""?v:"";const hyperlink=href!==""?'=HYPERLINK("'+href+(content.length?'","'+content:"")+'")':"";if(hyperlink!==""){if(typeof defaults.mso.xlsx.onHyperlink==="function"){v=defaults.mso.xlsx.onHyperlink($(elt),_R,_C,href,content,hyperlink);if(v.indexOf("=HYPERLINK")!==0){o={t:"s",v:v}}else{o={f:v}}}else{o={f:hyperlink}}}}}ws[xlsxEncodeCell({c:C,r:R})]=o;if(range.e.c=sheetRows){ws["!fullref"]=xlsxEncodeRange((range.e.r=rows.length-_R+R-1,range))}return ws}function xlsxEncodeRow(row){return""+(row+1)}function xlsxEncodeCol(col){let s="";for(++col;col;col=Math.floor((col-1)/26)){s=String.fromCharCode((col-1)%26+65)+s}return s}function xlsxEncodeCell(cell){return xlsxEncodeCol(cell.c)+xlsxEncodeRow(cell.r)}function xlsxEncodeRange(cs,ce){if(typeof ce==="undefined"||typeof ce==="number"){return xlsxEncodeRange(cs.s,cs.e)}if(typeof cs!=="string"){cs=xlsxEncodeCell(cs)}if(typeof ce!=="string"){ce=xlsxEncodeCell(ce)}return cs===ce?cs:cs+":"+ce}function xlsxToNumber(s,numbersFormat){let v=Number(s);if(isFinite(v))return v;let wt=1;let ss=s;if(""!==numbersFormat.thousandsSeparator)ss=ss.replace(new RegExp("([\\d])"+numbersFormat.thousandsSeparator+"([\\d])","g"),"$1$2");if("."!==numbersFormat.decimalMark)ss=ss.replace(new RegExp("([\\d])"+numbersFormat.decimalMark+"([\\d])","g"),"$1.$2");ss=ss.replace(/[$]/g,"").replace(/[%]/g,function(){wt*=100;return""});if(isFinite(v=Number(ss)))return v/wt;ss=ss.replace(/[(](.*)[)]/,function($$,$1){wt=-wt;return $1});if(isFinite(v=Number(ss)))return v/wt;return v}function strHashCode(str){let hash=0,i,chr,len;if(str.length===0)return hash;for(i=0,len=str.length;i0||!!ua.match(/Trident.*rv\:11\./))){const frame=document.createElement("iframe");if(frame){document.body.appendChild(frame);frame.setAttribute("style","display:none");frame.contentDocument.open("txt/plain","replace");frame.contentDocument.write(data);frame.contentDocument.close();frame.contentWindow.focus();const extension=filename.substr(filename.lastIndexOf(".")+1);switch(extension){case"doc":case"json":case"png":case"pdf":case"xls":case"xlsx":filename+=".txt";break}frame.contentDocument.execCommand("SaveAs",true,filename);document.body.removeChild(frame)}}else{const DownloadLink=document.createElement("a");if(DownloadLink){let blobUrl=null;DownloadLink.style.display="none";if(filename!==false)DownloadLink.download=filename;else DownloadLink.target="_blank";if(typeof data==="object"){window.URL=window.URL||window.webkitURL;const binaryData=[];binaryData.push(data);blobUrl=window.URL.createObjectURL(new Blob(binaryData,{type:header}));DownloadLink.href=blobUrl}else if(header.toLowerCase().indexOf("base64,")>=0){DownloadLink.href=header+base64encode(data)}else{DownloadLink.href=header+encodeURIComponent(data)}document.body.appendChild(DownloadLink);if(document.createEvent){if(DownloadEvt===null)DownloadEvt=document.createEvent("MouseEvents");DownloadEvt.initEvent("click",true,false);DownloadLink.dispatchEvent(DownloadEvt)}else if(document.createEventObject)DownloadLink.fireEvent("onclick");else if(typeof DownloadLink.onclick==="function")DownloadLink.onclick();setTimeout(function(){if(blobUrl)window.URL.revokeObjectURL(blobUrl);document.body.removeChild(DownloadLink);if(typeof defaults.onAfterSaveToFile==="function")defaults.onAfterSaveToFile(data,filename)},100)}}}function utf8Encode(text){if(typeof text==="string"){text=text.replace(/\x0d\x0a/g,"\n");let utfText="";for(let n=0;n127&&c<2048){utfText+=String.fromCharCode(c>>6|192);utfText+=String.fromCharCode(c&63|128)}else{utfText+=String.fromCharCode(c>>12|224);utfText+=String.fromCharCode(c>>6&63|128);utfText+=String.fromCharCode(c&63|128)}}return utfText}return text}function base64encode(input){let chr1,chr2,chr3,enc1,enc2,enc3,enc4;const keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let output="";let i=0;input=utf8Encode(input);while(i>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64}else if(isNaN(chr3)){enc4=64}output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4)}return output}var jsPdfDoc,jsPdfCursor,jsPdfSettings,jsPdfPageCount,jsPdfTable;function jsPdfAutoTable(doc,headers,data,options){jsPdfValidateInput(headers,data,options);jsPdfDoc=doc;jsPdfSettings=jsPdfInitOptions(options||{});jsPdfPageCount=1;jsPdfCursor={y:jsPdfSettings.startY===false?jsPdfSettings.margin.top:jsPdfSettings.startY};const userStyles={textColor:30,fontSize:jsPdfDoc.internal.getFontSize(),fontStyle:jsPdfDoc.internal.getFont().fontStyle,fontName:jsPdfDoc.internal.getFont().fontName};jsPdfCreateModels(headers,data);jsPdfCalculateWidths();const firstRowHeight=jsPdfTable.rows[0]&&jsPdfSettings.pageBreak==="auto"?jsPdfTable.rows[0].height:0;let minTableBottomPos=jsPdfSettings.startY+jsPdfSettings.margin.bottom+jsPdfTable.headerRow.height+firstRowHeight;if(jsPdfSettings.pageBreak==="avoid"){minTableBottomPos+=jsPdfTable.height}if(jsPdfSettings.pageBreak==="always"&&jsPdfSettings.startY!==false||jsPdfSettings.startY!==false&&minTableBottomPos>jsPdfDoc.internal.pageSize.height){jsPdfDoc.addPage();jsPdfCursor.y=jsPdfSettings.margin.top}jsPdfApplyStyles(userStyles);jsPdfSettings.beforePageContent(jsPdfHooksData());if(jsPdfSettings.drawHeaderRow(jsPdfTable.headerRow,jsPdfHooksData({row:jsPdfTable.headerRow}))!==false){jsPdfPrintRow(jsPdfTable.headerRow,jsPdfSettings.drawHeaderCell)}jsPdfApplyStyles(userStyles);jsPdfPrintRows();jsPdfSettings.afterPageContent(jsPdfHooksData());jsPdfApplyStyles(userStyles);return jsPdfDoc}function jsPdfAutoTableEndPosY(){if(typeof jsPdfCursor==="undefined"||typeof jsPdfCursor.y==="undefined"){return 0}return jsPdfCursor.y}function jsPdfAutoTableText(text,x,y,styles){if(typeof x!=="number"||typeof y!=="number"){console.error("The x and y parameters are required. Missing for the text: ",text)}const fontSize=jsPdfDoc.internal.getFontSize()/jsPdfDoc.internal.scaleFactor;const lineHeightProportion=FONT_ROW_RATIO;const splitRegex=/\r\n|\r|\n/g;let splittedText=null;let lineCount=1;if(styles.valign==="middle"||styles.valign==="bottom"||styles.halign==="center"||styles.halign==="right"){splittedText=typeof text==="string"?text.split(splitRegex):text;lineCount=splittedText.length||1}y+=fontSize*(2-lineHeightProportion);if(styles.valign==="middle")y-=lineCount/2*fontSize;else if(styles.valign==="bottom")y-=lineCount*fontSize;if(styles.halign==="center"||styles.halign==="right"){let alignSize=fontSize;if(styles.halign==="center")alignSize*=.5;if(splittedText&&lineCount>=1){for(let iLine=0;iLinecolumn.contentWidth){column.contentWidth=cellWidth}});column.width=column.contentWidth;tableContentWidth+=column.contentWidth});jsPdfTable.contentWidth=tableContentWidth;const maxTableWidth=jsPdfDoc.internal.pageSize.width-jsPdfSettings.margin.left-jsPdfSettings.margin.right;let preferredTableWidth=maxTableWidth;if(typeof jsPdfSettings.tableWidth==="number"){preferredTableWidth=jsPdfSettings.tableWidth}else if(jsPdfSettings.tableWidth==="wrap"){preferredTableWidth=jsPdfTable.contentWidth}jsPdfTable.width=preferredTableWidthjsPdfTable.width){column.width=column.contentWidth}else{dynamicColumns.push(column);dynamicColumnsContentWidth+=column.contentWidth;column.width=0}}staticWidth+=column.width});jsPdfDistributeWidth(dynamicColumns,staticWidth,dynamicColumnsContentWidth,fairWidth);jsPdfTable.height=0;const all=jsPdfTable.rows.concat(jsPdfTable.headerRow);all.forEach(function(row,i){let lineBreakCount=0;let cursorX=jsPdfTable.x;jsPdfTable.columns.forEach(function(col){const cell=row.cells[col.dataKey];col.x=cursorX;jsPdfApplyStyles(cell.styles);const textSpace=col.width-cell.styles.cellPadding*2;if(cell.styles.overflow==="linebreak"){cell.text=jsPdfDoc.splitTextToSize(cell.text,textSpace+1,{fontSize:cell.styles.fontSize})}else if(cell.styles.overflow==="ellipsize"){cell.text=jsPdfEllipsize(cell.text,textSpace,cell.styles)}else if(cell.styles.overflow==="visible"){}else if(cell.styles.overflow==="hidden"){cell.text=jsPdfEllipsize(cell.text,textSpace,cell.styles,"")}else if(typeof cell.styles.overflow==="function"){cell.text=cell.styles.overflow(cell.text,textSpace)}else{console.error("Unrecognized overflow type: "+cell.styles.overflow)}const count=Array.isArray(cell.text)?cell.text.length-1:0;if(count>lineBreakCount){lineBreakCount=count}cursorX+=col.width});row.heightStyle=row.styles.rowHeight;row.height=row.heightStyle+lineBreakCount*row.styles.fontSize*FONT_ROW_RATIO+(2-FONT_ROW_RATIO)/2*row.styles.fontSize;jsPdfTable.height+=row.height})}function jsPdfDistributeWidth(dynamicColumns,staticWidth,dynamicColumnsContentWidth,fairWidth){const extraWidth=jsPdfTable.width-staticWidth-dynamicColumnsContentWidth;for(let i=0;i=jsPdfDoc.internal.pageSize.height}function jsPdfPrintRow(row,hookHandler){for(let i=0;i=jsPdfGetStringWidth(text,styles)){return text}while(widthe&&"undefined"!==typeof fa[e]&&-1!==d.inArray(fa[e],b.ignoreColumn))&&(h=!0):h=!0;return h}function G(a,c,e,h,f){if("function"===typeof f){var x=!1;"function"===typeof b.onIgnoreRow&&(x=b.onIgnoreRow(d(a),e));if(!1===x&&(0===b.ignoreRow.length||-1===d.inArray(e,b.ignoreRow)&&-1===d.inArray(e-h,b.ignoreRow))&&O(d(a))){a= +P(d(a),c);var m=a.length,g=0,p=0;a.each(function(){var a=d(this),c=Q(this),b=ha(this),h;d.each(N,function(){if(e>this.s.r&&e<=this.e.r&&g>=this.s.c&&g<=this.e.c)for(h=0;h<=this.e.c-this.s.c;++h)m++,p++,f(null,e,g++)});if(b||c)c=c||1,N.push({s:{r:e,c:g},e:{r:e+(b||1)-1,c:g+c-1}});!1===Va(a,m,p++)&&f(this,e,g++);if(1=this.s.r&&e<=this.e.r&&g>=this.s.c&&g<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f(null,e,g++)})}}}function Wa(a,c, +b,h){if("undefined"!==typeof h.images&&(b=h.images[b],"undefined"!==typeof b)){c=c.getBoundingClientRect();var e=a.width/a.height,d=c.width/c.height,m=a.width,g=a.height,p=19.049976/25.4,B=0;d<=e?(g=Math.min(a.height,c.height),m=c.width*g/c.height):d>e&&(m=Math.min(a.width,c.width),g=c.height*m/c.width);m*=p;g*=p;ga.textPos.x&&h+B>a.textPos.x+a.width&&(0<=".,!%*;:=-".indexOf(p.charAt(0))&&(z=p.charAt(0),B=e.doc.getStringUnitWidth(z)*e.doc.internal.getFontSize(),h+B<=a.textPos.x+a.width&&(za(z,h,f,x),p=p.substring(1,p.length)),B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize()),h=a.textPos.x,f+=e.doc.internal.getFontSize()); +if("visible"!==a.styles.overflow)for(;p.length&&h+B>a.textPos.x+a.width;)p=p.substring(0,p.length-1),B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize();za(p,h,f,x);h+=B}if(m||g)d(c).is("b")?m=!1:d(c).is("i")&&(g=!1),e.doc.setFont("undefined ",m||g?m?"bold":"italic":"normal");c=c.nextSibling}a.textPos.x=h;a.textPos.y=f}else za(a.text,a.textPos.x,a.textPos.y,x)}}function la(a,c,b){return null==a?"":a.toString().replace(new RegExp(null==c?"":c.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g, +"\\$1"),"g"),b)}function Ha(a){return null==a?"":a.toString().replace(/^\s+/,"")}function Ia(a){return null==a?"":a.toString().replace(/\s+$/,"")}function ob(a){if(0===b.date.html.length)return!1;b.date.pattern.lastIndex=0;var c=b.date.pattern.exec(a);if(null==c)return!1;a=+c[b.date.match_y];if(0>a||8099"+g+"
",null,!1);var p=0,B=0;g="";d.each(a,function(){if(d(this).is("input"))g+=m.find("input").eq(p++).val();else if(d(this).is("select"))g+=m.find("select option:selected").eq(B++).text();else if(d(this).is("br"))g+="
";else{if("undefined"===typeof d(this).html())g+=d(this).text(); +else if(void 0===jQuery().bootstrapTable||!1===d(this).hasClass("fht-cell")&&!1===d(this).hasClass("filterControl")&&0===m.parents(".detail-view").length)g+=d(this).html();if(d(this).is("a")){var a=m.find("a").attr("href")||"";f="function"===typeof b.onCellHtmlHyperlink?f+b.onCellHtmlHyperlink(m,c,e,a,g):"href"===b.htmlHyperlink?f+a:f+g;g=""}}})}if(g&&""!==g&&!0===b.htmlContent)f=d.trim(g);else if(g&&""!==g)if(""!==m.attr("data-tableexport-cellformat")){var z=g.replace(/\n/g,"\u2028").replace(/(<\s*br([^>]*)>)/gi, +"\u2060"),k=d("
").html(z).contents();a=!1;z="";d.each(k.text().split("\u2028"),function(a,c){0a?1:0)).split(".");1===k.length&&(k[1]="");var l=3a?"-":"")+(b.numbers.output.thousandsSeparator?(l?k[0].substr(0,l)+b.numbers.output.thousandsSeparator:"")+k[0].substr(l).replace(/(\d{3})(?=\d)/g,"$1"+b.numbers.output.thousandsSeparator):k[0])+(k[1].length?b.numbers.output.decimalMark+ +k[1]:"")}}else f=g;!0===b.escape&&(f=escape(f));"function"===typeof b.onCellData&&(f=b.onCellData(m,c,e,f,x),m.data("teUserDefText",1))}void 0!==h&&(h.type=x);return f}function db(a){return 0x?f+=String.fromCharCode(x):(127x?f+=String.fromCharCode(x>>6|192):(f+=String.fromCharCode(x>>12|224),f+=String.fromCharCode(x>>6&63|128)),f+=String.fromCharCode(x&63|128))}a=f}for(;d>2;m=(m&3)<<4|f>>4;var g=(f&15)<<2|c>>6;var p=c&63;isNaN(f)?g=p=64:isNaN(c)&&(p=64);b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(x)+ +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(p)}return b}function sb(a,c,b,d){c&&"object"===typeof c||console.error("The headers should be an object or array, is: "+typeof c);b&&"object"===typeof b||console.error("The data should be an object or array, is: "+typeof b);d&&"object"!==typeof d&&console.error("The data should be an object or array, is: "+ +typeof b);Array.prototype.forEach||console.error("The current browser does not support Array.prototype.forEach which is required for jsPDF-AutoTable");y=a;l=tb(d||{});Ma=1;F={y:!1===l.startY?l.margin.top:l.startY};a={textColor:30,fontSize:y.internal.getFontSize(),fontStyle:y.internal.getFont().fontStyle,fontName:y.internal.getFont().fontName};ub(c,b);vb();c=l.startY+l.margin.bottom+q.headerRow.height+(q.rows[0]&&"auto"===l.pageBreak?q.rows[0].height:0);"avoid"===l.pageBreak&&(c+=q.height);if("always"=== +l.pageBreak&&!1!==l.startY||!1!==l.startY&&c>y.internal.pageSize.height)y.addPage(),F.y=l.margin.top;ma(a);l.beforePageContent(U());!1!==l.drawHeaderRow(q.headerRow,U({row:q.headerRow}))&&Na(q.headerRow,l.drawHeaderCell);ma(a);wb();l.afterPageContent(U());ma(a);return y}function za(a,c,b,d){"number"===typeof c&&"number"===typeof b||console.error("The x and y parameters are required. Missing for the text: ",a);var e=y.internal.getFontSize()/y.internal.scaleFactor,h=/\r\n|\r|\n/g,m=null,g=1;if("middle"=== +d.valign||"bottom"===d.valign||"center"===d.halign||"right"===d.halign)m="string"===typeof a?a.split(h):a,g=m.length||1;b+=e*(2-1.15);"middle"===d.valign?b-=g/2*e:"bottom"===d.valign&&(b-=g*e);if("center"===d.halign||"right"===d.halign){h=e;"center"===d.halign&&(h*=.5);if(m&&1<=g){for(a=0;ab.contentWidth&&(b.contentWidth=a)});b.width=b.contentWidth;a+=b.contentWidth});q.contentWidth=a;var b=y.internal.pageSize.width-l.margin.left-l.margin.right,d=b;"number"===typeof l.tableWidth?d=l.tableWidth:"wrap"===l.tableWidth&&(d=q.contentWidth);q.width=dq.width?a.width=a.contentWidth:(h.push(a),f+=a.contentWidth,a.width=0);m+=a.width});hb(h,m,f,k);q.height=0;q.rows.concat(q.headerRow).forEach(function(a,b){var c=0,d=q.x;q.columns.forEach(function(b){var e=a.cells[b.dataKey];b.x=d;ma(e.styles);var g=b.width- +2*e.styles.cellPadding;"linebreak"===e.styles.overflow?e.text=y.splitTextToSize(e.text,g+1,{fontSize:e.styles.fontSize}):"ellipsize"===e.styles.overflow?e.text=Oa(e.text,g,e.styles):"visible"!==e.styles.overflow&&("hidden"===e.styles.overflow?e.text=Oa(e.text,g,e.styles,""):"function"===typeof e.styles.overflow?e.text=e.styles.overflow(e.text,g):console.error("Unrecognized overflow type: "+e.styles.overflow));e=Array.isArray(e.text)?e.text.length-1:0;e>c&&(c=e);d+=b.width});a.heightStyle=a.styles.rowHeight; +a.height=a.heightStyle+c*a.styles.fontSize*1.15+(2-1.15)/2*a.styles.fontSize;q.height+=a.height})}function hb(a,b,d,h){for(var c=q.width-b-d,e=0;ec&&p){a.splice(e,1);d-=m.contentWidth;m.width=h;b+=m.width;hb(a,b,d,h);break}else m.width=m.contentWidth+c*g}}function wb(){q.rows.forEach(function(a,b){F.y+a.height+l.margin.bottom>=y.internal.pageSize.height&&(l.afterPageContent(U()),y.addPage(),Ma++,F={x:l.margin.left,y:l.margin.top}, +l.beforePageContent(U()),!1!==l.drawHeaderRow(q.headerRow,U({row:q.headerRow}))&&Na(q.headerRow,l.drawHeaderCell));a.y=F.y;!1!==l.drawRow(a,U({row:a}))&&Na(a,l.drawCell)})}function Na(a,b){for(var c=0;c= +Ca(a,d))return a;for(;ba.length);)a=a.substring(0,a.length-1);return a.trim()+h}function Ca(a,b){ma(b);return y.getStringUnitWidth(a)*b.fontSize}function Z(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);for(var h=1;h"+E(a,b,d)+""});r++});da+="";var ib=1;A=Y(d(u));d(A).each(function(){var a=1;t="";G(this,"td,th",r,v.length+A.length,function(b,d,h){t+=""+E(b,d,h)+"";a++});0"!==t&&(da+=''+t+"",ib++);r++});da+="";if("string"=== +b.outputMode)return da;if("base64"===b.outputMode)return S(da);T(da,b.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===b.type&&"xmlss"===b.mso.fileFormat){var Sa=[],M=[];d(u).filter(function(){return O(d(this))}).each(function(){function a(a,b,c){var e=[];d(a).each(function(){var b=0,f=0;t="";G(this,"td,th",r,c+a.length,function(a,c,g){if(null!==a){var m="";c=E(a,c,g);g="String";if(!1!==jQuery.isNumeric(c))g="Number";else{var h=pb(c);!1!==h&&(c=h,g="Number",m+=' ss:StyleID="pct1"')}"Number"!== +g&&(c=c.replace(/\n/g,"
"));h=Q(a);a=ha(a);d.each(e,function(){if(r>=this.s.r&&r<=this.e.r&&f>=this.s.c&&f<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f++,b++});if(a||h)a=a||1,h=h||1,e.push({s:{r:r,c:f},e:{r:r+a-1,c:f+h-1}});1'+d("
").text(c).html()+"\r";f++}});0\r'+ +t+"\r");r++});return a.length}var c=d(this),e="";"string"===typeof b.mso.worksheetName&&b.mso.worksheetName.length?e=b.mso.worksheetName+" "+(M.length+1):"undefined"!==typeof b.mso.worksheetName[M.length]&&(e=b.mso.worksheetName[M.length]);e.length||(e=c.find("caption").text()||"");e.length||(e="Table "+(M.length+1));e=d.trim(e.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));M.push(d("
").text(e).html());!1===b.exportHiddenCells&&(R=c.find("tr, th, td").filter(":hidden"),ka=0\r";e=a(X(c),"th,td",0);a(Y(c),"td,th",e);L+="\r";Sa.push(L)});for(var Da={},Ta={},ea,ra,oa=0,yb=M.length;oa\r\r\r \r\r\r 9000\r 13860\r 0\r 0\r False\r False\r\r\r \r \r \r\r', +Ea=0;Ea\r'+Sa[Ea],W=b.mso.rtl?W+'\r\r\r':W+'\r',W+="\r";W+="\r";if("string"===b.outputMode)return W;if("base64"===b.outputMode)return S(W);T(W,b.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"=== +b.type&&"xlsx"===b.mso.fileFormat){var sa=[],jb=XLSX.utils.book_new();d(u).filter(function(){return O(d(this))}).each(function(){for(var a=d(this),c,e={},h=this.getElementsByTagName("tr"),f=Math.min(1E7,h.length),k={s:{r:0,c:0},e:{r:0,c:0}},m=[],g,p=0,B=0,z,l,r,q,n,t=XLSX.SSF.get_table();pc||36c||48===c)u="n";else{if("date"===w.type||13c||44c||56===c)u="d"}else u="s";if(null!=C){if(0===C.length)g.t="z";else if(0!==C.trim().length&&"s"!==u)if("function"===w.type)g={f:C};else if("TRUE"===C)g={t:"b",v:!0};else if("FALSE"===C)g={t:"b",v:!1};else if("n"===u||isFinite(fb(C,b.numbers.output))){if(u= +fb(C,b.numbers.output),0===c&&"function"!==typeof b.mso.xlsx.formatId.numbers&&(c=b.mso.xlsx.formatId.numbers),isFinite(u)||isFinite(C))g={t:"n",v:isFinite(u)?u:C,z:"string"===typeof c?c:c in t?t[c]:c===b.mso.xlsx.formatId.currency?b.mso.xlsx.format.currency:"0.00"}}else if(!1!==(w=ob(C))||"d"===u)0===c&&"function"!==typeof b.mso.xlsx.formatId.date&&(c=b.mso.xlsx.formatId.date),g={t:"d",v:!1!==w?w:C,z:"string"===typeof c?c:c in t?t[c]:"m/d/yy"};(u=d(n).find("a"))&&u.length&&(u=u[0].hasAttribute("href")? +u.attr("href"):"",C="href"!==b.htmlHyperlink||""===u?C:"",w=""!==u?'=HYPERLINK("'+u+(C.length?'","'+C:"")+'")':"",""!==w&&("function"===typeof b.mso.xlsx.onHyperlink?(C=b.mso.xlsx.onHyperlink(d(n),p,z,u,C,w),g=0!==C.indexOf("=HYPERLINK")?{t:"s",v:C}:{f:C}):g={f:w}))}e[Ka({c:l,r:B})]=g;k.e.c=f&&(e["!fullref"]=La((k.e.r=h.length-p+B-1,k)));c="";"string"===typeof b.mso.worksheetName&& +b.mso.worksheetName.length?c=b.mso.worksheetName+" "+(sa.length+1):"undefined"!==typeof b.mso.worksheetName[sa.length]&&(c=b.mso.worksheetName[sa.length]);c.length||(c=a.find("caption").text()||"");c.length||(c="Table "+(sa.length+1));c=d.trim(c.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));sa.push(c);XLSX.utils.book_append_sheet(jb,e,c)});var zb=XLSX.write(jb,{type:"binary",bookType:b.mso.fileFormat,bookSST:!1});T(rb(zb),b.fileName+"."+b.mso.fileFormat,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", +"UTF-8","",!1)}else if("excel"===b.type||"xls"===b.type||"word"===b.type||"doc"===b.type){var ta="excel"===b.type||"xls"===b.type?"excel":"word",Ab="excel"===ta?"xls":"doc",Bb='xmlns:x="urn:schemas-microsoft-com:office:'+ta+'"',ua=L="";d(u).filter(function(){return O(d(this))}).each(function(){var a=d(this);""===ua&&(ua=b.mso.worksheetName||a.find("caption").text()||"Table",ua=d.trim(ua.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31)));!1===b.exportHiddenCells&&(R=a.find("tr, th, td").filter(":hidden"), +ka=0";v=X(a);d(v).each(function(){var a=d(this),e=document.defaultView.getComputedStyle(a[0],null);t="";G(this,"th,td",r,v.length,function(a,c,d){if(null!==a){var f="";t+=""}});0"+t+"");r++});L+="";A=Y(a);d(A).each(function(){var a=d(this),e=null,h=null;t="";G(this,"td,th",r,v.length+A.length,function(c,k,m){if(null!==c){var g=E(c,k,m),f="",l=d(c).attr("data-tableexport-msonumberformat");"undefined"===typeof l&&"function"===typeof b.mso.onMsoNumberFormat&&(l=b.mso.onMsoNumberFormat(c,k,m));"undefined"!==typeof l&&""!==l&&(f="style=\"mso-number-format:'"+ +l+"'");if(b.mso.styles.length){e=document.defaultView.getComputedStyle(c,null);h=null;for(var n in b.mso.styles)k=b.mso.styles[n],l=H(e,k),""===l&&(null===h&&(h=document.defaultView.getComputedStyle(a[0],null)),l=H(h,k)),""!==l&&"0px none rgb(0, 0, 0)"!==l&&"rgba(0, 0, 0, 0)"!==l&&(f+=""===f?'style="':";",f+=k+":"+l)}t+=""));t+=">"+g+""}}); +0"+t+"");r++});b.displayTableName&&(L+=""+E(d("

"+b.tableName+"

"))+"");L+=""});var n='';n+="";n+='';"excel"===ta&&(n+="\x3c!--[if gte mso 9]>",n+="",n+="",n+="",n+="", +n+="",n+=ua,n+="",n+="",n+="",b.mso.rtl&&(n+=""),n+="",n+="",n+="",n+="",n+="",n+="";n+="@page { size:"+b.mso.pageOrientation+"; mso-page-orientation:"+b.mso.pageOrientation+"; }";n+="@page Section1 {size:"+V[b.mso.pageFormat][0]+"pt "+V[b.mso.pageFormat][1]+"pt";n+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}"; +n+="div.Section1 {page:Section1;}";n+="@page Section2 {size:"+V[b.mso.pageFormat][1]+"pt "+V[b.mso.pageFormat][0]+"pt";n+=";mso-page-orientation:"+b.mso.pageOrientation+";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";n+="div.Section2 {page:Section2;}";n+="br {mso-data-placement:same-cell;}";n+="";n+="";n+="";n+='
';n+=L;n+="
";n+="";n+=""; +if("string"===b.outputMode)return n;if("base64"===b.outputMode)return S(n);T(n,b.fileName+"."+Ab,"application/vnd.ms-"+ta,"","base64",!1)}else if("png"===b.type)html2canvas(d(u)[0]).then(function(a){a=a.toDataURL();for(var c=atob(a.substring(22)),d=new ArrayBuffer(c.length),h=new Uint8Array(d),f=0;fkb){a>V.a0[0]&&(Fa="a0",va="l");for(var b in V)V.hasOwnProperty(b)&&V[b][1]>a&&(Fa=b,va="l",V[b][0]>a&&(va="p"));kb=a}}});b.jspdf.format=""===Fa?"a4":Fa;b.jspdf.orientation=""===va?"w":va}if(null== +k.doc&&(k.doc=new jspdf.jsPDF(b.jspdf.orientation,b.jspdf.unit,b.jspdf.format),k.wScaleFactor=1,k.hScaleFactor=1,"function"===typeof b.jspdf.onDocCreated))b.jspdf.onDocCreated(k.doc);Ba.fontName=k.doc.getFont().fontName;!0===k.outputImages&&(k.images={});"undefined"!==typeof k.images&&(d(u).filter(function(){return O(d(this))}).each(function(){var a=0;N=[];!1===b.exportHiddenCells&&(R=d(this).find("tr, th, td").filter(":hidden"),ka=0a.styles.rowHeight&&(a.styles.rowHeight=e)}a.styles.halign="inherit"===c.headerStyles.halign?"center":c.headerStyles.halign;a.styles.valign=c.headerStyles.valign;"undefined"!==typeof d.style&&!0!==d.style.hidden&&("inherit"===c.headerStyles.halign&&(a.styles.halign=d.style.align),"inherit"===c.styles.fillColor&&(a.styles.fillColor=d.style.bcolor),"inherit"===c.styles.textColor&&(a.styles.textColor=d.style.color),"inherit"=== +c.styles.fontStyle&&(a.styles.fontStyle=d.style.fstyle))}});"function"!==typeof c.createdCell&&(c.createdCell=function(a,b){b=k.teCells[b.row.index+":"+b.column.dataKey];a.styles.halign="inherit"===c.styles.halign?"center":c.styles.halign;a.styles.valign=c.styles.valign;"undefined"!==typeof b&&"undefined"!==typeof b.style&&!0!==b.style.hidden&&("inherit"===c.styles.halign&&(a.styles.halign=b.style.align),"inherit"===c.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===c.styles.textColor&& +(a.styles.textColor=b.style.color),"inherit"===c.styles.fontStyle&&(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof c.drawHeaderCell&&(c.drawHeaderCell=function(a,b){var c=k.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?Ya(a,b,c):!1});"function"!==typeof c.drawCell&&(c.drawCell=function(a,b){var c=k.teCells[b.row.index+":"+b.column.dataKey];if(!0!==("undefined"!==typeof c&&c.isCanvas))Ya(a,b,c)&&(k.doc.rect(a.x,a.y,a.width,a.height, +a.styles.fillStyle),"undefined"===typeof c||"undefined"!==typeof c.hasUserDefText&&!0===c.hasUserDefText||"undefined"===typeof c.elements||!c.elements.length?cb(a,{},k):(b=a.height/c.rect.height,b>k.hScaleFactor&&(k.hScaleFactor=b),k.wScaleFactor=a.width/c.rect.width,b=a.textPos.y,ab(a,c.elements,k),a.textPos.y=b,cb(a,c.elements,k)));else{c=c.elements[0];var e=d(c).attr("data-tableexport-canvas"),f=c.getBoundingClientRect();a.width=f.width*k.wScaleFactor;a.height=f.height*k.hScaleFactor;b.row.height= +a.height;Wa(a,c,e,k)}return!1});k.headerrows=[];v=X(d(this));d(v).each(function(){a=0;k.headerrows[r]=[];G(this,"th,td",r,v.length,function(b,c,d){var e=eb(b);e.title=E(b,c,d);e.key=a++;e.rowIndex=r;k.headerrows[r].push(e)});r++});if(0 .th-inner::before margin-top:160px; } } -@media screen and (max-width: 771px) and (min-width: 512px){ +@media screen and (max-width: 912px) and (min-width: 512px){ .sidebar-menu { - margin-top:160px + margin-top:100px } } -@media screen and (max-width: 1098px) and (min-width: 772px){ +@media screen and (max-width: 1268px) and (min-width: 912px){ .sidebar-menu { - margin-top:98px + margin-top:50px } } diff --git a/resources/views/components/checkin.blade.php b/resources/views/components/checkin.blade.php index 6a7055f727..e195685d2a 100644 --- a/resources/views/components/checkin.blade.php +++ b/resources/views/components/checkin.blade.php @@ -17,7 +17,7 @@
-
+ {{csrf_field()}}
diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index a583602958..0757be5ae5 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -1017,6 +1017,8 @@ {{ trans('general.qty') }} {{ trans('general.purchase_cost') }} {{trans('admin/hardware/form.serial')}} + {{trans('general.checkin')}} + @@ -1031,6 +1033,9 @@ {{ $component->pivot->assigned_qty }} {{ Helper::formatCurrencyOutput($component->purchase_cost) }} each {{ $component->serial }} + + {{ trans('general.checkin') }} + purchase_cost *$component->pivot->assigned_qty) ?> From 92776adb933ecb201cf8d8ee943310c33937668d Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 3 Oct 2023 12:31:58 -0700 Subject: [PATCH 03/45] remove unnecessary changes --- .../Components/ComponentCheckinController.php | 2 +- public/css/dist/all.css | 18 +- public/css/dist/bootstrap-table.css | 2 +- public/js/dist/bootstrap-table.js | 601 +++++++----------- public/mix-manifest.json | 10 +- resources/assets/less/overrides.less | 8 +- 6 files changed, 257 insertions(+), 384 deletions(-) diff --git a/app/Http/Controllers/Components/ComponentCheckinController.php b/app/Http/Controllers/Components/ComponentCheckinController.php index 395d75b6ac..65251b6c4c 100644 --- a/app/Http/Controllers/Components/ComponentCheckinController.php +++ b/app/Http/Controllers/Components/ComponentCheckinController.php @@ -43,7 +43,7 @@ class ComponentCheckinController extends Controller return view('components/checkin', compact('component_assets', 'component', 'asset')); } -// return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found')); + return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found')); } /** diff --git a/public/css/dist/all.css b/public/css/dist/all.css index de7c6eb786..3313bdac45 100644 --- a/public/css/dist/all.css +++ b/public/css/dist/all.css @@ -22385,7 +22385,7 @@ a.ui-button:active, /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVra28tbGlnaHRib3guY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQ0UsOEJBQXlCLEFBQXpCLHVCQUF5QixBQUN6QixzQkFBb0IsQUFBcEIsbUJBQW9CLEFBQ3BCLHFCQUF3QixBQUF4Qix1QkFBd0IsQUFDeEIseUJBQTZCLENBQzlCLEFBQ0QseUJBQ0UsaUJBQW1CLENBQ3BCLEFBQ0QsZ0RBQ0Usa0JBQW1CLEFBQ25CLE1BQU8sQUFDUCxPQUFRLEFBQ1IsU0FBVSxBQUNWLFFBQVMsQUFDVCxVQUFZLENBQ2IsQUFDRCxzQkFDRSxXQUFZLEFBQ1osV0FBYSxDQUNkLEFBQ0QsMkJBQ0UsVUFBYSxBQUNiLGtCQUFtQixBQUNuQixNQUFPLEFBQ1AsT0FBUSxBQUNSLFdBQVksQUFDWixZQUFhLEFBQ2Isb0JBQWMsQUFBZCxZQUFjLENBQ2YsQUFDRCw2QkFDRSxXQUFRLEFBQVIsT0FBUSxBQUNSLG9CQUFjLEFBQWQsYUFBYyxBQUNkLHNCQUFvQixBQUFwQixtQkFBb0IsQUFDcEIsVUFBVyxBQUNYLHVCQUF5QixBQUN6QixXQUFZLEFBQ1osZUFBZ0IsQUFDaEIsU0FBYSxDQUNkLEFBQ0QsK0JBQ0Usb0JBQWEsQUFBYixXQUFhLENBQ2QsQUFDRCxvQ0FDRSxZQUFjLENBQ2YsQUFDRCxrQ0FDRSxjQUFnQixDQUNqQixBQUNELDZDQUNFLGdCQUFrQixDQUNuQixBQUNELG1DQUNFLG9CQUFzQixDQUN2QixBQUNELG1DQUNFLFlBQWMsQ0FDZixBQUNELHNDQUNFLGVBQWdCLEFBQ2hCLGlCQUFtQixDQUNwQixBQUNELHVCQUNFLFVBQVcsQUFDWCxvQkFBc0IsQ0FDdkIsQUFDRCw2QkFDRSxZQUFjLENBQ2YsQUFDRCw2QkFDRSxlQUFpQixDQUNsQixBQUNELHNCQUNFLGtCQUFtQixBQUNuQixNQUFPLEFBQ1AsT0FBUSxBQUNSLFNBQVUsQUFDVixRQUFTLEFBQ1QsV0FBWSxBQUNaLG9CQUFjLEFBQWQsYUFBYyxBQUVkLDBCQUF1QixBQUF2QixzQkFBdUIsQUFFdkIscUJBQXdCLEFBQXhCLHVCQUF3QixBQUV4QixzQkFBb0IsQUFBcEIsa0JBQW9CLENBQ3JCLEFBQ0QsMEJBQ0UsV0FBWSxBQUNaLFlBQWEsQUFDYixrQkFBbUIsQUFDbkIsaUJBQW1CLENBQ3BCLEFBQ0QsOEJBQ0UsV0FBWSxBQUNaLFlBQWEsQUFDYixrQkFBbUIsQUFDbkIsc0JBQXVCLEFBQ3ZCLFdBQWEsQUFDYixrQkFBbUIsQUFDbkIsTUFBTyxBQUNQLE9BQVEsQUFDUixtQ0FBNkMsQ0FDOUMsQUFDRCx5Q0FDRSxtQkFBcUIsQ0FDdEIsQUFDRCw0Q0FDRSxxQkFBdUIsQ0FDeEIsQUFVRCxhQUNFLE1BRUUsbUJBQW9CLEFBQ3BCLDBCQUE0QixDQUM3QixBQUNELElBQ0UsbUJBQW9CLEFBQ3BCLDBCQUE0QixDQUM3QixDQUNGIiwiZmlsZSI6ImVra28tbGlnaHRib3guY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmVra28tbGlnaHRib3gge1xuICBkaXNwbGF5OiBmbGV4ICFpbXBvcnRhbnQ7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBwYWRkaW5nLXJpZ2h0OiAwcHghaW1wb3J0YW50O1xufVxuLmVra28tbGlnaHRib3gtY29udGFpbmVyIHtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xufVxuLmVra28tbGlnaHRib3gtY29udGFpbmVyID4gZGl2LmVra28tbGlnaHRib3gtaXRlbSB7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICBib3R0b206IDA7XG4gIHJpZ2h0OiAwO1xuICB3aWR0aDogMTAwJTtcbn1cbi5la2tvLWxpZ2h0Ym94IGlmcmFtZSB7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSB7XG4gIHotaW5kZXg6IDEwMDtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB0b3A6IDA7XG4gIGxlZnQ6IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGRpc3BsYXk6IGZsZXg7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhIHtcbiAgZmxleDogMTtcbiAgZGlzcGxheTogZmxleDtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgb3BhY2l0eTogMDtcbiAgdHJhbnNpdGlvbjogb3BhY2l0eSAwLjVzO1xuICBjb2xvcjogI2ZmZjtcbiAgZm9udC1zaXplOiAzMHB4O1xuICB6LWluZGV4OiAxMDA7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhID4gKiB7XG4gIGZsZXgtZ3JvdzogMTtcbn1cbi5la2tvLWxpZ2h0Ym94LW5hdi1vdmVybGF5IGEgPiAqOmZvY3VzIHtcbiAgb3V0bGluZTogbm9uZTtcbn1cbi5la2tvLWxpZ2h0Ym94LW5hdi1vdmVybGF5IGEgc3BhbiB7XG4gIHBhZGRpbmc6IDAgMzBweDtcbn1cbi5la2tvLWxpZ2h0Ym94LW5hdi1vdmVybGF5IGE6bGFzdC1jaGlsZCBzcGFuIHtcbiAgdGV4dC1hbGlnbjogcmlnaHQ7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhOmhvdmVyIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuLmVra28tbGlnaHRib3gtbmF2LW92ZXJsYXkgYTpmb2N1cyB7XG4gIG91dGxpbmU6IG5vbmU7XG59XG4uZWtrby1saWdodGJveC1uYXYtb3ZlcmxheSBhLmRpc2FibGVkIHtcbiAgY3Vyc29yOiBkZWZhdWx0O1xuICB2aXNpYmlsaXR5OiBoaWRkZW47XG59XG4uZWtrby1saWdodGJveCBhOmhvdmVyIHtcbiAgb3BhY2l0eTogMTtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuLmVra28tbGlnaHRib3ggLm1vZGFsLWRpYWxvZyB7XG4gIGRpc3BsYXk6IG5vbmU7XG59XG4uZWtrby1saWdodGJveCAubW9kYWwtZm9vdGVyIHtcbiAgdGV4dC1hbGlnbjogbGVmdDtcbn1cbi5la2tvLWxpZ2h0Ym94LWxvYWRlciB7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICBib3R0b206IDA7XG4gIHJpZ2h0OiAwO1xuICB3aWR0aDogMTAwJTtcbiAgZGlzcGxheTogZmxleDtcbiAgLyogZXN0YWJsaXNoIGZsZXggY29udGFpbmVyICovXG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIC8qIG1ha2UgbWFpbiBheGlzIHZlcnRpY2FsICovXG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAvKiBjZW50ZXIgaXRlbXMgdmVydGljYWxseSwgaW4gdGhpcyBjYXNlICovXG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG59XG4uZWtrby1saWdodGJveC1sb2FkZXIgPiBkaXYge1xuICB3aWR0aDogNDBweDtcbiAgaGVpZ2h0OiA0MHB4O1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIHRleHQtYWxpZ246IGNlbnRlcjtcbn1cbi5la2tvLWxpZ2h0Ym94LWxvYWRlciA+IGRpdiA+IGRpdiB7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGJvcmRlci1yYWRpdXM6IDUwJTtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcbiAgb3BhY2l0eTogMC42O1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHRvcDogMDtcbiAgbGVmdDogMDtcbiAgYW5pbWF0aW9uOiBzay1ib3VuY2UgMnMgaW5maW5pdGUgZWFzZS1pbi1vdXQ7XG59XG4uZWtrby1saWdodGJveC1sb2FkZXIgPiBkaXYgPiBkaXY6bGFzdC1jaGlsZCB7XG4gIGFuaW1hdGlvbi1kZWxheTogLTFzO1xufVxuLm1vZGFsLWRpYWxvZyAuZWtrby1saWdodGJveC1sb2FkZXIgPiBkaXYgPiBkaXYge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjMzMzO1xufVxuQC13ZWJraXQta2V5ZnJhbWVzIHNrLWJvdW5jZSB7XG4gIDAlLFxuICAxMDAlIHtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMCk7XG4gIH1cbiAgNTAlIHtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbn1cbkBrZXlmcmFtZXMgc2stYm91bmNlIHtcbiAgMCUsXG4gIDEwMCUge1xuICAgIHRyYW5zZm9ybTogc2NhbGUoMCk7XG4gICAgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDApO1xuICB9XG4gIDUwJSB7XG4gICAgdHJhbnNmb3JtOiBzY2FsZSgxKTtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbn1cbiJdfQ== */ /** * @author zhixin wen - * version: 1.22.1 + * version: 1.22.0 * https://github.com/wenzhixin/bootstrap-table/ */ /* stylelint-disable annotation-no-unknown, max-line-length */ @@ -23730,14 +23730,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 912px) and (min-width: 512px) { +@media screen and (max-width: 771px) and (min-width: 512px) { .sidebar-menu { - margin-top: 100px; + margin-top: 160px; } } -@media screen and (max-width: 1268px) and (min-width: 912px) { +@media screen and (max-width: 1098px) and (min-width: 772px) { .sidebar-menu { - margin-top: 50px; + margin-top: 98px; } } .ellipsis { @@ -24968,14 +24968,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 912px) and (min-width: 512px) { +@media screen and (max-width: 771px) and (min-width: 512px) { .sidebar-menu { - margin-top: 100px; + margin-top: 160px; } } -@media screen and (max-width: 1268px) and (min-width: 912px) { +@media screen and (max-width: 1098px) and (min-width: 772px) { .sidebar-menu { - margin-top: 50px; + margin-top: 98px; } } .ellipsis { diff --git a/public/css/dist/bootstrap-table.css b/public/css/dist/bootstrap-table.css index 301c592a5d..c8749ad4b4 100644 --- a/public/css/dist/bootstrap-table.css +++ b/public/css/dist/bootstrap-table.css @@ -1,6 +1,6 @@ /** * @author zhixin wen - * version: 1.22.1 + * version: 1.22.0 * https://github.com/wenzhixin/bootstrap-table/ */ /* stylelint-disable annotation-no-unknown, max-line-length */ diff --git a/public/js/dist/bootstrap-table.js b/public/js/dist/bootstrap-table.js index c01fba3e19..53d6e2d52d 100644 --- a/public/js/dist/bootstrap-table.js +++ b/public/js/dist/bootstrap-table.js @@ -2,7 +2,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery)); -})(this, (function ($$p) { 'use strict'; +})(this, (function ($$o) { 'use strict'; function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; @@ -181,7 +181,7 @@ var objectGetOwnPropertyDescriptor = {}; - var fails$v = function (exec) { + var fails$u = function (exec) { try { return !!exec(); } catch (error) { @@ -189,17 +189,17 @@ } }; - var fails$u = fails$v; + var fails$t = fails$u; // Detect IE8's incomplete defineProperty implementation - var descriptors = !fails$u(function () { + var descriptors = !fails$t(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); - var fails$t = fails$v; + var fails$s = fails$u; - var functionBindNative = !fails$t(function () { + var functionBindNative = !fails$s(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe @@ -261,14 +261,14 @@ }; var uncurryThis$y = functionUncurryThis; - var fails$s = fails$v; + var fails$r = fails$u; var classof$7 = classofRaw$2; var $Object$4 = Object; var split = uncurryThis$y(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings - var indexedObject = fails$s(function () { + var indexedObject = fails$r(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object$4('z').propertyIsEnumerable(0); @@ -383,10 +383,10 @@ /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION$2 = engineV8Version; - var fails$r = fails$v; + var fails$q = fails$u; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing - var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$r(function () { + var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$q(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances @@ -511,12 +511,12 @@ // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject - var toObject$a = function (argument) { + var toObject$9 = function (argument) { return $Object$2(requireObjectCoercible$9(argument)); }; var uncurryThis$w = functionUncurryThis; - var toObject$9 = toObject$a; + var toObject$8 = toObject$9; var hasOwnProperty = uncurryThis$w({}.hasOwnProperty); @@ -524,7 +524,7 @@ // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { - return hasOwnProperty(toObject$9(it), key); + return hasOwnProperty(toObject$8(it), key); }; var uncurryThis$v = functionUncurryThis; @@ -604,11 +604,11 @@ }; var DESCRIPTORS$e = descriptors; - var fails$q = fails$v; + var fails$p = fails$u; var createElement = documentCreateElement$2; // Thanks to IE8 for its funny defineProperty - var ie8DomDefine = !DESCRIPTORS$e && !fails$q(function () { + var ie8DomDefine = !DESCRIPTORS$e && !fails$p(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } @@ -641,11 +641,11 @@ var objectDefineProperty = {}; var DESCRIPTORS$c = descriptors; - var fails$p = fails$v; + var fails$o = fails$u; // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 - var v8PrototypeDefineBug = DESCRIPTORS$c && fails$p(function () { + var v8PrototypeDefineBug = DESCRIPTORS$c && fails$o(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, @@ -848,7 +848,7 @@ }; var uncurryThis$t = functionUncurryThis; - var fails$o = fails$v; + var fails$n = fails$u; var isCallable$b = isCallable$j; var hasOwn$7 = hasOwnProperty_1; var DESCRIPTORS$8 = descriptors; @@ -865,7 +865,7 @@ var replace$4 = uncurryThis$t(''.replace); var join = uncurryThis$t([].join); - var CONFIGURABLE_LENGTH = DESCRIPTORS$8 && !fails$o(function () { + var CONFIGURABLE_LENGTH = DESCRIPTORS$8 && !fails$n(function () { return defineProperty$7(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); @@ -1098,7 +1098,7 @@ } }; - var fails$n = fails$v; + var fails$m = fails$u; var isCallable$9 = isCallable$j; var replacement = /#|\.prototype\./; @@ -1107,7 +1107,7 @@ var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false - : isCallable$9(detection) ? fails$n(detection) + : isCallable$9(detection) ? fails$m(detection) : !!detection; }; @@ -1189,11 +1189,11 @@ var DESCRIPTORS$7 = descriptors; var uncurryThis$q = functionUncurryThis; var call$9 = functionCall; - var fails$m = fails$v; + var fails$l = fails$u; var objectKeys$2 = objectKeys$3; var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; var propertyIsEnumerableModule = objectPropertyIsEnumerable; - var toObject$8 = toObject$a; + var toObject$7 = toObject$9; var IndexedObject$2 = indexedObject; // eslint-disable-next-line es/no-object-assign -- safe @@ -1204,7 +1204,7 @@ // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign - var objectAssign = !$assign || fails$m(function () { + var objectAssign = !$assign || fails$l(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS$7 && $assign({ b: 1 }, $assign(defineProperty$6({}, 'a', { enumerable: true, @@ -1225,7 +1225,7 @@ alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` - var T = toObject$8(target); + var T = toObject$7(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; @@ -1243,13 +1243,13 @@ } return T; } : $assign; - var $$o = _export; + var $$n = _export; var assign = objectAssign; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing - $$o({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { + $$n({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { assign: assign }); @@ -1337,7 +1337,7 @@ }; var PROPER_FUNCTION_NAME$2 = functionName.PROPER; - var fails$l = fails$v; + var fails$k = fails$u; var whitespaces$2 = whitespaces$4; var non = '\u200B\u0085\u180E'; @@ -1345,36 +1345,36 @@ // check that a method works with the correct list // of whitespaces and has a correct name var stringTrimForced = function (METHOD_NAME) { - return fails$l(function () { + return fails$k(function () { return !!whitespaces$2[METHOD_NAME]() || non[METHOD_NAME]() !== non || (PROPER_FUNCTION_NAME$2 && whitespaces$2[METHOD_NAME].name !== METHOD_NAME); }); }; - var $$n = _export; + var $$m = _export; var $trim = stringTrim.trim; var forcedStringTrimMethod = stringTrimForced; // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim - $$n({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + $$m({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { trim: function trim() { return $trim(this); } }); - var fails$k = fails$v; + var fails$j = fails$u; var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; - return !!method && fails$k(function () { + return !!method && fails$j(function () { // eslint-disable-next-line no-useless-call -- required for testing method.call(null, argument || function () { return 1; }, 1); }); }; - var $$m = _export; + var $$l = _export; var uncurryThis$o = functionUncurryThis; var IndexedObject$1 = indexedObject; var toIndexedObject$4 = toIndexedObject$8; @@ -1387,7 +1387,7 @@ // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join - $$m({ target: 'Array', proto: true, forced: FORCED$6 }, { + $$l({ target: 'Array', proto: true, forced: FORCED$6 }, { join: function join(separator) { return nativeJoin(toIndexedObject$4(this), separator === undefined ? ',' : separator); } @@ -1411,13 +1411,13 @@ return result; }; - var fails$j = fails$v; + var fails$i = fails$u; var global$a = global$k; // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError var $RegExp$2 = global$a.RegExp; - var UNSUPPORTED_Y$3 = fails$j(function () { + var UNSUPPORTED_Y$3 = fails$i(function () { var re = $RegExp$2('a', 'y'); re.lastIndex = 2; return re.exec('abcd') != null; @@ -1425,11 +1425,11 @@ // UC Browser bug // https://github.com/zloirock/core-js/issues/1008 - var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$j(function () { + var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$i(function () { return !$RegExp$2('a', 'y').sticky; }); - var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$j(function () { + var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$i(function () { // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 var re = $RegExp$2('^r', 'gy'); re.lastIndex = 2; @@ -1554,24 +1554,24 @@ return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; - var fails$i = fails$v; + var fails$h = fails$u; var global$9 = global$k; // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError var $RegExp$1 = global$9.RegExp; - var regexpUnsupportedDotAll = fails$i(function () { + var regexpUnsupportedDotAll = fails$h(function () { var re = $RegExp$1('.', 's'); return !(re.dotAll && re.exec('\n') && re.flags === 's'); }); - var fails$h = fails$v; + var fails$g = fails$u; var global$8 = global$k; // babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError var $RegExp = global$8.RegExp; - var regexpUnsupportedNcg = fails$h(function () { + var regexpUnsupportedNcg = fails$g(function () { var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; @@ -1694,12 +1694,12 @@ var regexpExec$3 = patchedExec; - var $$l = _export; + var $$k = _export; var exec$4 = regexpExec$3; // `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec - $$l({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, { + $$k({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, { exec: exec$4 }); @@ -1729,7 +1729,7 @@ var uncurryThis$l = functionUncurryThisClause; var defineBuiltIn$5 = defineBuiltIn$7; var regexpExec$2 = regexpExec$3; - var fails$g = fails$v; + var fails$f = fails$u; var wellKnownSymbol$f = wellKnownSymbol$j; var createNonEnumerableProperty$4 = createNonEnumerableProperty$7; @@ -1739,14 +1739,14 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol$f(KEY); - var DELEGATES_TO_SYMBOL = !fails$g(function () { + var DELEGATES_TO_SYMBOL = !fails$f(function () { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) != 7; }); - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$g(function () { + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$f(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; @@ -1812,7 +1812,7 @@ }; var uncurryThis$k = functionUncurryThis; - var fails$f = fails$v; + var fails$e = fails$u; var isCallable$7 = isCallable$j; var classof$3 = classof$6; var getBuiltIn$1 = getBuiltIn$5; @@ -1856,7 +1856,7 @@ // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor - var isConstructor$3 = !construct || fails$f(function () { + var isConstructor$3 = !construct || fails$e(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) @@ -2000,7 +2000,7 @@ var callRegExpExec = regexpExecAbstract; var regexpExec = regexpExec$3; var stickyHelpers$1 = regexpStickyHelpers; - var fails$e = fails$v; + var fails$d = fails$u; var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y; var MAX_UINT32 = 0xFFFFFFFF; @@ -2012,7 +2012,7 @@ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper - var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$e(function () { + var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$d(function () { // eslint-disable-next-line regexp/no-empty-group -- required for testing var re = /(?:)/; var originalExec = re.exec; @@ -2177,12 +2177,12 @@ values: createMethod$1(false) }; - var $$k = _export; + var $$j = _export; var $entries = objectToArray.entries; // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries - $$k({ target: 'Object', stat: true }, { + $$j({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } @@ -2209,20 +2209,20 @@ ArrayPrototype[UNSCOPABLES][key] = true; }; - var $$j = _export; + var $$i = _export; var $includes = arrayIncludes.includes; - var fails$d = fails$v; + var fails$c = fails$u; var addToUnscopables$3 = addToUnscopables$4; // FF99+ bug - var BROKEN_ON_SPARSE = fails$d(function () { + var BROKEN_ON_SPARSE = fails$c(function () { // eslint-disable-next-line es/no-array-prototype-includes -- detection return !Array(1).includes(); }); // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes - $$j({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { + $$i({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } @@ -2279,7 +2279,7 @@ return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; - var fails$c = fails$v; + var fails$b = fails$u; var wellKnownSymbol$a = wellKnownSymbol$j; var V8_VERSION$1 = engineV8Version; @@ -2289,7 +2289,7 @@ // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 - return V8_VERSION$1 >= 51 || !fails$c(function () { + return V8_VERSION$1 >= 51 || !fails$b(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES$2] = function () { @@ -2299,11 +2299,11 @@ }); }; - var $$i = _export; - var fails$b = fails$v; + var $$h = _export; + var fails$a = fails$u; var isArray$3 = isArray$5; var isObject$3 = isObject$b; - var toObject$7 = toObject$a; + var toObject$6 = toObject$9; var lengthOfArrayLike$4 = lengthOfArrayLike$7; var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2; var createProperty$2 = createProperty$4; @@ -2317,7 +2317,7 @@ // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/679 - var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$b(function () { + var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$a(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; @@ -2334,10 +2334,10 @@ // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species - $$i({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, { + $$h({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, { // eslint-disable-next-line no-unused-vars -- required for `.length` concat: function concat(arg) { - var O = toObject$7(this); + var O = toObject$6(this); var A = arraySpeciesCreate$2(O, 0); var n = 0; var i, k, length, len, E; @@ -2374,7 +2374,7 @@ var bind = functionBindContext; var uncurryThis$f = functionUncurryThis; var IndexedObject = indexedObject; - var toObject$6 = toObject$a; + var toObject$5 = toObject$9; var lengthOfArrayLike$3 = lengthOfArrayLike$7; var arraySpeciesCreate$1 = arraySpeciesCreate$3; @@ -2390,7 +2390,7 @@ var IS_FILTER_REJECT = TYPE == 7; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { - var O = toObject$6($this); + var O = toObject$5($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that); var length = lengthOfArrayLike$3(self); @@ -2445,7 +2445,7 @@ filterReject: createMethod(7) }; - var $$h = _export; + var $$g = _export; var $find = arrayIteration.find; var addToUnscopables$2 = addToUnscopables$4; @@ -2457,7 +2457,7 @@ // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find - $$h({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { + $$g({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2511,7 +2511,7 @@ } return false; }; - var $$g = _export; + var $$f = _export; var uncurryThis$e = functionUncurryThis; var notARegExp$2 = notARegexp; var requireObjectCoercible$5 = requireObjectCoercible$b; @@ -2522,7 +2522,7 @@ // `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes - $$g({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, { + $$f({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~stringIndexOf$2( toString$9(requireObjectCoercible$5(this)), @@ -2612,7 +2612,7 @@ handlePrototype$1(DOMTokenListPrototype$1); var global$6 = global$k; - var fails$a = fails$v; + var fails$9 = fails$u; var uncurryThis$d = functionUncurryThis; var toString$8 = toString$f; var trim$2 = stringTrim.trim; @@ -2624,7 +2624,7 @@ var ITERATOR$4 = Symbol$2 && Symbol$2.iterator; var FORCED$4 = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols - || (ITERATOR$4 && !fails$a(function () { $parseFloat$1(Object(ITERATOR$4)); })); + || (ITERATOR$4 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$4)); })); // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string @@ -2634,32 +2634,32 @@ return result === 0 && charAt$2(trimmedString, 0) == '-' ? -0 : result; } : $parseFloat$1; - var $$f = _export; + var $$e = _export; var $parseFloat = numberParseFloat; // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string - $$f({ global: true, forced: parseFloat != $parseFloat }, { + $$e({ global: true, forced: parseFloat != $parseFloat }, { parseFloat: $parseFloat }); - var $$e = _export; - var toObject$5 = toObject$a; + var $$d = _export; + var toObject$4 = toObject$9; var nativeKeys = objectKeys$3; - var fails$9 = fails$v; + var fails$8 = fails$u; - var FAILS_ON_PRIMITIVES$1 = fails$9(function () { nativeKeys(1); }); + var FAILS_ON_PRIMITIVES = fails$8(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys - $$e({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, { + $$d({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { keys: function keys(it) { - return nativeKeys(toObject$5(it)); + return nativeKeys(toObject$4(it)); } }); /* eslint-disable es/no-array-prototype-indexof -- required for testing */ - var $$d = _export; + var $$c = _export; var uncurryThis$c = functionUncurryThisClause; var $indexOf = arrayIncludes.indexOf; var arrayMethodIsStrict$1 = arrayMethodIsStrict$4; @@ -2671,7 +2671,7 @@ // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof - $$d({ target: 'Array', proto: true, forced: FORCED$3 }, { + $$c({ target: 'Array', proto: true, forced: FORCED$3 }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { var fromIndex = arguments.length > 1 ? arguments[1] : undefined; return NEGATIVE_ZERO @@ -2750,14 +2750,14 @@ var engineWebkitVersion = !!webkit && +webkit[1]; - var $$c = _export; + var $$b = _export; var uncurryThis$b = functionUncurryThis; var aCallable$1 = aCallable$4; - var toObject$4 = toObject$a; + var toObject$3 = toObject$9; var lengthOfArrayLike$2 = lengthOfArrayLike$7; var deletePropertyOrThrow$1 = deletePropertyOrThrow$2; var toString$7 = toString$f; - var fails$8 = fails$v; + var fails$7 = fails$u; var internalSort = arraySort; var arrayMethodIsStrict = arrayMethodIsStrict$4; var FF = engineFfVersion; @@ -2770,17 +2770,17 @@ var push$1 = uncurryThis$b(test$1.push); // IE8- - var FAILS_ON_UNDEFINED = fails$8(function () { + var FAILS_ON_UNDEFINED = fails$7(function () { test$1.sort(undefined); }); // V8 bug - var FAILS_ON_NULL = fails$8(function () { + var FAILS_ON_NULL = fails$7(function () { test$1.sort(null); }); // Old WebKit var STRICT_METHOD = arrayMethodIsStrict('sort'); - var STABLE_SORT = !fails$8(function () { + var STABLE_SORT = !fails$7(function () { // feature detection can be too slow, so check engines versions if (V8) return V8 < 70; if (FF && FF > 3) return; @@ -2828,11 +2828,11 @@ // `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort - $$c({ target: 'Array', proto: true, forced: FORCED$2 }, { + $$b({ target: 'Array', proto: true, forced: FORCED$2 }, { sort: function sort(comparefn) { if (comparefn !== undefined) aCallable$1(comparefn); - var array = toObject$4(this); + var array = toObject$3(this); if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn); @@ -2857,7 +2857,7 @@ }); var uncurryThis$a = functionUncurryThis; - var toObject$3 = toObject$a; + var toObject$2 = toObject$9; var floor = Math.floor; var charAt$1 = uncurryThis$a(''.charAt); @@ -2874,7 +2874,7 @@ var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { - namedCaptures = toObject$3(namedCaptures); + namedCaptures = toObject$2(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return replace$1(replacement, symbols, function (match, ch) { @@ -2906,7 +2906,7 @@ var call$4 = functionCall; var uncurryThis$9 = functionUncurryThis; var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic; - var fails$7 = fails$v; + var fails$6 = fails$u; var anObject$4 = anObject$d; var isCallable$5 = isCallable$j; var isNullOrUndefined$2 = isNullOrUndefined$7; @@ -2947,7 +2947,7 @@ return false; })(); - var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () { + var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function () { var re = /./; re.exec = function () { var result = []; @@ -3039,7 +3039,7 @@ ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); - var $$b = _export; + var $$a = _export; var $filter = arrayIteration.filter; var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5; @@ -3048,7 +3048,7 @@ // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species - $$b({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { + $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -3101,7 +3101,7 @@ }); var global$5 = global$k; - var fails$6 = fails$v; + var fails$5 = fails$u; var uncurryThis$8 = functionUncurryThis; var toString$4 = toString$f; var trim$1 = stringTrim.trim; @@ -3114,7 +3114,7 @@ var exec$1 = uncurryThis$8(hex.exec); var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22 // MS Edge 18- broken with boxed symbols - || (ITERATOR$3 && !fails$6(function () { $parseInt$1(Object(ITERATOR$3)); })); + || (ITERATOR$3 && !fails$5(function () { $parseInt$1(Object(ITERATOR$3)); })); // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix @@ -3123,16 +3123,16 @@ return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10)); } : $parseInt$1; - var $$a = _export; + var $$9 = _export; var $parseInt = numberParseInt; // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix - $$a({ global: true, forced: parseInt != $parseInt }, { + $$9({ global: true, forced: parseInt != $parseInt }, { parseInt: $parseInt }); - var $$9 = _export; + var $$8 = _export; var $map = arrayIteration.map; var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5; @@ -3141,13 +3141,13 @@ // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species - $$9({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { + $$8({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); - var $$8 = _export; + var $$7 = _export; var $findIndex = arrayIteration.findIndex; var addToUnscopables$1 = addToUnscopables$4; @@ -3159,7 +3159,7 @@ // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findindex - $$8({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + $$7({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -3299,7 +3299,7 @@ var stickyHelpers = regexpStickyHelpers; var proxyAccessor = proxyAccessor$1; var defineBuiltIn$3 = defineBuiltIn$7; - var fails$5 = fails$v; + var fails$4 = fails$u; var hasOwn$3 = hasOwnProperty_1; var enforceInternalState = internalState.enforce; var setSpecies = setSpecies$1; @@ -3328,7 +3328,7 @@ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var BASE_FORCED = DESCRIPTORS$3 && - (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$5(function () { + (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$4(function () { re2[MATCH] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; @@ -3480,14 +3480,14 @@ var defineBuiltIn$2 = defineBuiltIn$7; var anObject$1 = anObject$d; var $toString = toString$f; - var fails$4 = fails$v; + var fails$3 = fails$u; var getRegExpFlags = regexpGetFlags; var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; - var NOT_GENERIC = fails$4(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); + var NOT_GENERIC = fails$3(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING; @@ -3506,7 +3506,7 @@ var arraySlice = uncurryThis$5([].slice); - var $$7 = _export; + var $$6 = _export; var isArray$2 = isArray$5; var isConstructor = isConstructor$3; var isObject$1 = isObject$b; @@ -3527,7 +3527,7 @@ // `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects - $$7({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { + $$6({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { slice: function slice(start, end) { var O = toIndexedObject$1(this); var length = lengthOfArrayLike$1(O); @@ -3557,9 +3557,9 @@ var iterators = {}; - var fails$3 = fails$v; + var fails$2 = fails$u; - var correctPrototypeGetter = !fails$3(function () { + var correctPrototypeGetter = !fails$2(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing @@ -3568,9 +3568,9 @@ var hasOwn$2 = hasOwnProperty_1; var isCallable$2 = isCallable$j; - var toObject$2 = toObject$a; + var toObject$1 = toObject$9; var sharedKey = sharedKey$3; - var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter; + var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; @@ -3579,8 +3579,8 @@ // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe - var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? $Object.getPrototypeOf : function (O) { - var object = toObject$2(O); + var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { + var object = toObject$1(O); if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable$2(constructor) && object instanceof constructor) { @@ -3588,7 +3588,7 @@ } return object instanceof $Object ? ObjectPrototype : null; }; - var fails$2 = fails$v; + var fails$1 = fails$u; var isCallable$1 = isCallable$j; var isObject = isObject$b; var getPrototypeOf$1 = objectGetPrototypeOf; @@ -3613,7 +3613,7 @@ } } - var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$2(function () { + var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$1(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$2[ITERATOR$2].call(test) !== test; @@ -3663,7 +3663,7 @@ return IteratorConstructor; }; - var $$6 = _export; + var $$5 = _export; var call$1 = functionCall; var FunctionName = functionName; var isCallable = isCallable$j; @@ -3748,7 +3748,7 @@ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn(IterablePrototype, KEY, methods[KEY]); } - } else $$6({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator @@ -3893,8 +3893,8 @@ return O.length = length; }; - var $$5 = _export; - var toObject$1 = toObject$a; + var $$4 = _export; + var toObject = toObject$9; var toAbsoluteIndex = toAbsoluteIndex$4; var toIntegerOrInfinity = toIntegerOrInfinity$5; var lengthOfArrayLike = lengthOfArrayLike$7; @@ -3913,9 +3913,9 @@ // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species - $$5({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + $$4({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice(start, deleteCount /* , ...items */) { - var O = toObject$1(this); + var O = toObject(this); var len = lengthOfArrayLike(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; @@ -3970,7 +3970,7 @@ // https://tc39.es/ecma262/#sec-thisnumbervalue var thisNumberValue$1 = uncurryThis$4(1.0.valueOf); - var $$4 = _export; + var $$3 = _export; var IS_PURE = isPure; var DESCRIPTORS = descriptors; var global$1 = global$k; @@ -3982,7 +3982,7 @@ var isPrototypeOf = objectIsPrototypeOf; var isSymbol = isSymbol$3; var toPrimitive = toPrimitive$2; - var fails$1 = fails$v; + var fails = fails$u; var getOwnPropertyNames = objectGetOwnPropertyNames.f; var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; var defineProperty = objectDefineProperty.f; @@ -4038,7 +4038,7 @@ var calledWithNew = function (dummy) { // includes check on 1..constructor(foo) case - return isPrototypeOf(NumberPrototype, dummy) && fails$1(function () { thisNumberValue(dummy); }); + return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); }); }; // `Number` constructor @@ -4051,7 +4051,7 @@ NumberWrapper.prototype = NumberPrototype; if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper; - $$4({ global: true, constructor: true, wrap: true, forced: FORCED }, { + $$3({ global: true, constructor: true, wrap: true, forced: FORCED }, { Number: NumberWrapper }); @@ -4072,7 +4072,7 @@ }; if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber); - var $$3 = _export; + var $$2 = _export; var uncurryThis$2 = functionUncurryThis; var isArray = isArray$5; @@ -4083,7 +4083,7 @@ // https://tc39.es/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 - $$3({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { + $$2({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { reverse: function reverse() { // eslint-disable-next-line no-self-assign -- dirty hack if (isArray(this)) this.length = this.length; @@ -4091,22 +4091,6 @@ } }); - var $$2 = _export; - var fails = fails$v; - var toObject = toObject$a; - var nativeGetPrototypeOf = objectGetPrototypeOf; - var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; - - var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); }); - - // `Object.getPrototypeOf` method - // https://tc39.es/ecma262/#sec-object.getprototypeof - $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { - getPrototypeOf: function getPrototypeOf(it) { - return nativeGetPrototypeOf(toObject(it)); - } - }); - var call = functionCall; var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic; var anObject = anObject$d; @@ -4231,7 +4215,7 @@ getBootstrapVersion: function getBootstrapVersion() { var bootstrapVersion = 5; try { - var rawVersion = $$p.fn.dropdown.Constructor.VERSION; + var rawVersion = $$o.fn.dropdown.Constructor.VERSION; // Only try to parse VERSION if it is defined. // It is undefined in older versions of Bootstrap (tested with 3.1.1). @@ -4336,7 +4320,7 @@ }, getSearchInput: function getSearchInput(that) { if (typeof that.options.searchSelector === 'string') { - return $$p(that.options.searchSelector); + return $$o(that.options.searchSelector); } return that.$toolbar.find('.search input'); }, @@ -4432,14 +4416,7 @@ return flag ? str : ''; }, isObject: function isObject(obj) { - if (_typeof(obj) !== 'object' || obj === null) { - return false; - } - var proto = obj; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - return Object.getPrototypeOf(obj) === proto; + return _typeof(obj) === 'object' && obj !== null && !Array.isArray(obj); }, isEmptyObject: function isEmptyObject() { var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -4602,10 +4579,10 @@ }, getScrollBarWidth: function getScrollBarWidth() { if (this.cachedWidth === undefined) { - var $inner = $$p('
').addClass('fixed-table-scroll-inner'); - var $outer = $$p('
').addClass('fixed-table-scroll-outer'); + var $inner = $$o('
').addClass('fixed-table-scroll-inner'); + var $outer = $$o('
').addClass('fixed-table-scroll-outer'); $outer.append($inner); - $$p('body').append($outer); + $$o('body').append($outer); var w1 = $inner[0].offsetWidth; $outer.css('overflow', 'scroll'); var w2 = $inner[0].offsetWidth; @@ -4761,7 +4738,7 @@ var data = []; var m = []; $els.each(function (y, el) { - var $el = $$p(el); + var $el = $$o(el); var row = {}; // save tr's id, class and data-* attributes @@ -4770,7 +4747,7 @@ row._data = _this2.getRealDataAttr($el.data()); row._style = $el.attr('style'); $el.find('>td,>th').each(function (_x, el) { - var $el = $$p(el); + var $el = $$o(el); var cspan = +$el.attr('colspan') || 1; var rspan = +$el.attr('rowspan') || 1; var x = _x; @@ -4905,7 +4882,7 @@ } }; - var VERSION = '1.22.1'; + var VERSION = '1.22.0'; var bootstrapVersion = Utils.getBootstrapVersion(); var CONSTANTS = { 3: { @@ -5545,7 +5522,7 @@ function BootstrapTable(el, options) { _classCallCheck(this, BootstrapTable); this.options = options; - this.$el = $$p(el); + this.$el = $$o(el); this.$el_ = this.$el.clone(); this.timeoutId_ = 0; this.timeoutFooter_ = 0; @@ -5571,17 +5548,17 @@ value: function initConstants() { var opts = this.options; this.constants = Constants.CONSTANTS; - this.constants.theme = $$p.fn.bootstrapTable.theme; + this.constants.theme = $$o.fn.bootstrapTable.theme; this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle'; // init iconsPrefix and icons - var iconsPrefix = Utils.getIconsPrefix($$p.fn.bootstrapTable.theme); + var iconsPrefix = Utils.getIconsPrefix($$o.fn.bootstrapTable.theme); var icons = Utils.getIcons(iconsPrefix); if (typeof opts.icons === 'string') { opts.icons = Utils.calculateObjectValue(null, opts.icons); } - opts.iconsPrefix = opts.iconsPrefix || $$p.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix; - opts.icons = Object.assign(icons, $$p.fn.bootstrapTable.defaults.icons, opts.icons); + opts.iconsPrefix = opts.iconsPrefix || $$o.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix; + opts.icons = Object.assign(icons, $$o.fn.bootstrapTable.defaults.icons, opts.icons); // init buttons class var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : ''; @@ -5595,7 +5572,7 @@ key: "initLocale", value: function initLocale() { if (this.options.locale) { - var locales = $$p.fn.bootstrapTable.locales; + var locales = $$o.fn.bootstrapTable.locales; var parts = this.options.locale.split(/-|_/); parts[0] = parts[0].toLowerCase(); if (parts[1]) { @@ -5626,7 +5603,7 @@ var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '
' : ''; var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '
' : ''; var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]); - this.$container = $$p("\n
\n
\n ").concat(topPagination, "\n
\n
\n
\n
\n ").concat(loadingTemplate, "\n
\n
\n
\n
\n ").concat(bottomPagination, "\n
\n ")); + this.$container = $$o("\n
\n
\n ").concat(topPagination, "\n
\n
\n
\n
\n ").concat(loadingTemplate, "\n
\n
\n
\n
\n ").concat(bottomPagination, "\n
\n ")); this.$container.insertAfter(this.$el); this.$tableContainer = this.$container.find('.fixed-table-container'); this.$tableHeader = this.$container.find('.fixed-table-header'); @@ -5635,7 +5612,7 @@ this.$tableFooter = this.$el.find('tfoot'); // checking if custom table-toolbar exists or not if (this.options.buttonsToolbar) { - this.$toolbar = $$p('body').find(this.options.buttonsToolbar); + this.$toolbar = $$o('body').find(this.options.buttonsToolbar); } else { this.$toolbar = this.$container.find('.fixed-table-toolbar'); } @@ -5664,17 +5641,17 @@ var columns = []; this.$header = this.$el.find('>thead'); if (!this.$header.length) { - this.$header = $$p("")).appendTo(this.$el); + this.$header = $$o("")).appendTo(this.$el); } else if (this.options.theadClasses) { this.$header.addClass(this.options.theadClasses); } this._headerTrClasses = []; this._headerTrStyles = []; this.$header.find('tr').each(function (i, el) { - var $tr = $$p(el); + var $tr = $$o(el); var column = []; $tr.find('th').each(function (i, el) { - var $th = $$p(el); + var $th = $$o(el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not if (typeof $th.data('field') !== 'undefined') { @@ -5682,7 +5659,7 @@ } var _data = Object.assign({}, $th.data()); for (var key in _data) { - if ($$p.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) { + if ($$o.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) { delete _data[key]; } } @@ -5863,10 +5840,10 @@ }); this.$header.html(headerHtml.join('')); this.$header.find('th[data-field]').each(function (i, el) { - $$p(el).data(visibleColumns[$$p(el).data('field')]); + $$o(el).data(visibleColumns[$$o(el).data('field')]); }); this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) { - var $this = $$p(e.currentTarget); + var $this = $$o(e.currentTarget); if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) { if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) { return false; @@ -5877,7 +5854,7 @@ } }); var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id')); - $$p(window).off(resizeEvent); + $$o(window).off(resizeEvent); if (!this.options.showHeader || this.options.cardView) { this.$header.hide(); this.$tableHeader.hide(); @@ -5888,14 +5865,14 @@ this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow this.getCaret(); - $$p(window).on(resizeEvent, function () { + $$o(window).on(resizeEvent, function () { return _this2.resetView(); }); } this.$selectAll = this.$header.find('[name="btSelectAll"]'); this.$selectAll.off('click').on('click', function (e) { e.stopPropagation(); - var checked = $$p(e.currentTarget).prop('checked'); + var checked = $$o(e.currentTarget).prop('checked'); _this2[checked ? 'checkAll' : 'uncheckAll'](); _this2.updateSelected(); }); @@ -5979,7 +5956,7 @@ value: function onSort(_ref) { var type = _ref.type, currentTarget = _ref.currentTarget; - var $this = type === 'keypress' ? $$p(currentTarget) : $$p(currentTarget).parent(); + var $this = type === 'keypress' ? $$o(currentTarget) : $$o(currentTarget).parent(); var $this_ = this.$header.find('th').eq($this.index()); this.$header.add(this.$header_).find('span.order').remove(); if (this.options.sortName === $this.data('field')) { @@ -6035,11 +6012,11 @@ var $keepOpen; var switchableCount = 0; if (this.$toolbar.find('.bs-bars').children().length) { - $$p('body').append($$p(opts.toolbar)); + $$o('body').append($$o(opts.toolbar)); } this.$toolbar.html(''); if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') { - $$p(Utils.sprintf('
', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$p(opts.toolbar)); + $$o(Utils.sprintf('
', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$o(opts.toolbar)); } // showColumns, showToggle, showRefresh @@ -6241,7 +6218,7 @@ }); $checkboxes.off('click').on('click', function (_ref2) { var currentTarget = _ref2.currentTarget; - var $this = $$p(currentTarget); + var $this = $$o(currentTarget); _this4._toggleColumn($this.val(), $this.prop('checked'), false); _this4.trigger('column-switch', $this.data('field'), $this.prop('checked')); $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) { @@ -6250,19 +6227,19 @@ }); $toggleAll.off('click').on('click', function (_ref3) { var currentTarget = _ref3.currentTarget; - _this4._toggleAllColumns($$p(currentTarget).prop('checked')); - _this4.trigger('column-switch-all', $$p(currentTarget).prop('checked')); + _this4._toggleAllColumns($$o(currentTarget).prop('checked')); + _this4.trigger('column-switch-all', $$o(currentTarget).prop('checked')); }); if (opts.showColumnsSearch) { var $columnsSearch = $keepOpen.find('[name="columnsSearch"]'); var $listItems = $keepOpen.find('.dropdown-item-marker'); $columnsSearch.on('keyup paste change', function (_ref4) { var currentTarget = _ref4.currentTarget; - var $this = $$p(currentTarget); + var $this = $$o(currentTarget); var searchValue = $this.val().toLowerCase(); $listItems.show(); $checkboxes.each(function (i, el) { - var $checkbox = $$p(el); + var $checkbox = $$o(el); var $listItem = $checkbox.parents('.dropdown-item-marker'); var text = $listItem.text().toLowerCase(); if (!text.includes(searchValue)) { @@ -6336,16 +6313,16 @@ currentTarget = _ref5.currentTarget, firedByInitSearchText = _ref5.firedByInitSearchText; var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - if (currentTarget !== undefined && $$p(currentTarget).length && overwriteSearchText) { - var text = $$p(currentTarget).val().trim(); - if (this.options.trimOnSearch && $$p(currentTarget).val() !== text) { - $$p(currentTarget).val(text); + if (currentTarget !== undefined && $$o(currentTarget).length && overwriteSearchText) { + var text = $$o(currentTarget).val().trim(); + if (this.options.trimOnSearch && $$o(currentTarget).val() !== text) { + $$o(currentTarget).val(text); } if (this.searchText === text) { return; } var $searchInput = Utils.getSearchInput(this); - var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$p(currentTarget); + var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$o(currentTarget); if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) { this.searchText = text; this.options.searchText = text; @@ -6696,7 +6673,7 @@ key: "updatePagination", value: function updatePagination(event) { // Fix #171: IE disabled button can be clicked bug. - if (event && $$p(event.currentTarget).hasClass('disabled')) { + if (event && $$o(event.currentTarget).hasClass('disabled')) { return; } if (!this.options.maintainMetaData) { @@ -6714,7 +6691,7 @@ key: "onPageListChange", value: function onPageListChange(event) { event.preventDefault(); - var $this = $$p(event.currentTarget); + var $this = $$o(event.currentTarget); $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive); this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text(); this.$toolbar.find('.page-size').text(this.options.pageSize); @@ -6724,7 +6701,7 @@ }, { key: "onPagePre", value: function onPagePre(event) { - if ($$p(event.target).hasClass('disabled')) { + if ($$o(event.target).hasClass('disabled')) { return; } event.preventDefault(); @@ -6739,7 +6716,7 @@ }, { key: "onPageNext", value: function onPageNext(event) { - if ($$p(event.target).hasClass('disabled')) { + if ($$o(event.target).hasClass('disabled')) { return; } event.preventDefault(); @@ -6755,10 +6732,10 @@ key: "onPageNumber", value: function onPageNumber(event) { event.preventDefault(); - if (this.options.pageNumber === +$$p(event.currentTarget).text()) { + if (this.options.pageNumber === +$$o(event.currentTarget).text()) { return; } - this.options.pageNumber = +$$p(event.currentTarget).text(); + this.options.pageNumber = +$$o(event.currentTarget).text(); this.updatePagination(event); return false; } @@ -6968,7 +6945,7 @@ this.trigger('pre-body', data); this.$body = this.$el.find('>tbody'); if (!this.$body.length) { - this.$body = $$p('').appendTo(this.$el); + this.$body = $$o('').appendTo(this.$el); } // Fix #389 Bootstrap-table-flatJSON is not working @@ -6977,7 +6954,7 @@ this.pageTo = data.length; } var rows = []; - var trFragments = $$p(document.createDocumentFragment()); + var trFragments = $$o(document.createDocumentFragment()); var hasTr = false; var toExpand = []; this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo)); @@ -7049,13 +7026,13 @@ var _this9 = this; // click to select by column this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) { - var $td = $$p(e.currentTarget); + var $td = $$o(e.currentTarget); if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) { return; } var $tr = $td.parent(); - var $cardViewArr = $$p(e.target).parents('.card-views').children(); - var $cardViewTarget = $$p(e.target).parents('.card-view'); + var $cardViewArr = $$o(e.target).parents('.card-views').children(); + var $cardViewTarget = $$o(e.target).parents('.card-view'); var rowIndex = $tr.data('index'); var item = _this9.data[rowIndex]; var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex; @@ -7083,13 +7060,13 @@ }); this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) { e.preventDefault(); - _this9.toggleDetailView($$p(e.currentTarget).parent().parent().data('index')); + _this9.toggleDetailView($$o(e.currentTarget).parent().parent().data('index')); return false; }); this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName)); this.$selectItem.off('click').on('click', function (e) { e.stopImmediatePropagation(); - var $this = $$p(e.currentTarget); + var $this = $$o(e.currentTarget); _this9._toggleCheck($this.prop('checked'), $this.data('index')); }); this.header.events.forEach(function (_events, i) { @@ -7116,7 +7093,7 @@ } var event = events[key]; _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) { - var $tr = $$p(tr); + var $tr = $$o(tr); var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex); var index = key.indexOf(' '); var name = key.substring(0, index); @@ -7246,7 +7223,7 @@ this._xhrAbort = true; this._xhr.abort(); } - this._xhr = $$p.ajax(request); + this._xhr = $$o.ajax(request); } return data; } @@ -7270,7 +7247,7 @@ value: function getCaret() { var _this11 = this; this.$header.find('th').each(function (i, th) { - $$p(th).find('.sortable').removeClass('desc asc').addClass($$p(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both'); + $$o(th).find('.sortable').removeClass('desc asc').addClass($$o(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both'); }); } }, { @@ -7279,7 +7256,7 @@ var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length; this.$selectAll.add(this.$selectAll_).prop('checked', checkAll); this.$selectItem.each(function (i, el) { - $$p(el).closest('tr')[$$p(el).prop('checked') ? 'addClass' : 'removeClass']('selected'); + $$o(el).closest('tr')[$$o(el).prop('checked') ? 'addClass' : 'removeClass']('selected'); }); } }, { @@ -7287,7 +7264,7 @@ value: function updateRows() { var _this12 = this; this.$selectItem.each(function (i, el) { - _this12.data[$$p(el).data('index')][_this12.header.stateField] = $$p(el).prop('checked'); + _this12.data[$$o(el).data('index')][_this12.header.stateField] = $$o(el).prop('checked'); }); } }, { @@ -7320,11 +7297,11 @@ args[_key4 - 1] = arguments[_key4]; } (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this])); - this.$el.trigger($$p.Event(name, { + this.$el.trigger($$o.Event(name, { sender: this }), args); (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this]))); - this.$el.trigger($$p.Event('all.bs.table', { + this.$el.trigger($$o.Event('all.bs.table', { sender: this }), [name, args]); } @@ -7369,7 +7346,7 @@ this.$selectAll_ = this.$header_.find('[name="btSelectAll"]'); this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_); this.$tableLoading.css('width', this.$el.outerWidth()); - var focusedTemp = $$p('.focus-temp:visible:eq(0)'); + var focusedTemp = $$o('.focus-temp:visible:eq(0)'); if (focusedTemp.length > 0) { focusedTemp.focus(); this.$header.find('.focus-temp').removeClass('focus-temp'); @@ -7377,7 +7354,7 @@ // fix bug: $.data() is not working as expected after $.append() this.$header.find('th[data-field]').each(function (i, el) { - _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$p(el).data('field'))).data($$p(el).data()); + _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$o(el).data('field'))).data($$o(el).data()); }); var visibleFields = this.getVisibleFields(); var $ths = this.$header_.find('th'); @@ -7387,7 +7364,7 @@ } var trLength = $tr.find('> *').length; $tr.find('> *').each(function (i, el) { - var $this = $$p(el); + var $this = $$o(el); if (Utils.hasDetailViewIcon(_this14.options)) { if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') { var $thDetail = $ths.filter('.detail'); @@ -7399,7 +7376,7 @@ var index = i - Utils.getDetailViewIndexOffset(_this14.options); var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index])); if ($th.length > 1) { - $th = $$p($ths[$this[0].cellIndex]); + $th = $$o($ths[$this[0].cellIndex]); } var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width(); $th.find('.fht-cell').width($this.innerWidth() - zoomWidth); @@ -7512,7 +7489,7 @@ } var trLength = $tr.find('> *').length; $tr.find('> *').each(function (i, el) { - var $this = $$p(el); + var $this = $$o(el); if (Utils.hasDetailViewIcon(_this15.options)) { if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') { var $thDetail = $ths.filter('.detail'); @@ -7844,7 +7821,7 @@ return; } fieldIndex += Utils.getDetailViewIndexOffset(this.options); - this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$p(rowHtml).find(">td:eq(".concat(fieldIndex, ")"))); + this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$o(rowHtml).find(">td:eq(".concat(fieldIndex, ")"))); this.initBodyEvent(); this.initFooter(); this.resetView(); @@ -8049,7 +8026,7 @@ } else { $items.get().reverse().forEach(function (item) { if ($items.filter(':checked').length > _this23.options.minimumCountColumns) { - $$p(item).prop('checked', visible); + $$o(item).prop('checked', visible); } }); } @@ -8111,7 +8088,7 @@ var $items = this.$selectItem.filter(':enabled'); var checked = $items.filter(':checked'); $items.each(function (i, el) { - $$p(el).prop('checked', !$$p(el).prop('checked')); + $$o(el).prop('checked', !$$o(el).prop('checked')); }); this.updateRows(); this.updateSelected(); @@ -8225,13 +8202,13 @@ key: "destroy", value: function destroy() { this.$el.insertBefore(this.$container); - $$p(this.options.toolbar).insertBefore(this.$el); + $$o(this.options.toolbar).insertBefore(this.$el); this.$container.next().remove(); this.$container.remove(); this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id')); - $$p(window).off(resizeEvent); + $$o(window).off(resizeEvent); } }, { key: "resetView", @@ -8378,7 +8355,7 @@ if (options.unit === 'rows') { scrollTo = 0; this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) { - scrollTo += $$p(el).outerHeight(true); + scrollTo += $$o(el).outerHeight(true); }); } this.$tableBody.scrollTop(scrollTo); @@ -8480,7 +8457,7 @@ value: function expandAllRows() { var trs = this.$body.find('> tr[data-index][data-has-detail-view]'); for (var i = 0; i < trs.length; i++) { - this.expandRow($$p(trs[i]).data('index')); + this.expandRow($$o(trs[i]).data('index')); } } }, { @@ -8488,7 +8465,7 @@ value: function collapseAllRows() { var trs = this.$body.find('> tr[data-index][data-has-detail-view]'); for (var i = 0; i < trs.length; i++) { - this.collapseRow($$p(trs[i]).data('index')); + this.collapseRow($$o(trs[i]).data('index')); } } }, { @@ -8500,8 +8477,8 @@ this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(params.title) : params.title; if (this.columns[this.fieldsColumnsIndex[params.field]].visible) { this.$header.find('th[data-field]').each(function (i, el) { - if ($$p(el).data('field') === params.field) { - $$p($$p(el).find('.th-inner')[0]).text(params.title); + if ($$o(el).data('field') === params.field) { + $$o($$o(el).find('.th-inner')[0]).text(params.title); return false; } }); @@ -8538,14 +8515,14 @@ // BOOTSTRAP TABLE PLUGIN DEFINITION // ======================= - $$p.BootstrapTable = BootstrapTable; - $$p.fn.bootstrapTable = function (option) { + $$o.BootstrapTable = BootstrapTable; + $$o.fn.bootstrapTable = function (option) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) { args[_key5 - 1] = arguments[_key5]; } var value; this.each(function (i, el) { - var data = $$p(el).data('bootstrap.table'); + var data = $$o(el).data('bootstrap.table'); if (typeof option === 'string') { var _data2; if (!Constants.METHODS.includes(option)) { @@ -8556,7 +8533,7 @@ } value = (_data2 = data)[option].apply(_data2, args); if (option === 'destroy') { - $$p(el).removeData('bootstrap.table'); + $$o(el).removeData('bootstrap.table'); } return; } @@ -8564,28 +8541,28 @@ console.warn('You cannot initialize the table more than once!'); return; } - var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$p(el).data(), _typeof(option) === 'object' && option); - data = new $$p.BootstrapTable(el, options); - $$p(el).data('bootstrap.table', data); + var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$o(el).data(), _typeof(option) === 'object' && option); + data = new $$o.BootstrapTable(el, options); + $$o(el).data('bootstrap.table', data); data.init(); }); return typeof value === 'undefined' ? this : value; }; - $$p.fn.bootstrapTable.Constructor = BootstrapTable; - $$p.fn.bootstrapTable.theme = Constants.THEME; - $$p.fn.bootstrapTable.VERSION = Constants.VERSION; - $$p.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS; - $$p.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS; - $$p.fn.bootstrapTable.events = BootstrapTable.EVENTS; - $$p.fn.bootstrapTable.locales = BootstrapTable.LOCALES; - $$p.fn.bootstrapTable.methods = BootstrapTable.METHODS; - $$p.fn.bootstrapTable.utils = Utils; + $$o.fn.bootstrapTable.Constructor = BootstrapTable; + $$o.fn.bootstrapTable.theme = Constants.THEME; + $$o.fn.bootstrapTable.VERSION = Constants.VERSION; + $$o.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS; + $$o.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS; + $$o.fn.bootstrapTable.events = BootstrapTable.EVENTS; + $$o.fn.bootstrapTable.locales = BootstrapTable.LOCALES; + $$o.fn.bootstrapTable.methods = BootstrapTable.METHODS; + $$o.fn.bootstrapTable.utils = Utils; // BOOTSTRAP TABLE INIT // ======================= - $$p(function () { - $$p('[data-toggle="table"]').bootstrapTable(); + $$o(function () { + $$o('[data-toggle="table"]').bootstrapTable(); }); return BootstrapTable; @@ -16756,123 +16733,19 @@ jQuery.base64 = (function($) { }; }(jQuery)); -/* - tableExport.jquery.plugin - - Version 1.28.0 - - Copyright (c) 2015-2023 hhurz, - https://github.com/hhurz/tableExport.jquery.plugin - - Based on https://github.com/kayalshri/tableExport.jquery.plugin - - Licensed under the MIT License -*/ -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,I,w){d instanceof String&&(d=String(d));for(var J=d.length,K=0;Ke&&"undefined"!==typeof fa[e]&&-1!==d.inArray(fa[e],b.ignoreColumn))&&(h=!0):h=!0;return h}function G(a,c,e,h,f){if("function"===typeof f){var x=!1;"function"===typeof b.onIgnoreRow&&(x=b.onIgnoreRow(d(a),e));if(!1===x&&(0===b.ignoreRow.length||-1===d.inArray(e,b.ignoreRow)&&-1===d.inArray(e-h,b.ignoreRow))&&O(d(a))){a= -P(d(a),c);var m=a.length,g=0,p=0;a.each(function(){var a=d(this),c=Q(this),b=ha(this),h;d.each(N,function(){if(e>this.s.r&&e<=this.e.r&&g>=this.s.c&&g<=this.e.c)for(h=0;h<=this.e.c-this.s.c;++h)m++,p++,f(null,e,g++)});if(b||c)c=c||1,N.push({s:{r:e,c:g},e:{r:e+(b||1)-1,c:g+c-1}});!1===Va(a,m,p++)&&f(this,e,g++);if(1=this.s.r&&e<=this.e.r&&g>=this.s.c&&g<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f(null,e,g++)})}}}function Wa(a,c, -b,h){if("undefined"!==typeof h.images&&(b=h.images[b],"undefined"!==typeof b)){c=c.getBoundingClientRect();var e=a.width/a.height,d=c.width/c.height,m=a.width,g=a.height,p=19.049976/25.4,B=0;d<=e?(g=Math.min(a.height,c.height),m=c.width*g/c.height):d>e&&(m=Math.min(a.width,c.width),g=c.height*m/c.width);m*=p;g*=p;ga.textPos.x&&h+B>a.textPos.x+a.width&&(0<=".,!%*;:=-".indexOf(p.charAt(0))&&(z=p.charAt(0),B=e.doc.getStringUnitWidth(z)*e.doc.internal.getFontSize(),h+B<=a.textPos.x+a.width&&(za(z,h,f,x),p=p.substring(1,p.length)),B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize()),h=a.textPos.x,f+=e.doc.internal.getFontSize()); -if("visible"!==a.styles.overflow)for(;p.length&&h+B>a.textPos.x+a.width;)p=p.substring(0,p.length-1),B=e.doc.getStringUnitWidth(p)*e.doc.internal.getFontSize();za(p,h,f,x);h+=B}if(m||g)d(c).is("b")?m=!1:d(c).is("i")&&(g=!1),e.doc.setFont("undefined ",m||g?m?"bold":"italic":"normal");c=c.nextSibling}a.textPos.x=h;a.textPos.y=f}else za(a.text,a.textPos.x,a.textPos.y,x)}}function la(a,c,b){return null==a?"":a.toString().replace(new RegExp(null==c?"":c.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g, -"\\$1"),"g"),b)}function Ha(a){return null==a?"":a.toString().replace(/^\s+/,"")}function Ia(a){return null==a?"":a.toString().replace(/\s+$/,"")}function ob(a){if(0===b.date.html.length)return!1;b.date.pattern.lastIndex=0;var c=b.date.pattern.exec(a);if(null==c)return!1;a=+c[b.date.match_y];if(0>a||8099"+g+"
",null,!1);var p=0,B=0;g="";d.each(a,function(){if(d(this).is("input"))g+=m.find("input").eq(p++).val();else if(d(this).is("select"))g+=m.find("select option:selected").eq(B++).text();else if(d(this).is("br"))g+="
";else{if("undefined"===typeof d(this).html())g+=d(this).text(); -else if(void 0===jQuery().bootstrapTable||!1===d(this).hasClass("fht-cell")&&!1===d(this).hasClass("filterControl")&&0===m.parents(".detail-view").length)g+=d(this).html();if(d(this).is("a")){var a=m.find("a").attr("href")||"";f="function"===typeof b.onCellHtmlHyperlink?f+b.onCellHtmlHyperlink(m,c,e,a,g):"href"===b.htmlHyperlink?f+a:f+g;g=""}}})}if(g&&""!==g&&!0===b.htmlContent)f=d.trim(g);else if(g&&""!==g)if(""!==m.attr("data-tableexport-cellformat")){var z=g.replace(/\n/g,"\u2028").replace(/(<\s*br([^>]*)>)/gi, -"\u2060"),k=d("
").html(z).contents();a=!1;z="";d.each(k.text().split("\u2028"),function(a,c){0a?1:0)).split(".");1===k.length&&(k[1]="");var l=3a?"-":"")+(b.numbers.output.thousandsSeparator?(l?k[0].substr(0,l)+b.numbers.output.thousandsSeparator:"")+k[0].substr(l).replace(/(\d{3})(?=\d)/g,"$1"+b.numbers.output.thousandsSeparator):k[0])+(k[1].length?b.numbers.output.decimalMark+ -k[1]:"")}}else f=g;!0===b.escape&&(f=escape(f));"function"===typeof b.onCellData&&(f=b.onCellData(m,c,e,f,x),m.data("teUserDefText",1))}void 0!==h&&(h.type=x);return f}function db(a){return 0x?f+=String.fromCharCode(x):(127x?f+=String.fromCharCode(x>>6|192):(f+=String.fromCharCode(x>>12|224),f+=String.fromCharCode(x>>6&63|128)),f+=String.fromCharCode(x&63|128))}a=f}for(;d>2;m=(m&3)<<4|f>>4;var g=(f&15)<<2|c>>6;var p=c&63;isNaN(f)?g=p=64:isNaN(c)&&(p=64);b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(x)+ -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(p)}return b}function sb(a,c,b,d){c&&"object"===typeof c||console.error("The headers should be an object or array, is: "+typeof c);b&&"object"===typeof b||console.error("The data should be an object or array, is: "+typeof b);d&&"object"!==typeof d&&console.error("The data should be an object or array, is: "+ -typeof b);Array.prototype.forEach||console.error("The current browser does not support Array.prototype.forEach which is required for jsPDF-AutoTable");y=a;l=tb(d||{});Ma=1;F={y:!1===l.startY?l.margin.top:l.startY};a={textColor:30,fontSize:y.internal.getFontSize(),fontStyle:y.internal.getFont().fontStyle,fontName:y.internal.getFont().fontName};ub(c,b);vb();c=l.startY+l.margin.bottom+q.headerRow.height+(q.rows[0]&&"auto"===l.pageBreak?q.rows[0].height:0);"avoid"===l.pageBreak&&(c+=q.height);if("always"=== -l.pageBreak&&!1!==l.startY||!1!==l.startY&&c>y.internal.pageSize.height)y.addPage(),F.y=l.margin.top;ma(a);l.beforePageContent(U());!1!==l.drawHeaderRow(q.headerRow,U({row:q.headerRow}))&&Na(q.headerRow,l.drawHeaderCell);ma(a);wb();l.afterPageContent(U());ma(a);return y}function za(a,c,b,d){"number"===typeof c&&"number"===typeof b||console.error("The x and y parameters are required. Missing for the text: ",a);var e=y.internal.getFontSize()/y.internal.scaleFactor,h=/\r\n|\r|\n/g,m=null,g=1;if("middle"=== -d.valign||"bottom"===d.valign||"center"===d.halign||"right"===d.halign)m="string"===typeof a?a.split(h):a,g=m.length||1;b+=e*(2-1.15);"middle"===d.valign?b-=g/2*e:"bottom"===d.valign&&(b-=g*e);if("center"===d.halign||"right"===d.halign){h=e;"center"===d.halign&&(h*=.5);if(m&&1<=g){for(a=0;ab.contentWidth&&(b.contentWidth=a)});b.width=b.contentWidth;a+=b.contentWidth});q.contentWidth=a;var b=y.internal.pageSize.width-l.margin.left-l.margin.right,d=b;"number"===typeof l.tableWidth?d=l.tableWidth:"wrap"===l.tableWidth&&(d=q.contentWidth);q.width=dq.width?a.width=a.contentWidth:(h.push(a),f+=a.contentWidth,a.width=0);m+=a.width});hb(h,m,f,k);q.height=0;q.rows.concat(q.headerRow).forEach(function(a,b){var c=0,d=q.x;q.columns.forEach(function(b){var e=a.cells[b.dataKey];b.x=d;ma(e.styles);var g=b.width- -2*e.styles.cellPadding;"linebreak"===e.styles.overflow?e.text=y.splitTextToSize(e.text,g+1,{fontSize:e.styles.fontSize}):"ellipsize"===e.styles.overflow?e.text=Oa(e.text,g,e.styles):"visible"!==e.styles.overflow&&("hidden"===e.styles.overflow?e.text=Oa(e.text,g,e.styles,""):"function"===typeof e.styles.overflow?e.text=e.styles.overflow(e.text,g):console.error("Unrecognized overflow type: "+e.styles.overflow));e=Array.isArray(e.text)?e.text.length-1:0;e>c&&(c=e);d+=b.width});a.heightStyle=a.styles.rowHeight; -a.height=a.heightStyle+c*a.styles.fontSize*1.15+(2-1.15)/2*a.styles.fontSize;q.height+=a.height})}function hb(a,b,d,h){for(var c=q.width-b-d,e=0;ec&&p){a.splice(e,1);d-=m.contentWidth;m.width=h;b+=m.width;hb(a,b,d,h);break}else m.width=m.contentWidth+c*g}}function wb(){q.rows.forEach(function(a,b){F.y+a.height+l.margin.bottom>=y.internal.pageSize.height&&(l.afterPageContent(U()),y.addPage(),Ma++,F={x:l.margin.left,y:l.margin.top}, -l.beforePageContent(U()),!1!==l.drawHeaderRow(q.headerRow,U({row:q.headerRow}))&&Na(q.headerRow,l.drawHeaderCell));a.y=F.y;!1!==l.drawRow(a,U({row:a}))&&Na(a,l.drawCell)})}function Na(a,b){for(var c=0;c= -Ca(a,d))return a;for(;ba.length);)a=a.substring(0,a.length-1);return a.trim()+h}function Ca(a,b){ma(b);return y.getStringUnitWidth(a)*b.fontSize}function Z(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);for(var h=1;h"+E(a,b,d)+""});r++});da+="";var ib=1;A=Y(d(u));d(A).each(function(){var a=1;t="";G(this,"td,th",r,v.length+A.length,function(b,d,h){t+=""+E(b,d,h)+"";a++});0"!==t&&(da+=''+t+"",ib++);r++});da+="";if("string"=== -b.outputMode)return da;if("base64"===b.outputMode)return S(da);T(da,b.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===b.type&&"xmlss"===b.mso.fileFormat){var Sa=[],M=[];d(u).filter(function(){return O(d(this))}).each(function(){function a(a,b,c){var e=[];d(a).each(function(){var b=0,f=0;t="";G(this,"td,th",r,c+a.length,function(a,c,g){if(null!==a){var m="";c=E(a,c,g);g="String";if(!1!==jQuery.isNumeric(c))g="Number";else{var h=pb(c);!1!==h&&(c=h,g="Number",m+=' ss:StyleID="pct1"')}"Number"!== -g&&(c=c.replace(/\n/g,"
"));h=Q(a);a=ha(a);d.each(e,function(){if(r>=this.s.r&&r<=this.e.r&&f>=this.s.c&&f<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)f++,b++});if(a||h)a=a||1,h=h||1,e.push({s:{r:r,c:f},e:{r:r+a-1,c:f+h-1}});1'+d("
").text(c).html()+"\r";f++}});0\r'+ -t+"\r");r++});return a.length}var c=d(this),e="";"string"===typeof b.mso.worksheetName&&b.mso.worksheetName.length?e=b.mso.worksheetName+" "+(M.length+1):"undefined"!==typeof b.mso.worksheetName[M.length]&&(e=b.mso.worksheetName[M.length]);e.length||(e=c.find("caption").text()||"");e.length||(e="Table "+(M.length+1));e=d.trim(e.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));M.push(d("
").text(e).html());!1===b.exportHiddenCells&&(R=c.find("tr, th, td").filter(":hidden"),ka=0\r";e=a(X(c),"th,td",0);a(Y(c),"td,th",e);L+="\r";Sa.push(L)});for(var Da={},Ta={},ea,ra,oa=0,yb=M.length;oa\r\r\r \r\r\r 9000\r 13860\r 0\r 0\r False\r False\r\r\r \r \r \r\r', -Ea=0;Ea\r'+Sa[Ea],W=b.mso.rtl?W+'\r\r\r':W+'\r',W+="\r";W+="\r";if("string"===b.outputMode)return W;if("base64"===b.outputMode)return S(W);T(W,b.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"=== -b.type&&"xlsx"===b.mso.fileFormat){var sa=[],jb=XLSX.utils.book_new();d(u).filter(function(){return O(d(this))}).each(function(){for(var a=d(this),c,e={},h=this.getElementsByTagName("tr"),f=Math.min(1E7,h.length),k={s:{r:0,c:0},e:{r:0,c:0}},m=[],g,p=0,B=0,z,l,r,q,n,t=XLSX.SSF.get_table();pc||36c||48===c)u="n";else{if("date"===w.type||13c||44c||56===c)u="d"}else u="s";if(null!=C){if(0===C.length)g.t="z";else if(0!==C.trim().length&&"s"!==u)if("function"===w.type)g={f:C};else if("TRUE"===C)g={t:"b",v:!0};else if("FALSE"===C)g={t:"b",v:!1};else if("n"===u||isFinite(fb(C,b.numbers.output))){if(u= -fb(C,b.numbers.output),0===c&&"function"!==typeof b.mso.xlsx.formatId.numbers&&(c=b.mso.xlsx.formatId.numbers),isFinite(u)||isFinite(C))g={t:"n",v:isFinite(u)?u:C,z:"string"===typeof c?c:c in t?t[c]:c===b.mso.xlsx.formatId.currency?b.mso.xlsx.format.currency:"0.00"}}else if(!1!==(w=ob(C))||"d"===u)0===c&&"function"!==typeof b.mso.xlsx.formatId.date&&(c=b.mso.xlsx.formatId.date),g={t:"d",v:!1!==w?w:C,z:"string"===typeof c?c:c in t?t[c]:"m/d/yy"};(u=d(n).find("a"))&&u.length&&(u=u[0].hasAttribute("href")? -u.attr("href"):"",C="href"!==b.htmlHyperlink||""===u?C:"",w=""!==u?'=HYPERLINK("'+u+(C.length?'","'+C:"")+'")':"",""!==w&&("function"===typeof b.mso.xlsx.onHyperlink?(C=b.mso.xlsx.onHyperlink(d(n),p,z,u,C,w),g=0!==C.indexOf("=HYPERLINK")?{t:"s",v:C}:{f:C}):g={f:w}))}e[Ka({c:l,r:B})]=g;k.e.c=f&&(e["!fullref"]=La((k.e.r=h.length-p+B-1,k)));c="";"string"===typeof b.mso.worksheetName&& -b.mso.worksheetName.length?c=b.mso.worksheetName+" "+(sa.length+1):"undefined"!==typeof b.mso.worksheetName[sa.length]&&(c=b.mso.worksheetName[sa.length]);c.length||(c=a.find("caption").text()||"");c.length||(c="Table "+(sa.length+1));c=d.trim(c.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));sa.push(c);XLSX.utils.book_append_sheet(jb,e,c)});var zb=XLSX.write(jb,{type:"binary",bookType:b.mso.fileFormat,bookSST:!1});T(rb(zb),b.fileName+"."+b.mso.fileFormat,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", -"UTF-8","",!1)}else if("excel"===b.type||"xls"===b.type||"word"===b.type||"doc"===b.type){var ta="excel"===b.type||"xls"===b.type?"excel":"word",Ab="excel"===ta?"xls":"doc",Bb='xmlns:x="urn:schemas-microsoft-com:office:'+ta+'"',ua=L="";d(u).filter(function(){return O(d(this))}).each(function(){var a=d(this);""===ua&&(ua=b.mso.worksheetName||a.find("caption").text()||"Table",ua=d.trim(ua.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31)));!1===b.exportHiddenCells&&(R=a.find("tr, th, td").filter(":hidden"), -ka=0";v=X(a);d(v).each(function(){var a=d(this),e=document.defaultView.getComputedStyle(a[0],null);t="";G(this,"th,td",r,v.length,function(a,c,d){if(null!==a){var f="";t+=""}});0"+t+"");r++});L+="";A=Y(a);d(A).each(function(){var a=d(this),e=null,h=null;t="";G(this,"td,th",r,v.length+A.length,function(c,k,m){if(null!==c){var g=E(c,k,m),f="",l=d(c).attr("data-tableexport-msonumberformat");"undefined"===typeof l&&"function"===typeof b.mso.onMsoNumberFormat&&(l=b.mso.onMsoNumberFormat(c,k,m));"undefined"!==typeof l&&""!==l&&(f="style=\"mso-number-format:'"+ -l+"'");if(b.mso.styles.length){e=document.defaultView.getComputedStyle(c,null);h=null;for(var n in b.mso.styles)k=b.mso.styles[n],l=H(e,k),""===l&&(null===h&&(h=document.defaultView.getComputedStyle(a[0],null)),l=H(h,k)),""!==l&&"0px none rgb(0, 0, 0)"!==l&&"rgba(0, 0, 0, 0)"!==l&&(f+=""===f?'style="':";",f+=k+":"+l)}t+=""));t+=">"+g+""}}); -0"+t+"");r++});b.displayTableName&&(L+=""+E(d("

"+b.tableName+"

"))+"");L+=""});var n='';n+="";n+='';"excel"===ta&&(n+="\x3c!--[if gte mso 9]>",n+="",n+="",n+="",n+="", -n+="",n+=ua,n+="",n+="",n+="",b.mso.rtl&&(n+=""),n+="",n+="",n+="",n+="",n+="",n+="";n+="@page { size:"+b.mso.pageOrientation+"; mso-page-orientation:"+b.mso.pageOrientation+"; }";n+="@page Section1 {size:"+V[b.mso.pageFormat][0]+"pt "+V[b.mso.pageFormat][1]+"pt";n+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}"; -n+="div.Section1 {page:Section1;}";n+="@page Section2 {size:"+V[b.mso.pageFormat][1]+"pt "+V[b.mso.pageFormat][0]+"pt";n+=";mso-page-orientation:"+b.mso.pageOrientation+";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";n+="div.Section2 {page:Section2;}";n+="br {mso-data-placement:same-cell;}";n+="";n+="";n+="";n+='
';n+=L;n+="
";n+="";n+=""; -if("string"===b.outputMode)return n;if("base64"===b.outputMode)return S(n);T(n,b.fileName+"."+Ab,"application/vnd.ms-"+ta,"","base64",!1)}else if("png"===b.type)html2canvas(d(u)[0]).then(function(a){a=a.toDataURL();for(var c=atob(a.substring(22)),d=new ArrayBuffer(c.length),h=new Uint8Array(d),f=0;fkb){a>V.a0[0]&&(Fa="a0",va="l");for(var b in V)V.hasOwnProperty(b)&&V[b][1]>a&&(Fa=b,va="l",V[b][0]>a&&(va="p"));kb=a}}});b.jspdf.format=""===Fa?"a4":Fa;b.jspdf.orientation=""===va?"w":va}if(null== -k.doc&&(k.doc=new jspdf.jsPDF(b.jspdf.orientation,b.jspdf.unit,b.jspdf.format),k.wScaleFactor=1,k.hScaleFactor=1,"function"===typeof b.jspdf.onDocCreated))b.jspdf.onDocCreated(k.doc);Ba.fontName=k.doc.getFont().fontName;!0===k.outputImages&&(k.images={});"undefined"!==typeof k.images&&(d(u).filter(function(){return O(d(this))}).each(function(){var a=0;N=[];!1===b.exportHiddenCells&&(R=d(this).find("tr, th, td").filter(":hidden"),ka=0a.styles.rowHeight&&(a.styles.rowHeight=e)}a.styles.halign="inherit"===c.headerStyles.halign?"center":c.headerStyles.halign;a.styles.valign=c.headerStyles.valign;"undefined"!==typeof d.style&&!0!==d.style.hidden&&("inherit"===c.headerStyles.halign&&(a.styles.halign=d.style.align),"inherit"===c.styles.fillColor&&(a.styles.fillColor=d.style.bcolor),"inherit"===c.styles.textColor&&(a.styles.textColor=d.style.color),"inherit"=== -c.styles.fontStyle&&(a.styles.fontStyle=d.style.fstyle))}});"function"!==typeof c.createdCell&&(c.createdCell=function(a,b){b=k.teCells[b.row.index+":"+b.column.dataKey];a.styles.halign="inherit"===c.styles.halign?"center":c.styles.halign;a.styles.valign=c.styles.valign;"undefined"!==typeof b&&"undefined"!==typeof b.style&&!0!==b.style.hidden&&("inherit"===c.styles.halign&&(a.styles.halign=b.style.align),"inherit"===c.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===c.styles.textColor&& -(a.styles.textColor=b.style.color),"inherit"===c.styles.fontStyle&&(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof c.drawHeaderCell&&(c.drawHeaderCell=function(a,b){var c=k.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?Ya(a,b,c):!1});"function"!==typeof c.drawCell&&(c.drawCell=function(a,b){var c=k.teCells[b.row.index+":"+b.column.dataKey];if(!0!==("undefined"!==typeof c&&c.isCanvas))Ya(a,b,c)&&(k.doc.rect(a.x,a.y,a.width,a.height, -a.styles.fillStyle),"undefined"===typeof c||"undefined"!==typeof c.hasUserDefText&&!0===c.hasUserDefText||"undefined"===typeof c.elements||!c.elements.length?cb(a,{},k):(b=a.height/c.rect.height,b>k.hScaleFactor&&(k.hScaleFactor=b),k.wScaleFactor=a.width/c.rect.width,b=a.textPos.y,ab(a,c.elements,k),a.textPos.y=b,cb(a,c.elements,k)));else{c=c.elements[0];var e=d(c).attr("data-tableexport-canvas"),f=c.getBoundingClientRect();a.width=f.width*k.wScaleFactor;a.height=f.height*k.hScaleFactor;b.row.height= -a.height;Wa(a,c,e,k)}return!1});k.headerrows=[];v=X(d(this));d(v).each(function(){a=0;k.headerrows[r]=[];G(this,"th,td",r,v.length,function(b,c,d){var e=eb(b);e.title=E(b,c,d);e.key=a++;e.rowIndex=r;k.headerrows[r].push(e)});r++});if(01?1:0);f=formatItems.indexOf("mm")+1;defaults.date.match_m=f+(f>1?1:0);f=(formatItems.indexOf("yyyy")>=0?formatItems.indexOf("yyyy"):formatItems.indexOf("yy"))+1;defaults.date.match_y=f+(f>1?1:0)}colNames=GetColumnNames(el);if(typeof defaults.onTableExportBegin==="function")defaults.onTableExportBegin();if(defaults.type==="csv"||defaults.type==="tsv"||defaults.type==="txt"){let csvData="";let rowLength=0;ranges=[];rowIndex=0;const csvString=function(cell,rowIndex,colIndex){let result="";if(cell!==null){const dataString=parseString(cell,rowIndex,colIndex);const csvValue=dataString===null||dataString===""?"":dataString.toString();if(defaults.type==="tsv"){if(dataString instanceof Date)dataString.toLocaleString();result=replaceAll(csvValue,"\t"," ")}else{if(dataString instanceof Date)result=defaults.csvEnclosure+dataString.toLocaleString()+defaults.csvEnclosure;else{result=preventInjection(csvValue);result=replaceAll(result,defaults.csvEnclosure,defaults.csvEnclosure+defaults.csvEnclosure);if(result.indexOf(defaults.csvSeparator)>=0||/[\r\n ]/g.test(result))result=defaults.csvEnclosure+result+defaults.csvEnclosure}}}return result};const CollectCsvData=function($rows,rowselector,length){$rows.each(function(){trData="";ForEachVisibleCell(this,rowselector,rowIndex,length+$rows.length,function(cell,row,col){trData+=csvString(cell,row,col)+(defaults.type==="tsv"?"\t":defaults.csvSeparator)});trData=$.trim(trData).substring(0,trData.length-1);if(trData.length>0){if(csvData.length>0)csvData+="\n";csvData+=trData}rowIndex++});return $rows.length};rowLength+=CollectCsvData($(el).find("thead").first().find(defaults.theadSelector),"th,td",rowLength);findTableElements($(el),"tbody").each(function(){rowLength+=CollectCsvData(findTableElements($(this),defaults.tbodySelector),"td,th",rowLength)});if(defaults.tfootSelector.length)CollectCsvData($(el).find("tfoot").first().find(defaults.tfootSelector),"td,th",rowLength);csvData+="\n";if(defaults.outputMode==="string")return csvData;if(defaults.outputMode==="base64")return base64encode(csvData);if(defaults.outputMode==="window"){downloadFile(false,"data:text/"+(defaults.type==="csv"?"csv":"plain")+";charset=utf-8,",csvData);return}saveToFile(csvData,defaults.fileName+"."+defaults.type,"text/"+(defaults.type==="csv"?"csv":"plain"),"utf-8","",defaults.type==="csv"&&defaults.csvUseBOM)}else if(defaults.type==="sql"){rowIndex=0;ranges=[];let tdData="INSERT INTO "+defaults.sql.tableEnclosure+defaults.tableName+defaults.sql.tableEnclosure+" (";$head_rows=collectHeadRows($(el));$($head_rows).each(function(){ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){let colName=parseString(cell,row,col)||"";if(colName.indexOf(defaults.sql.columnEnclosure)>-1)colName=replaceAll(colName.toString(),defaults.sql.columnEnclosure,defaults.sql.columnEnclosure+defaults.sql.columnEnclosure);tdData+=defaults.sql.columnEnclosure+colName+defaults.sql.columnEnclosure+","});rowIndex++;tdData=$.trim(tdData).substring(0,tdData.length-1)});tdData+=") VALUES ";$rows=collectRows($(el));$($rows).each(function(){trData="";ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){let dataString=parseString(cell,row,col)||"";if(dataString.indexOf("'")>-1)dataString=replaceAll(dataString.toString(),"'","''");trData+="'"+dataString+"',"});if(trData.length>3){tdData+="("+trData;tdData=$.trim(tdData).substring(0,tdData.length-1);tdData+="),"}rowIndex++});tdData=$.trim(tdData).substring(0,tdData.length-1);tdData+=";";if(defaults.outputMode==="string")return tdData;if(defaults.outputMode==="base64")return base64encode(tdData);saveToFile(tdData,defaults.fileName+".sql","application/sql","utf-8","",false)}else if(defaults.type==="json"){const jsonHeaderArray=[];ranges=[];$head_rows=collectHeadRows($(el));$($head_rows).each(function(){const jsonArrayTd=[];ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){jsonArrayTd.push(parseString(cell,row,col))});jsonHeaderArray.push(jsonArrayTd)});const jsonArray=[];$rows=collectRows($(el));$($rows).each(function(){const jsonObjectTd={};let colIndex=0;ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){if(jsonHeaderArray.length){jsonObjectTd[jsonHeaderArray[jsonHeaderArray.length-1][colIndex]]=parseString(cell,row,col)}else{jsonObjectTd[colIndex]=parseString(cell,row,col)}colIndex++});if($.isEmptyObject(jsonObjectTd)===false)jsonArray.push(jsonObjectTd);rowIndex++});let save_data;if(defaults.jsonScope==="head")save_data=JSON.stringify(jsonHeaderArray);else if(defaults.jsonScope==="data")save_data=JSON.stringify(jsonArray);else save_data=JSON.stringify({header:jsonHeaderArray,data:jsonArray});if(defaults.outputMode==="string")return save_data;if(defaults.outputMode==="base64")return base64encode(save_data);saveToFile(save_data,defaults.fileName+".json","application/json","utf-8","base64",false)}else if(defaults.type==="xml"){rowIndex=0;ranges=[];let xml='';xml+="";$head_rows=collectHeadRows($(el));$($head_rows).each(function(){ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){xml+=""+parseString(cell,row,col)+""});rowIndex++});xml+="";let rowCount=1;$rows=collectRows($(el));$($rows).each(function(){let colCount=1;trData="";ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){trData+=""+parseString(cell,row,col)+"";colCount++});if(trData.length>0&&trData!==""){xml+=''+trData+"";rowCount++}rowIndex++});xml+="";if(defaults.outputMode==="string")return xml;if(defaults.outputMode==="base64")return base64encode(xml);saveToFile(xml,defaults.fileName+".xml","application/xml","utf-8","base64",false)}else if(defaults.type==="excel"&&defaults.mso.fileFormat==="xmlss"){const sheetData=[];const docNames=[];$(el).filter(function(){return isVisible($(this))}).each(function(){const $table=$(this);let ssName="";if(typeof defaults.mso.worksheetName==="string"&&defaults.mso.worksheetName.length)ssName=defaults.mso.worksheetName+" "+(docNames.length+1);else if(typeof defaults.mso.worksheetName[docNames.length]!=="undefined")ssName=defaults.mso.worksheetName[docNames.length];if(!ssName.length)ssName=$table.find("caption").text()||"";if(!ssName.length)ssName="Table "+(docNames.length+1);ssName=$.trim(ssName.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));docNames.push($("
").text(ssName).html());if(defaults.exportHiddenCells===false){$hiddenTableElements=$table.find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}rowIndex=0;colNames=GetColumnNames(this);docData="\r";function CollectXmlssData($rows,rowselector,length){const spans=[];$($rows).each(function(){let ssIndex=0;let nCols=0;trData="";ForEachVisibleCell(this,"td,th",rowIndex,length+$rows.length,function(cell,row,col){if(cell!==null){let style="";let data=parseString(cell,row,col);let type="String";if(jQuery.isNumeric(data)!==false){type="Number"}else{const number=parsePercent(data);if(number!==false){data=number;type="Number";style+=' ss:StyleID="pct1"'}}if(type!=="Number")data=data.replace(/\n/g,"
");let colspan=getColspan(cell);let rowspan=getRowspan(cell);$.each(spans,function(){const range=this;if(rowIndex>=range.s.r&&rowIndex<=range.e.r&&nCols>=range.s.c&&nCols<=range.e.c){for(let i=0;i<=range.e.c-range.s.c;++i){nCols++;ssIndex++}}});if(rowspan||colspan){rowspan=rowspan||1;colspan=colspan||1;spans.push({s:{r:rowIndex,c:nCols},e:{r:rowIndex+rowspan-1,c:nCols+colspan-1}})}if(colspan>1){style+=' ss:MergeAcross="'+(colspan-1)+'"';nCols+=colspan-1}if(rowspan>1){style+=' ss:MergeDown="'+(rowspan-1)+'" ss:StyleID="rsp1"'}if(ssIndex>0){style+=' ss:Index="'+(nCols+1)+'"';ssIndex=0}trData+="'+$("
").text(data).html()+"\r";nCols++}});if(trData.length>0)docData+='\r'+trData+"\r";rowIndex++});return $rows.length}const rowLength=CollectXmlssData(collectHeadRows($table),"th,td",0);CollectXmlssData(collectRows($table),"td,th",rowLength);docData+="
\r";sheetData.push(docData)});const count={};const firstOccurrences={};let item,itemCount;for(let n=0,c=docNames.length;n1)docNames[n]=docNames[n].substring(0,29)+"-"+count[item];else firstOccurrences[item]=n}const CreationDate=(new Date).toISOString();let xmlssDocFile='\r'+'\r'+'\r'+'\r'+" "+CreationDate+"\r"+"\r"+'\r'+" \r"+"\r"+'\r'+" 9000\r"+" 13860\r"+" 0\r"+" 0\r"+" False\r"+" False\r"+"\r"+"\r"+' \r"+' \r"+' \r"+"\r";for(let j=0;j\r'+sheetData[j];if(defaults.mso.rtl){xmlssDocFile+='\r'+"\r"+"\r"}else xmlssDocFile+='\r';xmlssDocFile+="\r"}xmlssDocFile+="\r";if(defaults.outputMode==="string")return xmlssDocFile;if(defaults.outputMode==="base64")return base64encode(xmlssDocFile);saveToFile(xmlssDocFile,defaults.fileName+".xml","application/xml","utf-8","base64",false)}else if(defaults.type==="excel"&&defaults.mso.fileFormat==="xlsx"){const sheetNames=[];const workbook=XLSX.utils.book_new();$(el).filter(function(){return isVisible($(this))}).each(function(){const $table=$(this);const ws=xlsxTableToSheet(this);let sheetName="";if(typeof defaults.mso.worksheetName==="string"&&defaults.mso.worksheetName.length)sheetName=defaults.mso.worksheetName+" "+(sheetNames.length+1);else if(typeof defaults.mso.worksheetName[sheetNames.length]!=="undefined")sheetName=defaults.mso.worksheetName[sheetNames.length];if(!sheetName.length)sheetName=$table.find("caption").text()||"";if(!sheetName.length)sheetName="Table "+(sheetNames.length+1);sheetName=$.trim(sheetName.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));sheetNames.push(sheetName);XLSX.utils.book_append_sheet(workbook,ws,sheetName)});const wbData=XLSX.write(workbook,{type:"binary",bookType:defaults.mso.fileFormat,bookSST:false});saveToFile(xlsxWorkbookToArrayBuffer(wbData),defaults.fileName+"."+defaults.mso.fileFormat,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","UTF-8","",false)}else if(defaults.type==="excel"||defaults.type==="xls"||defaults.type==="word"||defaults.type==="doc"){const MSDocType=defaults.type==="excel"||defaults.type==="xls"?"excel":"word";const MSDocExt=MSDocType==="excel"?"xls":"doc";const MSDocSchema='xmlns:x="urn:schemas-microsoft-com:office:'+MSDocType+'"';docData="";let docName="";$(el).filter(function(){return isVisible($(this))}).each(function(){const $table=$(this);if(docName===""){docName=defaults.mso.worksheetName||$table.find("caption").text()||"Table";docName=$.trim(docName.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31))}if(defaults.exportHiddenCells===false){$hiddenTableElements=$table.find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}rowIndex=0;ranges=[];colNames=GetColumnNames(this);docData+="";$head_rows=collectHeadRows($table);$($head_rows).each(function(){const $row=$(this);trData="";ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){if(cell!==null){let thStyle="";trData+="0)trData+=' colspan="'+tdColspan+'"';const tdRowspan=getRowspan(cell);if(tdRowspan>0)trData+=' rowspan="'+tdRowspan+'"';trData+=">"+parseString(cell,row,col)+""}});if(trData.length>0)docData+=""+trData+"";rowIndex++});docData+="";$rows=collectRows($table);$($rows).each(function(){const $row=$(this);trData="";ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){if(cell!==null){let tdValue=parseString(cell,row,col);let tdStyle="";let tdCss=$(cell).attr("data-tableexport-msonumberformat");if(typeof tdCss==="undefined"&&typeof defaults.mso.onMsoNumberFormat==="function")tdCss=defaults.mso.onMsoNumberFormat(cell,row,col);if(typeof tdCss!=="undefined"&&tdCss!=="")tdStyle="style=\"mso-number-format:'"+tdCss+"'";if(defaults.mso.styles.length){const cellStyles=document.defaultView.getComputedStyle(cell,null);const rowStyles=document.defaultView.getComputedStyle($row[0],null);for(let cssStyle in defaults.mso.styles){tdCss=cellStyles[defaults.mso.styles[cssStyle]];if(tdCss==="")tdCss=rowStyles[defaults.mso.styles[cssStyle]];if(tdCss!==""&&tdCss!=="0px none rgb(0, 0, 0)"&&tdCss!=="rgba(0, 0, 0, 0)"){tdStyle+=tdStyle===""?'style="':";";tdStyle+=defaults.mso.styles[cssStyle]+":"+tdCss}}}trData+="0)trData+=' colspan="'+tdColspan+'"';const tdRowspan=getRowspan(cell);if(tdRowspan>0)trData+=' rowspan="'+tdRowspan+'"';if(typeof tdValue==="string"&&tdValue!==""){tdValue=preventInjection(tdValue);tdValue=tdValue.replace(/\n/g,"
")}trData+=">"+tdValue+""}});if(trData.length>0)docData+="
"+trData+"";rowIndex++});if(defaults.displayTableName)docData+="";docData+="
"+parseString($("

"+defaults.tableName+"

"))+"
"});let docFile='';docFile+='';docFile+="";if(MSDocType==="excel"){docFile+="\x3c!--[if gte mso 9]>";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+=docName;docFile+="";docFile+="";docFile+="";if(defaults.mso.rtl)docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="";docFile+="@page { size:"+defaults.mso.pageOrientation+"; mso-page-orientation:"+defaults.mso.pageOrientation+"; }";docFile+="@page Section1 {size:"+pageFormats[defaults.mso.pageFormat][0]+"pt "+pageFormats[defaults.mso.pageFormat][1]+"pt";docFile+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";docFile+="div.Section1 {page:Section1;}";docFile+="@page Section2 {size:"+pageFormats[defaults.mso.pageFormat][1]+"pt "+pageFormats[defaults.mso.pageFormat][0]+"pt";docFile+=";mso-page-orientation:"+defaults.mso.pageOrientation+";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";docFile+="div.Section2 {page:Section2;}";docFile+="br {mso-data-placement:same-cell;}";docFile+="";docFile+="";docFile+="";docFile+='
';docFile+=docData;docFile+="
";docFile+="";docFile+="";if(defaults.outputMode==="string")return docFile;if(defaults.outputMode==="base64")return base64encode(docFile);saveToFile(docFile,defaults.fileName+"."+MSDocExt,"application/vnd.ms-"+MSDocType,"","base64",false)}else if(defaults.type==="png"){html2canvas($(el)[0]).then(function(canvas){const image=canvas.toDataURL();const byteString=atob(image.substring(22));const buffer=new ArrayBuffer(byteString.length);const intArray=new Uint8Array(buffer);for(let i=0;i1||rowspan>1){cellContent["colSpan"]=colspan||1;cellContent["rowSpan"]=rowspan||1}}else cellContent={text:" "};if(colselector.indexOf("th")>=0)cellContent["style"]="header";r.push(cellContent)});if(r.length)body.push(r);if(rLengthmw){if(w>pageFormats.a0[0]){rk="a0";ro="l"}for(let key in pageFormats){if(pageFormats.hasOwnProperty(key)){if(pageFormats[key][1]>w){rk=key;ro="l";if(pageFormats[key][0]>w)ro="p"}}}mw=w}}});defaults.jspdf.format=rk===""?"a4":rk;defaults.jspdf.orientation=ro===""?"w":ro}if(teOptions.doc==null){teOptions.doc=new jspdf.jsPDF(defaults.jspdf.orientation,defaults.jspdf.unit,defaults.jspdf.format);teOptions.wScaleFactor=1;teOptions.hScaleFactor=1;if(typeof defaults.jspdf.onDocCreated==="function")defaults.jspdf.onDocCreated(teOptions.doc)}jsPdfDefaultStyles.fontName=teOptions.doc.getFont().fontName;if(teOptions.outputImages===true)teOptions.images={};if(typeof teOptions.images!=="undefined"){$(el).filter(function(){return isVisible($(this))}).each(function(){let rowCount=0;ranges=[];if(defaults.exportHiddenCells===false){$hiddenTableElements=$(this).find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}$head_rows=collectHeadRows($(this));$rows=collectRows($(this));$($rows).each(function(){ForEachVisibleCell(this,"td,th",$head_rows.length+rowCount,$head_rows.length+$rows.length,function(cell){collectImages(cell,$(cell).children(),teOptions)});rowCount++})});$head_rows=[];$rows=[]}loadImages(teOptions,function(){$(el).filter(function(){return isVisible($(this))}).each(function(){let colKey;rowIndex=0;ranges=[];if(defaults.exportHiddenCells===false){$hiddenTableElements=$(this).find("tr, th, td").filter(":hidden");checkCellVisibility=$hiddenTableElements.length>0}colNames=GetColumnNames(this);teOptions.columns=[];teOptions.rows=[];teOptions.teCells={};if(typeof teOptions.onTable==="function")if(teOptions.onTable($(this),defaults)===false)return true;defaults.jspdf.autotable.tableExport=null;const atOptions=$.extend(true,{},defaults.jspdf.autotable);defaults.jspdf.autotable.tableExport=teOptions;atOptions.margin={};$.extend(true,atOptions.margin,defaults.jspdf.margins);atOptions.tableExport=teOptions;if(typeof atOptions.createdHeaderCell!=="function"){atOptions.createdHeaderCell=function(cell,data){if(typeof teOptions.columns[data.column.dataKey]!=="undefined"){const col=teOptions.columns[data.column.dataKey];if(typeof col.rect!=="undefined"){let rh;cell.contentWidth=col.rect.width;if(typeof teOptions.heightRatio==="undefined"||teOptions.heightRatio===0){if(data.row.raw[data.column.dataKey].rowspan)rh=data.row.raw[data.column.dataKey].rect.height/data.row.raw[data.column.dataKey].rowspan;else rh=data.row.raw[data.column.dataKey].rect.height;teOptions.heightRatio=cell.styles.rowHeight/rh}rh=data.row.raw[data.column.dataKey].rect.height*teOptions.heightRatio;if(rh>cell.styles.rowHeight)cell.styles.rowHeight=rh}cell.styles.halign=atOptions.headerStyles.halign==="inherit"?"center":atOptions.headerStyles.halign;cell.styles.valign=atOptions.headerStyles.valign;if(typeof col.style!=="undefined"&&col.style.hidden!==true){if(atOptions.headerStyles.halign==="inherit")cell.styles.halign=col.style.align;if(atOptions.styles.fillColor==="inherit")cell.styles.fillColor=col.style.bcolor;if(atOptions.styles.textColor==="inherit")cell.styles.textColor=col.style.color;if(atOptions.styles.fontStyle==="inherit")cell.styles.fontStyle=col.style.fstyle}}}}if(typeof atOptions.createdCell!=="function"){atOptions.createdCell=function(cell,data){const tecell=teOptions.teCells[data.row.index+":"+data.column.dataKey];cell.styles.halign=atOptions.styles.halign==="inherit"?"center":atOptions.styles.halign;cell.styles.valign=atOptions.styles.valign;if(typeof tecell!=="undefined"&&typeof tecell.style!=="undefined"&&tecell.style.hidden!==true){if(atOptions.styles.halign==="inherit")cell.styles.halign=tecell.style.align;if(atOptions.styles.fillColor==="inherit")cell.styles.fillColor=tecell.style.bcolor;if(atOptions.styles.textColor==="inherit")cell.styles.textColor=tecell.style.color;if(atOptions.styles.fontStyle==="inherit")cell.styles.fontStyle=tecell.style.fstyle}}}if(typeof atOptions.drawHeaderCell!=="function"){atOptions.drawHeaderCell=function(cell,data){const colopt=teOptions.columns[data.column.dataKey];if((colopt.style.hasOwnProperty("hidden")!==true||colopt.style.hidden!==true)&&colopt.rowIndex>=0)return prepareAutoTableText(cell,data,colopt);else return false}}if(typeof atOptions.drawCell!=="function"){atOptions.drawCell=function(cell,data){const teCell=teOptions.teCells[data.row.index+":"+data.column.dataKey];const draw2canvas=typeof teCell!=="undefined"&&teCell.isCanvas;if(draw2canvas!==true){if(prepareAutoTableText(cell,data,teCell)){teOptions.doc.rect(cell.x,cell.y,cell.width,cell.height,cell.styles.fillStyle);if(typeof teCell!=="undefined"&&(typeof teCell.hasUserDefText==="undefined"||teCell.hasUserDefText!==true)&&typeof teCell.elements!=="undefined"&&teCell.elements.length){const hScale=cell.height/teCell.rect.height;if(hScale>teOptions.hScaleFactor)teOptions.hScaleFactor=hScale;teOptions.wScaleFactor=cell.width/teCell.rect.width;const ySave=cell.textPos.y;drawAutotableElements(cell,teCell.elements,teOptions);cell.textPos.y=ySave;drawAutotableText(cell,teCell.elements,teOptions)}else drawAutotableText(cell,{},teOptions)}}else{const container=teCell.elements[0];const imgId=$(container).attr("data-tableexport-canvas");const r=container.getBoundingClientRect();cell.width=r.width*teOptions.wScaleFactor;cell.height=r.height*teOptions.hScaleFactor;data.row.height=cell.height;jsPdfDrawImage(cell,container,imgId,teOptions)}return false}}teOptions.headerrows=[];$head_rows=collectHeadRows($(this));$($head_rows).each(function(){colKey=0;teOptions.headerrows[rowIndex]=[];ForEachVisibleCell(this,"th,td",rowIndex,$head_rows.length,function(cell,row,col){const obj=getCellStyles(cell);obj.title=parseString(cell,row,col);obj.key=colKey++;obj.rowIndex=rowIndex;teOptions.headerrows[rowIndex].push(obj)});rowIndex++});if(rowIndex>0){let lastrow=rowIndex-1;while(lastrow>=0){$.each(teOptions.headerrows[lastrow],function(){let obj=this;if(lastrow>0&&this.rect===null)obj=teOptions.headerrows[lastrow-1][this.key];if(obj!==null&&obj.rowIndex>=0&&(obj.style.hasOwnProperty("hidden")!==true||obj.style.hidden!==true))teOptions.columns.push(obj)});lastrow=teOptions.columns.length>0?-1:lastrow-1}}let rowCount=0;$rows=[];$rows=collectRows($(this));$($rows).each(function(){const rowData=[];colKey=0;ForEachVisibleCell(this,"td,th",rowIndex,$head_rows.length+$rows.length,function(cell,row,col){let obj;if(typeof teOptions.columns[colKey]==="undefined"){obj={title:"",key:colKey,style:{hidden:true}};teOptions.columns.push(obj)}rowData.push(parseString(cell,row,col));if(typeof cell!=="undefined"&&cell!==null){obj=getCellStyles(cell);obj.isCanvas=cell.hasAttribute("data-tableexport-canvas");obj.elements=obj.isCanvas?$(cell):$(cell).children();if(typeof $(cell).data("teUserDefText")!=="undefined")obj.hasUserDefText=true;teOptions.teCells[rowCount+":"+colKey++]=obj}else{obj=$.extend(true,{},teOptions.teCells[rowCount+":"+(colKey-1)]);obj.colspan=-1;teOptions.teCells[rowCount+":"+colKey++]=obj}});if(rowData.length){teOptions.rows.push(rowData);rowCount++}rowIndex++});if(typeof teOptions.onBeforeAutotable==="function")teOptions.onBeforeAutotable($(this),teOptions.columns,teOptions.rows,atOptions);jsPdfAutoTable(atOptions.tableExport.doc,teOptions.columns,teOptions.rows,atOptions);if(typeof teOptions.onAfterAutotable==="function")teOptions.onAfterAutotable($(this),atOptions);defaults.jspdf.autotable.startY=jsPdfAutoTableEndPosY()+atOptions.margin.top});jsPdfOutput(teOptions.doc,typeof teOptions.images!=="undefined"&&jQuery.isEmptyObject(teOptions.images)===false);if(typeof teOptions.headerrows!=="undefined")teOptions.headerrows.length=0;if(typeof teOptions.columns!=="undefined")teOptions.columns.length=0;if(typeof teOptions.rows!=="undefined")teOptions.rows.length=0;delete teOptions.doc;teOptions.doc=null})}}function collectHeadRows($table){const result=[];findTableElements($table,"thead").each(function(){result.push.apply(result,findTableElements($(this),defaults.theadSelector).toArray())});return result}function collectRows($table){const result=[];findTableElements($table,"tbody").each(function(){result.push.apply(result,findTableElements($(this),defaults.tbodySelector).toArray())});if(defaults.tfootSelector.length){findTableElements($table,"tfoot").each(function(){result.push.apply(result,findTableElements($(this),defaults.tfootSelector).toArray())})}return result}function findTableElements($parent,selector){const parentSelector=$parent[0].tagName;const parentLevel=$parent.parents(parentSelector).length;return $parent.find(selector).filter(function(){return parentLevel===$(this).closest(parentSelector).parents(parentSelector).length})}function GetColumnNames(table){const result=[];let maxCols=0;let row=0;let col=0;$(table).find("thead").first().find("th").each(function(index,el){const hasDataField=$(el).attr("data-field")!==undefined;if(typeof el.parentNode.rowIndex!=="undefined"&&row!==el.parentNode.rowIndex){row=el.parentNode.rowIndex;col=0;maxCols=0}const colSpan=getColspan(el);maxCols+=colSpan?colSpan:1;while(col0){if($.inArray(colIndex,defaults.ignoreColumn)!==-1||$.inArray(colIndex-rowLength,defaults.ignoreColumn)!==-1||colNames.length>colIndex&&typeof colNames[colIndex]!=="undefined"&&$.inArray(colNames[colIndex],defaults.ignoreColumn)!==-1)result=true}}else result=true;return result}function ForEachVisibleCell(tableRow,selector,rowIndex,rowCount,cellcallback){if(typeof cellcallback==="function"){let ignoreRow=false;if(typeof defaults.onIgnoreRow==="function")ignoreRow=defaults.onIgnoreRow($(tableRow),rowIndex);if(ignoreRow===false&&(defaults.ignoreRow.length===0||$.inArray(rowIndex,defaults.ignoreRow)===-1&&$.inArray(rowIndex-rowCount,defaults.ignoreRow)===-1)&&isVisible($(tableRow))){const $cells=findTableElements($(tableRow),selector);let cellsCount=$cells.length;let colCount=0;let colIndex=0;$cells.each(function(){const $cell=$(this);let colspan=getColspan(this);let rowspan=getRowspan(this);let c;$.each(ranges,function(){const range=this;if(rowIndex>range.s.r&&rowIndex<=range.e.r&&colCount>=range.s.c&&colCount<=range.e.c){for(c=0;c<=range.e.c-range.s.c;++c){cellsCount++;colIndex++;cellcallback(null,rowIndex,colCount++)}}});if(rowspan||colspan){rowspan=rowspan||1;colspan=colspan||1;ranges.push({s:{r:rowIndex,c:colCount},e:{r:rowIndex+rowspan-1,c:colCount+colspan-1}})}if(isColumnIgnored($cell,cellsCount,colIndex++)===false){cellcallback(this,rowIndex,colCount++)}if(colspan>1){for(c=0;c=range.s.r&&rowIndex<=range.e.r&&colCount>=range.s.c&&colCount<=range.e.c){for(let c=0;c<=range.e.c-range.s.c;++c){cellcallback(null,rowIndex,colCount++)}}})}}}function jsPdfDrawImage(cell,container,imgId,teOptions){if(typeof teOptions.images!=="undefined"){const image=teOptions.images[imgId];if(typeof image!=="undefined"){const r=container.getBoundingClientRect();const arCell=cell.width/cell.height;const arImg=r.width/r.height;let imgWidth=cell.width;let imgHeight=cell.height;const px2pt=.264583*72/25.4;let uy=0;if(arImg<=arCell){imgHeight=Math.min(cell.height,r.height);imgWidth=r.width*imgHeight/r.height}else if(arImg>arCell){imgWidth=Math.min(cell.width,r.width);imgHeight=r.height*imgWidth/r.width}imgWidth*=px2pt;imgHeight*=px2pt;if(imgHeight=0){let cellWidth=cell.width;let textPosX=cell.textPos.x;const i=data.table.columns.indexOf(data.column);for(let c=1;c1){if(cell.styles.halign==="right")textPosX=cell.textPos.x+cellWidth-cell.width;else if(cell.styles.halign==="center")textPosX=cell.textPos.x+(cellWidth-cell.width)/2}cell.width=cellWidth;cell.textPos.x=textPosX;if(typeof cellopt!=="undefined"&&cellopt.rowspan>1)cell.height=cell.height*cellopt.rowspan;if(cell.styles.valign==="middle"||cell.styles.valign==="bottom"){const splittedText=typeof cell.text==="string"?cell.text.split(/\r\n|\r|\n/g):cell.text;const lineCount=splittedText.length||1;if(lineCount>2)cell.textPos.y-=(2-FONT_ROW_RATIO)/2*data.row.styles.fontSize*(lineCount-2)/3}return true}else return false}function collectImages(cell,elements,teOptions){if(typeof cell!=="undefined"&&cell!==null){if(cell.hasAttribute("data-tableexport-canvas")){const imgId=(new Date).getTime();$(cell).attr("data-tableexport-canvas",imgId);teOptions.images[imgId]={url:'[data-tableexport-canvas="'+imgId+'"]',src:null}}else if(elements!=="undefined"&&elements!=null){elements.each(function(){if($(this).is("img")){const imgId=strHashCode(this.src);teOptions.images[imgId]={url:this.src,src:this.src}}collectImages(cell,$(this).children(),teOptions)})}}}function loadImages(teOptions,callback){let imageCount=0;let pendingCount=0;function done(){callback(imageCount)}function loadImage(image){if(image.url){if(!image.src){const $imgContainer=$(image.url);if($imgContainer.length){imageCount=++pendingCount;html2canvas($imgContainer[0]).then(function(canvas){image.src=canvas.toDataURL("image/png");if(!--pendingCount)done()})}}else{const img=new Image;imageCount=++pendingCount;img.crossOrigin="Anonymous";img.onerror=img.onload=function(){if(img.complete){if(img.src.indexOf("data:image/")===0){img.width=image.width||img.width||0;img.height=image.height||img.height||0}if(img.width+img.height){const canvas=document.createElement("canvas");const ctx=canvas.getContext("2d");canvas.width=img.width;canvas.height=img.height;ctx.drawImage(img,0,0);image.src=canvas.toDataURL("image/png")}}if(!--pendingCount)done()};img.src=image.url}}}if(typeof teOptions.images!=="undefined"){for(let i in teOptions.images)if(teOptions.images.hasOwnProperty(i))loadImage(teOptions.images[i])}return pendingCount||done()}function drawAutotableElements(cell,elements,teOptions){elements.each(function(){if($(this).is("div")){const bColor=rgb2array(getStyle(this,"background-color"),[255,255,255]);const lColor=rgb2array(getStyle(this,"border-top-color"),[0,0,0]);const lWidth=getPropertyUnitValue(this,"border-top-width",defaults.jspdf.unit);const r=this.getBoundingClientRect();const ux=this.offsetLeft*teOptions.wScaleFactor;const uy=this.offsetTop*teOptions.hScaleFactor;const uw=r.width*teOptions.wScaleFactor;const uh=r.height*teOptions.hScaleFactor;teOptions.doc.setDrawColor.apply(undefined,lColor);teOptions.doc.setFillColor.apply(undefined,bColor);teOptions.doc.setLineWidth(lWidth);teOptions.doc.rect(cell.x+ux,cell.y+uy,uw,uh,lWidth?"FD":"F")}else if($(this).is("img")){const imgId=strHashCode(this.src);jsPdfDrawImage(cell,this,imgId,teOptions)}drawAutotableElements(cell,$(this).children(),teOptions)})}function drawAutotableText(cell,texttags,teOptions){if(typeof teOptions.onAutotableText==="function"){teOptions.onAutotableText(teOptions.doc,cell,texttags)}else{let x=cell.textPos.x;let y=cell.textPos.y;const style={halign:cell.styles.halign,valign:cell.styles.valign};if(texttags.length){let tag=texttags[0];while(tag.previousSibling)tag=tag.previousSibling;let b=false,i=false;while(tag){let txt=tag.innerText||tag.textContent||"";const leadingSpace=txt.length&&txt[0]===" "?" ":"";const trailingSpace=txt.length>1&&txt[txt.length-1]===" "?" ":"";if(defaults.preserve.leadingWS!==true)txt=leadingSpace+trimLeft(txt);if(defaults.preserve.trailingWS!==true)txt=trimRight(txt)+trailingSpace;if($(tag).is("br")){x=cell.textPos.x;y+=teOptions.doc.internal.getFontSize()}if($(tag).is("b"))b=true;else if($(tag).is("i"))i=true;if(b||i)teOptions.doc.setFont("undefined ",b&&i?"bolditalic":b?"bold":"italic");let w=teOptions.doc.getStringUnitWidth(txt)*teOptions.doc.internal.getFontSize();if(w){if(cell.styles.overflow==="linebreak"&&x>cell.textPos.x&&x+w>cell.textPos.x+cell.width){const chars=".,!%*;:=-";if(chars.indexOf(txt.charAt(0))>=0){const s=txt.charAt(0);w=teOptions.doc.getStringUnitWidth(s)*teOptions.doc.internal.getFontSize();if(x+w<=cell.textPos.x+cell.width){jsPdfAutoTableText(s,x,y,style);txt=txt.substring(1,txt.length)}w=teOptions.doc.getStringUnitWidth(txt)*teOptions.doc.internal.getFontSize()}x=cell.textPos.x;y+=teOptions.doc.internal.getFontSize()}if(cell.styles.overflow!=="visible"){while(txt.length&&x+w>cell.textPos.x+cell.width){txt=txt.substring(0,txt.length-1);w=teOptions.doc.getStringUnitWidth(txt)*teOptions.doc.internal.getFontSize()}}jsPdfAutoTableText(txt,x,y,style);x+=w}if(b||i){if($(tag).is("b"))b=false;else if($(tag).is("i"))i=false;teOptions.doc.setFont("undefined ",!b&&!i?"normal":b?"bold":"italic")}tag=tag.nextSibling}cell.textPos.x=x;cell.textPos.y=y}else{jsPdfAutoTableText(cell.text,cell.textPos.x,cell.textPos.y,style)}}}function escapeRegExp(string){return string==null?"":string.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function replaceAll(string,find,replace){return string==null?"":string.toString().replace(new RegExp(escapeRegExp(find),"g"),replace)}function trimLeft(string){return string==null?"":string.toString().replace(/^\s+/,"")}function trimRight(string){return string==null?"":string.toString().replace(/\s+$/,"")}function parseDateUTC(s){if(defaults.date.html.length===0)return false;defaults.date.pattern.lastIndex=0;const match=defaults.date.pattern.exec(s);if(match==null)return false;const y=+match[defaults.date.match_y];if(y<0||y>8099)return false;const m=match[defaults.date.match_m]*1;const d=match[defaults.date.match_d]*1;if(!isFinite(d))return false;const o=new Date(y,m-1,d,0,0,0);if(o.getFullYear()===y&&o.getMonth()===m-1&&o.getDate()===d)return new Date(Date.UTC(y,m-1,d,0,0,0));else return false}function parseNumber(value){value=value||"0";if(""!==defaults.numbers.html.thousandsSeparator)value=replaceAll(value,defaults.numbers.html.thousandsSeparator,"");if("."!==defaults.numbers.html.decimalMark)value=replaceAll(value,defaults.numbers.html.decimalMark,".");return typeof value==="number"||jQuery.isNumeric(value)!==false?value:false}function parsePercent(value){if(value.indexOf("%")>-1){value=parseNumber(value.replace(/%/g,""));if(value!==false)value=value/100}else value=false;return value}function parseString(cell,rowIndex,colIndex,cellInfo){let result="";let cellType="text";if(cell!==null){const $cell=$(cell);let htmlData;$cell.removeData("teUserDefText");if($cell[0].hasAttribute("data-tableexport-canvas")){htmlData=""}else if($cell[0].hasAttribute("data-tableexport-value")){htmlData=$cell.attr("data-tableexport-value");htmlData=htmlData?htmlData+"":"";$cell.data("teUserDefText",1)}else{htmlData=$cell.html();if(typeof defaults.onCellHtmlData==="function"){htmlData=defaults.onCellHtmlData($cell,rowIndex,colIndex,htmlData);$cell.data("teUserDefText",1)}else if(htmlData!==""){const html=$.parseHTML("
"+htmlData+"
",null,false);let inputIndex=0;let selectIndex=0;htmlData="";$.each(html,function(){if($(this).is("input")){htmlData+=$cell.find("input").eq(inputIndex++).val()}else if($(this).is("select")){htmlData+=$cell.find("select option:selected").eq(selectIndex++).text()}else if($(this).is("br")){htmlData+="
"}else{if(typeof $(this).html()==="undefined")htmlData+=$(this).text();else if(jQuery().bootstrapTable===undefined||$(this).hasClass("fht-cell")===false&&$(this).hasClass("filterControl")===false&&$cell.parents(".detail-view").length===0)htmlData+=$(this).html();if($(this).is("a")){const href=$cell.find("a").attr("href")||"";if(typeof defaults.onCellHtmlHyperlink==="function"){result+=defaults.onCellHtmlHyperlink($cell,rowIndex,colIndex,href,htmlData)}else if(defaults.htmlHyperlink==="href"){result+=href}else{result+=htmlData}htmlData=""}}})}}if(htmlData&&htmlData!==""&&defaults.htmlContent===true){result=$.trim(htmlData)}else if(htmlData&&htmlData!==""){const cellFormat=$cell.attr("data-tableexport-cellformat");if(cellFormat!==""){let text=htmlData.replace(/\n/g,"\u2028").replace(/(<\s*br([^>]*)>)/gi,"⁠");const obj=$("
").html(text).contents();let number=false;text="";$.each(obj.text().split("\u2028"),function(i,v){if(i>0)text+=" ";if(defaults.preserve.leadingWS!==true)v=trimLeft(v);text+=defaults.preserve.trailingWS!==true?trimRight(v):v});$.each(text.split("⁠"),function(i,v){if(i>0)result+="\n";if(defaults.preserve.leadingWS!==true)v=trimLeft(v);if(defaults.preserve.trailingWS!==true)v=trimRight(v);result+=v.replace(/\u00AD/g,"")});result=result.replace(/\u00A0/g," ");if(defaults.type==="json"||defaults.type==="excel"&&defaults.mso.fileFormat==="xmlss"||defaults.numbers.output===false){number=parseNumber(result);if(number!==false){cellType="number";result=Number(number)}}else if(defaults.numbers.html.decimalMark!==defaults.numbers.output.decimalMark||defaults.numbers.html.thousandsSeparator!==defaults.numbers.output.thousandsSeparator){number=parseNumber(result);if(number!==false){const frac=(""+number.substr(number<0?1:0)).split(".");if(frac.length===1)frac[1]="";const mod=frac[0].length>3?frac[0].length%3:0;cellType="number";result=(number<0?"-":"")+(defaults.numbers.output.thousandsSeparator?(mod?frac[0].substr(0,mod)+defaults.numbers.output.thousandsSeparator:"")+frac[0].substr(mod).replace(/(\d{3})(?=\d)/g,"$1"+defaults.numbers.output.thousandsSeparator):frac[0])+(frac[1].length?defaults.numbers.output.decimalMark+frac[1]:"")}}}else result=htmlData}if(defaults.escape===true){result=escape(result)}if(typeof defaults.onCellData==="function"){result=defaults.onCellData($cell,rowIndex,colIndex,result,cellType);$cell.data("teUserDefText",1)}}if(cellInfo!==undefined)cellInfo.type=cellType;return result}function preventInjection(str){if(str.length>0&&defaults.preventInjection===true){const chars="=+-@";if(chars.indexOf(str.charAt(0))>=0)return"'"+str}return str}function hyphenate(a,b,c){return b+"-"+c.toLowerCase()}function rgb2array(rgb_string,default_result){const re=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/;const bits=re.exec(rgb_string);let result=default_result;if(bits)result=[parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3])];return result}function getCellStyles(cell){let a=getStyle(cell,"text-align");const fw=getStyle(cell,"font-weight");const fs=getStyle(cell,"font-style");let f="";if(a==="start")a=getStyle(cell,"direction")==="rtl"?"right":"left";if(fw>=700)f="bold";if(fs==="italic")f+=fs;if(f==="")f="normal";const result={style:{align:a,bcolor:rgb2array(getStyle(cell,"background-color"),[255,255,255]),color:rgb2array(getStyle(cell,"color"),[0,0,0]),fstyle:f},colspan:getColspan(cell),rowspan:getRowspan(cell)};if(cell!==null){const r=cell.getBoundingClientRect();result.rect={width:r.width,height:r.height}}return result}function getColspan(cell){let result=$(cell).attr("data-tableexport-colspan");if(typeof result==="undefined"&&$(cell).is("[colspan]"))result=$(cell).attr("colspan");return parseInt(result)||0}function getRowspan(cell){let result=$(cell).attr("data-tableexport-rowspan");if(typeof result==="undefined"&&$(cell).is("[rowspan]"))result=$(cell).attr("rowspan");return parseInt(result)||0}function getStyle(target,prop){try{if(window.getComputedStyle){prop=prop.replace(/([a-z])([A-Z])/,hyphenate);return window.getComputedStyle(target,null).getPropertyValue(prop)}if(target.currentStyle){return target.currentStyle[prop]}return target.style[prop]}catch(e){}return""}function getUnitValue(parent,value,unit){const baseline=100;const temp=document.createElement("div");temp.style.overflow="hidden";temp.style.visibility="hidden";parent.appendChild(temp);temp.style.width=baseline+unit;const factor=baseline/temp.offsetWidth;parent.removeChild(temp);return value*factor}function getPropertyUnitValue(target,prop,unit){const value=getStyle(target,prop);let numeric=value.match(/\d+/);if(numeric!==null){numeric=numeric[0];return getUnitValue(target.parentElement,numeric,unit)}return 0}function xlsxWorkbookToArrayBuffer(s){const buf=new ArrayBuffer(s.length);const view=new Uint8Array(buf);for(let i=0;i!==s.length;++i)view[i]=s.charCodeAt(i)&255;return buf}function xlsxTableToSheet(table){let ssfId;const ws={};const rows=table.getElementsByTagName("tr");const sheetRows=Math.min(1e7,rows.length);const range={s:{r:0,c:0},e:{r:0,c:0}};let merges=[],midx=0;let _R=0,R=0,_C=0,C=0,RS=0,CS=0;let elt;const ssfTable=XLSX.SSF.get_table();for(;_R0||CS>1)merges.push({s:{r:R,c:C},e:{r:R+(RS||1)-1,c:C+CS-1}});const cellInfo={type:""};let v=parseString(elt,_R,_C+CSOffset,cellInfo);let o={t:"s",v:v};let _t="";const cellFormat=$(elt).attr("data-tableexport-cellformat")||undefined;if(cellFormat!==""){ssfId=parseInt($(elt).attr("data-tableexport-xlsxformatid")||0);if(ssfId===0&&typeof defaults.mso.xlsx.formatId.numbers==="function")ssfId=defaults.mso.xlsx.formatId.numbers($(elt),_R,_C+CSOffset);if(ssfId===0&&typeof defaults.mso.xlsx.formatId.date==="function")ssfId=defaults.mso.xlsx.formatId.date($(elt),_R,_C+CSOffset);if(ssfId===49||ssfId==="@")_t="s";else if(cellInfo.type==="number"||ssfId>0&&ssfId<14||ssfId>36&&ssfId<41||ssfId===48)_t="n";else if(cellInfo.type==="date"||ssfId>13&&ssfId<37||ssfId>44&&ssfId<48||ssfId===56)_t="d"}else _t="s";if(v!=null){let vd;if(v.length===0){o.t="z"}else if(v.trim().length===0){}else if(_t==="s"){}else if(cellInfo.type==="function"){o={f:v}}else if(v==="TRUE"){o={t:"b",v:true}}else if(v==="FALSE"){o={t:"b",v:false}}else if(_t==="n"||isFinite(xlsxToNumber(v,defaults.numbers.output))){const vn=xlsxToNumber(v,defaults.numbers.output);if(ssfId===0&&typeof defaults.mso.xlsx.formatId.numbers!=="function"){ssfId=defaults.mso.xlsx.formatId.numbers}if(isFinite(vn)||isFinite(v))o={t:"n",v:isFinite(vn)?vn:v,z:typeof ssfId==="string"?ssfId:ssfId in ssfTable?ssfTable[ssfId]:ssfId===defaults.mso.xlsx.formatId.currency?defaults.mso.xlsx.format.currency:"0.00"}}else if((vd=parseDateUTC(v))!==false||_t==="d"){if(ssfId===0&&typeof defaults.mso.xlsx.formatId.date!=="function"){ssfId=defaults.mso.xlsx.formatId.date}o={t:"d",v:vd!==false?vd:v,z:typeof ssfId==="string"?ssfId:ssfId in ssfTable?ssfTable[ssfId]:"m/d/yy"}}const $aTag=$(elt).find("a");if($aTag&&$aTag.length){const href=$aTag[0].hasAttribute("href")?$aTag.attr("href"):"";const content=defaults.htmlHyperlink!=="href"||href===""?v:"";const hyperlink=href!==""?'=HYPERLINK("'+href+(content.length?'","'+content:"")+'")':"";if(hyperlink!==""){if(typeof defaults.mso.xlsx.onHyperlink==="function"){v=defaults.mso.xlsx.onHyperlink($(elt),_R,_C,href,content,hyperlink);if(v.indexOf("=HYPERLINK")!==0){o={t:"s",v:v}}else{o={f:v}}}else{o={f:hyperlink}}}}}ws[xlsxEncodeCell({c:C,r:R})]=o;if(range.e.c=sheetRows){ws["!fullref"]=xlsxEncodeRange((range.e.r=rows.length-_R+R-1,range))}return ws}function xlsxEncodeRow(row){return""+(row+1)}function xlsxEncodeCol(col){let s="";for(++col;col;col=Math.floor((col-1)/26)){s=String.fromCharCode((col-1)%26+65)+s}return s}function xlsxEncodeCell(cell){return xlsxEncodeCol(cell.c)+xlsxEncodeRow(cell.r)}function xlsxEncodeRange(cs,ce){if(typeof ce==="undefined"||typeof ce==="number"){return xlsxEncodeRange(cs.s,cs.e)}if(typeof cs!=="string"){cs=xlsxEncodeCell(cs)}if(typeof ce!=="string"){ce=xlsxEncodeCell(ce)}return cs===ce?cs:cs+":"+ce}function xlsxToNumber(s,numbersFormat){let v=Number(s);if(isFinite(v))return v;let wt=1;let ss=s;if(""!==numbersFormat.thousandsSeparator)ss=ss.replace(new RegExp("([\\d])"+numbersFormat.thousandsSeparator+"([\\d])","g"),"$1$2");if("."!==numbersFormat.decimalMark)ss=ss.replace(new RegExp("([\\d])"+numbersFormat.decimalMark+"([\\d])","g"),"$1.$2");ss=ss.replace(/[$]/g,"").replace(/[%]/g,function(){wt*=100;return""});if(isFinite(v=Number(ss)))return v/wt;ss=ss.replace(/[(](.*)[)]/,function($$,$1){wt=-wt;return $1});if(isFinite(v=Number(ss)))return v/wt;return v}function strHashCode(str){let hash=0,i,chr,len;if(str.length===0)return hash;for(i=0,len=str.length;i0||!!ua.match(/Trident.*rv\:11\./))){const frame=document.createElement("iframe");if(frame){document.body.appendChild(frame);frame.setAttribute("style","display:none");frame.contentDocument.open("txt/plain","replace");frame.contentDocument.write(data);frame.contentDocument.close();frame.contentWindow.focus();const extension=filename.substr(filename.lastIndexOf(".")+1);switch(extension){case"doc":case"json":case"png":case"pdf":case"xls":case"xlsx":filename+=".txt";break}frame.contentDocument.execCommand("SaveAs",true,filename);document.body.removeChild(frame)}}else{const DownloadLink=document.createElement("a");if(DownloadLink){let blobUrl=null;DownloadLink.style.display="none";if(filename!==false)DownloadLink.download=filename;else DownloadLink.target="_blank";if(typeof data==="object"){window.URL=window.URL||window.webkitURL;const binaryData=[];binaryData.push(data);blobUrl=window.URL.createObjectURL(new Blob(binaryData,{type:header}));DownloadLink.href=blobUrl}else if(header.toLowerCase().indexOf("base64,")>=0){DownloadLink.href=header+base64encode(data)}else{DownloadLink.href=header+encodeURIComponent(data)}document.body.appendChild(DownloadLink);if(document.createEvent){if(DownloadEvt===null)DownloadEvt=document.createEvent("MouseEvents");DownloadEvt.initEvent("click",true,false);DownloadLink.dispatchEvent(DownloadEvt)}else if(document.createEventObject)DownloadLink.fireEvent("onclick");else if(typeof DownloadLink.onclick==="function")DownloadLink.onclick();setTimeout(function(){if(blobUrl)window.URL.revokeObjectURL(blobUrl);document.body.removeChild(DownloadLink);if(typeof defaults.onAfterSaveToFile==="function")defaults.onAfterSaveToFile(data,filename)},100)}}}function utf8Encode(text){if(typeof text==="string"){text=text.replace(/\x0d\x0a/g,"\n");let utfText="";for(let n=0;n127&&c<2048){utfText+=String.fromCharCode(c>>6|192);utfText+=String.fromCharCode(c&63|128)}else{utfText+=String.fromCharCode(c>>12|224);utfText+=String.fromCharCode(c>>6&63|128);utfText+=String.fromCharCode(c&63|128)}}return utfText}return text}function base64encode(input){let chr1,chr2,chr3,enc1,enc2,enc3,enc4;const keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let output="";let i=0;input=utf8Encode(input);while(i>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64}else if(isNaN(chr3)){enc4=64}output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4)}return output}var jsPdfDoc,jsPdfCursor,jsPdfSettings,jsPdfPageCount,jsPdfTable;function jsPdfAutoTable(doc,headers,data,options){jsPdfValidateInput(headers,data,options);jsPdfDoc=doc;jsPdfSettings=jsPdfInitOptions(options||{});jsPdfPageCount=1;jsPdfCursor={y:jsPdfSettings.startY===false?jsPdfSettings.margin.top:jsPdfSettings.startY};const userStyles={textColor:30,fontSize:jsPdfDoc.internal.getFontSize(),fontStyle:jsPdfDoc.internal.getFont().fontStyle,fontName:jsPdfDoc.internal.getFont().fontName};jsPdfCreateModels(headers,data);jsPdfCalculateWidths();const firstRowHeight=jsPdfTable.rows[0]&&jsPdfSettings.pageBreak==="auto"?jsPdfTable.rows[0].height:0;let minTableBottomPos=jsPdfSettings.startY+jsPdfSettings.margin.bottom+jsPdfTable.headerRow.height+firstRowHeight;if(jsPdfSettings.pageBreak==="avoid"){minTableBottomPos+=jsPdfTable.height}if(jsPdfSettings.pageBreak==="always"&&jsPdfSettings.startY!==false||jsPdfSettings.startY!==false&&minTableBottomPos>jsPdfDoc.internal.pageSize.height){jsPdfDoc.addPage();jsPdfCursor.y=jsPdfSettings.margin.top}jsPdfApplyStyles(userStyles);jsPdfSettings.beforePageContent(jsPdfHooksData());if(jsPdfSettings.drawHeaderRow(jsPdfTable.headerRow,jsPdfHooksData({row:jsPdfTable.headerRow}))!==false){jsPdfPrintRow(jsPdfTable.headerRow,jsPdfSettings.drawHeaderCell)}jsPdfApplyStyles(userStyles);jsPdfPrintRows();jsPdfSettings.afterPageContent(jsPdfHooksData());jsPdfApplyStyles(userStyles);return jsPdfDoc}function jsPdfAutoTableEndPosY(){if(typeof jsPdfCursor==="undefined"||typeof jsPdfCursor.y==="undefined"){return 0}return jsPdfCursor.y}function jsPdfAutoTableText(text,x,y,styles){if(typeof x!=="number"||typeof y!=="number"){console.error("The x and y parameters are required. Missing for the text: ",text)}const fontSize=jsPdfDoc.internal.getFontSize()/jsPdfDoc.internal.scaleFactor;const lineHeightProportion=FONT_ROW_RATIO;const splitRegex=/\r\n|\r|\n/g;let splittedText=null;let lineCount=1;if(styles.valign==="middle"||styles.valign==="bottom"||styles.halign==="center"||styles.halign==="right"){splittedText=typeof text==="string"?text.split(splitRegex):text;lineCount=splittedText.length||1}y+=fontSize*(2-lineHeightProportion);if(styles.valign==="middle")y-=lineCount/2*fontSize;else if(styles.valign==="bottom")y-=lineCount*fontSize;if(styles.halign==="center"||styles.halign==="right"){let alignSize=fontSize;if(styles.halign==="center")alignSize*=.5;if(splittedText&&lineCount>=1){for(let iLine=0;iLinecolumn.contentWidth){column.contentWidth=cellWidth}});column.width=column.contentWidth;tableContentWidth+=column.contentWidth});jsPdfTable.contentWidth=tableContentWidth;const maxTableWidth=jsPdfDoc.internal.pageSize.width-jsPdfSettings.margin.left-jsPdfSettings.margin.right;let preferredTableWidth=maxTableWidth;if(typeof jsPdfSettings.tableWidth==="number"){preferredTableWidth=jsPdfSettings.tableWidth}else if(jsPdfSettings.tableWidth==="wrap"){preferredTableWidth=jsPdfTable.contentWidth}jsPdfTable.width=preferredTableWidthjsPdfTable.width){column.width=column.contentWidth}else{dynamicColumns.push(column);dynamicColumnsContentWidth+=column.contentWidth;column.width=0}}staticWidth+=column.width});jsPdfDistributeWidth(dynamicColumns,staticWidth,dynamicColumnsContentWidth,fairWidth);jsPdfTable.height=0;const all=jsPdfTable.rows.concat(jsPdfTable.headerRow);all.forEach(function(row,i){let lineBreakCount=0;let cursorX=jsPdfTable.x;jsPdfTable.columns.forEach(function(col){const cell=row.cells[col.dataKey];col.x=cursorX;jsPdfApplyStyles(cell.styles);const textSpace=col.width-cell.styles.cellPadding*2;if(cell.styles.overflow==="linebreak"){cell.text=jsPdfDoc.splitTextToSize(cell.text,textSpace+1,{fontSize:cell.styles.fontSize})}else if(cell.styles.overflow==="ellipsize"){cell.text=jsPdfEllipsize(cell.text,textSpace,cell.styles)}else if(cell.styles.overflow==="visible"){}else if(cell.styles.overflow==="hidden"){cell.text=jsPdfEllipsize(cell.text,textSpace,cell.styles,"")}else if(typeof cell.styles.overflow==="function"){cell.text=cell.styles.overflow(cell.text,textSpace)}else{console.error("Unrecognized overflow type: "+cell.styles.overflow)}const count=Array.isArray(cell.text)?cell.text.length-1:0;if(count>lineBreakCount){lineBreakCount=count}cursorX+=col.width});row.heightStyle=row.styles.rowHeight;row.height=row.heightStyle+lineBreakCount*row.styles.fontSize*FONT_ROW_RATIO+(2-FONT_ROW_RATIO)/2*row.styles.fontSize;jsPdfTable.height+=row.height})}function jsPdfDistributeWidth(dynamicColumns,staticWidth,dynamicColumnsContentWidth,fairWidth){const extraWidth=jsPdfTable.width-staticWidth-dynamicColumnsContentWidth;for(let i=0;i=jsPdfDoc.internal.pageSize.height}function jsPdfPrintRow(row,hookHandler){for(let i=0;i=jsPdfGetStringWidth(text,styles)){return text}while(width .th-inner::before margin-top:160px; } } -@media screen and (max-width: 912px) and (min-width: 512px){ +@media screen and (max-width: 771px) and (min-width: 512px){ .sidebar-menu { - margin-top:100px + margin-top:160px } } -@media screen and (max-width: 1268px) and (min-width: 912px){ +@media screen and (max-width: 1098px) and (min-width: 772px){ .sidebar-menu { - margin-top:50px + margin-top:98px } } From c69958d95da7847d80ce83d810e1835fde7d86c8 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 3 Oct 2023 12:32:24 -0700 Subject: [PATCH 04/45] removed dead space --- app/Http/Controllers/Components/ComponentCheckinController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Controllers/Components/ComponentCheckinController.php b/app/Http/Controllers/Components/ComponentCheckinController.php index 65251b6c4c..49199aa6d2 100644 --- a/app/Http/Controllers/Components/ComponentCheckinController.php +++ b/app/Http/Controllers/Components/ComponentCheckinController.php @@ -30,7 +30,6 @@ class ComponentCheckinController extends Controller // This could probably be done more cleanly but I am very tired. - @snipe if ($component_assets = DB::table('components_assets')->find($component_asset_id)) { - if (is_null($component = Component::find($component_assets->component_id))) { return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found')); } From 37c1d6fc04614d56cedf8b3a7c0b53321709a24a Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 3 Oct 2023 12:45:13 -0700 Subject: [PATCH 05/45] removed unnecessary changes --- public/css/build/app.css | 8 ++++---- public/css/build/overrides.css | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/css/build/app.css b/public/css/build/app.css index b82e27befc..c8fc025597 100644 --- a/public/css/build/app.css +++ b/public/css/build/app.css @@ -964,14 +964,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 912px) and (min-width: 512px) { +@media screen and (max-width: 771px) and (min-width: 512px) { .sidebar-menu { - margin-top: 100px; + margin-top: 160px; } } -@media screen and (max-width: 1268px) and (min-width: 912px) { +@media screen and (max-width: 1098px) and (min-width: 772px) { .sidebar-menu { - margin-top: 50px; + margin-top: 98px; } } .ellipsis { diff --git a/public/css/build/overrides.css b/public/css/build/overrides.css index 4020194f84..5111695ac7 100644 --- a/public/css/build/overrides.css +++ b/public/css/build/overrides.css @@ -597,14 +597,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 912px) and (min-width: 512px) { +@media screen and (max-width: 771px) and (min-width: 512px) { .sidebar-menu { - margin-top: 100px; + margin-top: 160px; } } -@media screen and (max-width: 1268px) and (min-width: 912px) { +@media screen and (max-width: 1098px) and (min-width: 772px) { .sidebar-menu { - margin-top: 50px; + margin-top: 98px; } } .ellipsis { From 99d409c0a5a98c449f8b285ec2685ebdd9026a7c Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 14:32:28 -0500 Subject: [PATCH 06/45] transaction --- ...add_column_for_explicit_date_to_assets.php | 54 +++++++++++-------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index ae103ba153..ce1528defb 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -4,6 +4,7 @@ use App\Models\Asset; use Carbon\CarbonImmutable; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Log; @@ -22,37 +23,44 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration // Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value - Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) { - foreach ($assetsWithEolDates as $asset) { - if ($asset->asset_eol_date && $asset->purchase_date) { - try { - $months = CarbonImmutable::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date); - } catch (\Exception $e) { - Log::info('asset_eol_date invalid for asset '.$asset->id); - } - if ($asset->model->eol) { - if ($months != $asset->model->eol) { + $assetsToUpdateEolExplicit = []; + DB::transaction(function() { + Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) { + foreach ($assetsWithEolDates as $asset) { + if ($asset->asset_eol_date && $asset->purchase_date) { + try { + $months = CarbonImmutable::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date); + } catch (\Exception $e) { + Log::info('asset_eol_date invalid for asset ' . $asset->id); + } + if ($asset->model->eol) { + if ($months != $asset->model->eol) { + $assetToUpdateEolExplicit = $asset->id; + //$asset->update(['eol_explicit' => true]); + } + } else { $asset->update(['eol_explicit' => true]); } - } else { - $asset->update(['eol_explicit' => true]); } } - } + }); }); + //Asset::whereIn('id', $assetToUpdateEolExplicit)->update(['eol_explicit' => true]); - // Update the asset_eol_date column with the calculated value if it doesn't exist - Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) { - foreach ($assets as $asset) { - if ($asset->model->eol && $asset->purchase_date) { - try { - $asset_eol_date = CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); - $asset->update(['asset_eol_date' => $asset_eol_date]); - } catch (\Exception $e) { - Log::info('purchase date invalid for asset '.$asset->id); + // Update the asset_eol_date column with the calculated value if it doesn't exist + DB::transaction(function () { + Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) { + foreach ($assets as $asset) { + if ($asset->model->eol && $asset->purchase_date) { + try { + $asset_eol_date = CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); + $asset->update(['asset_eol_date' => $asset_eol_date]); + } catch (\Exception $e) { + Log::info('purchase date invalid for asset ' . $asset->id); + } } } - } + }); }); } From cb10c7af2798b82f8aec4b05ae42137785d89829 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 14:33:35 -0500 Subject: [PATCH 07/45] oops --- ...ormalized_eol_and_add_column_for_explicit_date_to_assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index ce1528defb..c1eee5ea1b 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -36,7 +36,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration if ($asset->model->eol) { if ($months != $asset->model->eol) { $assetToUpdateEolExplicit = $asset->id; - //$asset->update(['eol_explicit' => true]); + $asset->update(['eol_explicit' => true]); } } else { $asset->update(['eol_explicit' => true]); From ad6b5020059dc77c520cab6be4b0c74e60f68398 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 14:37:18 -0500 Subject: [PATCH 08/45] comments --- ...malized_eol_and_add_column_for_explicit_date_to_assets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index c1eee5ea1b..306b551f7b 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -23,7 +23,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration // Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value - $assetsToUpdateEolExplicit = []; + //$assetsToUpdateEolExplicit = []; DB::transaction(function() { Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) { foreach ($assetsWithEolDates as $asset) { @@ -35,7 +35,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } if ($asset->model->eol) { if ($months != $asset->model->eol) { - $assetToUpdateEolExplicit = $asset->id; + //$assetToUpdateEolExplicit = $asset->id; $asset->update(['eol_explicit' => true]); } } else { From 101bd9c4049fc6d2fe7ef583224c40449dc9a63d Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 14:47:14 -0500 Subject: [PATCH 09/45] kill transaction, try update array --- ...eol_and_add_column_for_explicit_date_to_assets.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 306b551f7b..7b477c9a3b 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -23,8 +23,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration // Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value - //$assetsToUpdateEolExplicit = []; - DB::transaction(function() { + $assetsToUpdateEolExplicit = []; Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) { foreach ($assetsWithEolDates as $asset) { if ($asset->asset_eol_date && $asset->purchase_date) { @@ -35,20 +34,19 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } if ($asset->model->eol) { if ($months != $asset->model->eol) { - //$assetToUpdateEolExplicit = $asset->id; + $assetsToUpdateEolExplicit = $asset->id; $asset->update(['eol_explicit' => true]); } } else { + $assetsToUpdateEolExplicit = $asset->id; $asset->update(['eol_explicit' => true]); } } } }); - }); - //Asset::whereIn('id', $assetToUpdateEolExplicit)->update(['eol_explicit' => true]); + Asset::whereIn('id', $assetsToUpdateEolExplicit)->update(['eol_explicit' => true]); // Update the asset_eol_date column with the calculated value if it doesn't exist - DB::transaction(function () { Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) { foreach ($assets as $asset) { if ($asset->model->eol && $asset->purchase_date) { @@ -61,7 +59,6 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } } }); - }); } From 6cda9056b8854d7b877c6cb90c361018bc7d51bd Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 14:56:18 -0500 Subject: [PATCH 10/45] oops --- ...malized_eol_and_add_column_for_explicit_date_to_assets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 7b477c9a3b..756d48f849 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -35,11 +35,11 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration if ($asset->model->eol) { if ($months != $asset->model->eol) { $assetsToUpdateEolExplicit = $asset->id; - $asset->update(['eol_explicit' => true]); + //$asset->update(['eol_explicit' => true]); } } else { $assetsToUpdateEolExplicit = $asset->id; - $asset->update(['eol_explicit' => true]); + //$asset->update(['eol_explicit' => true]); } } } From 46af40bd027168a1ab521e58c6cc49d433c28884 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 15:20:16 -0500 Subject: [PATCH 11/45] ????? --- ...add_column_for_explicit_date_to_assets.php | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 756d48f849..15f54f4e05 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -23,7 +23,6 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration // Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value - $assetsToUpdateEolExplicit = []; Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) { foreach ($assetsWithEolDates as $asset) { if ($asset->asset_eol_date && $asset->purchase_date) { @@ -34,31 +33,30 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } if ($asset->model->eol) { if ($months != $asset->model->eol) { - $assetsToUpdateEolExplicit = $asset->id; - //$asset->update(['eol_explicit' => true]); + $asset->update(['eol_explicit' => true]); } } else { - $assetsToUpdateEolExplicit = $asset->id; - //$asset->update(['eol_explicit' => true]); + $asset->update(['eol_explicit' => true]); } } } }); - Asset::whereIn('id', $assetsToUpdateEolExplicit)->update(['eol_explicit' => true]); // Update the asset_eol_date column with the calculated value if it doesn't exist - Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) { - foreach ($assets as $asset) { - if ($asset->model->eol && $asset->purchase_date) { - try { - $asset_eol_date = CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); - $asset->update(['asset_eol_date' => $asset_eol_date]); - } catch (\Exception $e) { - Log::info('purchase date invalid for asset ' . $asset->id); - } - } - } - }); + // Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) { + // foreach ($assets as $asset) { + // if ($asset->model->eol && $asset->purchase_date) { + // try { + // $asset_eol_date = CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); + // $asset->update(['asset_eol_date' => $asset_eol_date]); + // } catch (\Exception $e) { + // Log::info('purchase date invalid for asset ' . $asset->id); + // } + // } + // } + // }); + Asset::whereNull('asset_eol_date')->whereNotNull('purchase_date')->has('model') + ->update(['asset_eol_date' => DB::raw('LEFT JOIN models ON assets.model_id = models.id) DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')]); } From 8c9961aba8ab27c796b0391f5c4b8659082032f3 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 15:40:42 -0500 Subject: [PATCH 12/45] refactor --- ...eol_and_add_column_for_explicit_date_to_assets.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 15f54f4e05..86f1844fce 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -55,8 +55,15 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration // } // } // }); - Asset::whereNull('asset_eol_date')->whereNotNull('purchase_date')->has('model') - ->update(['asset_eol_date' => DB::raw('LEFT JOIN models ON assets.model_id = models.id) DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')]); + // Asset::whereNull('asset_eol_date')->whereNotNull('purchase_date')->has('model') + // ->update(['asset_eol_date' => DB::raw('LEFT JOIN models ON assets.model_id = models.id) DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')]); + DB::table('assets') + ->whereNull('asset_eol_date') + ->whereNotNull('purchase_date') + ->join('models', 'assets.model_id', '=', 'models.id') + ->update([ + 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL models.eol MONTH)') + ]); } From cc82e86eeb761437ce9c6cff575274c0950ab4d3 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 16:54:56 -0500 Subject: [PATCH 13/45] one more check --- ...normalized_eol_and_add_column_for_explicit_date_to_assets.php | 1 + 1 file changed, 1 insertion(+) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 86f1844fce..a84688f773 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -60,6 +60,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration DB::table('assets') ->whereNull('asset_eol_date') ->whereNotNull('purchase_date') + ->whereNotNull('model_id') ->join('models', 'assets.model_id', '=', 'models.id') ->update([ 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL models.eol MONTH)') From c07c0c0f74bbc33c391a2b014f635e3387c7a121 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 16:55:35 -0500 Subject: [PATCH 14/45] cleanup --- ...and_add_column_for_explicit_date_to_assets.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index a84688f773..8bceca535e 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -42,21 +42,6 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } }); - // Update the asset_eol_date column with the calculated value if it doesn't exist - // Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) { - // foreach ($assets as $asset) { - // if ($asset->model->eol && $asset->purchase_date) { - // try { - // $asset_eol_date = CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); - // $asset->update(['asset_eol_date' => $asset_eol_date]); - // } catch (\Exception $e) { - // Log::info('purchase date invalid for asset ' . $asset->id); - // } - // } - // } - // }); - // Asset::whereNull('asset_eol_date')->whereNotNull('purchase_date')->has('model') - // ->update(['asset_eol_date' => DB::raw('LEFT JOIN models ON assets.model_id = models.id) DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')]); DB::table('assets') ->whereNull('asset_eol_date') ->whereNotNull('purchase_date') From 8d921359ca3a043d9a693a22c8e5fcc1de027f7c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 5 Oct 2023 14:12:36 +0100 Subject: [PATCH 15/45] [Snyk] Security upgrade css-loader from 4.3.0 to 5.0.0 #13685 Signed-off-by: snipe --- package-lock.json | 221 ++++++++++------------------------------------ package.json | 2 +- 2 files changed, 48 insertions(+), 175 deletions(-) diff --git a/package-lock.json b/package-lock.json index d9ef739273..b6254682a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3546,11 +3546,6 @@ "tslib": "^2.0.3" } }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" - }, "caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -4175,24 +4170,27 @@ } }, "css-loader": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-4.3.0.tgz", - "integrity": "sha512-rdezjCjScIrsL8BSYszgT4s476IcNKt6yX69t0pHjJVnPUTDpn4WfIpDQTN3wCJvUvfsz/mFjuGOekf3PY3NUg==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.7.tgz", + "integrity": "sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg==", "requires": { - "camelcase": "^6.0.0", - "cssesc": "^3.0.0", - "icss-utils": "^4.1.1", + "icss-utils": "^5.1.0", "loader-utils": "^2.0.0", - "postcss": "^7.0.32", - "postcss-modules-extract-imports": "^2.0.0", - "postcss-modules-local-by-default": "^3.0.3", - "postcss-modules-scope": "^2.2.0", - "postcss-modules-values": "^3.0.0", + "postcss": "^8.2.15", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.0", + "postcss-modules-scope": "^3.0.0", + "postcss-modules-values": "^4.0.0", "postcss-value-parser": "^4.1.0", - "schema-utils": "^2.7.1", - "semver": "^7.3.2" + "schema-utils": "^3.0.0", + "semver": "^7.3.5" }, "dependencies": { + "@types/json-schema": { + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", + "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==" + }, "loader-utils": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", @@ -4203,32 +4201,23 @@ "json5": "^2.1.2" } }, - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" } } }, @@ -15328,33 +15317,9 @@ } }, "icss-utils": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz", - "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", - "requires": { - "postcss": "^7.0.14" - }, - "dependencies": { - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } - } + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==" }, "ieee754": { "version": "1.2.1", @@ -16836,8 +16801,7 @@ "nanoid": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "dev": true + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" }, "needle": { "version": "3.2.0", @@ -17479,7 +17443,6 @@ "version": "8.4.5", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==", - "dev": true, "requires": { "nanoid": "^3.1.30", "picocolors": "^1.0.0", @@ -17757,124 +17720,34 @@ } }, "postcss-modules-extract-imports": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", - "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", - "requires": { - "postcss": "^7.0.5" - }, - "dependencies": { - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", + "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==" }, "postcss-modules-local-by-default": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz", - "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.3.tgz", + "integrity": "sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==", "requires": { - "icss-utils": "^4.1.1", - "postcss": "^7.0.32", + "icss-utils": "^5.0.0", "postcss-selector-parser": "^6.0.2", "postcss-value-parser": "^4.1.0" - }, - "dependencies": { - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } } }, "postcss-modules-scope": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz", - "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", + "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", "requires": { - "postcss": "^7.0.6", - "postcss-selector-parser": "^6.0.0" - }, - "dependencies": { - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } + "postcss-selector-parser": "^6.0.4" } }, "postcss-modules-values": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", - "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", "requires": { - "icss-utils": "^4.0.0", - "postcss": "^7.0.6" - }, - "dependencies": { - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } + "icss-utils": "^5.0.0" } }, "postcss-normalize-charset": { @@ -18604,6 +18477,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, "requires": { "@types/json-schema": "^7.0.5", "ajv": "^6.12.4", @@ -18875,8 +18749,7 @@ "source-map-js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz", - "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==", - "dev": true + "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==" }, "source-map-support": { "version": "0.5.21", diff --git a/package.json b/package.json index dc1ed3f8d5..2e220c597a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "bootstrap-table": "1.22.1", "chart.js": "^2.9.4", "clipboard": "^2.0.11", - "css-loader": "^4.0.0", + "css-loader": "^5.0.0", "ekko-lightbox": "^5.1.1", "imagemin": "^8.0.1", "jquery-form-validator": "^2.3.79", From eea2eabaeef16fc8f3a1d61b19c06e9fc8ed942a Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 6 Oct 2023 19:45:23 +0100 Subject: [PATCH 16/45] Escaping asset history old/new values Signed-off-by: snipe --- .../Transformers/ActionlogsTransformer.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 0a81f864bf..1cc105e6a9 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -178,24 +178,26 @@ class ActionlogsTransformer if(array_key_exists('rtd_location_id',$clean_meta)) { - $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". $location->find($clean_meta['rtd_location_id']['old'])->name : trans('general.unassigned'); - $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". $location->find($clean_meta['rtd_location_id']['new'])->name : trans('general.unassigned'); + $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". e($location->find($clean_meta['rtd_location_id']['old'])->name) : trans('general.unassigned'); + $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". e($location->find($clean_meta['rtd_location_id']['new'])->name) : trans('general.unassigned'); $clean_meta['Default Location'] = $clean_meta['rtd_location_id']; unset($clean_meta['rtd_location_id']); } - if(array_key_exists('location_id', $clean_meta)) { - $clean_meta['location_id']['old'] = $clean_meta['location_id']['old'] ? "[id: ".$clean_meta['location_id']['old']."] ".$location->find($clean_meta['location_id']['old'])->name : trans('general.unassigned'); - $clean_meta['location_id']['new'] = $clean_meta['location_id']['new'] ? "[id: ".$clean_meta['location_id']['new']."] ".$location->find($clean_meta['location_id']['new'])->name : trans('general.unassigned'); + + if (array_key_exists('location_id', $clean_meta)) { + $clean_meta['location_id']['old'] = $clean_meta['location_id']['old'] ? "[id: ".$clean_meta['location_id']['old']."] ".e($location->find($clean_meta['location_id']['old'])->name): trans('general.unassigned'); + $clean_meta['location_id']['new'] = $clean_meta['location_id']['new'] ? "[id: ".$clean_meta['location_id']['new']."] ".e($location->find($clean_meta['location_id']['new'])->name) : trans('general.unassigned'); $clean_meta['Current Location'] = $clean_meta['location_id']; unset($clean_meta['location_id']); } + if(array_key_exists('model_id', $clean_meta)) { $oldModel = $model->find($clean_meta['model_id']['old']); - $oldModelName = $oldModel->name ?? trans('admin/models/message.deleted'); + $oldModelName = $oldModel ? e($oldModel->name) : trans('admin/models/message.deleted'); $newModel = $model->find($clean_meta['model_id']['new']); - $newModelName = $newModel->name ?? trans('admin/models/message.deleted'); + $newModelName = $newModel ? e($newModel->name) : trans('admin/models/message.deleted'); $clean_meta['model_id']['old'] = "[id: ".$clean_meta['model_id']['old']."] ".$oldModelName; $clean_meta['model_id']['new'] = "[id: ".$clean_meta['model_id']['new']."] ".$newModelName; /** model is required at asset creation */ @@ -206,10 +208,10 @@ class ActionlogsTransformer if(array_key_exists('company_id', $clean_meta)) { $oldCompany = $company->find($clean_meta['company_id']['old']); - $oldCompanyName = $oldCompany->name ?? trans('admin/companies/message.deleted'); + $oldCompanyName = $oldCompany ? e($oldCompany->name) : trans('admin/company/message.deleted'); $newCompany = $company->find($clean_meta['company_id']['new']); - $newCompanyName = $newCompany->name ?? trans('admin/companies/message.deleted'); + $newCompanyName = $newCompany ? e($newCompany->name) : trans('admin/company/message.deleted'); $clean_meta['company_id']['old'] = $clean_meta['company_id']['old'] ? "[id: ".$clean_meta['company_id']['old']."] ". $oldCompanyName : trans('general.unassigned'); $clean_meta['company_id']['new'] = $clean_meta['company_id']['new'] ? "[id: ".$clean_meta['company_id']['new']."] ". $newCompanyName : trans('general.unassigned'); @@ -219,10 +221,10 @@ class ActionlogsTransformer if(array_key_exists('supplier_id', $clean_meta)) { $oldSupplier = $supplier->find($clean_meta['supplier_id']['old']); - $oldSupplierName = $oldSupplier->name ?? trans('admin/suppliers/message.deleted'); + $oldSupplierName = $oldSupplier ? e($oldSupplier->name) : trans('admin/suppliers/message.deleted'); $newSupplier = $supplier->find($clean_meta['supplier_id']['new']); - $newSupplierName = $newSupplier->name ?? trans('admin/suppliers/message.deleted'); + $newSupplierName = $newSupplier ? e($newSupplier->name) : trans('admin/suppliers/message.deleted'); $clean_meta['supplier_id']['old'] = $clean_meta['supplier_id']['old'] ? "[id: ".$clean_meta['supplier_id']['old']."] ". $oldSupplierName : trans('general.unassigned'); $clean_meta['supplier_id']['new'] = $clean_meta['supplier_id']['new'] ? "[id: ".$clean_meta['supplier_id']['new']."] ". $newSupplierName : trans('general.unassigned'); From 25a5507d9dd9891b3cb639528e8869cbd7ad0773 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 6 Oct 2023 20:07:35 +0100 Subject: [PATCH 17/45] Bumped version Signed-off-by: snipe --- config/version.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/version.php b/config/version.php index 664ae0ac32..8381c19637 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v6.2.1', - 'full_app_version' => 'v6.2.1 - build 11625-gc45ede2d1', - 'build_version' => '11625', + 'app_version' => 'v6.2.2', + 'full_app_version' => 'v6.2.2 - build 11714-ga95fae0e9', + 'build_version' => '11714', 'prerelease_version' => '', - 'hash_version' => 'gc45ede2d1', - 'full_hash' => 'v6.2.1-47-gc45ede2d1', + 'hash_version' => 'ga95fae0e9', + 'full_hash' => 'v6.2.2-85-ga95fae0e9', 'branch' => 'develop', ); \ No newline at end of file From 5277f7cc5c76eaf9e36ee3c64f2fd1f313de43c2 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 6 Oct 2023 20:14:44 +0100 Subject: [PATCH 18/45] Dev assets Signed-off-by: snipe --- public/css/build/app.css | 8 ++++---- public/css/build/overrides.css | 8 ++++---- public/css/dist/all.css | 16 ++++++++-------- public/mix-manifest.json | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/public/css/build/app.css b/public/css/build/app.css index c8fc025597..b82e27befc 100644 --- a/public/css/build/app.css +++ b/public/css/build/app.css @@ -964,14 +964,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { diff --git a/public/css/build/overrides.css b/public/css/build/overrides.css index 5111695ac7..4020194f84 100644 --- a/public/css/build/overrides.css +++ b/public/css/build/overrides.css @@ -597,14 +597,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { diff --git a/public/css/dist/all.css b/public/css/dist/all.css index b181114443..0786a8b30d 100644 --- a/public/css/dist/all.css +++ b/public/css/dist/all.css @@ -23745,14 +23745,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { @@ -24983,14 +24983,14 @@ th.css-accessory > .th-inner::before { margin-top: 160px; } } -@media screen and (max-width: 771px) and (min-width: 512px) { +@media screen and (max-width: 912px) and (min-width: 512px) { .sidebar-menu { - margin-top: 160px; + margin-top: 100px; } } -@media screen and (max-width: 1098px) and (min-width: 772px) { +@media screen and (max-width: 1268px) and (min-width: 912px) { .sidebar-menu { - margin-top: 98px; + margin-top: 50px; } } .ellipsis { diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 4f67fc941f..e372984709 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,8 +1,8 @@ { "/js/build/app.js": "/js/build/app.js?id=41293fc7aa00ece89fd524e1e0e31a68", "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374", - "/css/build/overrides.css": "/css/build/overrides.css?id=5166569ede5a36802eadeea982686ca6", - "/css/build/app.css": "/css/build/app.css?id=b612c48e78fece2e1e8042ae24cc5f1e", + "/css/build/overrides.css": "/css/build/overrides.css?id=1681749b20329c40a052156ea4cb42fe", + "/css/build/app.css": "/css/build/app.css?id=cc0fd2d77504fdd7f03e91e2369d02a9", "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=dc383f8560a8d4adb51d44fb4043e03b", "/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=6f0563e726c2fe4fab4026daaa5bfdf2", "/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=e6e53eef152bba01a4c666a4d8b01117", @@ -18,7 +18,7 @@ "/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", "/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=da6c7997d9de2f8329142399f0ce50da", "/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=44bf834f2110504a793dadec132a5898", - "/css/dist/all.css": "/css/dist/all.css?id=c687b2e18c367a2600b13a237a23816a", + "/css/dist/all.css": "/css/dist/all.css?id=391b67f142742a6b11a92b042c6d475c", "/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=a656b2d865fe379d8851757e8e4001ef", From d2dc3253ab9c29d25c0f391dc74990975a15c031 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 7 Oct 2023 11:34:37 +0100 Subject: [PATCH 19/45] Cast the request limit to intval before we try to abs() Signed-off-by: snipe --- app/Providers/SettingsServiceProvider.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php index 371fc234de..6656f284e0 100644 --- a/app/Providers/SettingsServiceProvider.php +++ b/app/Providers/SettingsServiceProvider.php @@ -33,12 +33,14 @@ class SettingsServiceProvider extends ServiceProvider // Make sure the limit is actually set, is an integer and does not exceed system limits \App::singleton('api_limit_value', function () { $limit = config('app.max_results'); + $int_limit = intval(request('limit')); - if ((abs(intval(request('limit'))) > 0) && (abs(request('limit')) <= config('app.max_results'))) { - $limit = abs(request('limit')); + if ((abs($int_limit) > 0) && ($int_limit <= config('app.max_results'))) { + $limit = abs($int_limit); } \Log::debug('Max in env: '.config('app.max_results')); \Log::debug('Original requested limit: '.request('limit')); + \Log::debug('Int limit: '.$int_limit); \Log::debug('Modified limit: '.$limit); \Log::debug('------------------------------'); From e5f58022357a55a9c351e1e77898ada6aad96ae0 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Oct 2023 15:17:03 +0100 Subject: [PATCH 20/45] Added tighter controls for matching log ID and item_id Signed-off-by: snipe --- .../AccessoriesFilesController.php | 5 ++--- .../Assets/AssetFilesController.php | 2 +- .../ConsumablesFilesController.php | 2 +- .../Licenses/LicenseFilesController.php | 2 +- .../Controllers/Users/UserFilesController.php | 20 ++++++++++--------- resources/lang/en/admin/users/message.php | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoriesFilesController.php b/app/Http/Controllers/Accessories/AccessoriesFilesController.php index 4f166b06d5..939ab81260 100644 --- a/app/Http/Controllers/Accessories/AccessoriesFilesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesFilesController.php @@ -146,9 +146,8 @@ class AccessoriesFilesController extends Controller $this->authorize('view', $accessory); $this->authorize('accessories.files', $accessory); - if (! $log = Actionlog::find($fileId)) { - return response('No matching record for that asset/file', 500) - ->header('Content-Type', 'text/plain'); + if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $accessory->id)->first()) { + return redirect()->route('accessories.index')->with('error', trans('admin/users/message.log_record_not_found')); } $file = 'private_uploads/accessories/'.$log->filename; diff --git a/app/Http/Controllers/Assets/AssetFilesController.php b/app/Http/Controllers/Assets/AssetFilesController.php index a4e0605999..cfe8055bd6 100644 --- a/app/Http/Controllers/Assets/AssetFilesController.php +++ b/app/Http/Controllers/Assets/AssetFilesController.php @@ -86,7 +86,7 @@ class AssetFilesController extends Controller if (isset($asset->id)) { $this->authorize('view', $asset); - if (! $log = Actionlog::find($fileId)) { + if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $asset->id)->first()) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Consumables/ConsumablesFilesController.php b/app/Http/Controllers/Consumables/ConsumablesFilesController.php index def1e0d8ed..4d9d1d5f7d 100644 --- a/app/Http/Controllers/Consumables/ConsumablesFilesController.php +++ b/app/Http/Controllers/Consumables/ConsumablesFilesController.php @@ -140,7 +140,7 @@ class ConsumablesFilesController extends Controller $this->authorize('view', $consumable); $this->authorize('consumables.files', $consumable); - if (! $log = Actionlog::find($fileId)) { + if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $consumable->id)->first()) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Licenses/LicenseFilesController.php b/app/Http/Controllers/Licenses/LicenseFilesController.php index 442635669b..83fbc04903 100644 --- a/app/Http/Controllers/Licenses/LicenseFilesController.php +++ b/app/Http/Controllers/Licenses/LicenseFilesController.php @@ -137,7 +137,7 @@ class LicenseFilesController extends Controller $this->authorize('view', $license); $this->authorize('licenses.files', $license); - if (! $log = Actionlog::find($fileId)) { + if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $license->id)->first()) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Users/UserFilesController.php b/app/Http/Controllers/Users/UserFilesController.php index 62726e9827..d0778dd570 100644 --- a/app/Http/Controllers/Users/UserFilesController.php +++ b/app/Http/Controllers/Users/UserFilesController.php @@ -143,18 +143,20 @@ class UserFilesController extends Controller $this->authorize('view', $user); - $log = Actionlog::find($fileId); + if ($log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $user->id)->first()) { - // Display the file inline - if (request('inline') == 'true') { - $headers = [ - 'Content-Disposition' => 'inline', - ]; - return Storage::download('private_uploads/users/'.$log->filename, $log->filename, $headers); + // Display the file inline + if (request('inline') == 'true') { + $headers = [ + 'Content-Disposition' => 'inline', + ]; + return Storage::download('private_uploads/users/'.$log->filename, $log->filename, $headers); + } + + return Storage::download('private_uploads/users/'.$log->filename); } - return Storage::download('private_uploads/users/'.$log->filename); - + return redirect()->route('users.index')->with('error', trans('admin/users/message.log_record_not_found')); } // Redirect to the user management page if the user doesn't exist diff --git a/resources/lang/en/admin/users/message.php b/resources/lang/en/admin/users/message.php index adf26b3229..a3f936dcbb 100644 --- a/resources/lang/en/admin/users/message.php +++ b/resources/lang/en/admin/users/message.php @@ -15,7 +15,7 @@ return array( 'password_resets_sent' => 'The selected users who are activated and have a valid email addresses have been sent a password reset link.', 'password_reset_sent' => 'A password reset link has been sent to :email!', 'user_has_no_email' => 'This user does not have an email address in their profile.', - 'user_has_no_assets_assigned' => 'This user does not have any assets assigned', + 'log_record_not_found' => 'A matching log record for this user could not be found.', 'success' => array( From 6d55d782806c9660e9e65dc5250faacb5d0033ed Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Oct 2023 16:13:41 +0100 Subject: [PATCH 21/45] Set resend acceptance to POST Signed-off-by: snipe --- app/Http/Controllers/ReportsController.php | 16 +++++++++++++--- .../views/reports/unaccepted_assets.blade.php | 16 ++++++++++++++-- routes/web.php | 4 ++-- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index bacc27f423..4873c7f2a5 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -1043,27 +1043,37 @@ class ReportsController extends Controller * @throws \Illuminate\Auth\Access\AuthorizationException * @version v1.0 */ - public function sentAssetAcceptanceReminder($acceptanceId = null) + public function sentAssetAcceptanceReminder(Request $request) { $this->authorize('reports.view'); - if (!$acceptance = CheckoutAcceptance::pending()->find($acceptanceId)) { + if (!$acceptance = CheckoutAcceptance::pending()->find($request->input('acceptance_id'))) { + \Log::debug('No pending acceptances'); // Redirect to the unaccepted assets report page with error return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data')); } + $assetItem = $acceptance->checkoutable; + \Log::debug(print_r($assetItem, true)); + if (is_null($acceptance->created_at)){ + \Log::debug('No acceptance created_at'); return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data')); } else { $logItem_res = $assetItem->checkouts()->where('created_at', '=', $acceptance->created_at)->get(); + + \Log::debug('Acceptance created at: '.$acceptance->created_at); + \Log::debug(print_r($logItem_res, true)); + if ($logItem_res->isEmpty()){ + \Log::debug('Acceptance date mismatch'); return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data')); } $logItem = $logItem_res[0]; } - if(!$assetItem->assignedTo->locale){ + if (!$assetItem->assignedTo->locale){ Notification::locale(Setting::getSettings()->locale)->send( $assetItem->assignedTo, new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note) diff --git a/resources/views/reports/unaccepted_assets.blade.php b/resources/views/reports/unaccepted_assets.blade.php index 37ae66ce30..80d151fd42 100644 --- a/resources/views/reports/unaccepted_assets.blade.php +++ b/resources/views/reports/unaccepted_assets.blade.php @@ -77,11 +77,23 @@ {!! $item['assetItem']->present()->nameUrl() !!} {{ $item['assetItem']->asset_tag }} assignedTo === null || $item['acceptance']->assignedTo->trashed()) style="text-decoration: line-through" @endif>{!! ($item['acceptance']->assignedTo) ? $item['acceptance']->assignedTo->present()->nameUrl() : trans('admin/reports/general.deleted_user') !!} - + + @if(!$item['acceptance']->trashed()) - @if ($item['acceptance']->assignedTo){{ trans('admin/reports/general.send_reminder') }}@endif + + @if ($item['acceptance']->assignedTo) + @csrf + + + + @endif + @endif + + @endif diff --git a/routes/web.php b/routes/web.php index 4bc8b3bb58..0aacf85135 100644 --- a/routes/web.php +++ b/routes/web.php @@ -368,8 +368,8 @@ Route::group(['middleware' => ['auth']], function () { 'reports/unaccepted_assets/{deleted?}', [ReportsController::class, 'getAssetAcceptanceReport'] )->name('reports/unaccepted_assets'); - Route::get( - 'reports/unaccepted_assets/{acceptanceId}/sent_reminder', + Route::post( + 'reports/unaccepted_assets/sent_reminder', [ReportsController::class, 'sentAssetAcceptanceReminder'] )->name('reports/unaccepted_assets_sent_reminder'); Route::delete( From 866bbe5e1149223baa265f8d04a2854dfb9bfa99 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Oct 2023 16:15:14 +0100 Subject: [PATCH 22/45] Removed extra debugging Signed-off-by: snipe --- app/Http/Controllers/ReportsController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 4873c7f2a5..2791624216 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -1063,9 +1063,6 @@ class ReportsController extends Controller } else { $logItem_res = $assetItem->checkouts()->where('created_at', '=', $acceptance->created_at)->get(); - \Log::debug('Acceptance created at: '.$acceptance->created_at); - \Log::debug(print_r($logItem_res, true)); - if ($logItem_res->isEmpty()){ \Log::debug('Acceptance date mismatch'); return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data')); From b9dc7f88d00a22cd477a3a2f2a6fc8e48a3553ac Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Oct 2023 16:32:30 +0100 Subject: [PATCH 23/45] Fix qty requirements for Components API checkout Signed-off-by: snipe --- app/Http/Controllers/Api/ComponentsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ComponentsController.php b/app/Http/Controllers/Api/ComponentsController.php index a6e3e379e3..9525bdbafc 100644 --- a/app/Http/Controllers/Api/ComponentsController.php +++ b/app/Http/Controllers/Api/ComponentsController.php @@ -263,7 +263,7 @@ class ComponentsController extends Controller } // Make sure there is at least one available to checkout - if ($component->numRemaining() <= $request->get('assigned_qty')) { + if ($component->numRemaining() < $request->get('assigned_qty')) { return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/components/message.checkout.unavailable', ['remaining' => $component->numRemaining(), 'requested' => $request->get('assigned_qty')]))); } From 0fbe63d0cf6b6c3e21ae113f3eec70d0c2dc56e9 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Oct 2023 16:33:00 +0100 Subject: [PATCH 24/45] Add @Singrity as a contributor --- .all-contributorsrc | 9 +++++++++ README.md | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 41e7063e30..c10b080181 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2961,6 +2961,15 @@ "contributions": [ "code" ] + }, + { + "login": "Singrity", + "name": "Bogdan", + "avatar_url": "https://avatars.githubusercontent.com/u/58479551?v=4", + "profile": "http://@singrity", + "contributions": [ + "code" + ] } ] } diff --git a/README.md b/README.md index c29cccb67b..3a74120b3d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade) -[![All Contributors](https://img.shields.io/badge/all_contributors-326-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev) +[![All Contributors](https://img.shields.io/badge/all_contributors-327-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev) ## Snipe-IT - Open Source Asset Management System @@ -145,7 +145,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken | [
Chris Hartjes](http://www.littlehart.net/atthekeyboard)
[💻](https://github.com/snipe/snipe-it/commits?author=chartjes "Code") | [
geo-chen](https://github.com/geo-chen)
[💻](https://github.com/snipe/snipe-it/commits?author=geo-chen "Code") | [
Phan Nguyen](https://github.com/nh314)
[💻](https://github.com/snipe/snipe-it/commits?author=nh314 "Code") | [
Iisakki Jaakkola](https://github.com/StarlessNights)
[💻](https://github.com/snipe/snipe-it/commits?author=StarlessNights "Code") | [
Ikko Ashimine](https://bandism.net/)
[💻](https://github.com/snipe/snipe-it/commits?author=eltociear "Code") | [
Lukas Fehling](https://github.com/lukasfehling)
[💻](https://github.com/snipe/snipe-it/commits?author=lukasfehling "Code") | [
Fernando Almeida](https://github.com/fernando-almeida)
[💻](https://github.com/snipe/snipe-it/commits?author=fernando-almeida "Code") | | [
akemidx](https://github.com/akemidx)
[💻](https://github.com/snipe/snipe-it/commits?author=akemidx "Code") | [
Oguz Bilgic](http://oguz.site)
[💻](https://github.com/snipe/snipe-it/commits?author=oguzbilgic "Code") | [
Scooter Crawford](https://github.com/scoo73r)
[💻](https://github.com/snipe/snipe-it/commits?author=scoo73r "Code") | [
subdriven](https://github.com/subdriven)
[💻](https://github.com/snipe/snipe-it/commits?author=subdriven "Code") | [
Andrew Savinykh](https://github.com/AndrewSav)
[💻](https://github.com/snipe/snipe-it/commits?author=AndrewSav "Code") | [
Tadayuki Onishi](https://kenchan0130.github.io)
[💻](https://github.com/snipe/snipe-it/commits?author=kenchan0130 "Code") | [
Florian](https://github.com/floschoepfer)
[💻](https://github.com/snipe/snipe-it/commits?author=floschoepfer "Code") | | [
Spencer Long](http://spencerlong.com)
[💻](https://github.com/snipe/snipe-it/commits?author=spencerrlongg "Code") | [
Marcus Moore](https://github.com/marcusmoore)
[💻](https://github.com/snipe/snipe-it/commits?author=marcusmoore "Code") | [
Martin Meredith](https://github.com/Mezzle)
| [
dboth](http://dboth.de)
[💻](https://github.com/snipe/snipe-it/commits?author=dboth "Code") | [
Zachary Fleck](https://github.com/zacharyfleck)
[💻](https://github.com/snipe/snipe-it/commits?author=zacharyfleck "Code") | [
VIKAAS-A](https://github.com/vikaas-cyper)
[💻](https://github.com/snipe/snipe-it/commits?author=vikaas-cyper "Code") | [
Abdul Kareem](https://github.com/ak-piracha)
[💻](https://github.com/snipe/snipe-it/commits?author=ak-piracha "Code") | -| [
NojoudAlshehri](https://github.com/NojoudAlshehri)
[💻](https://github.com/snipe/snipe-it/commits?author=NojoudAlshehri "Code") | [
Stefan Stidl](https://github.com/stefanstidlffg)
[💻](https://github.com/snipe/snipe-it/commits?author=stefanstidlffg "Code") | [
Quentin Aymard](https://github.com/qay21)
[💻](https://github.com/snipe/snipe-it/commits?author=qay21 "Code") | [
Grant Le Roux](https://github.com/cram42)
[💻](https://github.com/snipe/snipe-it/commits?author=cram42 "Code") | +| [
NojoudAlshehri](https://github.com/NojoudAlshehri)
[💻](https://github.com/snipe/snipe-it/commits?author=NojoudAlshehri "Code") | [
Stefan Stidl](https://github.com/stefanstidlffg)
[💻](https://github.com/snipe/snipe-it/commits?author=stefanstidlffg "Code") | [
Quentin Aymard](https://github.com/qay21)
[💻](https://github.com/snipe/snipe-it/commits?author=qay21 "Code") | [
Grant Le Roux](https://github.com/cram42)
[💻](https://github.com/snipe/snipe-it/commits?author=cram42 "Code") | [
Bogdan](http://@singrity)
[💻](https://github.com/snipe/snipe-it/commits?author=Singrity "Code") | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! From f685ba01b61319a6ced0d1d976a323173454199f Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 9 Oct 2023 16:43:14 +0100 Subject: [PATCH 25/45] Reversed order of find Signed-off-by: snipe --- .../Controllers/Accessories/AccessoriesFilesController.php | 2 +- app/Http/Controllers/Assets/AssetFilesController.php | 2 +- .../Controllers/Components/ComponentsFilesController.php | 2 +- .../Controllers/Consumables/ConsumablesFilesController.php | 2 +- app/Http/Controllers/Licenses/LicenseFilesController.php | 2 +- app/Http/Controllers/Users/UserFilesController.php | 7 ++++++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoriesFilesController.php b/app/Http/Controllers/Accessories/AccessoriesFilesController.php index 939ab81260..6a94a897af 100644 --- a/app/Http/Controllers/Accessories/AccessoriesFilesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesFilesController.php @@ -146,7 +146,7 @@ class AccessoriesFilesController extends Controller $this->authorize('view', $accessory); $this->authorize('accessories.files', $accessory); - if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $accessory->id)->first()) { + if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $accessory->id)->find($fileId)) { return redirect()->route('accessories.index')->with('error', trans('admin/users/message.log_record_not_found')); } diff --git a/app/Http/Controllers/Assets/AssetFilesController.php b/app/Http/Controllers/Assets/AssetFilesController.php index cfe8055bd6..610705c604 100644 --- a/app/Http/Controllers/Assets/AssetFilesController.php +++ b/app/Http/Controllers/Assets/AssetFilesController.php @@ -86,7 +86,7 @@ class AssetFilesController extends Controller if (isset($asset->id)) { $this->authorize('view', $asset); - if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $asset->id)->first()) { + if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $asset->id)->find($fileId)) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Components/ComponentsFilesController.php b/app/Http/Controllers/Components/ComponentsFilesController.php index d46dc05f9c..0f4e782aa8 100644 --- a/app/Http/Controllers/Components/ComponentsFilesController.php +++ b/app/Http/Controllers/Components/ComponentsFilesController.php @@ -142,7 +142,7 @@ class ComponentsFilesController extends Controller $this->authorize('view', $component); $this->authorize('components.files', $component); - if (! $log = Actionlog::find($fileId)) { + if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $component->id)->find($fileId)) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Consumables/ConsumablesFilesController.php b/app/Http/Controllers/Consumables/ConsumablesFilesController.php index 4d9d1d5f7d..6053e82cca 100644 --- a/app/Http/Controllers/Consumables/ConsumablesFilesController.php +++ b/app/Http/Controllers/Consumables/ConsumablesFilesController.php @@ -140,7 +140,7 @@ class ConsumablesFilesController extends Controller $this->authorize('view', $consumable); $this->authorize('consumables.files', $consumable); - if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $consumable->id)->first()) { + if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $consumable->id)->find($fileId)) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Licenses/LicenseFilesController.php b/app/Http/Controllers/Licenses/LicenseFilesController.php index 83fbc04903..f6f7c1ad0c 100644 --- a/app/Http/Controllers/Licenses/LicenseFilesController.php +++ b/app/Http/Controllers/Licenses/LicenseFilesController.php @@ -137,7 +137,7 @@ class LicenseFilesController extends Controller $this->authorize('view', $license); $this->authorize('licenses.files', $license); - if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $license->id)->first()) { + if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $license->id)->find($fileId)) { return response('No matching record for that asset/file', 500) ->header('Content-Type', 'text/plain'); } diff --git a/app/Http/Controllers/Users/UserFilesController.php b/app/Http/Controllers/Users/UserFilesController.php index d0778dd570..0b787306f9 100644 --- a/app/Http/Controllers/Users/UserFilesController.php +++ b/app/Http/Controllers/Users/UserFilesController.php @@ -136,6 +136,11 @@ class UserFilesController extends Controller */ public function show($userId = null, $fileId = null) { + + if (empty($fileId)) { + return redirect()->route('users.show')->with('error', 'Invalid file request'); + } + $user = User::find($userId); // the license is valid @@ -143,7 +148,7 @@ class UserFilesController extends Controller $this->authorize('view', $user); - if ($log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $user->id)->first()) { + if ($log = Actionlog::whereNotNull('filename')->where('item_id', $user->id)->find($fileId)) { // Display the file inline if (request('inline') == 'true') { From 47a77eabf2d85152f370d2daa15a70b5fc7d57d7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:06:08 -0700 Subject: [PATCH 26/45] Avoid logging error messages for webhook request failures --- app/Listeners/CheckoutableListener.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index d9680f82a1..13579ce6b6 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -18,6 +18,7 @@ use App\Notifications\CheckoutAccessoryNotification; use App\Notifications\CheckoutAssetNotification; use App\Notifications\CheckoutConsumableNotification; use App\Notifications\CheckoutLicenseSeatNotification; +use GuzzleHttp\Exception\ClientException; use Illuminate\Support\Facades\Notification; use Exception; use Log; @@ -61,6 +62,16 @@ class CheckoutableListener ); } } catch (Exception $e) { + if ($e instanceof ClientException){ + $statusCode = $e->getResponse()->getStatusCode(); + // If status code is in 400 range, we don't want to log it as an error + // @todo: 300 and 500 as well? + if ($statusCode >= 400 && $statusCode < 500) { + Log::debug("Exception caught during checkout notification: ".$e->getMessage()); + return; + } + } + Log::error("Exception caught during checkout notification: ".$e->getMessage()); } } From ab3a3de59b64cd837f6d824f086a5749cdd60bf3 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:13:46 -0700 Subject: [PATCH 27/45] Fire webhook notification after sending emails --- app/Listeners/CheckoutableListener.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 13579ce6b6..917a037703 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -45,11 +45,6 @@ class CheckoutableListener $acceptance = $this->getCheckoutAcceptance($event); try { - if ($this->shouldSendWebhookNotification()) { - Notification::route('slack', Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckoutNotification($event)); - } - if (! $event->checkedOutTo->locale) { Notification::locale(Setting::getSettings()->locale)->send( $this->getNotifiables($event), @@ -61,6 +56,11 @@ class CheckoutableListener $this->getCheckoutNotification($event, $acceptance) ); } + + if ($this->shouldSendWebhookNotification()) { + Notification::route('slack', Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckoutNotification($event)); + } } catch (Exception $e) { if ($e instanceof ClientException){ $statusCode = $e->getResponse()->getStatusCode(); From 2a29566458521bf7a56b2a8ab2845268ac4590da Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:15:02 -0700 Subject: [PATCH 28/45] Catch all ClientExceptions on check out --- app/Listeners/CheckoutableListener.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 917a037703..01e5041f67 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -63,13 +63,8 @@ class CheckoutableListener } } catch (Exception $e) { if ($e instanceof ClientException){ - $statusCode = $e->getResponse()->getStatusCode(); - // If status code is in 400 range, we don't want to log it as an error - // @todo: 300 and 500 as well? - if ($statusCode >= 400 && $statusCode < 500) { - Log::debug("Exception caught during checkout notification: ".$e->getMessage()); - return; - } + Log::debug("Exception caught during checkout notification: ".$e->getMessage()); + return; } Log::error("Exception caught during checkout notification: ".$e->getMessage()); From 9ef598d07bdaf6565ec79cf7078697e1634e56be Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:16:12 -0700 Subject: [PATCH 29/45] Apply changes to exception handling for check outs to check ins --- app/Listeners/CheckoutableListener.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 01e5041f67..34d93550ed 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -98,11 +98,6 @@ class CheckoutableListener } try { - if ($this->shouldSendWebhookNotification()) { - Notification::route('slack', Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckinNotification($event)); - } - // Use default locale if (! $event->checkedOutTo->locale) { Notification::locale(Setting::getSettings()->locale)->send( @@ -115,7 +110,17 @@ class CheckoutableListener $this->getCheckinNotification($event) ); } + + if ($this->shouldSendWebhookNotification()) { + Notification::route('slack', Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckinNotification($event)); + } } catch (Exception $e) { + if ($e instanceof ClientException){ + Log::debug("Exception caught during checkout notification: ".$e->getMessage()); + return; + } + Log::error("Exception caught during checkin notification: ".$e->getMessage()); } } From dae9e6d09659a811c1c1d93548f3b501ff1deaf1 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:18:37 -0700 Subject: [PATCH 30/45] Improve try catch blocks --- app/Listeners/CheckoutableListener.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 34d93550ed..ec51130b1a 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -42,7 +42,7 @@ class CheckoutableListener /** * Make a checkout acceptance and attach it in the notification */ - $acceptance = $this->getCheckoutAcceptance($event); + $acceptance = $this->getCheckoutAcceptance($event); try { if (! $event->checkedOutTo->locale) { @@ -61,12 +61,11 @@ class CheckoutableListener Notification::route('slack', Setting::getSettings()->webhook_endpoint) ->notify($this->getCheckoutNotification($event)); } - } catch (Exception $e) { - if ($e instanceof ClientException){ - Log::debug("Exception caught during checkout notification: ".$e->getMessage()); - return; - } - + } + catch (ClientException $e){ + Log::debug("Exception caught during checkout notification: ".$e->getMessage()); + } + catch (Exception $e) { Log::error("Exception caught during checkout notification: ".$e->getMessage()); } } @@ -115,12 +114,11 @@ class CheckoutableListener Notification::route('slack', Setting::getSettings()->webhook_endpoint) ->notify($this->getCheckinNotification($event)); } - } catch (Exception $e) { - if ($e instanceof ClientException){ - Log::debug("Exception caught during checkout notification: ".$e->getMessage()); - return; - } - + } + catch (ClientException $e){ + Log::debug("Exception caught during checkout notification: ".$e->getMessage()); + } + catch (Exception $e) { Log::error("Exception caught during checkin notification: ".$e->getMessage()); } } From 43b9e6401c62e8f99d46fe383b2aca1d45cbe08f Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:18:55 -0700 Subject: [PATCH 31/45] Formatting --- app/Listeners/CheckoutableListener.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index ec51130b1a..17a8a6c1bf 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -61,12 +61,10 @@ class CheckoutableListener Notification::route('slack', Setting::getSettings()->webhook_endpoint) ->notify($this->getCheckoutNotification($event)); } - } - catch (ClientException $e){ - Log::debug("Exception caught during checkout notification: ".$e->getMessage()); - } - catch (Exception $e) { - Log::error("Exception caught during checkout notification: ".$e->getMessage()); + } catch (ClientException $e) { + Log::debug("Exception caught during checkout notification: " . $e->getMessage()); + } catch (Exception $e) { + Log::error("Exception caught during checkout notification: " . $e->getMessage()); } } @@ -114,12 +112,10 @@ class CheckoutableListener Notification::route('slack', Setting::getSettings()->webhook_endpoint) ->notify($this->getCheckinNotification($event)); } - } - catch (ClientException $e){ - Log::debug("Exception caught during checkout notification: ".$e->getMessage()); - } - catch (Exception $e) { - Log::error("Exception caught during checkin notification: ".$e->getMessage()); + } catch (ClientException $e) { + Log::debug("Exception caught during checkout notification: " . $e->getMessage()); + } catch (Exception $e) { + Log::error("Exception caught during checkin notification: " . $e->getMessage()); } } From 417f9c21e42a179cf23890c62fdc11008b24c50b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 17:51:29 -0700 Subject: [PATCH 32/45] Fix the storing of group permissions when creating via API --- app/Http/Controllers/Api/GroupsController.php | 2 +- tests/Feature/Api/Groups/GroupStoreTest.php | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/Api/Groups/GroupStoreTest.php diff --git a/app/Http/Controllers/Api/GroupsController.php b/app/Http/Controllers/Api/GroupsController.php index 7cc5d2d756..6dc7e83dd6 100644 --- a/app/Http/Controllers/Api/GroupsController.php +++ b/app/Http/Controllers/Api/GroupsController.php @@ -63,7 +63,7 @@ class GroupsController extends Controller $group = new Group; $group->name = $request->input('name'); - $group->permissions = $request->input('permissions'); // Todo - some JSON validation stuff here + $group->permissions = json_encode($request->input('permissions')); // Todo - some JSON validation stuff here if ($group->save()) { return response()->json(Helper::formatStandardApiResponse('success', $group, trans('admin/groups/message.create.success'))); diff --git a/tests/Feature/Api/Groups/GroupStoreTest.php b/tests/Feature/Api/Groups/GroupStoreTest.php new file mode 100644 index 0000000000..9ffba51913 --- /dev/null +++ b/tests/Feature/Api/Groups/GroupStoreTest.php @@ -0,0 +1,41 @@ +actingAsForApi(User::factory()->create()) + ->postJson(route('api.groups.store')) + ->assertForbidden(); + } + + public function testCanStoreGroup() + { + $this->actingAsForApi(User::factory()->superuser()->create()) + ->postJson(route('api.groups.store'), [ + 'name' => 'My Awesome Group', + 'permissions' => [ + 'admin' => '1', + 'import' => '1', + 'reports.view' => '0', + ], + ]) + ->assertOk(); + + $group = Group::where('name', 'My Awesome Group')->first(); + + $this->assertNotNull($group); + $this->assertEquals('1', $group->decodePermissions()['admin']); + $this->assertEquals('1', $group->decodePermissions()['import']); + $this->assertEquals('0', $group->decodePermissions()['reports.view']); + } +} From 9b53b0fedc53b011b23053228744c5265e17dd17 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 12 Oct 2023 14:50:12 -0500 Subject: [PATCH 33/45] resolve issue with migrations with table prefixes --- ...malized_eol_and_add_column_for_explicit_date_to_assets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 8bceca535e..ca067c3d4a 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -42,13 +42,13 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } }); - DB::table('assets') + DB::table( 'assets') ->whereNull('asset_eol_date') ->whereNotNull('purchase_date') ->whereNotNull('model_id') ->join('models', 'assets.model_id', '=', 'models.id') ->update([ - 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL models.eol MONTH)') + 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL ' . DB::getTablePrefix() . 'models.eol MONTH)') ]); } From f3bd23da3da69bef2171d12e725d7a99305309ed Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 12 Oct 2023 14:53:17 -0500 Subject: [PATCH 34/45] rm whitespace --- ...ormalized_eol_and_add_column_for_explicit_date_to_assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index ca067c3d4a..8d3ca96829 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -42,7 +42,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } }); - DB::table( 'assets') + DB::table('assets') ->whereNull('asset_eol_date') ->whereNotNull('purchase_date') ->whereNotNull('model_id') From c14a01eb8ba35a07caec89af875378d047a9ede3 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 12:18:19 +0100 Subject: [PATCH 35/45] Added comments to explain the potential race condition Signed-off-by: snipe --- app/Observers/AssetObserver.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.php index 3cbaedded2..55542ff2eb 100644 --- a/app/Observers/AssetObserver.php +++ b/app/Observers/AssetObserver.php @@ -120,17 +120,29 @@ class AssetObserver $logAction->user_id = Auth::id(); $logAction->logaction('delete'); } - + + /** + * Executes every time an asset is saved. + * + * This matters specifically because any database fields affected here MUST already exist on + * the assets table (and/or any related models), or related migrations WILL fail. + * + * For example, if there is a database migration that's a bit older and modifies an asset, if the save + * fires before a field gets created in a later migration and that field in the later migration + * is used in this observer, it doesn't actually exist yet and the migration will break. + * + * @see https://github.com/snipe/snipe-it/issues/13723#issuecomment-1761315938 + */ public function saving(Asset $asset) { - //determine if calculated eol and then calculate it - this should only happen on a new asset - if(is_null($asset->asset_eol_date) && !is_null($asset->purchase_date) && !is_null($asset->model->eol)){ + // determine if calculated eol and then calculate it - this should only happen on a new asset + if (is_null($asset->asset_eol_date) && !is_null($asset->purchase_date) && !is_null($asset->model->eol)){ $asset->asset_eol_date = $asset->purchase_date->addMonths($asset->model->eol)->format('Y-m-d'); $asset->eol_explicit = false; } - //determine if explicit and set eol_explit to true - if(!is_null($asset->asset_eol_date) && !is_null($asset->purchase_date)) { + // determine if explicit and set eol_explicit to true + if (!is_null($asset->asset_eol_date) && !is_null($asset->purchase_date)) { if($asset->model->eol) { $months = Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date); if($months != $asset->model->eol) { From 0b39591d882a263a106ffd8f80133f4959699f6d Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 12:18:58 +0100 Subject: [PATCH 36/45] Add the eol_explicit column earlier to accomodate the observer Signed-off-by: snipe --- .../2023_01_21_225350_add_eol_date_on_assets_table.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php index 9f5c5aa1e5..fbd4688da2 100644 --- a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php +++ b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php @@ -20,6 +20,14 @@ class AddEolDateOnAssetsTable extends Migration if (!Schema::hasColumn('assets', 'asset_eol_date')) { $table->date('asset_eol_date')->after('purchase_date')->nullable()->default(null); } + + // This is a temporary shim so we don't have to modify the asset observer for migrations where + // there is a large version difference. (See the AssetObserver notes). This column gets created + // later in 2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php + // but we have to temporarily create it now so the save method below doesn't break + if (!Schema::hasColumn('assets', 'eol_explicit')) { + $table->boolean('eol_explicit')->default(false)->after('asset_eol_date'); + } }); // Chunk the model query to get the models that do have an EOL date From ea960c39bb5caa066495c71e071853cea161d94f Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 12:19:32 +0100 Subject: [PATCH 37/45] Check if the eol_explicit column exists yet, add it if not Signed-off-by: snipe --- ...malized_eol_and_add_column_for_explicit_date_to_assets.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 8d3ca96829..982bd8ac0d 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -18,7 +18,9 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration public function up() { Schema::table('assets', function (Blueprint $table) { - $table->boolean('eol_explicit')->default(false)->after('asset_eol_date'); + if (!Schema::hasColumn('assets', 'eol_explicit')) { + $table->boolean('eol_explicit')->default(false)->after('asset_eol_date'); + } }); From b2aed7feeac598100134db8b7edceea4a5c58b94 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 12:30:26 +0100 Subject: [PATCH 38/45] Removed temp column Signed-off-by: snipe --- .../2023_01_21_225350_add_eol_date_on_assets_table.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php index fbd4688da2..550f6f335b 100644 --- a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php +++ b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php @@ -20,14 +20,6 @@ class AddEolDateOnAssetsTable extends Migration if (!Schema::hasColumn('assets', 'asset_eol_date')) { $table->date('asset_eol_date')->after('purchase_date')->nullable()->default(null); } - - // This is a temporary shim so we don't have to modify the asset observer for migrations where - // there is a large version difference. (See the AssetObserver notes). This column gets created - // later in 2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php - // but we have to temporarily create it now so the save method below doesn't break - if (!Schema::hasColumn('assets', 'eol_explicit')) { - $table->boolean('eol_explicit')->default(false)->after('asset_eol_date'); - } }); // Chunk the model query to get the models that do have an EOL date @@ -37,7 +29,7 @@ class AddEolDateOnAssetsTable extends Migration if ($asset->purchase_date!='') { $asset->asset_eol_date = $asset->present()->eol_date(); - $asset->save(); + $asset->saveQuietly(); } } From 2537d0fdaf3c6a8bbd848c16b028e53200d211ba Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 12:34:46 +0100 Subject: [PATCH 39/45] Added comments Signed-off-by: snipe --- app/Observers/AssetObserver.php | 3 ++- .../2023_01_21_225350_add_eol_date_on_assets_table.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.php index 55542ff2eb..c15c54a568 100644 --- a/app/Observers/AssetObserver.php +++ b/app/Observers/AssetObserver.php @@ -129,7 +129,8 @@ class AssetObserver * * For example, if there is a database migration that's a bit older and modifies an asset, if the save * fires before a field gets created in a later migration and that field in the later migration - * is used in this observer, it doesn't actually exist yet and the migration will break. + * is used in this observer, it doesn't actually exist yet and the migration will break unless we + * use saveQuietly() in the migration which skips this observer. * * @see https://github.com/snipe/snipe-it/issues/13723#issuecomment-1761315938 */ diff --git a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php index 550f6f335b..d20d47d440 100644 --- a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php +++ b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php @@ -23,6 +23,8 @@ class AddEolDateOnAssetsTable extends Migration }); // Chunk the model query to get the models that do have an EOL date + // We use saveQuietly() here to skip the AssetObserver, since it modifies fields + // that do not yet exist on the assets table. AssetModel::whereNotNull('eol')->chunk(10, function ($models) { foreach ($models as $model) { foreach ($model->assets as $asset) { From ca1420c9bd326cbcaa8909417f8fda08fed467af Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 12:39:28 +0100 Subject: [PATCH 40/45] Added the temp column back in Signed-off-by: snipe --- .../2023_01_21_225350_add_eol_date_on_assets_table.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php index d20d47d440..aa9086a7c7 100644 --- a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php +++ b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php @@ -17,9 +17,18 @@ class AddEolDateOnAssetsTable extends Migration { Schema::table('assets', function (Blueprint $table) { + if (!Schema::hasColumn('assets', 'asset_eol_date')) { $table->date('asset_eol_date')->after('purchase_date')->nullable()->default(null); } + + // This is a temporary shim so we don't have to modify the asset observer for migrations where + // there is a large version difference. (See the AssetObserver notes). This column gets created + // later in 2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php + // but we have to temporarily create it now so the save method below doesn't break + if (!Schema::hasColumn('assets', 'eol_explicit')) { + $table->boolean('eol_explicit')->default(false)->after('asset_eol_date'); + } }); // Chunk the model query to get the models that do have an EOL date From 93cccf4f5f22ba44aee96702ea362764c47fc0be Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 19:32:09 +0100 Subject: [PATCH 41/45] Handle case where value is deleted in history Signed-off-by: snipe --- .../Transformers/ActionlogsTransformer.php | 59 ++++++++++++++++--- app/Models/Asset.php | 3 +- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 1cc105e6a9..b04a737da2 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -10,6 +10,8 @@ use App\Models\Supplier; use App\Models\Location; use App\Models\AssetModel; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Contracts\Encryption\DecryptException; +use Illuminate\Support\Facades\Crypt; class ActionlogsTransformer { @@ -69,9 +71,36 @@ class ActionlogsTransformer if ($custom_field->db_column == $fieldname) { - if ($custom_field->field_encrypted == '1') { - $clean_meta[$fieldname]['old'] = "************"; - $clean_meta[$fieldname]['new'] = "************"; + if ($custom_field->field_encrypted == '1') { + + // Unset these fields. We need to decrypt them, since even if the decrypted value + // didn't change, their value in the DB will, so we have to compare the unencrypted version + // to see if the values actually did change + unset($clean_meta[$fieldname]); + unset($clean_meta[$fieldname]); + + $enc_old = ''; + $enc_new = ''; + + try { + $enc_old = \Crypt::decryptString($this->clean_field($fieldata->old)); + } catch (\Exception $e) { + \Log::debug('Could not decrypt field - maybe the key changed?'); + } + + try { + $enc_new = \Crypt::decryptString($this->clean_field($fieldata->new)); + } catch (\Exception $e) { + \Log::debug('Could not decrypt field - maybe the key changed?'); + } + + if ($enc_old != $enc_new) { + \Log::debug('custom fields do not match'); + $clean_meta[$fieldname]['old'] = "************"; + $clean_meta[$fieldname]['new'] = "************"; + } + + } } @@ -178,15 +207,31 @@ class ActionlogsTransformer if(array_key_exists('rtd_location_id',$clean_meta)) { - $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". e($location->find($clean_meta['rtd_location_id']['old'])->name) : trans('general.unassigned'); - $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". e($location->find($clean_meta['rtd_location_id']['new'])->name) : trans('general.unassigned'); + + $oldRtd = $location->find($clean_meta['rtd_location_id']['old']); + $oldRtdName = $oldRtd ? e($oldRtd->name) : trans('general.deleted'); + + $newRtd = $location->find($clean_meta['rtd_location_id']['new']); + $newRtdName = $newRtd ? e($newRtd->name) : trans('general.deleted'); + + $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". $oldRtdName : 'foo'; + $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". $newRtdName : trans('general.unassigned'); $clean_meta['Default Location'] = $clean_meta['rtd_location_id']; unset($clean_meta['rtd_location_id']); } + if (array_key_exists('location_id', $clean_meta)) { - $clean_meta['location_id']['old'] = $clean_meta['location_id']['old'] ? "[id: ".$clean_meta['location_id']['old']."] ".e($location->find($clean_meta['location_id']['old'])->name): trans('general.unassigned'); - $clean_meta['location_id']['new'] = $clean_meta['location_id']['new'] ? "[id: ".$clean_meta['location_id']['new']."] ".e($location->find($clean_meta['location_id']['new'])->name) : trans('general.unassigned'); + + $oldLocation = $location->find($clean_meta['location_id']['old']); + $oldLocationName = $oldLocation ? e($oldLocation->name) : trans('general.deleted'); + + $newLocation = $location->find($clean_meta['location_id']['new']); + $newLocationName = $newLocation ? e($newLocation->name) : trans('general.deleted'); + + + $clean_meta['location_id']['old'] = $clean_meta['location_id']['old'] ? "[id: ".$clean_meta['location_id']['old']."] ". $oldLocationName : trans('general.deleted'); + $clean_meta['location_id']['new'] = $clean_meta['location_id']['new'] ? "[id: ".$clean_meta['location_id']['new']."] ". $newLocationName : trans('general.unassigned'); $clean_meta['Current Location'] = $clean_meta['location_id']; unset($clean_meta['location_id']); } diff --git a/app/Models/Asset.php b/app/Models/Asset.php index e2ffb7ee99..1ce38bca01 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -72,8 +72,7 @@ class Asset extends Depreciable protected $casts = [ 'purchase_date' => 'date', - 'asset_eol_date' => 'date', - 'eol_explicit' => 'boolean', + 'eol_explicit' => 'boolean', 'last_checkout' => 'datetime', 'last_checkin' => 'datetime', 'expected_checkin' => 'date', From 8f23a45cb3467872267fb65cbc8fdc9df14dcaec Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 19:49:03 +0100 Subject: [PATCH 42/45] Removed dummy text Signed-off-by: snipe --- app/Http/Transformers/ActionlogsTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index b04a737da2..403662f47b 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -214,7 +214,7 @@ class ActionlogsTransformer $newRtd = $location->find($clean_meta['rtd_location_id']['new']); $newRtdName = $newRtd ? e($newRtd->name) : trans('general.deleted'); - $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". $oldRtdName : 'foo'; + $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". $oldRtdName : ''; $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". $newRtdName : trans('general.unassigned'); $clean_meta['Default Location'] = $clean_meta['rtd_location_id']; unset($clean_meta['rtd_location_id']); From a92a9d76166ff5f16e504f3f4781d9e599811615 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 13 Oct 2023 19:53:11 +0100 Subject: [PATCH 43/45] Removed duplicated deleted Signed-off-by: snipe --- app/Http/Transformers/ActionlogsTransformer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 403662f47b..d3af3bb753 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -215,7 +215,7 @@ class ActionlogsTransformer $newRtdName = $newRtd ? e($newRtd->name) : trans('general.deleted'); $clean_meta['rtd_location_id']['old'] = $clean_meta['rtd_location_id']['old'] ? "[id: ".$clean_meta['rtd_location_id']['old']."] ". $oldRtdName : ''; - $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". $newRtdName : trans('general.unassigned'); + $clean_meta['rtd_location_id']['new'] = $clean_meta['rtd_location_id']['new'] ? "[id: ".$clean_meta['rtd_location_id']['new']."] ". $newRtdName : ''; $clean_meta['Default Location'] = $clean_meta['rtd_location_id']; unset($clean_meta['rtd_location_id']); } @@ -230,8 +230,8 @@ class ActionlogsTransformer $newLocationName = $newLocation ? e($newLocation->name) : trans('general.deleted'); - $clean_meta['location_id']['old'] = $clean_meta['location_id']['old'] ? "[id: ".$clean_meta['location_id']['old']."] ". $oldLocationName : trans('general.deleted'); - $clean_meta['location_id']['new'] = $clean_meta['location_id']['new'] ? "[id: ".$clean_meta['location_id']['new']."] ". $newLocationName : trans('general.unassigned'); + $clean_meta['location_id']['old'] = $clean_meta['location_id']['old'] ? "[id: ".$clean_meta['location_id']['old']."] ". $oldLocationName : ''; + $clean_meta['location_id']['new'] = $clean_meta['location_id']['new'] ? "[id: ".$clean_meta['location_id']['new']."] ". $newLocationName : ''; $clean_meta['Current Location'] = $clean_meta['location_id']; unset($clean_meta['location_id']); } From 752171d5b8d60cf60431740db6ac6d5a28044bec Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 14 Oct 2023 20:39:52 +0100 Subject: [PATCH 44/45] Use singleton for offset Signed-off-by: snipe --- app/Http/Controllers/Api/AssetsController.php | 2 +- app/Http/Controllers/Api/CategoriesController.php | 2 +- app/Http/Controllers/Api/CompaniesController.php | 2 +- app/Http/Controllers/Api/ComponentsController.php | 2 +- app/Http/Controllers/Api/ConsumablesController.php | 2 +- app/Http/Controllers/Api/DepartmentsController.php | 2 +- .../Controllers/Api/DepreciationsController.php | 2 +- app/Http/Controllers/Api/GroupsController.php | 2 +- app/Http/Controllers/Api/LicenseSeatsController.php | 2 +- app/Http/Controllers/Api/LicensesController.php | 2 +- app/Http/Controllers/Api/LocationsController.php | 2 +- .../Controllers/Api/ManufacturersController.php | 2 +- .../Controllers/Api/PredefinedKitsController.php | 2 +- app/Http/Controllers/Api/ReportsController.php | 2 +- app/Http/Controllers/Api/StatuslabelsController.php | 2 +- app/Http/Controllers/Api/SuppliersController.php | 2 +- app/Http/Controllers/Api/UsersController.php | 2 +- app/Providers/SettingsServiceProvider.php | 13 +++++++++++++ 18 files changed, 30 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 39b5ee238e..e49edc4db4 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -346,7 +346,7 @@ class AssetsController extends Controller // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $assets->count()) ? $assets->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $assets->count()) ? $assets->count() : app('api_offset_value'); $limit = app('api_limit_value'); $total = $assets->count(); diff --git a/app/Http/Controllers/Api/CategoriesController.php b/app/Http/Controllers/Api/CategoriesController.php index 2781fa101f..2aa4b3741c 100644 --- a/app/Http/Controllers/Api/CategoriesController.php +++ b/app/Http/Controllers/Api/CategoriesController.php @@ -92,7 +92,7 @@ class CategoriesController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $categories->count()) ? $categories->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $categories->count()) ? $categories->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/CompaniesController.php b/app/Http/Controllers/Api/CompaniesController.php index 42b5302448..580bc5d9b9 100644 --- a/app/Http/Controllers/Api/CompaniesController.php +++ b/app/Http/Controllers/Api/CompaniesController.php @@ -56,7 +56,7 @@ class CompaniesController extends Controller // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $companies->count()) ? $companies->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $companies->count()) ? $companies->count() : app('api_offset_value'); $limit = app('api_limit_value'); diff --git a/app/Http/Controllers/Api/ComponentsController.php b/app/Http/Controllers/Api/ComponentsController.php index 9525bdbafc..9202b10b71 100644 --- a/app/Http/Controllers/Api/ComponentsController.php +++ b/app/Http/Controllers/Api/ComponentsController.php @@ -77,7 +77,7 @@ class ComponentsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $components->count()) ? $components->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $components->count()) ? $components->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.php index ba7e6fb302..b9b48328f5 100644 --- a/app/Http/Controllers/Api/ConsumablesController.php +++ b/app/Http/Controllers/Api/ConsumablesController.php @@ -86,7 +86,7 @@ class ConsumablesController extends Controller // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $consumables->count()) ? $consumables->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $consumables->count()) ? $consumables->count() : app('api_offset_value'); $limit = app('api_limit_value'); $allowed_columns = ['id', 'name', 'order_number', 'min_amt', 'purchase_date', 'purchase_cost', 'company', 'category', 'model_number', 'item_no', 'manufacturer', 'location', 'qty', 'image']; diff --git a/app/Http/Controllers/Api/DepartmentsController.php b/app/Http/Controllers/Api/DepartmentsController.php index d152d0a507..f211089b93 100644 --- a/app/Http/Controllers/Api/DepartmentsController.php +++ b/app/Http/Controllers/Api/DepartmentsController.php @@ -61,7 +61,7 @@ class DepartmentsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $departments->count()) ? $departments->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $departments->count()) ? $departments->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/DepreciationsController.php b/app/Http/Controllers/Api/DepreciationsController.php index 3d86c1b096..502a0741b7 100644 --- a/app/Http/Controllers/Api/DepreciationsController.php +++ b/app/Http/Controllers/Api/DepreciationsController.php @@ -29,7 +29,7 @@ class DepreciationsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $depreciations->count()) ? $depreciations->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $depreciations->count()) ? $depreciations->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/GroupsController.php b/app/Http/Controllers/Api/GroupsController.php index 6dc7e83dd6..8548af0ba5 100644 --- a/app/Http/Controllers/Api/GroupsController.php +++ b/app/Http/Controllers/Api/GroupsController.php @@ -36,7 +36,7 @@ class GroupsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $groups->count()) ? $groups->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $groups->count()) ? $groups->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/LicenseSeatsController.php b/app/Http/Controllers/Api/LicenseSeatsController.php index a091741e85..5e79c49b23 100644 --- a/app/Http/Controllers/Api/LicenseSeatsController.php +++ b/app/Http/Controllers/Api/LicenseSeatsController.php @@ -41,7 +41,7 @@ class LicenseSeatsController extends Controller $total = $seats->count(); // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $seats->count()) ? $seats->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $seats->count()) ? $seats->count() : app('api_offset_value'); if ($offset >= $total ){ $offset = 0; diff --git a/app/Http/Controllers/Api/LicensesController.php b/app/Http/Controllers/Api/LicensesController.php index e021fc3d3e..d456e3cd64 100644 --- a/app/Http/Controllers/Api/LicensesController.php +++ b/app/Http/Controllers/Api/LicensesController.php @@ -95,7 +95,7 @@ class LicensesController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $licenses->count()) ? $licenses->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $licenses->count()) ? $licenses->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.php index 87bc266217..b888493286 100644 --- a/app/Http/Controllers/Api/LocationsController.php +++ b/app/Http/Controllers/Api/LocationsController.php @@ -81,7 +81,7 @@ class LocationsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $locations->count()) ? $locations->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $locations->count()) ? $locations->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/ManufacturersController.php b/app/Http/Controllers/Api/ManufacturersController.php index 9ff0a0c202..dadef87e26 100644 --- a/app/Http/Controllers/Api/ManufacturersController.php +++ b/app/Http/Controllers/Api/ManufacturersController.php @@ -62,7 +62,7 @@ class ManufacturersController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $manufacturers->count()) ? $manufacturers->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $manufacturers->count()) ? $manufacturers->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/PredefinedKitsController.php b/app/Http/Controllers/Api/PredefinedKitsController.php index 85d05c422e..b398dbfae2 100644 --- a/app/Http/Controllers/Api/PredefinedKitsController.php +++ b/app/Http/Controllers/Api/PredefinedKitsController.php @@ -30,7 +30,7 @@ class PredefinedKitsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $kits->count()) ? $kits->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $kits->count()) ? $kits->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'desc' ? 'desc' : 'asc'; diff --git a/app/Http/Controllers/Api/ReportsController.php b/app/Http/Controllers/Api/ReportsController.php index 21294c5779..7335e7d8e0 100644 --- a/app/Http/Controllers/Api/ReportsController.php +++ b/app/Http/Controllers/Api/ReportsController.php @@ -56,7 +56,7 @@ class ReportsController extends Controller // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $actionlogs->count()) ? $actionlogs->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $actionlogs->count()) ? $actionlogs->count() : app('api_offset_value'); $limit = app('api_limit_value'); $sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at'; diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.php index 30a0b699e9..7c8e260c2f 100644 --- a/app/Http/Controllers/Api/StatuslabelsController.php +++ b/app/Http/Controllers/Api/StatuslabelsController.php @@ -52,7 +52,7 @@ class StatuslabelsController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $statuslabels->count()) ? $statuslabels->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $statuslabels->count()) ? $statuslabels->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/SuppliersController.php b/app/Http/Controllers/Api/SuppliersController.php index ad1227cc83..3e3d637be0 100644 --- a/app/Http/Controllers/Api/SuppliersController.php +++ b/app/Http/Controllers/Api/SuppliersController.php @@ -94,7 +94,7 @@ class SuppliersController extends Controller } // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $suppliers->count()) ? $suppliers->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $suppliers->count()) ? $suppliers->count() : app('api_offset_value'); $limit = app('api_limit_value'); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 64d942fb9d..5a2cd7dcf1 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -192,7 +192,7 @@ class UsersController extends Controller $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $users->count()) ? $users->count() : abs($request->input('offset')); + $offset = ($request->input('offset') > $users->count()) ? $users->count() : app('api_offset_value'); $limit = app('api_limit_value'); diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php index 6656f284e0..bed653783a 100644 --- a/app/Providers/SettingsServiceProvider.php +++ b/app/Providers/SettingsServiceProvider.php @@ -38,15 +38,28 @@ class SettingsServiceProvider extends ServiceProvider if ((abs($int_limit) > 0) && ($int_limit <= config('app.max_results'))) { $limit = abs($int_limit); } + \Log::debug('Max in env: '.config('app.max_results')); \Log::debug('Original requested limit: '.request('limit')); \Log::debug('Int limit: '.$int_limit); \Log::debug('Modified limit: '.$limit); \Log::debug('------------------------------'); + return $limit; }); + // Make sure the offset is actually set and is an integer + \App::singleton('api_offset_value', function () { + $offset = intval(request('offset')); + \Log::debug('Original requested offset: '.request('offset')); + \Log::debug('Modified offset: '.$offset); + \Log::debug('------------------------------'); + + + return $offset; + }); + /** * Set some common variables so that they're globally available. From 199cdf68994d88a6322cf2798e18794630e686a2 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 14 Oct 2023 20:43:18 +0100 Subject: [PATCH 45/45] Commented out noisy debugging Signed-off-by: snipe --- app/Providers/SettingsServiceProvider.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php index bed653783a..41dd80b4fc 100644 --- a/app/Providers/SettingsServiceProvider.php +++ b/app/Providers/SettingsServiceProvider.php @@ -39,11 +39,11 @@ class SettingsServiceProvider extends ServiceProvider $limit = abs($int_limit); } - \Log::debug('Max in env: '.config('app.max_results')); - \Log::debug('Original requested limit: '.request('limit')); - \Log::debug('Int limit: '.$int_limit); - \Log::debug('Modified limit: '.$limit); - \Log::debug('------------------------------'); +// \Log::debug('Max in env: '.config('app.max_results')); +// \Log::debug('Original requested limit: '.request('limit')); +// \Log::debug('Int limit: '.$int_limit); +// \Log::debug('Modified limit: '.$limit); +// \Log::debug('------------------------------'); return $limit; @@ -52,9 +52,9 @@ class SettingsServiceProvider extends ServiceProvider // Make sure the offset is actually set and is an integer \App::singleton('api_offset_value', function () { $offset = intval(request('offset')); - \Log::debug('Original requested offset: '.request('offset')); - \Log::debug('Modified offset: '.$offset); - \Log::debug('------------------------------'); +// \Log::debug('Original requested offset: '.request('offset')); +// \Log::debug('Modified offset: '.$offset); +// \Log::debug('------------------------------'); return $offset;