Files
wdi-dashboard/node_modules/@chakra-ui/media-query/dist/media-query.utils.js
2024-08-16 15:06:52 +05:30

52 lines
1.7 KiB
JavaScript

'use client'
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/media-query.utils.ts
var media_query_utils_exports = {};
__export(media_query_utils_exports, {
getClosestValue: () => getClosestValue
});
module.exports = __toCommonJS(media_query_utils_exports);
var import_breakpoint_utils = require("@chakra-ui/breakpoint-utils");
function getClosestValue(values, breakpoint, breakpoints = import_breakpoint_utils.breakpoints) {
let index = Object.keys(values).indexOf(breakpoint);
if (index !== -1) {
return values[breakpoint];
}
let stopIndex = breakpoints.indexOf(breakpoint);
while (stopIndex >= 0) {
const key = breakpoints[stopIndex];
if (values.hasOwnProperty(key)) {
index = stopIndex;
break;
}
stopIndex -= 1;
}
if (index !== -1) {
const key = breakpoints[index];
return values[key];
}
return void 0;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getClosestValue
});
//# sourceMappingURL=media-query.utils.js.map