- Replaced rainbow grid with phase-aware cockpit layout - Implemented smart lifecycle hero with readiness logic - Introduced dark command bar header with context pill and search placeholder - Updated global Tamagui theme to slate/indigo palette - Refined bottom navigation with minimalist spotlight style
40568 lines
1.5 MiB
40568 lines
1.5 MiB
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
// file that has been converted to a CommonJS file using a Babel-
|
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// node_modules/@babel/runtime/helpers/interopRequireDefault.js
|
|
var require_interopRequireDefault = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports2, module2) {
|
|
function _interopRequireDefault(e) {
|
|
return e && e.__esModule ? e : {
|
|
"default": e
|
|
};
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
module2.exports = _interopRequireDefault, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/isDisabled.js
|
|
var require_isDisabled = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/isDisabled.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var isDisabled = /* @__PURE__ */ __name((props) => props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf("disabled") > -1, "isDisabled");
|
|
var _default = exports2.default = isDisabled;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.js
|
|
var require_propsToAriaRole = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var accessibilityRoleToWebRole = {
|
|
adjustable: "slider",
|
|
button: "button",
|
|
header: "heading",
|
|
image: "img",
|
|
imagebutton: null,
|
|
keyboardkey: null,
|
|
label: null,
|
|
link: "link",
|
|
none: "presentation",
|
|
search: "search",
|
|
summary: "region",
|
|
text: null
|
|
};
|
|
var propsToAriaRole = /* @__PURE__ */ __name((_ref) => {
|
|
var accessibilityRole = _ref.accessibilityRole, role = _ref.role;
|
|
var _role = role || accessibilityRole;
|
|
if (_role) {
|
|
var inferredRole = accessibilityRoleToWebRole[_role];
|
|
if (inferredRole !== null) {
|
|
return inferredRole || _role;
|
|
}
|
|
}
|
|
}, "propsToAriaRole");
|
|
var _default = exports2.default = propsToAriaRole;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.js
|
|
var require_propsToAccessibilityComponent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _propsToAriaRole = _interopRequireDefault(require_propsToAriaRole());
|
|
var roleComponents = {
|
|
article: "article",
|
|
banner: "header",
|
|
blockquote: "blockquote",
|
|
button: "button",
|
|
code: "code",
|
|
complementary: "aside",
|
|
contentinfo: "footer",
|
|
deletion: "del",
|
|
emphasis: "em",
|
|
figure: "figure",
|
|
insertion: "ins",
|
|
form: "form",
|
|
list: "ul",
|
|
listitem: "li",
|
|
main: "main",
|
|
navigation: "nav",
|
|
paragraph: "p",
|
|
region: "section",
|
|
strong: "strong"
|
|
};
|
|
var emptyObject = {};
|
|
var propsToAccessibilityComponent = /* @__PURE__ */ __name(function propsToAccessibilityComponent2(props) {
|
|
if (props === void 0) {
|
|
props = emptyObject;
|
|
}
|
|
var roleProp = props.role || props.accessibilityRole;
|
|
if (roleProp === "label") {
|
|
return "label";
|
|
}
|
|
var role = (0, _propsToAriaRole.default)(props);
|
|
if (role) {
|
|
if (role === "heading") {
|
|
var level = props.accessibilityLevel || props["aria-level"];
|
|
if (level != null) {
|
|
return "h" + level;
|
|
}
|
|
return "h1";
|
|
}
|
|
return roleComponents[role];
|
|
}
|
|
}, "propsToAccessibilityComponent");
|
|
var _default = exports2.default = propsToAccessibilityComponent;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/index.js
|
|
var require_AccessibilityUtil = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _isDisabled = _interopRequireDefault(require_isDisabled());
|
|
var _propsToAccessibilityComponent = _interopRequireDefault(require_propsToAccessibilityComponent());
|
|
var _propsToAriaRole = _interopRequireDefault(require_propsToAriaRole());
|
|
var AccessibilityUtil = {
|
|
isDisabled: _isDisabled.default,
|
|
propsToAccessibilityComponent: _propsToAccessibilityComponent.default,
|
|
propsToAriaRole: _propsToAriaRole.default
|
|
};
|
|
var _default = exports2.default = AccessibilityUtil;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/typeof.js
|
|
var require_typeof = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/typeof.js"(exports2, module2) {
|
|
function _typeof(o) {
|
|
"@babel/helpers - typeof";
|
|
return module2.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports, _typeof(o);
|
|
}
|
|
__name(_typeof, "_typeof");
|
|
module2.exports = _typeof, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/toPrimitive.js
|
|
var require_toPrimitive = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/toPrimitive.js"(exports2, module2) {
|
|
var _typeof = require_typeof()["default"];
|
|
function toPrimitive(t, r) {
|
|
if ("object" != _typeof(t) || !t) return t;
|
|
var e = t[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i = e.call(t, r || "default");
|
|
if ("object" != _typeof(i)) return i;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t);
|
|
}
|
|
__name(toPrimitive, "toPrimitive");
|
|
module2.exports = toPrimitive, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/toPropertyKey.js
|
|
var require_toPropertyKey = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/toPropertyKey.js"(exports2, module2) {
|
|
var _typeof = require_typeof()["default"];
|
|
var toPrimitive = require_toPrimitive();
|
|
function toPropertyKey(t) {
|
|
var i = toPrimitive(t, "string");
|
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
}
|
|
__name(toPropertyKey, "toPropertyKey");
|
|
module2.exports = toPropertyKey, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/defineProperty.js
|
|
var require_defineProperty = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/defineProperty.js"(exports2, module2) {
|
|
var toPropertyKey = require_toPropertyKey();
|
|
function _defineProperty(e, r, t) {
|
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
value: t,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
}) : e[r] = t, e;
|
|
}
|
|
__name(_defineProperty, "_defineProperty");
|
|
module2.exports = _defineProperty, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var require_objectSpread2 = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/objectSpread2.js"(exports2, module2) {
|
|
var defineProperty = require_defineProperty();
|
|
function ownKeys(e, r) {
|
|
var t = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t.push.apply(t, o);
|
|
}
|
|
return t;
|
|
}
|
|
__name(ownKeys, "ownKeys");
|
|
function _objectSpread2(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
defineProperty(e, r2, t[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
__name(_objectSpread2, "_objectSpread2");
|
|
module2.exports = _objectSpread2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
|
|
var require_objectWithoutPropertiesLoose = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports2, module2) {
|
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
if (null == r) return {};
|
|
var t = {};
|
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
if (-1 !== e.indexOf(n)) continue;
|
|
t[n] = r[n];
|
|
}
|
|
return t;
|
|
}
|
|
__name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose");
|
|
module2.exports = _objectWithoutPropertiesLoose, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/unitlessNumbers.js
|
|
var require_unitlessNumbers = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/unitlessNumbers.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var unitlessNumbers = {
|
|
animationIterationCount: true,
|
|
aspectRatio: true,
|
|
borderImageOutset: true,
|
|
borderImageSlice: true,
|
|
borderImageWidth: true,
|
|
boxFlex: true,
|
|
boxFlexGroup: true,
|
|
boxOrdinalGroup: true,
|
|
columnCount: true,
|
|
flex: true,
|
|
flexGrow: true,
|
|
flexOrder: true,
|
|
flexPositive: true,
|
|
flexShrink: true,
|
|
flexNegative: true,
|
|
fontWeight: true,
|
|
gridRow: true,
|
|
gridRowEnd: true,
|
|
gridRowGap: true,
|
|
gridRowStart: true,
|
|
gridColumn: true,
|
|
gridColumnEnd: true,
|
|
gridColumnGap: true,
|
|
gridColumnStart: true,
|
|
lineClamp: true,
|
|
opacity: true,
|
|
order: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
// SVG-related
|
|
fillOpacity: true,
|
|
floodOpacity: true,
|
|
stopOpacity: true,
|
|
strokeDasharray: true,
|
|
strokeDashoffset: true,
|
|
strokeMiterlimit: true,
|
|
strokeOpacity: true,
|
|
strokeWidth: true,
|
|
// transform types
|
|
scale: true,
|
|
scaleX: true,
|
|
scaleY: true,
|
|
scaleZ: true,
|
|
// RN properties
|
|
shadowOpacity: true
|
|
};
|
|
var prefixes = ["ms", "Moz", "O", "Webkit"];
|
|
var prefixKey = /* @__PURE__ */ __name((prefix, key) => {
|
|
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
}, "prefixKey");
|
|
Object.keys(unitlessNumbers).forEach((prop) => {
|
|
prefixes.forEach((prefix) => {
|
|
unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
|
|
});
|
|
});
|
|
var _default = exports2.default = unitlessNumbers;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/isWebColor/index.js
|
|
var require_isWebColor = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/isWebColor/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var isWebColor = /* @__PURE__ */ __name((color) => color === "currentcolor" || color === "currentColor" || color === "inherit" || color.indexOf("var(") === 0, "isWebColor");
|
|
var _default = exports2.default = isWebColor;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/node_modules/@react-native/normalize-colors/index.js
|
|
var require_normalize_colors = __commonJS({
|
|
"node_modules/react-native-web/node_modules/@react-native/normalize-colors/index.js"(exports2, module2) {
|
|
"use strict";
|
|
function normalizeColor(color) {
|
|
if (typeof color === "number") {
|
|
if (color >>> 0 === color && color >= 0 && color <= 4294967295) {
|
|
return color;
|
|
}
|
|
return null;
|
|
}
|
|
if (typeof color !== "string") {
|
|
return null;
|
|
}
|
|
const matchers = getMatchers();
|
|
let match;
|
|
if (match = matchers.hex6.exec(color)) {
|
|
return parseInt(match[1] + "ff", 16) >>> 0;
|
|
}
|
|
const colorFromKeyword = normalizeKeyword(color);
|
|
if (colorFromKeyword != null) {
|
|
return colorFromKeyword;
|
|
}
|
|
if (match = matchers.rgb.exec(color)) {
|
|
return (parse255(match[1]) << 24 | // r
|
|
parse255(match[2]) << 16 | // g
|
|
parse255(match[3]) << 8 | // b
|
|
255) >>> // a
|
|
0;
|
|
}
|
|
if (match = matchers.rgba.exec(color)) {
|
|
if (match[6] !== void 0) {
|
|
return (parse255(match[6]) << 24 | // r
|
|
parse255(match[7]) << 16 | // g
|
|
parse255(match[8]) << 8 | // b
|
|
parse1(match[9])) >>> // a
|
|
0;
|
|
}
|
|
return (parse255(match[2]) << 24 | // r
|
|
parse255(match[3]) << 16 | // g
|
|
parse255(match[4]) << 8 | // b
|
|
parse1(match[5])) >>> // a
|
|
0;
|
|
}
|
|
if (match = matchers.hex3.exec(color)) {
|
|
return parseInt(
|
|
match[1] + match[1] + // r
|
|
match[2] + match[2] + // g
|
|
match[3] + match[3] + // b
|
|
"ff",
|
|
// a
|
|
16
|
|
) >>> 0;
|
|
}
|
|
if (match = matchers.hex8.exec(color)) {
|
|
return parseInt(match[1], 16) >>> 0;
|
|
}
|
|
if (match = matchers.hex4.exec(color)) {
|
|
return parseInt(
|
|
match[1] + match[1] + // r
|
|
match[2] + match[2] + // g
|
|
match[3] + match[3] + // b
|
|
match[4] + match[4],
|
|
// a
|
|
16
|
|
) >>> 0;
|
|
}
|
|
if (match = matchers.hsl.exec(color)) {
|
|
return (hslToRgb(
|
|
parse360(match[1]),
|
|
// h
|
|
parsePercentage(match[2]),
|
|
// s
|
|
parsePercentage(match[3])
|
|
// l
|
|
) | 255) >>> // a
|
|
0;
|
|
}
|
|
if (match = matchers.hsla.exec(color)) {
|
|
if (match[6] !== void 0) {
|
|
return (hslToRgb(
|
|
parse360(match[6]),
|
|
// h
|
|
parsePercentage(match[7]),
|
|
// s
|
|
parsePercentage(match[8])
|
|
// l
|
|
) | parse1(match[9])) >>> // a
|
|
0;
|
|
}
|
|
return (hslToRgb(
|
|
parse360(match[2]),
|
|
// h
|
|
parsePercentage(match[3]),
|
|
// s
|
|
parsePercentage(match[4])
|
|
// l
|
|
) | parse1(match[5])) >>> // a
|
|
0;
|
|
}
|
|
if (match = matchers.hwb.exec(color)) {
|
|
return (hwbToRgb(
|
|
parse360(match[1]),
|
|
// h
|
|
parsePercentage(match[2]),
|
|
// w
|
|
parsePercentage(match[3])
|
|
// b
|
|
) | 255) >>> // a
|
|
0;
|
|
}
|
|
return null;
|
|
}
|
|
__name(normalizeColor, "normalizeColor");
|
|
function hue2rgb(p, q, t) {
|
|
if (t < 0) {
|
|
t += 1;
|
|
}
|
|
if (t > 1) {
|
|
t -= 1;
|
|
}
|
|
if (t < 1 / 6) {
|
|
return p + (q - p) * 6 * t;
|
|
}
|
|
if (t < 1 / 2) {
|
|
return q;
|
|
}
|
|
if (t < 2 / 3) {
|
|
return p + (q - p) * (2 / 3 - t) * 6;
|
|
}
|
|
return p;
|
|
}
|
|
__name(hue2rgb, "hue2rgb");
|
|
function hslToRgb(h, s, l) {
|
|
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
const p = 2 * l - q;
|
|
const r = hue2rgb(p, q, h + 1 / 3);
|
|
const g = hue2rgb(p, q, h);
|
|
const b = hue2rgb(p, q, h - 1 / 3);
|
|
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
|
}
|
|
__name(hslToRgb, "hslToRgb");
|
|
function hwbToRgb(h, w, b) {
|
|
if (w + b >= 1) {
|
|
const gray = Math.round(w * 255 / (w + b));
|
|
return gray << 24 | gray << 16 | gray << 8;
|
|
}
|
|
const red = hue2rgb(0, 1, h + 1 / 3) * (1 - w - b) + w;
|
|
const green = hue2rgb(0, 1, h) * (1 - w - b) + w;
|
|
const blue = hue2rgb(0, 1, h - 1 / 3) * (1 - w - b) + w;
|
|
return Math.round(red * 255) << 24 | Math.round(green * 255) << 16 | Math.round(blue * 255) << 8;
|
|
}
|
|
__name(hwbToRgb, "hwbToRgb");
|
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
var PERCENTAGE = NUMBER + "%";
|
|
function call(...args) {
|
|
return "\\(\\s*(" + args.join(")\\s*,?\\s*(") + ")\\s*\\)";
|
|
}
|
|
__name(call, "call");
|
|
function callWithSlashSeparator(...args) {
|
|
return "\\(\\s*(" + args.slice(0, args.length - 1).join(")\\s*,?\\s*(") + ")\\s*/\\s*(" + args[args.length - 1] + ")\\s*\\)";
|
|
}
|
|
__name(callWithSlashSeparator, "callWithSlashSeparator");
|
|
function commaSeparatedCall(...args) {
|
|
return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
}
|
|
__name(commaSeparatedCall, "commaSeparatedCall");
|
|
var cachedMatchers;
|
|
function getMatchers() {
|
|
if (cachedMatchers === void 0) {
|
|
cachedMatchers = {
|
|
rgb: new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)),
|
|
rgba: new RegExp(
|
|
"rgba(" + commaSeparatedCall(NUMBER, NUMBER, NUMBER, NUMBER) + "|" + callWithSlashSeparator(NUMBER, NUMBER, NUMBER, NUMBER) + ")"
|
|
),
|
|
hsl: new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
|
|
hsla: new RegExp(
|
|
"hsla(" + commaSeparatedCall(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + "|" + callWithSlashSeparator(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + ")"
|
|
),
|
|
hwb: new RegExp("hwb" + call(NUMBER, PERCENTAGE, PERCENTAGE)),
|
|
hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
hex6: /^#([0-9a-fA-F]{6})$/,
|
|
hex8: /^#([0-9a-fA-F]{8})$/
|
|
};
|
|
}
|
|
return cachedMatchers;
|
|
}
|
|
__name(getMatchers, "getMatchers");
|
|
function parse255(str) {
|
|
const int = parseInt(str, 10);
|
|
if (int < 0) {
|
|
return 0;
|
|
}
|
|
if (int > 255) {
|
|
return 255;
|
|
}
|
|
return int;
|
|
}
|
|
__name(parse255, "parse255");
|
|
function parse360(str) {
|
|
const int = parseFloat(str);
|
|
return (int % 360 + 360) % 360 / 360;
|
|
}
|
|
__name(parse360, "parse360");
|
|
function parse1(str) {
|
|
const num = parseFloat(str);
|
|
if (num < 0) {
|
|
return 0;
|
|
}
|
|
if (num > 1) {
|
|
return 255;
|
|
}
|
|
return Math.round(num * 255);
|
|
}
|
|
__name(parse1, "parse1");
|
|
function parsePercentage(str) {
|
|
const int = parseFloat(str);
|
|
if (int < 0) {
|
|
return 0;
|
|
}
|
|
if (int > 100) {
|
|
return 1;
|
|
}
|
|
return int / 100;
|
|
}
|
|
__name(parsePercentage, "parsePercentage");
|
|
function normalizeKeyword(name) {
|
|
switch (name) {
|
|
case "transparent":
|
|
return 0;
|
|
// http://www.w3.org/TR/css3-color/#svg-color
|
|
case "aliceblue":
|
|
return 4042850303;
|
|
case "antiquewhite":
|
|
return 4209760255;
|
|
case "aqua":
|
|
return 16777215;
|
|
case "aquamarine":
|
|
return 2147472639;
|
|
case "azure":
|
|
return 4043309055;
|
|
case "beige":
|
|
return 4126530815;
|
|
case "bisque":
|
|
return 4293182719;
|
|
case "black":
|
|
return 255;
|
|
case "blanchedalmond":
|
|
return 4293643775;
|
|
case "blue":
|
|
return 65535;
|
|
case "blueviolet":
|
|
return 2318131967;
|
|
case "brown":
|
|
return 2771004159;
|
|
case "burlywood":
|
|
return 3736635391;
|
|
case "burntsienna":
|
|
return 3934150143;
|
|
case "cadetblue":
|
|
return 1604231423;
|
|
case "chartreuse":
|
|
return 2147418367;
|
|
case "chocolate":
|
|
return 3530104575;
|
|
case "coral":
|
|
return 4286533887;
|
|
case "cornflowerblue":
|
|
return 1687547391;
|
|
case "cornsilk":
|
|
return 4294499583;
|
|
case "crimson":
|
|
return 3692313855;
|
|
case "cyan":
|
|
return 16777215;
|
|
case "darkblue":
|
|
return 35839;
|
|
case "darkcyan":
|
|
return 9145343;
|
|
case "darkgoldenrod":
|
|
return 3095792639;
|
|
case "darkgray":
|
|
return 2846468607;
|
|
case "darkgreen":
|
|
return 6553855;
|
|
case "darkgrey":
|
|
return 2846468607;
|
|
case "darkkhaki":
|
|
return 3182914559;
|
|
case "darkmagenta":
|
|
return 2332068863;
|
|
case "darkolivegreen":
|
|
return 1433087999;
|
|
case "darkorange":
|
|
return 4287365375;
|
|
case "darkorchid":
|
|
return 2570243327;
|
|
case "darkred":
|
|
return 2332033279;
|
|
case "darksalmon":
|
|
return 3918953215;
|
|
case "darkseagreen":
|
|
return 2411499519;
|
|
case "darkslateblue":
|
|
return 1211993087;
|
|
case "darkslategray":
|
|
return 793726975;
|
|
case "darkslategrey":
|
|
return 793726975;
|
|
case "darkturquoise":
|
|
return 13554175;
|
|
case "darkviolet":
|
|
return 2483082239;
|
|
case "deeppink":
|
|
return 4279538687;
|
|
case "deepskyblue":
|
|
return 12582911;
|
|
case "dimgray":
|
|
return 1768516095;
|
|
case "dimgrey":
|
|
return 1768516095;
|
|
case "dodgerblue":
|
|
return 512819199;
|
|
case "firebrick":
|
|
return 2988581631;
|
|
case "floralwhite":
|
|
return 4294635775;
|
|
case "forestgreen":
|
|
return 579543807;
|
|
case "fuchsia":
|
|
return 4278255615;
|
|
case "gainsboro":
|
|
return 3705462015;
|
|
case "ghostwhite":
|
|
return 4177068031;
|
|
case "gold":
|
|
return 4292280575;
|
|
case "goldenrod":
|
|
return 3668254975;
|
|
case "gray":
|
|
return 2155905279;
|
|
case "green":
|
|
return 8388863;
|
|
case "greenyellow":
|
|
return 2919182335;
|
|
case "grey":
|
|
return 2155905279;
|
|
case "honeydew":
|
|
return 4043305215;
|
|
case "hotpink":
|
|
return 4285117695;
|
|
case "indianred":
|
|
return 3445382399;
|
|
case "indigo":
|
|
return 1258324735;
|
|
case "ivory":
|
|
return 4294963455;
|
|
case "khaki":
|
|
return 4041641215;
|
|
case "lavender":
|
|
return 3873897215;
|
|
case "lavenderblush":
|
|
return 4293981695;
|
|
case "lawngreen":
|
|
return 2096890111;
|
|
case "lemonchiffon":
|
|
return 4294626815;
|
|
case "lightblue":
|
|
return 2916673279;
|
|
case "lightcoral":
|
|
return 4034953471;
|
|
case "lightcyan":
|
|
return 3774873599;
|
|
case "lightgoldenrodyellow":
|
|
return 4210742015;
|
|
case "lightgray":
|
|
return 3553874943;
|
|
case "lightgreen":
|
|
return 2431553791;
|
|
case "lightgrey":
|
|
return 3553874943;
|
|
case "lightpink":
|
|
return 4290167295;
|
|
case "lightsalmon":
|
|
return 4288707327;
|
|
case "lightseagreen":
|
|
return 548580095;
|
|
case "lightskyblue":
|
|
return 2278488831;
|
|
case "lightslategray":
|
|
return 2005441023;
|
|
case "lightslategrey":
|
|
return 2005441023;
|
|
case "lightsteelblue":
|
|
return 2965692159;
|
|
case "lightyellow":
|
|
return 4294959359;
|
|
case "lime":
|
|
return 16711935;
|
|
case "limegreen":
|
|
return 852308735;
|
|
case "linen":
|
|
return 4210091775;
|
|
case "magenta":
|
|
return 4278255615;
|
|
case "maroon":
|
|
return 2147483903;
|
|
case "mediumaquamarine":
|
|
return 1724754687;
|
|
case "mediumblue":
|
|
return 52735;
|
|
case "mediumorchid":
|
|
return 3126187007;
|
|
case "mediumpurple":
|
|
return 2473647103;
|
|
case "mediumseagreen":
|
|
return 1018393087;
|
|
case "mediumslateblue":
|
|
return 2070474495;
|
|
case "mediumspringgreen":
|
|
return 16423679;
|
|
case "mediumturquoise":
|
|
return 1221709055;
|
|
case "mediumvioletred":
|
|
return 3340076543;
|
|
case "midnightblue":
|
|
return 421097727;
|
|
case "mintcream":
|
|
return 4127193855;
|
|
case "mistyrose":
|
|
return 4293190143;
|
|
case "moccasin":
|
|
return 4293178879;
|
|
case "navajowhite":
|
|
return 4292783615;
|
|
case "navy":
|
|
return 33023;
|
|
case "oldlace":
|
|
return 4260751103;
|
|
case "olive":
|
|
return 2155872511;
|
|
case "olivedrab":
|
|
return 1804477439;
|
|
case "orange":
|
|
return 4289003775;
|
|
case "orangered":
|
|
return 4282712319;
|
|
case "orchid":
|
|
return 3664828159;
|
|
case "palegoldenrod":
|
|
return 4008225535;
|
|
case "palegreen":
|
|
return 2566625535;
|
|
case "paleturquoise":
|
|
return 2951671551;
|
|
case "palevioletred":
|
|
return 3681588223;
|
|
case "papayawhip":
|
|
return 4293907967;
|
|
case "peachpuff":
|
|
return 4292524543;
|
|
case "peru":
|
|
return 3448061951;
|
|
case "pink":
|
|
return 4290825215;
|
|
case "plum":
|
|
return 3718307327;
|
|
case "powderblue":
|
|
return 2967529215;
|
|
case "purple":
|
|
return 2147516671;
|
|
case "rebeccapurple":
|
|
return 1714657791;
|
|
case "red":
|
|
return 4278190335;
|
|
case "rosybrown":
|
|
return 3163525119;
|
|
case "royalblue":
|
|
return 1097458175;
|
|
case "saddlebrown":
|
|
return 2336560127;
|
|
case "salmon":
|
|
return 4202722047;
|
|
case "sandybrown":
|
|
return 4104413439;
|
|
case "seagreen":
|
|
return 780883967;
|
|
case "seashell":
|
|
return 4294307583;
|
|
case "sienna":
|
|
return 2689740287;
|
|
case "silver":
|
|
return 3233857791;
|
|
case "skyblue":
|
|
return 2278484991;
|
|
case "slateblue":
|
|
return 1784335871;
|
|
case "slategray":
|
|
return 1887473919;
|
|
case "slategrey":
|
|
return 1887473919;
|
|
case "snow":
|
|
return 4294638335;
|
|
case "springgreen":
|
|
return 16744447;
|
|
case "steelblue":
|
|
return 1182971135;
|
|
case "tan":
|
|
return 3535047935;
|
|
case "teal":
|
|
return 8421631;
|
|
case "thistle":
|
|
return 3636451583;
|
|
case "tomato":
|
|
return 4284696575;
|
|
case "turquoise":
|
|
return 1088475391;
|
|
case "violet":
|
|
return 4001558271;
|
|
case "wheat":
|
|
return 4125012991;
|
|
case "white":
|
|
return 4294967295;
|
|
case "whitesmoke":
|
|
return 4126537215;
|
|
case "yellow":
|
|
return 4294902015;
|
|
case "yellowgreen":
|
|
return 2597139199;
|
|
}
|
|
return null;
|
|
}
|
|
__name(normalizeKeyword, "normalizeKeyword");
|
|
module2.exports = normalizeColor;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/processColor/index.js
|
|
var require_processColor = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/processColor/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _normalizeColors = _interopRequireDefault(require_normalize_colors());
|
|
var processColor = /* @__PURE__ */ __name((color) => {
|
|
if (color === void 0 || color === null) {
|
|
return color;
|
|
}
|
|
var int32Color = (0, _normalizeColors.default)(color);
|
|
if (int32Color === void 0 || int32Color === null) {
|
|
return void 0;
|
|
}
|
|
int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;
|
|
return int32Color;
|
|
}, "processColor");
|
|
var _default = exports2.default = processColor;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/normalizeColor.js
|
|
var require_normalizeColor = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/normalizeColor.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _isWebColor = _interopRequireDefault(require_isWebColor());
|
|
var _processColor = _interopRequireDefault(require_processColor());
|
|
var normalizeColor = /* @__PURE__ */ __name(function normalizeColor2(color, opacity) {
|
|
if (opacity === void 0) {
|
|
opacity = 1;
|
|
}
|
|
if (color == null) return;
|
|
if (typeof color === "string" && (0, _isWebColor.default)(color)) {
|
|
return color;
|
|
}
|
|
var colorInt = (0, _processColor.default)(color);
|
|
if (colorInt != null) {
|
|
var r = colorInt >> 16 & 255;
|
|
var g = colorInt >> 8 & 255;
|
|
var b = colorInt & 255;
|
|
var a = (colorInt >> 24 & 255) / 255;
|
|
var alpha = (a * opacity).toFixed(2);
|
|
return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
|
|
}
|
|
}, "normalizeColor");
|
|
var _default = exports2.default = normalizeColor;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/normalizeValueWithProperty.js
|
|
var require_normalizeValueWithProperty = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/normalizeValueWithProperty.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = normalizeValueWithProperty;
|
|
var _unitlessNumbers = _interopRequireDefault(require_unitlessNumbers());
|
|
var _normalizeColor = _interopRequireDefault(require_normalizeColor());
|
|
var colorProps = {
|
|
backgroundColor: true,
|
|
borderColor: true,
|
|
borderTopColor: true,
|
|
borderRightColor: true,
|
|
borderBottomColor: true,
|
|
borderLeftColor: true,
|
|
color: true,
|
|
shadowColor: true,
|
|
textDecorationColor: true,
|
|
textShadowColor: true
|
|
};
|
|
function normalizeValueWithProperty(value, property) {
|
|
var returnValue = value;
|
|
if ((property == null || !_unitlessNumbers.default[property]) && typeof value === "number") {
|
|
returnValue = value + "px";
|
|
} else if (property != null && colorProps[property]) {
|
|
returnValue = (0, _normalizeColor.default)(value);
|
|
}
|
|
return returnValue;
|
|
}
|
|
__name(normalizeValueWithProperty, "normalizeValueWithProperty");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/canUseDom/index.js
|
|
var require_canUseDom = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/canUseDom/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var canUseDOM2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
var _default = exports2.default = canUseDOM2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/createReactDOMStyle.js
|
|
var require_createReactDOMStyle = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/createReactDOMStyle.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _normalizeValueWithProperty = _interopRequireDefault(require_normalizeValueWithProperty());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var emptyObject = {};
|
|
var supportsCSS3TextDecoration = !_canUseDom.default || window.CSS != null && window.CSS.supports != null && (window.CSS.supports("text-decoration-line", "none") || window.CSS.supports("-webkit-text-decoration-line", "none"));
|
|
var MONOSPACE_FONT_STACK = "monospace,monospace";
|
|
var SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
|
|
var STYLE_SHORT_FORM_EXPANSIONS = {
|
|
borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
|
|
borderBlockColor: ["borderTopColor", "borderBottomColor"],
|
|
borderInlineColor: ["borderRightColor", "borderLeftColor"],
|
|
borderRadius: ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
|
|
borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
|
|
borderBlockStyle: ["borderTopStyle", "borderBottomStyle"],
|
|
borderInlineStyle: ["borderRightStyle", "borderLeftStyle"],
|
|
borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
|
|
borderBlockWidth: ["borderTopWidth", "borderBottomWidth"],
|
|
borderInlineWidth: ["borderRightWidth", "borderLeftWidth"],
|
|
insetBlock: ["top", "bottom"],
|
|
insetInline: ["left", "right"],
|
|
marginBlock: ["marginTop", "marginBottom"],
|
|
marginInline: ["marginRight", "marginLeft"],
|
|
paddingBlock: ["paddingTop", "paddingBottom"],
|
|
paddingInline: ["paddingRight", "paddingLeft"],
|
|
overflow: ["overflowX", "overflowY"],
|
|
overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
|
|
borderBlockStartColor: ["borderTopColor"],
|
|
borderBlockStartStyle: ["borderTopStyle"],
|
|
borderBlockStartWidth: ["borderTopWidth"],
|
|
borderBlockEndColor: ["borderBottomColor"],
|
|
borderBlockEndStyle: ["borderBottomStyle"],
|
|
borderBlockEndWidth: ["borderBottomWidth"],
|
|
//borderInlineStartColor: ['borderLeftColor'],
|
|
//borderInlineStartStyle: ['borderLeftStyle'],
|
|
//borderInlineStartWidth: ['borderLeftWidth'],
|
|
//borderInlineEndColor: ['borderRightColor'],
|
|
//borderInlineEndStyle: ['borderRightStyle'],
|
|
//borderInlineEndWidth: ['borderRightWidth'],
|
|
borderEndStartRadius: ["borderBottomLeftRadius"],
|
|
borderEndEndRadius: ["borderBottomRightRadius"],
|
|
borderStartStartRadius: ["borderTopLeftRadius"],
|
|
borderStartEndRadius: ["borderTopRightRadius"],
|
|
insetBlockEnd: ["bottom"],
|
|
insetBlockStart: ["top"],
|
|
//insetInlineEnd: ['right'],
|
|
//insetInlineStart: ['left'],
|
|
marginBlockStart: ["marginTop"],
|
|
marginBlockEnd: ["marginBottom"],
|
|
//marginInlineStart: ['marginLeft'],
|
|
//marginInlineEnd: ['marginRight'],
|
|
paddingBlockStart: ["paddingTop"],
|
|
paddingBlockEnd: ["paddingBottom"]
|
|
//paddingInlineStart: ['marginLeft'],
|
|
//paddingInlineEnd: ['marginRight'],
|
|
};
|
|
var createReactDOMStyle = /* @__PURE__ */ __name((style, isInline) => {
|
|
if (!style) {
|
|
return emptyObject;
|
|
}
|
|
var resolvedStyle = {};
|
|
var _loop = /* @__PURE__ */ __name(function _loop2() {
|
|
var value = style[prop];
|
|
if (
|
|
// Ignore everything with a null value
|
|
value == null
|
|
) {
|
|
return "continue";
|
|
}
|
|
if (prop === "backgroundClip") {
|
|
if (value === "text") {
|
|
resolvedStyle.backgroundClip = value;
|
|
resolvedStyle.WebkitBackgroundClip = value;
|
|
}
|
|
} else if (prop === "flex") {
|
|
if (value === -1) {
|
|
resolvedStyle.flexGrow = 0;
|
|
resolvedStyle.flexShrink = 1;
|
|
resolvedStyle.flexBasis = "auto";
|
|
} else {
|
|
resolvedStyle.flex = value;
|
|
}
|
|
} else if (prop === "font") {
|
|
resolvedStyle[prop] = value.replace("System", SYSTEM_FONT_STACK);
|
|
} else if (prop === "fontFamily") {
|
|
if (value.indexOf("System") > -1) {
|
|
var stack = value.split(/,\s*/);
|
|
stack[stack.indexOf("System")] = SYSTEM_FONT_STACK;
|
|
resolvedStyle[prop] = stack.join(",");
|
|
} else if (value === "monospace") {
|
|
resolvedStyle[prop] = MONOSPACE_FONT_STACK;
|
|
} else {
|
|
resolvedStyle[prop] = value;
|
|
}
|
|
} else if (prop === "textDecorationLine") {
|
|
if (!supportsCSS3TextDecoration) {
|
|
resolvedStyle.textDecoration = value;
|
|
} else {
|
|
resolvedStyle.textDecorationLine = value;
|
|
}
|
|
} else if (prop === "writingDirection") {
|
|
resolvedStyle.direction = value;
|
|
} else {
|
|
var _value = (0, _normalizeValueWithProperty.default)(style[prop], prop);
|
|
var longFormProperties = STYLE_SHORT_FORM_EXPANSIONS[prop];
|
|
if (isInline && prop === "inset") {
|
|
if (style.insetInline == null) {
|
|
resolvedStyle.left = _value;
|
|
resolvedStyle.right = _value;
|
|
}
|
|
if (style.insetBlock == null) {
|
|
resolvedStyle.top = _value;
|
|
resolvedStyle.bottom = _value;
|
|
}
|
|
} else if (isInline && prop === "margin") {
|
|
if (style.marginInline == null) {
|
|
resolvedStyle.marginLeft = _value;
|
|
resolvedStyle.marginRight = _value;
|
|
}
|
|
if (style.marginBlock == null) {
|
|
resolvedStyle.marginTop = _value;
|
|
resolvedStyle.marginBottom = _value;
|
|
}
|
|
} else if (isInline && prop === "padding") {
|
|
if (style.paddingInline == null) {
|
|
resolvedStyle.paddingLeft = _value;
|
|
resolvedStyle.paddingRight = _value;
|
|
}
|
|
if (style.paddingBlock == null) {
|
|
resolvedStyle.paddingTop = _value;
|
|
resolvedStyle.paddingBottom = _value;
|
|
}
|
|
} else if (longFormProperties) {
|
|
longFormProperties.forEach((longForm, i) => {
|
|
if (style[longForm] == null) {
|
|
resolvedStyle[longForm] = _value;
|
|
}
|
|
});
|
|
} else {
|
|
resolvedStyle[prop] = _value;
|
|
}
|
|
}
|
|
}, "_loop");
|
|
for (var prop in style) {
|
|
var _ret = _loop();
|
|
if (_ret === "continue") continue;
|
|
}
|
|
return resolvedStyle;
|
|
}, "createReactDOMStyle");
|
|
var _default = exports2.default = createReactDOMStyle;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/hash.js
|
|
var require_hash = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/hash.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
function murmurhash2_32_gc(str, seed) {
|
|
var l = str.length, h = seed ^ l, i = 0, k;
|
|
while (l >= 4) {
|
|
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
|
|
k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
|
|
k ^= k >>> 24;
|
|
k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
|
|
h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16) ^ k;
|
|
l -= 4;
|
|
++i;
|
|
}
|
|
switch (l) {
|
|
case 3:
|
|
h ^= (str.charCodeAt(i + 2) & 255) << 16;
|
|
case 2:
|
|
h ^= (str.charCodeAt(i + 1) & 255) << 8;
|
|
case 1:
|
|
h ^= str.charCodeAt(i) & 255;
|
|
h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
|
|
}
|
|
h ^= h >>> 13;
|
|
h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
|
|
h ^= h >>> 15;
|
|
return h >>> 0;
|
|
}
|
|
__name(murmurhash2_32_gc, "murmurhash2_32_gc");
|
|
var hash = /* @__PURE__ */ __name((str) => murmurhash2_32_gc(str, 1).toString(36), "hash");
|
|
var _default = exports2.default = hash;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/hyphenateStyleName.js
|
|
var require_hyphenateStyleName = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/hyphenateStyleName.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var uppercasePattern = /[A-Z]/g;
|
|
var msPattern = /^ms-/;
|
|
var cache3 = {};
|
|
function toHyphenLower(match) {
|
|
return "-" + match.toLowerCase();
|
|
}
|
|
__name(toHyphenLower, "toHyphenLower");
|
|
function hyphenateStyleName(name) {
|
|
if (name in cache3) {
|
|
return cache3[name];
|
|
}
|
|
var hName = name.replace(uppercasePattern, toHyphenLower);
|
|
return cache3[name] = msPattern.test(hName) ? "-" + hName : hName;
|
|
}
|
|
__name(hyphenateStyleName, "hyphenateStyleName");
|
|
var _default = exports2.default = hyphenateStyleName;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/utils/capitalizeString.js
|
|
var require_capitalizeString = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/utils/capitalizeString.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = capitalizeString;
|
|
function capitalizeString(str) {
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
}
|
|
__name(capitalizeString, "capitalizeString");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/utils/prefixProperty.js
|
|
var require_prefixProperty = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/utils/prefixProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = prefixProperty;
|
|
var _capitalizeString = require_capitalizeString();
|
|
var _capitalizeString2 = _interopRequireDefault(_capitalizeString);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function prefixProperty(prefixProperties, property, style) {
|
|
var requiredPrefixes = prefixProperties[property];
|
|
if (requiredPrefixes && style.hasOwnProperty(property)) {
|
|
var capitalizedProperty = (0, _capitalizeString2.default)(property);
|
|
for (var i = 0; i < requiredPrefixes.length; ++i) {
|
|
var prefixedProperty = requiredPrefixes[i] + capitalizedProperty;
|
|
if (!style[prefixedProperty]) {
|
|
style[prefixedProperty] = style[property];
|
|
}
|
|
}
|
|
}
|
|
return style;
|
|
}
|
|
__name(prefixProperty, "prefixProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/utils/prefixValue.js
|
|
var require_prefixValue = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/utils/prefixValue.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = prefixValue;
|
|
function prefixValue(plugins, property, value, style, metaData) {
|
|
for (var i = 0, len = plugins.length; i < len; ++i) {
|
|
var processedValue = plugins[i](property, value, style, metaData);
|
|
if (processedValue) {
|
|
return processedValue;
|
|
}
|
|
}
|
|
}
|
|
__name(prefixValue, "prefixValue");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/utils/addNewValuesOnly.js
|
|
var require_addNewValuesOnly = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/utils/addNewValuesOnly.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = addNewValuesOnly;
|
|
function addIfNew(list, value) {
|
|
if (list.indexOf(value) === -1) {
|
|
list.push(value);
|
|
}
|
|
}
|
|
__name(addIfNew, "addIfNew");
|
|
function addNewValuesOnly(list, values) {
|
|
if (Array.isArray(values)) {
|
|
for (var i = 0, len = values.length; i < len; ++i) {
|
|
addIfNew(list, values[i]);
|
|
}
|
|
} else {
|
|
addIfNew(list, values);
|
|
}
|
|
}
|
|
__name(addNewValuesOnly, "addNewValuesOnly");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/utils/isObject.js
|
|
var require_isObject = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/utils/isObject.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = isObject;
|
|
function isObject(value) {
|
|
return value instanceof Object && !Array.isArray(value);
|
|
}
|
|
__name(isObject, "isObject");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/createPrefixer.js
|
|
var require_createPrefixer = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/createPrefixer.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = createPrefixer;
|
|
var _prefixProperty = require_prefixProperty();
|
|
var _prefixProperty2 = _interopRequireDefault(_prefixProperty);
|
|
var _prefixValue = require_prefixValue();
|
|
var _prefixValue2 = _interopRequireDefault(_prefixValue);
|
|
var _addNewValuesOnly = require_addNewValuesOnly();
|
|
var _addNewValuesOnly2 = _interopRequireDefault(_addNewValuesOnly);
|
|
var _isObject = require_isObject();
|
|
var _isObject2 = _interopRequireDefault(_isObject);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function createPrefixer(_ref) {
|
|
var prefixMap = _ref.prefixMap, plugins = _ref.plugins;
|
|
return /* @__PURE__ */ __name(function prefix(style) {
|
|
for (var property in style) {
|
|
var value = style[property];
|
|
if ((0, _isObject2.default)(value)) {
|
|
style[property] = prefix(value);
|
|
} else if (Array.isArray(value)) {
|
|
var combinedValue = [];
|
|
for (var i = 0, len = value.length; i < len; ++i) {
|
|
var processedValue = (0, _prefixValue2.default)(plugins, property, value[i], style, prefixMap);
|
|
(0, _addNewValuesOnly2.default)(combinedValue, processedValue || value[i]);
|
|
}
|
|
if (combinedValue.length > 0) {
|
|
style[property] = combinedValue;
|
|
}
|
|
} else {
|
|
var _processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap);
|
|
if (_processedValue) {
|
|
style[property] = _processedValue;
|
|
}
|
|
style = (0, _prefixProperty2.default)(prefixMap, property, style);
|
|
}
|
|
}
|
|
return style;
|
|
}, "prefix");
|
|
}
|
|
__name(createPrefixer, "createPrefixer");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/assignStyle.js
|
|
var require_assignStyle = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/assignStyle.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = assignStyle;
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = /* @__PURE__ */ __name(function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
}, "_typeof");
|
|
} else {
|
|
_typeof = /* @__PURE__ */ __name(function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
}, "_typeof");
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
__name(_typeof, "_typeof");
|
|
function _toConsumableArray(arr) {
|
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
}
|
|
__name(_toConsumableArray, "_toConsumableArray");
|
|
function _nonIterableSpread() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
__name(_nonIterableSpread, "_nonIterableSpread");
|
|
function _unsupportedIterableToArray(o, minLen) {
|
|
if (!o) return;
|
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
}
|
|
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
function _iterableToArray(iter) {
|
|
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
}
|
|
__name(_iterableToArray, "_iterableToArray");
|
|
function _arrayWithoutHoles(arr) {
|
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
}
|
|
__name(_arrayWithoutHoles, "_arrayWithoutHoles");
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length) len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
arr2[i] = arr[i];
|
|
}
|
|
return arr2;
|
|
}
|
|
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
function filterUniqueArray(arr) {
|
|
return arr.filter(function(val, index5) {
|
|
return arr.lastIndexOf(val) === index5;
|
|
});
|
|
}
|
|
__name(filterUniqueArray, "filterUniqueArray");
|
|
function assignStyle(base) {
|
|
for (var i = 0, len = arguments.length <= 1 ? 0 : arguments.length - 1; i < len; ++i) {
|
|
var style = i + 1 < 1 || arguments.length <= i + 1 ? void 0 : arguments[i + 1];
|
|
for (var property in style) {
|
|
var value = style[property];
|
|
var baseValue = base[property];
|
|
if (baseValue && value) {
|
|
if (Array.isArray(baseValue)) {
|
|
base[property] = filterUniqueArray(baseValue.concat(value));
|
|
continue;
|
|
}
|
|
if (Array.isArray(value)) {
|
|
base[property] = filterUniqueArray([baseValue].concat(_toConsumableArray(value)));
|
|
continue;
|
|
}
|
|
if (_typeof(value) === "object") {
|
|
base[property] = assignStyle({}, baseValue, value);
|
|
continue;
|
|
}
|
|
}
|
|
base[property] = value;
|
|
}
|
|
}
|
|
return base;
|
|
}
|
|
__name(assignStyle, "assignStyle");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/camelCaseProperty.js
|
|
var require_camelCaseProperty = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/camelCaseProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = camelCaseProperty;
|
|
var DASH = /-([a-z])/g;
|
|
var MS = /^Ms/g;
|
|
var cache3 = {};
|
|
function toUpper(match) {
|
|
return match[1].toUpperCase();
|
|
}
|
|
__name(toUpper, "toUpper");
|
|
function camelCaseProperty(property) {
|
|
if (cache3.hasOwnProperty(property)) {
|
|
return cache3[property];
|
|
}
|
|
var camelProp = property.replace(DASH, toUpper).replace(MS, "ms");
|
|
cache3[property] = camelProp;
|
|
return camelProp;
|
|
}
|
|
__name(camelCaseProperty, "camelCaseProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/hyphenate-style-name/index.cjs.js
|
|
var require_index_cjs = __commonJS({
|
|
"node_modules/hyphenate-style-name/index.cjs.js"(exports2, module2) {
|
|
"use strict";
|
|
var uppercasePattern = /[A-Z]/g;
|
|
var msPattern = /^ms-/;
|
|
var cache3 = {};
|
|
function toHyphenLower(match) {
|
|
return "-" + match.toLowerCase();
|
|
}
|
|
__name(toHyphenLower, "toHyphenLower");
|
|
function hyphenateStyleName(name) {
|
|
if (cache3.hasOwnProperty(name)) {
|
|
return cache3[name];
|
|
}
|
|
var hName = name.replace(uppercasePattern, toHyphenLower);
|
|
return cache3[name] = msPattern.test(hName) ? "-" + hName : hName;
|
|
}
|
|
__name(hyphenateStyleName, "hyphenateStyleName");
|
|
module2.exports = hyphenateStyleName;
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/hyphenateProperty.js
|
|
var require_hyphenateProperty = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/hyphenateProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = hyphenateProperty;
|
|
var _hyphenateStyleName = require_index_cjs();
|
|
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function hyphenateProperty(property) {
|
|
return (0, _hyphenateStyleName2["default"])(property);
|
|
}
|
|
__name(hyphenateProperty, "hyphenateProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/cssifyDeclaration.js
|
|
var require_cssifyDeclaration = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/cssifyDeclaration.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = cssifyDeclaration;
|
|
var _hyphenateProperty = require_hyphenateProperty();
|
|
var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function cssifyDeclaration(property, value) {
|
|
return (0, _hyphenateProperty2["default"])(property) + ":" + value;
|
|
}
|
|
__name(cssifyDeclaration, "cssifyDeclaration");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/cssifyObject.js
|
|
var require_cssifyObject = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/cssifyObject.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = cssifyObject;
|
|
var _cssifyDeclaration = require_cssifyDeclaration();
|
|
var _cssifyDeclaration2 = _interopRequireDefault(_cssifyDeclaration);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function cssifyObject(style) {
|
|
var css = "";
|
|
for (var property in style) {
|
|
var value = style[property];
|
|
if (typeof value !== "string" && typeof value !== "number") {
|
|
continue;
|
|
}
|
|
if (css) {
|
|
css += ";";
|
|
}
|
|
css += (0, _cssifyDeclaration2["default"])(property, value);
|
|
}
|
|
return css;
|
|
}
|
|
__name(cssifyObject, "cssifyObject");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/isPrefixedProperty.js
|
|
var require_isPrefixedProperty = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/isPrefixedProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = isPrefixedProperty;
|
|
var RE = /^(Webkit|Moz|O|ms)/;
|
|
function isPrefixedProperty(property) {
|
|
return RE.test(property);
|
|
}
|
|
__name(isPrefixedProperty, "isPrefixedProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/isPrefixedValue.js
|
|
var require_isPrefixedValue = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/isPrefixedValue.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = isPrefixedValue;
|
|
var RE = /-webkit-|-moz-|-ms-/;
|
|
function isPrefixedValue(value) {
|
|
return typeof value === "string" && RE.test(value);
|
|
}
|
|
__name(isPrefixedValue, "isPrefixedValue");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/isUnitlessProperty.js
|
|
var require_isUnitlessProperty = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/isUnitlessProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = isUnitlessProperty;
|
|
var _hyphenateProperty = require_hyphenateProperty();
|
|
var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
var unitlessProperties = {
|
|
borderImageOutset: true,
|
|
borderImageSlice: true,
|
|
borderImageWidth: true,
|
|
fontWeight: true,
|
|
lineHeight: true,
|
|
opacity: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
// SVG-related properties
|
|
fillOpacity: true,
|
|
floodOpacity: true,
|
|
stopOpacity: true,
|
|
strokeDasharray: true,
|
|
strokeDashoffset: true,
|
|
strokeMiterlimit: true,
|
|
strokeOpacity: true,
|
|
strokeWidth: true
|
|
};
|
|
var prefixedUnitlessProperties = ["animationIterationCount", "boxFlex", "boxFlexGroup", "boxOrdinalGroup", "columnCount", "flex", "flexGrow", "flexPositive", "flexShrink", "flexNegative", "flexOrder", "gridColumn", "gridColumnEnd", "gridColumnStart", "gridRow", "gridRowEnd", "gridRowStart", "lineClamp", "order"];
|
|
var prefixes = ["Webkit", "ms", "Moz", "O"];
|
|
function getPrefixedProperty(prefix, property2) {
|
|
return prefix + property2.charAt(0).toUpperCase() + property2.slice(1);
|
|
}
|
|
__name(getPrefixedProperty, "getPrefixedProperty");
|
|
for (i = 0, len = prefixedUnitlessProperties.length; i < len; ++i) {
|
|
property = prefixedUnitlessProperties[i];
|
|
unitlessProperties[property] = true;
|
|
for (j = 0, jLen = prefixes.length; j < jLen; ++j) {
|
|
unitlessProperties[getPrefixedProperty(prefixes[j], property)] = true;
|
|
}
|
|
}
|
|
var property;
|
|
var j;
|
|
var jLen;
|
|
var i;
|
|
var len;
|
|
for (_property in unitlessProperties) {
|
|
unitlessProperties[(0, _hyphenateProperty2["default"])(_property)] = true;
|
|
}
|
|
var _property;
|
|
function isUnitlessProperty(property2) {
|
|
return unitlessProperties.hasOwnProperty(property2);
|
|
}
|
|
__name(isUnitlessProperty, "isUnitlessProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/unprefixProperty.js
|
|
var require_unprefixProperty = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/unprefixProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = unprefixProperty;
|
|
var RE = /^(ms|Webkit|Moz|O)/;
|
|
function unprefixProperty(property) {
|
|
var propertyWithoutPrefix = property.replace(RE, "");
|
|
return propertyWithoutPrefix.charAt(0).toLowerCase() + propertyWithoutPrefix.slice(1);
|
|
}
|
|
__name(unprefixProperty, "unprefixProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/normalizeProperty.js
|
|
var require_normalizeProperty = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/normalizeProperty.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = normalizeProperty;
|
|
var _camelCaseProperty = require_camelCaseProperty();
|
|
var _camelCaseProperty2 = _interopRequireDefault(_camelCaseProperty);
|
|
var _unprefixProperty = require_unprefixProperty();
|
|
var _unprefixProperty2 = _interopRequireDefault(_unprefixProperty);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function normalizeProperty(property) {
|
|
return (0, _unprefixProperty2["default"])((0, _camelCaseProperty2["default"])(property));
|
|
}
|
|
__name(normalizeProperty, "normalizeProperty");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/resolveArrayValue.js
|
|
var require_resolveArrayValue = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/resolveArrayValue.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = resolveArrayValue;
|
|
var _hyphenateProperty = require_hyphenateProperty();
|
|
var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
function resolveArrayValue(property, value) {
|
|
return value.join(";" + (0, _hyphenateProperty2["default"])(property) + ":");
|
|
}
|
|
__name(resolveArrayValue, "resolveArrayValue");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/unprefixValue.js
|
|
var require_unprefixValue = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/unprefixValue.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2["default"] = unprefixValue;
|
|
var RE = /(-ms-|-webkit-|-moz-|-o-)/g;
|
|
function unprefixValue(value) {
|
|
if (typeof value === "string") {
|
|
return value.replace(RE, "");
|
|
}
|
|
return value;
|
|
}
|
|
__name(unprefixValue, "unprefixValue");
|
|
}
|
|
});
|
|
|
|
// node_modules/css-in-js-utils/lib/index.js
|
|
var require_lib = __commonJS({
|
|
"node_modules/css-in-js-utils/lib/index.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.unprefixValue = exports2.unprefixProperty = exports2.resolveArrayValue = exports2.normalizeProperty = exports2.isUnitlessProperty = exports2.isPrefixedValue = exports2.isPrefixedProperty = exports2.hyphenateProperty = exports2.cssifyObject = exports2.cssifyDeclaration = exports2.camelCaseProperty = exports2.assignStyle = void 0;
|
|
var _assignStyle = require_assignStyle();
|
|
var _assignStyle2 = _interopRequireDefault(_assignStyle);
|
|
var _camelCaseProperty = require_camelCaseProperty();
|
|
var _camelCaseProperty2 = _interopRequireDefault(_camelCaseProperty);
|
|
var _cssifyDeclaration = require_cssifyDeclaration();
|
|
var _cssifyDeclaration2 = _interopRequireDefault(_cssifyDeclaration);
|
|
var _cssifyObject = require_cssifyObject();
|
|
var _cssifyObject2 = _interopRequireDefault(_cssifyObject);
|
|
var _hyphenateProperty = require_hyphenateProperty();
|
|
var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
|
|
var _isPrefixedProperty = require_isPrefixedProperty();
|
|
var _isPrefixedProperty2 = _interopRequireDefault(_isPrefixedProperty);
|
|
var _isPrefixedValue = require_isPrefixedValue();
|
|
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
|
|
var _isUnitlessProperty = require_isUnitlessProperty();
|
|
var _isUnitlessProperty2 = _interopRequireDefault(_isUnitlessProperty);
|
|
var _normalizeProperty = require_normalizeProperty();
|
|
var _normalizeProperty2 = _interopRequireDefault(_normalizeProperty);
|
|
var _resolveArrayValue = require_resolveArrayValue();
|
|
var _resolveArrayValue2 = _interopRequireDefault(_resolveArrayValue);
|
|
var _unprefixProperty = require_unprefixProperty();
|
|
var _unprefixProperty2 = _interopRequireDefault(_unprefixProperty);
|
|
var _unprefixValue = require_unprefixValue();
|
|
var _unprefixValue2 = _interopRequireDefault(_unprefixValue);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
exports2.assignStyle = _assignStyle2["default"];
|
|
exports2.camelCaseProperty = _camelCaseProperty2["default"];
|
|
exports2.cssifyDeclaration = _cssifyDeclaration2["default"];
|
|
exports2.cssifyObject = _cssifyObject2["default"];
|
|
exports2.hyphenateProperty = _hyphenateProperty2["default"];
|
|
exports2.isPrefixedProperty = _isPrefixedProperty2["default"];
|
|
exports2.isPrefixedValue = _isPrefixedValue2["default"];
|
|
exports2.isUnitlessProperty = _isUnitlessProperty2["default"];
|
|
exports2.normalizeProperty = _normalizeProperty2["default"];
|
|
exports2.resolveArrayValue = _resolveArrayValue2["default"];
|
|
exports2.unprefixProperty = _unprefixProperty2["default"];
|
|
exports2.unprefixValue = _unprefixValue2["default"];
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/plugins/crossFade.js
|
|
var require_crossFade = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/plugins/crossFade.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = crossFade;
|
|
var _cssInJsUtils = require_lib();
|
|
var CROSS_FADE_REGEX = /cross-fade\(/g;
|
|
var prefixes = ["-webkit-", ""];
|
|
function crossFade(property, value) {
|
|
if (typeof value === "string" && !(0, _cssInJsUtils.isPrefixedValue)(value) && value.indexOf("cross-fade(") !== -1) {
|
|
return prefixes.map(function(prefix) {
|
|
return value.replace(CROSS_FADE_REGEX, prefix + "cross-fade(");
|
|
});
|
|
}
|
|
}
|
|
__name(crossFade, "crossFade");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/plugins/imageSet.js
|
|
var require_imageSet = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/plugins/imageSet.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = imageSet;
|
|
var _isPrefixedValue = require_isPrefixedValue();
|
|
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
var prefixes = ["-webkit-", ""];
|
|
function imageSet(property, value) {
|
|
if (typeof value === "string" && !(0, _isPrefixedValue2.default)(value) && value.indexOf("image-set(") > -1) {
|
|
return prefixes.map(function(prefix) {
|
|
return value.replace(/image-set\(/g, prefix + "image-set(");
|
|
});
|
|
}
|
|
}
|
|
__name(imageSet, "imageSet");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/plugins/logical.js
|
|
var require_logical = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/plugins/logical.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = logical;
|
|
var alternativeProps = {
|
|
marginBlockStart: ["WebkitMarginBefore"],
|
|
marginBlockEnd: ["WebkitMarginAfter"],
|
|
marginInlineStart: ["WebkitMarginStart", "MozMarginStart"],
|
|
marginInlineEnd: ["WebkitMarginEnd", "MozMarginEnd"],
|
|
paddingBlockStart: ["WebkitPaddingBefore"],
|
|
paddingBlockEnd: ["WebkitPaddingAfter"],
|
|
paddingInlineStart: ["WebkitPaddingStart", "MozPaddingStart"],
|
|
paddingInlineEnd: ["WebkitPaddingEnd", "MozPaddingEnd"],
|
|
borderBlockStart: ["WebkitBorderBefore"],
|
|
borderBlockStartColor: ["WebkitBorderBeforeColor"],
|
|
borderBlockStartStyle: ["WebkitBorderBeforeStyle"],
|
|
borderBlockStartWidth: ["WebkitBorderBeforeWidth"],
|
|
borderBlockEnd: ["WebkitBorderAfter"],
|
|
borderBlockEndColor: ["WebkitBorderAfterColor"],
|
|
borderBlockEndStyle: ["WebkitBorderAfterStyle"],
|
|
borderBlockEndWidth: ["WebkitBorderAfterWidth"],
|
|
borderInlineStart: ["WebkitBorderStart", "MozBorderStart"],
|
|
borderInlineStartColor: ["WebkitBorderStartColor", "MozBorderStartColor"],
|
|
borderInlineStartStyle: ["WebkitBorderStartStyle", "MozBorderStartStyle"],
|
|
borderInlineStartWidth: ["WebkitBorderStartWidth", "MozBorderStartWidth"],
|
|
borderInlineEnd: ["WebkitBorderEnd", "MozBorderEnd"],
|
|
borderInlineEndColor: ["WebkitBorderEndColor", "MozBorderEndColor"],
|
|
borderInlineEndStyle: ["WebkitBorderEndStyle", "MozBorderEndStyle"],
|
|
borderInlineEndWidth: ["WebkitBorderEndWidth", "MozBorderEndWidth"]
|
|
};
|
|
function logical(property, value, style) {
|
|
if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {
|
|
var alternativePropList = alternativeProps[property];
|
|
for (var i = 0, len = alternativePropList.length; i < len; ++i) {
|
|
style[alternativePropList[i]] = value;
|
|
}
|
|
}
|
|
}
|
|
__name(logical, "logical");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/plugins/position.js
|
|
var require_position = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/plugins/position.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = position;
|
|
function position(property, value) {
|
|
if (property === "position" && value === "sticky") {
|
|
return ["-webkit-sticky", "sticky"];
|
|
}
|
|
}
|
|
__name(position, "position");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/plugins/sizing.js
|
|
var require_sizing = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/plugins/sizing.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = sizing;
|
|
var prefixes = ["-webkit-", "-moz-", ""];
|
|
var properties = {
|
|
maxHeight: true,
|
|
maxWidth: true,
|
|
width: true,
|
|
height: true,
|
|
columnWidth: true,
|
|
minWidth: true,
|
|
minHeight: true
|
|
};
|
|
var values = {
|
|
"min-content": true,
|
|
"max-content": true,
|
|
"fill-available": true,
|
|
"fit-content": true,
|
|
"contain-floats": true
|
|
};
|
|
function sizing(property, value) {
|
|
if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {
|
|
return prefixes.map(function(prefix) {
|
|
return prefix + value;
|
|
});
|
|
}
|
|
}
|
|
__name(sizing, "sizing");
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-prefixer/lib/plugins/transition.js
|
|
var require_transition = __commonJS({
|
|
"node_modules/inline-style-prefixer/lib/plugins/transition.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.default = transition;
|
|
var _hyphenateProperty = require_hyphenateProperty();
|
|
var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
|
|
var _isPrefixedValue = require_isPrefixedValue();
|
|
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
|
|
var _capitalizeString = require_capitalizeString();
|
|
var _capitalizeString2 = _interopRequireDefault(_capitalizeString);
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
var properties = {
|
|
transition: true,
|
|
transitionProperty: true,
|
|
WebkitTransition: true,
|
|
WebkitTransitionProperty: true,
|
|
MozTransition: true,
|
|
MozTransitionProperty: true
|
|
};
|
|
var prefixMapping = {
|
|
Webkit: "-webkit-",
|
|
Moz: "-moz-",
|
|
ms: "-ms-"
|
|
};
|
|
function prefixValue(value, propertyPrefixMap) {
|
|
if ((0, _isPrefixedValue2.default)(value)) {
|
|
return value;
|
|
}
|
|
var multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g);
|
|
for (var i = 0, len = multipleValues.length; i < len; ++i) {
|
|
var singleValue = multipleValues[i];
|
|
var values = [singleValue];
|
|
for (var property in propertyPrefixMap) {
|
|
var dashCaseProperty = (0, _hyphenateProperty2.default)(property);
|
|
if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== "order") {
|
|
var prefixes = propertyPrefixMap[property];
|
|
for (var j = 0, pLen = prefixes.length; j < pLen; ++j) {
|
|
values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty));
|
|
}
|
|
}
|
|
}
|
|
multipleValues[i] = values.join(",");
|
|
}
|
|
return multipleValues.join(",");
|
|
}
|
|
__name(prefixValue, "prefixValue");
|
|
function transition(property, value, style, propertyPrefixMap) {
|
|
if (typeof value === "string" && properties.hasOwnProperty(property)) {
|
|
var outputValue = prefixValue(value, propertyPrefixMap);
|
|
var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(val) {
|
|
return !/-moz-|-ms-/.test(val);
|
|
}).join(",");
|
|
if (property.indexOf("Webkit") > -1) {
|
|
return webkitOutput;
|
|
}
|
|
var mozOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(val) {
|
|
return !/-webkit-|-ms-/.test(val);
|
|
}).join(",");
|
|
if (property.indexOf("Moz") > -1) {
|
|
return mozOutput;
|
|
}
|
|
style["Webkit" + (0, _capitalizeString2.default)(property)] = webkitOutput;
|
|
style["Moz" + (0, _capitalizeString2.default)(property)] = mozOutput;
|
|
return outputValue;
|
|
}
|
|
}
|
|
__name(transition, "transition");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/prefixStyles/static.js
|
|
var require_static = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/prefixStyles/static.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _crossFade = _interopRequireDefault(require_crossFade());
|
|
var _imageSet = _interopRequireDefault(require_imageSet());
|
|
var _logical = _interopRequireDefault(require_logical());
|
|
var _position = _interopRequireDefault(require_position());
|
|
var _sizing = _interopRequireDefault(require_sizing());
|
|
var _transition = _interopRequireDefault(require_transition());
|
|
var w = ["Webkit"];
|
|
var m = ["Moz"];
|
|
var wm = ["Webkit", "Moz"];
|
|
var wms = ["Webkit", "ms"];
|
|
var wmms = ["Webkit", "Moz", "ms"];
|
|
var _default = exports2.default = {
|
|
plugins: [_crossFade.default, _imageSet.default, _logical.default, _position.default, _sizing.default, _transition.default],
|
|
prefixMap: {
|
|
appearance: wmms,
|
|
userSelect: wm,
|
|
textEmphasisPosition: wms,
|
|
textEmphasis: wms,
|
|
textEmphasisStyle: wms,
|
|
textEmphasisColor: wms,
|
|
boxDecorationBreak: wms,
|
|
clipPath: w,
|
|
maskImage: wms,
|
|
maskMode: wms,
|
|
maskRepeat: wms,
|
|
maskPosition: wms,
|
|
maskClip: wms,
|
|
maskOrigin: wms,
|
|
maskSize: wms,
|
|
maskComposite: wms,
|
|
mask: wms,
|
|
maskBorderSource: wms,
|
|
maskBorderMode: wms,
|
|
maskBorderSlice: wms,
|
|
maskBorderWidth: wms,
|
|
maskBorderOutset: wms,
|
|
maskBorderRepeat: wms,
|
|
maskBorder: wms,
|
|
maskType: wms,
|
|
textDecorationStyle: w,
|
|
textDecorationSkip: w,
|
|
textDecorationLine: w,
|
|
textDecorationColor: w,
|
|
filter: w,
|
|
breakAfter: w,
|
|
breakBefore: w,
|
|
breakInside: w,
|
|
columnCount: w,
|
|
columnFill: w,
|
|
columnGap: w,
|
|
columnRule: w,
|
|
columnRuleColor: w,
|
|
columnRuleStyle: w,
|
|
columnRuleWidth: w,
|
|
columns: w,
|
|
columnSpan: w,
|
|
columnWidth: w,
|
|
backdropFilter: w,
|
|
hyphens: w,
|
|
flowInto: w,
|
|
flowFrom: w,
|
|
regionFragment: w,
|
|
textOrientation: w,
|
|
tabSize: m,
|
|
fontKerning: w,
|
|
textSizeAdjust: w
|
|
}
|
|
};
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/prefixStyles/index.js
|
|
var require_prefixStyles = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/prefixStyles/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _createPrefixer = _interopRequireDefault(require_createPrefixer());
|
|
var _static = _interopRequireDefault(require_static());
|
|
var prefixAll = (0, _createPrefixer.default)(_static.default);
|
|
var _default = exports2.default = prefixAll;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/index.js
|
|
var require_compiler = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.atomic = atomic;
|
|
exports2.classic = classic;
|
|
exports2.inline = inline4;
|
|
exports2.stringifyValueWithProperty = stringifyValueWithProperty;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _createReactDOMStyle = _interopRequireDefault(require_createReactDOMStyle());
|
|
var _hash = _interopRequireDefault(require_hash());
|
|
var _hyphenateStyleName = _interopRequireDefault(require_hyphenateStyleName());
|
|
var _normalizeValueWithProperty = _interopRequireDefault(require_normalizeValueWithProperty());
|
|
var _prefixStyles = _interopRequireDefault(require_prefixStyles());
|
|
var _excluded = ["animationKeyframes"];
|
|
var cache3 = /* @__PURE__ */ new Map();
|
|
var emptyObject = {};
|
|
var classicGroup = 1;
|
|
var atomicGroup = 3;
|
|
var customGroup = {
|
|
borderColor: 2,
|
|
borderRadius: 2,
|
|
borderStyle: 2,
|
|
borderWidth: 2,
|
|
display: 2,
|
|
flex: 2,
|
|
inset: 2,
|
|
margin: 2,
|
|
overflow: 2,
|
|
overscrollBehavior: 2,
|
|
padding: 2,
|
|
insetBlock: 2.1,
|
|
insetInline: 2.1,
|
|
marginInline: 2.1,
|
|
marginBlock: 2.1,
|
|
paddingInline: 2.1,
|
|
paddingBlock: 2.1,
|
|
borderBlockStartColor: 2.2,
|
|
borderBlockStartStyle: 2.2,
|
|
borderBlockStartWidth: 2.2,
|
|
borderBlockEndColor: 2.2,
|
|
borderBlockEndStyle: 2.2,
|
|
borderBlockEndWidth: 2.2,
|
|
borderInlineStartColor: 2.2,
|
|
borderInlineStartStyle: 2.2,
|
|
borderInlineStartWidth: 2.2,
|
|
borderInlineEndColor: 2.2,
|
|
borderInlineEndStyle: 2.2,
|
|
borderInlineEndWidth: 2.2,
|
|
borderEndStartRadius: 2.2,
|
|
borderEndEndRadius: 2.2,
|
|
borderStartStartRadius: 2.2,
|
|
borderStartEndRadius: 2.2,
|
|
insetBlockEnd: 2.2,
|
|
insetBlockStart: 2.2,
|
|
insetInlineEnd: 2.2,
|
|
insetInlineStart: 2.2,
|
|
marginBlockStart: 2.2,
|
|
marginBlockEnd: 2.2,
|
|
marginInlineStart: 2.2,
|
|
marginInlineEnd: 2.2,
|
|
paddingBlockStart: 2.2,
|
|
paddingBlockEnd: 2.2,
|
|
paddingInlineStart: 2.2,
|
|
paddingInlineEnd: 2.2
|
|
};
|
|
var borderTopLeftRadius = "borderTopLeftRadius";
|
|
var borderTopRightRadius = "borderTopRightRadius";
|
|
var borderBottomLeftRadius = "borderBottomLeftRadius";
|
|
var borderBottomRightRadius = "borderBottomRightRadius";
|
|
var borderLeftColor = "borderLeftColor";
|
|
var borderLeftStyle = "borderLeftStyle";
|
|
var borderLeftWidth = "borderLeftWidth";
|
|
var borderRightColor = "borderRightColor";
|
|
var borderRightStyle = "borderRightStyle";
|
|
var borderRightWidth = "borderRightWidth";
|
|
var right = "right";
|
|
var marginLeft = "marginLeft";
|
|
var marginRight = "marginRight";
|
|
var paddingLeft = "paddingLeft";
|
|
var paddingRight = "paddingRight";
|
|
var left = "left";
|
|
var PROPERTIES_FLIP = {
|
|
[borderTopLeftRadius]: borderTopRightRadius,
|
|
[borderTopRightRadius]: borderTopLeftRadius,
|
|
[borderBottomLeftRadius]: borderBottomRightRadius,
|
|
[borderBottomRightRadius]: borderBottomLeftRadius,
|
|
[borderLeftColor]: borderRightColor,
|
|
[borderLeftStyle]: borderRightStyle,
|
|
[borderLeftWidth]: borderRightWidth,
|
|
[borderRightColor]: borderLeftColor,
|
|
[borderRightStyle]: borderLeftStyle,
|
|
[borderRightWidth]: borderLeftWidth,
|
|
[left]: right,
|
|
[marginLeft]: marginRight,
|
|
[marginRight]: marginLeft,
|
|
[paddingLeft]: paddingRight,
|
|
[paddingRight]: paddingLeft,
|
|
[right]: left
|
|
};
|
|
var PROPERTIES_I18N = {
|
|
borderStartStartRadius: borderTopLeftRadius,
|
|
borderStartEndRadius: borderTopRightRadius,
|
|
borderEndStartRadius: borderBottomLeftRadius,
|
|
borderEndEndRadius: borderBottomRightRadius,
|
|
borderInlineStartColor: borderLeftColor,
|
|
borderInlineStartStyle: borderLeftStyle,
|
|
borderInlineStartWidth: borderLeftWidth,
|
|
borderInlineEndColor: borderRightColor,
|
|
borderInlineEndStyle: borderRightStyle,
|
|
borderInlineEndWidth: borderRightWidth,
|
|
insetInlineEnd: right,
|
|
insetInlineStart: left,
|
|
marginInlineStart: marginLeft,
|
|
marginInlineEnd: marginRight,
|
|
paddingInlineStart: paddingLeft,
|
|
paddingInlineEnd: paddingRight
|
|
};
|
|
var PROPERTIES_VALUE = ["clear", "float", "textAlign"];
|
|
function atomic(style) {
|
|
var compiledStyle = {
|
|
$$css: true
|
|
};
|
|
var compiledRules = [];
|
|
function atomicCompile(srcProp, prop, value) {
|
|
var valueString = stringifyValueWithProperty(value, prop);
|
|
var cacheKey = prop + valueString;
|
|
var cachedResult = cache3.get(cacheKey);
|
|
var identifier;
|
|
if (cachedResult != null) {
|
|
identifier = cachedResult[0];
|
|
compiledRules.push(cachedResult[1]);
|
|
} else {
|
|
var v = srcProp !== prop ? cacheKey : valueString;
|
|
identifier = createIdentifier("r", srcProp, v);
|
|
var order = customGroup[srcProp] || atomicGroup;
|
|
var rules = createAtomicRules(identifier, prop, value);
|
|
var orderedRules = [rules, order];
|
|
compiledRules.push(orderedRules);
|
|
cache3.set(cacheKey, [identifier, orderedRules]);
|
|
}
|
|
return identifier;
|
|
}
|
|
__name(atomicCompile, "atomicCompile");
|
|
Object.keys(style).sort().forEach((srcProp) => {
|
|
var value = style[srcProp];
|
|
if (value != null) {
|
|
var localizeableValue;
|
|
if (PROPERTIES_VALUE.indexOf(srcProp) > -1) {
|
|
var _left = atomicCompile(srcProp, srcProp, "left");
|
|
var _right = atomicCompile(srcProp, srcProp, "right");
|
|
if (value === "start") {
|
|
localizeableValue = [_left, _right];
|
|
} else if (value === "end") {
|
|
localizeableValue = [_right, _left];
|
|
}
|
|
}
|
|
var propPolyfill = PROPERTIES_I18N[srcProp];
|
|
if (propPolyfill != null) {
|
|
var ltr = atomicCompile(srcProp, propPolyfill, value);
|
|
var rtl = atomicCompile(srcProp, PROPERTIES_FLIP[propPolyfill], value);
|
|
localizeableValue = [ltr, rtl];
|
|
}
|
|
if (srcProp === "transitionProperty") {
|
|
var values = Array.isArray(value) ? value : [value];
|
|
var polyfillIndices = [];
|
|
for (var i = 0; i < values.length; i++) {
|
|
var val = values[i];
|
|
if (typeof val === "string" && PROPERTIES_I18N[val] != null) {
|
|
polyfillIndices.push(i);
|
|
}
|
|
}
|
|
if (polyfillIndices.length > 0) {
|
|
var ltrPolyfillValues = [...values];
|
|
var rtlPolyfillValues = [...values];
|
|
polyfillIndices.forEach((i2) => {
|
|
var ltrVal = ltrPolyfillValues[i2];
|
|
if (typeof ltrVal === "string") {
|
|
var ltrPolyfill = PROPERTIES_I18N[ltrVal];
|
|
var rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];
|
|
ltrPolyfillValues[i2] = ltrPolyfill;
|
|
rtlPolyfillValues[i2] = rtlPolyfill;
|
|
var _ltr = atomicCompile(srcProp, srcProp, ltrPolyfillValues);
|
|
var _rtl = atomicCompile(srcProp, srcProp, rtlPolyfillValues);
|
|
localizeableValue = [_ltr, _rtl];
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if (localizeableValue == null) {
|
|
localizeableValue = atomicCompile(srcProp, srcProp, value);
|
|
} else {
|
|
compiledStyle["$$css$localize"] = true;
|
|
}
|
|
compiledStyle[srcProp] = localizeableValue;
|
|
}
|
|
});
|
|
return [compiledStyle, compiledRules];
|
|
}
|
|
__name(atomic, "atomic");
|
|
function classic(style, name) {
|
|
var compiledStyle = {
|
|
$$css: true
|
|
};
|
|
var compiledRules = [];
|
|
var animationKeyframes = style.animationKeyframes, rest = (0, _objectWithoutPropertiesLoose2.default)(style, _excluded);
|
|
var identifier = createIdentifier("css", name, JSON.stringify(style));
|
|
var selector = "." + identifier;
|
|
var animationName;
|
|
if (animationKeyframes != null) {
|
|
var _processKeyframesValu = processKeyframesValue(animationKeyframes), animationNames = _processKeyframesValu[0], keyframesRules = _processKeyframesValu[1];
|
|
animationName = animationNames.join(",");
|
|
compiledRules.push(...keyframesRules);
|
|
}
|
|
var block = createDeclarationBlock((0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
animationName
|
|
}));
|
|
compiledRules.push("" + selector + block);
|
|
compiledStyle[identifier] = identifier;
|
|
return [compiledStyle, [[compiledRules, classicGroup]]];
|
|
}
|
|
__name(classic, "classic");
|
|
function inline4(originalStyle, isRTL2) {
|
|
var style = originalStyle || emptyObject;
|
|
var frozenProps = {};
|
|
var nextStyle = {};
|
|
var _loop = /* @__PURE__ */ __name(function _loop2() {
|
|
var originalValue = style[originalProp];
|
|
var prop = originalProp;
|
|
var value = originalValue;
|
|
if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) {
|
|
return "continue";
|
|
}
|
|
if (PROPERTIES_VALUE.indexOf(originalProp) > -1) {
|
|
if (originalValue === "start") {
|
|
value = isRTL2 ? "right" : "left";
|
|
} else if (originalValue === "end") {
|
|
value = isRTL2 ? "left" : "right";
|
|
}
|
|
}
|
|
var propPolyfill = PROPERTIES_I18N[originalProp];
|
|
if (propPolyfill != null) {
|
|
prop = isRTL2 ? PROPERTIES_FLIP[propPolyfill] : propPolyfill;
|
|
}
|
|
if (originalProp === "transitionProperty") {
|
|
var originalValues = Array.isArray(originalValue) ? originalValue : [originalValue];
|
|
originalValues.forEach((val, i) => {
|
|
if (typeof val === "string") {
|
|
var valuePolyfill = PROPERTIES_I18N[val];
|
|
if (valuePolyfill != null) {
|
|
originalValues[i] = isRTL2 ? PROPERTIES_FLIP[valuePolyfill] : valuePolyfill;
|
|
value = originalValues.join(" ");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
if (!frozenProps[prop]) {
|
|
nextStyle[prop] = value;
|
|
}
|
|
if (prop === originalProp) {
|
|
frozenProps[prop] = true;
|
|
}
|
|
}, "_loop");
|
|
for (var originalProp in style) {
|
|
var _ret = _loop();
|
|
if (_ret === "continue") continue;
|
|
}
|
|
return (0, _createReactDOMStyle.default)(nextStyle, true);
|
|
}
|
|
__name(inline4, "inline");
|
|
function stringifyValueWithProperty(value, property) {
|
|
var normalizedValue = (0, _normalizeValueWithProperty.default)(value, property);
|
|
return typeof normalizedValue !== "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
|
|
}
|
|
__name(stringifyValueWithProperty, "stringifyValueWithProperty");
|
|
function createAtomicRules(identifier, property, value) {
|
|
var rules = [];
|
|
var selector = "." + identifier;
|
|
switch (property) {
|
|
case "animationKeyframes": {
|
|
var _processKeyframesValu2 = processKeyframesValue(value), animationNames = _processKeyframesValu2[0], keyframesRules = _processKeyframesValu2[1];
|
|
var block = createDeclarationBlock({
|
|
animationName: animationNames.join(",")
|
|
});
|
|
rules.push("" + selector + block, ...keyframesRules);
|
|
break;
|
|
}
|
|
// Equivalent to using '::placeholder'
|
|
case "placeholderTextColor": {
|
|
var _block = createDeclarationBlock({
|
|
color: value,
|
|
opacity: 1
|
|
});
|
|
rules.push(selector + "::-webkit-input-placeholder" + _block, selector + "::-moz-placeholder" + _block, selector + ":-ms-input-placeholder" + _block, selector + "::placeholder" + _block);
|
|
break;
|
|
}
|
|
// Polyfill for additional 'pointer-events' values
|
|
// See d13f78622b233a0afc0c7a200c0a0792c8ca9e58
|
|
// See https://reactnative.dev/docs/view#pointerevents
|
|
case "pointerEvents": {
|
|
var finalValue = value;
|
|
if (value === "auto") {
|
|
finalValue = "auto!important";
|
|
} else if (value === "none") {
|
|
finalValue = "none!important";
|
|
var _block2 = createDeclarationBlock({
|
|
pointerEvents: "none"
|
|
});
|
|
rules.push(selector + ">* " + _block2);
|
|
} else if (value === "box-none") {
|
|
finalValue = "none!important";
|
|
var _block3 = createDeclarationBlock({
|
|
pointerEvents: "auto"
|
|
});
|
|
rules.push(selector + ">* " + _block3);
|
|
} else if (value === "box-only") {
|
|
finalValue = "auto!important";
|
|
var _block4 = createDeclarationBlock({
|
|
pointerEvents: "none"
|
|
});
|
|
rules.push(selector + ">* " + _block4);
|
|
}
|
|
var _block5 = createDeclarationBlock({
|
|
pointerEvents: finalValue
|
|
});
|
|
rules.push("" + selector + _block5);
|
|
break;
|
|
}
|
|
// Polyfill for draft spec
|
|
// https://drafts.csswg.org/css-scrollbars-1/
|
|
case "scrollbarWidth": {
|
|
if (value === "none") {
|
|
rules.push(selector + "::-webkit-scrollbar{display:none}");
|
|
}
|
|
var _block6 = createDeclarationBlock({
|
|
scrollbarWidth: value
|
|
});
|
|
rules.push("" + selector + _block6);
|
|
break;
|
|
}
|
|
default: {
|
|
var _block7 = createDeclarationBlock({
|
|
[property]: value
|
|
});
|
|
rules.push("" + selector + _block7);
|
|
break;
|
|
}
|
|
}
|
|
return rules;
|
|
}
|
|
__name(createAtomicRules, "createAtomicRules");
|
|
function createDeclarationBlock(style) {
|
|
var domStyle = (0, _prefixStyles.default)((0, _createReactDOMStyle.default)(style));
|
|
var declarationsString = Object.keys(domStyle).map((property) => {
|
|
var value = domStyle[property];
|
|
var prop = (0, _hyphenateStyleName.default)(property);
|
|
if (Array.isArray(value)) {
|
|
return value.map((v) => prop + ":" + v).join(";");
|
|
} else {
|
|
return prop + ":" + value;
|
|
}
|
|
}).sort().join(";");
|
|
return "{" + declarationsString + ";}";
|
|
}
|
|
__name(createDeclarationBlock, "createDeclarationBlock");
|
|
function createIdentifier(prefix, name, key) {
|
|
var hashedString = (0, _hash.default)(name + key);
|
|
return process.env.NODE_ENV !== "production" ? prefix + "-" + name + "-" + hashedString : prefix + "-" + hashedString;
|
|
}
|
|
__name(createIdentifier, "createIdentifier");
|
|
function createKeyframes(keyframes) {
|
|
var prefixes = ["-webkit-", ""];
|
|
var identifier = createIdentifier("r", "animation", JSON.stringify(keyframes));
|
|
var steps = "{" + Object.keys(keyframes).map((stepName) => {
|
|
var rule = keyframes[stepName];
|
|
var block = createDeclarationBlock(rule);
|
|
return "" + stepName + block;
|
|
}).join("") + "}";
|
|
var rules = prefixes.map((prefix) => {
|
|
return "@" + prefix + "keyframes " + identifier + steps;
|
|
});
|
|
return [identifier, rules];
|
|
}
|
|
__name(createKeyframes, "createKeyframes");
|
|
function processKeyframesValue(keyframesValue) {
|
|
if (typeof keyframesValue === "number") {
|
|
throw new Error("Invalid CSS keyframes type: " + typeof keyframesValue);
|
|
}
|
|
var animationNames = [];
|
|
var rules = [];
|
|
var value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
|
|
value.forEach((keyframes) => {
|
|
if (typeof keyframes === "string") {
|
|
animationNames.push(keyframes);
|
|
} else {
|
|
var _createKeyframes = createKeyframes(keyframes), identifier = _createKeyframes[0], keyframesRules = _createKeyframes[1];
|
|
animationNames.push(identifier);
|
|
rules.push(...keyframesRules);
|
|
}
|
|
});
|
|
return [animationNames, rules];
|
|
}
|
|
__name(processKeyframesValue, "processKeyframesValue");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/createCSSStyleSheet.js
|
|
var require_createCSSStyleSheet = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/createCSSStyleSheet.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = createCSSStyleSheet;
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
function createCSSStyleSheet(id, rootNode, textContent) {
|
|
if (_canUseDom.default) {
|
|
var root = rootNode != null ? rootNode : document;
|
|
var element = root.getElementById(id);
|
|
if (element == null) {
|
|
element = document.createElement("style");
|
|
element.setAttribute("id", id);
|
|
if (typeof textContent === "string") {
|
|
element.appendChild(document.createTextNode(textContent));
|
|
}
|
|
if (root instanceof ShadowRoot) {
|
|
root.insertBefore(element, root.firstChild);
|
|
} else {
|
|
var head = root.head;
|
|
if (head) {
|
|
head.insertBefore(element, head.firstChild);
|
|
}
|
|
}
|
|
}
|
|
return element.sheet;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
__name(createCSSStyleSheet, "createCSSStyleSheet");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/createOrderedCSSStyleSheet.js
|
|
var require_createOrderedCSSStyleSheet = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/createOrderedCSSStyleSheet.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = createOrderedCSSStyleSheet;
|
|
var slice = Array.prototype.slice;
|
|
function createOrderedCSSStyleSheet(sheet) {
|
|
var groups = {};
|
|
var selectors = {};
|
|
if (sheet != null) {
|
|
var group;
|
|
slice.call(sheet.cssRules).forEach((cssRule, i) => {
|
|
var cssText = cssRule.cssText;
|
|
if (cssText.indexOf("stylesheet-group") > -1) {
|
|
group = decodeGroupRule(cssRule);
|
|
groups[group] = {
|
|
start: i,
|
|
rules: [cssText]
|
|
};
|
|
} else {
|
|
var selectorText = getSelectorText(cssText);
|
|
if (selectorText != null) {
|
|
selectors[selectorText] = true;
|
|
groups[group].rules.push(cssText);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function sheetInsert(sheet2, group2, text) {
|
|
var orderedGroups = getOrderedGroups(groups);
|
|
var groupIndex = orderedGroups.indexOf(group2);
|
|
var nextGroupIndex = groupIndex + 1;
|
|
var nextGroup = orderedGroups[nextGroupIndex];
|
|
var position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length;
|
|
var isInserted = insertRuleAt(sheet2, text, position);
|
|
if (isInserted) {
|
|
if (groups[group2].start == null) {
|
|
groups[group2].start = position;
|
|
}
|
|
for (var i = nextGroupIndex; i < orderedGroups.length; i += 1) {
|
|
var groupNumber = orderedGroups[i];
|
|
var previousStart = groups[groupNumber].start || 0;
|
|
groups[groupNumber].start = previousStart + 1;
|
|
}
|
|
}
|
|
return isInserted;
|
|
}
|
|
__name(sheetInsert, "sheetInsert");
|
|
var OrderedCSSStyleSheet = {
|
|
/**
|
|
* The textContent of the style sheet.
|
|
*/
|
|
getTextContent() {
|
|
return getOrderedGroups(groups).map((group2) => {
|
|
var rules = groups[group2].rules;
|
|
var marker = rules.shift();
|
|
rules.sort();
|
|
rules.unshift(marker);
|
|
return rules.join("\n");
|
|
}).join("\n");
|
|
},
|
|
/**
|
|
* Insert a rule into the style sheet
|
|
*/
|
|
insert(cssText, groupValue) {
|
|
var group2 = Number(groupValue);
|
|
if (groups[group2] == null) {
|
|
var markerRule = encodeGroupRule(group2);
|
|
groups[group2] = {
|
|
start: null,
|
|
rules: [markerRule]
|
|
};
|
|
if (sheet != null) {
|
|
sheetInsert(sheet, group2, markerRule);
|
|
}
|
|
}
|
|
var selectorText = getSelectorText(cssText);
|
|
if (selectorText != null && selectors[selectorText] == null) {
|
|
selectors[selectorText] = true;
|
|
groups[group2].rules.push(cssText);
|
|
if (sheet != null) {
|
|
var isInserted = sheetInsert(sheet, group2, cssText);
|
|
if (!isInserted) {
|
|
groups[group2].rules.pop();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
return OrderedCSSStyleSheet;
|
|
}
|
|
__name(createOrderedCSSStyleSheet, "createOrderedCSSStyleSheet");
|
|
function encodeGroupRule(group) {
|
|
return '[stylesheet-group="' + group + '"]{}';
|
|
}
|
|
__name(encodeGroupRule, "encodeGroupRule");
|
|
var groupPattern = /["']/g;
|
|
function decodeGroupRule(cssRule) {
|
|
return Number(cssRule.selectorText.split(groupPattern)[1]);
|
|
}
|
|
__name(decodeGroupRule, "decodeGroupRule");
|
|
function getOrderedGroups(obj) {
|
|
return Object.keys(obj).map(Number).sort((a, b) => a > b ? 1 : -1);
|
|
}
|
|
__name(getOrderedGroups, "getOrderedGroups");
|
|
var selectorPattern = /\s*([,])\s*/g;
|
|
function getSelectorText(cssText) {
|
|
var selector = cssText.split("{")[0].trim();
|
|
return selector !== "" ? selector.replace(selectorPattern, "$1") : null;
|
|
}
|
|
__name(getSelectorText, "getSelectorText");
|
|
function insertRuleAt(root, cssText, position) {
|
|
try {
|
|
root.insertRule(cssText, position);
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
__name(insertRuleAt, "insertRuleAt");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/index.js
|
|
var require_dom = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.createSheet = createSheet2;
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var _createCSSStyleSheet = _interopRequireDefault(require_createCSSStyleSheet());
|
|
var _createOrderedCSSStyleSheet = _interopRequireDefault(require_createOrderedCSSStyleSheet());
|
|
var defaultId = "react-native-stylesheet";
|
|
var roots = /* @__PURE__ */ new WeakMap();
|
|
var sheets = [];
|
|
var initialRules = [
|
|
// minimal top-level reset
|
|
"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}",
|
|
"body{margin:0;}",
|
|
// minimal form pseudo-element reset
|
|
"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}",
|
|
"input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"
|
|
];
|
|
function createSheet2(root, id) {
|
|
if (id === void 0) {
|
|
id = defaultId;
|
|
}
|
|
var sheet;
|
|
if (_canUseDom.default) {
|
|
var rootNode = root != null ? root.getRootNode() : document;
|
|
if (sheets.length === 0) {
|
|
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(id));
|
|
initialRules.forEach((rule) => {
|
|
sheet.insert(rule, 0);
|
|
});
|
|
roots.set(rootNode, sheets.length);
|
|
sheets.push(sheet);
|
|
} else {
|
|
var index5 = roots.get(rootNode);
|
|
if (index5 == null) {
|
|
var initialSheet = sheets[0];
|
|
var textContent = initialSheet != null ? initialSheet.getTextContent() : "";
|
|
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(id, rootNode, textContent));
|
|
roots.set(rootNode, sheets.length);
|
|
sheets.push(sheet);
|
|
} else {
|
|
sheet = sheets[index5];
|
|
}
|
|
}
|
|
} else {
|
|
if (sheets.length === 0) {
|
|
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(id));
|
|
initialRules.forEach((rule) => {
|
|
sheet.insert(rule, 0);
|
|
});
|
|
sheets.push(sheet);
|
|
} else {
|
|
sheet = sheets[0];
|
|
}
|
|
}
|
|
return {
|
|
getTextContent() {
|
|
return sheet.getTextContent();
|
|
},
|
|
id,
|
|
insert(cssText, groupValue) {
|
|
sheets.forEach((s) => {
|
|
s.insert(cssText, groupValue);
|
|
});
|
|
}
|
|
};
|
|
}
|
|
__name(createSheet2, "createSheet");
|
|
}
|
|
});
|
|
|
|
// node_modules/styleq/dist/transform-localize-style.js
|
|
var require_transform_localize_style = __commonJS({
|
|
"node_modules/styleq/dist/transform-localize-style.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.localizeStyle = localizeStyle;
|
|
var cache3 = /* @__PURE__ */ new WeakMap();
|
|
var markerProp = "$$css$localize";
|
|
function compileStyle(style, isRTL2) {
|
|
var compiledStyle = {};
|
|
for (var prop in style) {
|
|
if (prop !== markerProp) {
|
|
var value = style[prop];
|
|
if (Array.isArray(value)) {
|
|
compiledStyle[prop] = isRTL2 ? value[1] : value[0];
|
|
} else {
|
|
compiledStyle[prop] = value;
|
|
}
|
|
}
|
|
}
|
|
return compiledStyle;
|
|
}
|
|
__name(compileStyle, "compileStyle");
|
|
function localizeStyle(style, isRTL2) {
|
|
if (style[markerProp] != null) {
|
|
var compiledStyleIndex = isRTL2 ? 1 : 0;
|
|
if (cache3.has(style)) {
|
|
var _cachedStyles = cache3.get(style);
|
|
var _compiledStyle = _cachedStyles[compiledStyleIndex];
|
|
if (_compiledStyle == null) {
|
|
_compiledStyle = compileStyle(style, isRTL2);
|
|
_cachedStyles[compiledStyleIndex] = _compiledStyle;
|
|
cache3.set(style, _cachedStyles);
|
|
}
|
|
return _compiledStyle;
|
|
}
|
|
var compiledStyle = compileStyle(style, isRTL2);
|
|
var cachedStyles = new Array(2);
|
|
cachedStyles[compiledStyleIndex] = compiledStyle;
|
|
cache3.set(style, cachedStyles);
|
|
return compiledStyle;
|
|
}
|
|
return style;
|
|
}
|
|
__name(localizeStyle, "localizeStyle");
|
|
}
|
|
});
|
|
|
|
// node_modules/styleq/transform-localize-style.js
|
|
var require_transform_localize_style2 = __commonJS({
|
|
"node_modules/styleq/transform-localize-style.js"(exports2, module2) {
|
|
module2.exports = require_transform_localize_style();
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/warnOnce/index.js
|
|
var require_warnOnce = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/warnOnce/index.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.warnOnce = warnOnce;
|
|
var warnedKeys = {};
|
|
function warnOnce(key, message) {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
if (warnedKeys[key]) {
|
|
return;
|
|
}
|
|
console.warn(message);
|
|
warnedKeys[key] = true;
|
|
}
|
|
}
|
|
__name(warnOnce, "warnOnce");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/preprocess.js
|
|
var require_preprocess = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/preprocess.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.preprocess = exports2.default = exports2.createTransformValue = exports2.createTransformOriginValue = exports2.createTextShadowValue = exports2.createBoxShadowValue = exports2.createBoxShadowArrayValue = void 0;
|
|
var _normalizeColor = _interopRequireDefault(require_normalizeColor());
|
|
var _normalizeValueWithProperty = _interopRequireDefault(require_normalizeValueWithProperty());
|
|
var _warnOnce = require_warnOnce();
|
|
var emptyObject = {};
|
|
var defaultOffset = {
|
|
height: 0,
|
|
width: 0
|
|
};
|
|
var createBoxShadowValue = /* @__PURE__ */ __name((style) => {
|
|
var shadowColor = style.shadowColor, shadowOffset = style.shadowOffset, shadowOpacity = style.shadowOpacity, shadowRadius = style.shadowRadius;
|
|
var _ref = shadowOffset || defaultOffset, height = _ref.height, width = _ref.width;
|
|
var offsetX = (0, _normalizeValueWithProperty.default)(width);
|
|
var offsetY = (0, _normalizeValueWithProperty.default)(height);
|
|
var blurRadius = (0, _normalizeValueWithProperty.default)(shadowRadius || 0);
|
|
var color = (0, _normalizeColor.default)(shadowColor || "black", shadowOpacity);
|
|
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
|
|
return offsetX + " " + offsetY + " " + blurRadius + " " + color;
|
|
}
|
|
}, "createBoxShadowValue");
|
|
exports2.createBoxShadowValue = createBoxShadowValue;
|
|
var createTextShadowValue = /* @__PURE__ */ __name((style) => {
|
|
var textShadowColor = style.textShadowColor, textShadowOffset = style.textShadowOffset, textShadowRadius = style.textShadowRadius;
|
|
var _ref2 = textShadowOffset || defaultOffset, height = _ref2.height, width = _ref2.width;
|
|
var radius = textShadowRadius || 0;
|
|
var offsetX = (0, _normalizeValueWithProperty.default)(width);
|
|
var offsetY = (0, _normalizeValueWithProperty.default)(height);
|
|
var blurRadius = (0, _normalizeValueWithProperty.default)(radius);
|
|
var color = (0, _normalizeValueWithProperty.default)(textShadowColor, "textShadowColor");
|
|
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
|
|
return offsetX + " " + offsetY + " " + blurRadius + " " + color;
|
|
}
|
|
}, "createTextShadowValue");
|
|
exports2.createTextShadowValue = createTextShadowValue;
|
|
var mapBoxShadow = /* @__PURE__ */ __name((boxShadow) => {
|
|
if (typeof boxShadow === "string") {
|
|
return boxShadow;
|
|
}
|
|
var offsetX = (0, _normalizeValueWithProperty.default)(boxShadow.offsetX) || 0;
|
|
var offsetY = (0, _normalizeValueWithProperty.default)(boxShadow.offsetY) || 0;
|
|
var blurRadius = (0, _normalizeValueWithProperty.default)(boxShadow.blurRadius) || 0;
|
|
var spreadDistance = (0, _normalizeValueWithProperty.default)(boxShadow.spreadDistance) || 0;
|
|
var color = (0, _normalizeColor.default)(boxShadow.color) || "black";
|
|
var position = boxShadow.inset ? "inset " : "";
|
|
return "" + position + offsetX + " " + offsetY + " " + blurRadius + " " + spreadDistance + " " + color;
|
|
}, "mapBoxShadow");
|
|
var createBoxShadowArrayValue = /* @__PURE__ */ __name((value) => {
|
|
return value.map(mapBoxShadow).join(", ");
|
|
}, "createBoxShadowArrayValue");
|
|
exports2.createBoxShadowArrayValue = createBoxShadowArrayValue;
|
|
var mapTransform = /* @__PURE__ */ __name((transform) => {
|
|
var type = Object.keys(transform)[0];
|
|
var value = transform[type];
|
|
if (type === "matrix" || type === "matrix3d") {
|
|
return type + "(" + value.join(",") + ")";
|
|
} else {
|
|
var normalizedValue = (0, _normalizeValueWithProperty.default)(value, type);
|
|
return type + "(" + normalizedValue + ")";
|
|
}
|
|
}, "mapTransform");
|
|
var createTransformValue = /* @__PURE__ */ __name((value) => {
|
|
return value.map(mapTransform).join(" ");
|
|
}, "createTransformValue");
|
|
exports2.createTransformValue = createTransformValue;
|
|
var createTransformOriginValue = /* @__PURE__ */ __name((value) => {
|
|
return value.map((v) => (0, _normalizeValueWithProperty.default)(v)).join(" ");
|
|
}, "createTransformOriginValue");
|
|
exports2.createTransformOriginValue = createTransformOriginValue;
|
|
var PROPERTIES_STANDARD = {
|
|
borderBottomEndRadius: "borderEndEndRadius",
|
|
borderBottomStartRadius: "borderEndStartRadius",
|
|
borderTopEndRadius: "borderStartEndRadius",
|
|
borderTopStartRadius: "borderStartStartRadius",
|
|
borderEndColor: "borderInlineEndColor",
|
|
borderEndStyle: "borderInlineEndStyle",
|
|
borderEndWidth: "borderInlineEndWidth",
|
|
borderStartColor: "borderInlineStartColor",
|
|
borderStartStyle: "borderInlineStartStyle",
|
|
borderStartWidth: "borderInlineStartWidth",
|
|
end: "insetInlineEnd",
|
|
marginEnd: "marginInlineEnd",
|
|
marginHorizontal: "marginInline",
|
|
marginStart: "marginInlineStart",
|
|
marginVertical: "marginBlock",
|
|
paddingEnd: "paddingInlineEnd",
|
|
paddingHorizontal: "paddingInline",
|
|
paddingStart: "paddingInlineStart",
|
|
paddingVertical: "paddingBlock",
|
|
start: "insetInlineStart"
|
|
};
|
|
var ignoredProps = {
|
|
elevation: true,
|
|
overlayColor: true,
|
|
resizeMode: true,
|
|
tintColor: true
|
|
};
|
|
var preprocess = exports2.preprocess = /* @__PURE__ */ __name(function preprocess2(originalStyle, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var style = originalStyle || emptyObject;
|
|
var nextStyle = {};
|
|
if (options.shadow === true, style.shadowColor != null || style.shadowOffset != null || style.shadowOpacity != null || style.shadowRadius != null) {
|
|
(0, _warnOnce.warnOnce)("shadowStyles", '"shadow*" style props are deprecated. Use "boxShadow".');
|
|
var boxShadowValue = createBoxShadowValue(style);
|
|
if (boxShadowValue != null) {
|
|
nextStyle.boxShadow = boxShadowValue;
|
|
}
|
|
}
|
|
if (options.textShadow === true, style.textShadowColor != null || style.textShadowOffset != null || style.textShadowRadius != null) {
|
|
(0, _warnOnce.warnOnce)("textShadowStyles", '"textShadow*" style props are deprecated. Use "textShadow".');
|
|
var textShadowValue = createTextShadowValue(style);
|
|
if (textShadowValue != null && nextStyle.textShadow == null) {
|
|
var textShadow = style.textShadow;
|
|
var value = textShadow ? textShadow + ", " + textShadowValue : textShadowValue;
|
|
nextStyle.textShadow = value;
|
|
}
|
|
}
|
|
for (var originalProp in style) {
|
|
if (
|
|
// Ignore some React Native styles
|
|
ignoredProps[originalProp] != null || originalProp === "shadowColor" || originalProp === "shadowOffset" || originalProp === "shadowOpacity" || originalProp === "shadowRadius" || originalProp === "textShadowColor" || originalProp === "textShadowOffset" || originalProp === "textShadowRadius"
|
|
) {
|
|
continue;
|
|
}
|
|
var originalValue = style[originalProp];
|
|
var prop = PROPERTIES_STANDARD[originalProp] || originalProp;
|
|
var _value = originalValue;
|
|
if (!Object.prototype.hasOwnProperty.call(style, originalProp) || prop !== originalProp && style[prop] != null) {
|
|
continue;
|
|
}
|
|
if (prop === "aspectRatio" && typeof _value === "number") {
|
|
nextStyle[prop] = _value.toString();
|
|
} else if (prop === "boxShadow") {
|
|
if (Array.isArray(_value)) {
|
|
_value = createBoxShadowArrayValue(_value);
|
|
}
|
|
var boxShadow = nextStyle.boxShadow;
|
|
nextStyle.boxShadow = boxShadow ? _value + ", " + boxShadow : _value;
|
|
} else if (prop === "fontVariant") {
|
|
if (Array.isArray(_value) && _value.length > 0) {
|
|
_value = _value.join(" ");
|
|
}
|
|
nextStyle[prop] = _value;
|
|
} else if (prop === "textAlignVertical") {
|
|
if (style.verticalAlign == null) {
|
|
nextStyle.verticalAlign = _value === "center" ? "middle" : _value;
|
|
}
|
|
} else if (prop === "transform") {
|
|
if (Array.isArray(_value)) {
|
|
_value = createTransformValue(_value);
|
|
}
|
|
nextStyle.transform = _value;
|
|
} else if (prop === "transformOrigin") {
|
|
if (Array.isArray(_value)) {
|
|
_value = createTransformOriginValue(_value);
|
|
}
|
|
nextStyle.transformOrigin = _value;
|
|
} else {
|
|
nextStyle[prop] = _value;
|
|
}
|
|
}
|
|
return nextStyle;
|
|
}, "preprocess");
|
|
var _default = exports2.default = preprocess;
|
|
}
|
|
});
|
|
|
|
// node_modules/styleq/dist/styleq.js
|
|
var require_styleq = __commonJS({
|
|
"node_modules/styleq/dist/styleq.js"(exports2) {
|
|
"use strict";
|
|
Object.defineProperty(exports2, "__esModule", {
|
|
value: true
|
|
});
|
|
exports2.styleq = void 0;
|
|
var cache3 = /* @__PURE__ */ new WeakMap();
|
|
var compiledKey = "$$css";
|
|
function createStyleq(options) {
|
|
var disableCache;
|
|
var disableMix;
|
|
var transform;
|
|
if (options != null) {
|
|
disableCache = options.disableCache === true;
|
|
disableMix = options.disableMix === true;
|
|
transform = options.transform;
|
|
}
|
|
return /* @__PURE__ */ __name(function styleq2() {
|
|
var definedProperties = [];
|
|
var className = "";
|
|
var inlineStyle = null;
|
|
var nextCache = disableCache ? null : cache3;
|
|
var styles = new Array(arguments.length);
|
|
for (var i = 0; i < arguments.length; i++) {
|
|
styles[i] = arguments[i];
|
|
}
|
|
while (styles.length > 0) {
|
|
var possibleStyle = styles.pop();
|
|
if (possibleStyle == null || possibleStyle === false) {
|
|
continue;
|
|
}
|
|
if (Array.isArray(possibleStyle)) {
|
|
for (var _i = 0; _i < possibleStyle.length; _i++) {
|
|
styles.push(possibleStyle[_i]);
|
|
}
|
|
continue;
|
|
}
|
|
var style = transform != null ? transform(possibleStyle) : possibleStyle;
|
|
if (style.$$css) {
|
|
var classNameChunk = "";
|
|
if (nextCache != null && nextCache.has(style)) {
|
|
var cacheEntry = nextCache.get(style);
|
|
if (cacheEntry != null) {
|
|
classNameChunk = cacheEntry[0];
|
|
definedProperties.push.apply(definedProperties, cacheEntry[1]);
|
|
nextCache = cacheEntry[2];
|
|
}
|
|
} else {
|
|
var definedPropertiesChunk = [];
|
|
for (var prop in style) {
|
|
var value = style[prop];
|
|
if (prop === compiledKey) continue;
|
|
if (typeof value === "string" || value === null) {
|
|
if (!definedProperties.includes(prop)) {
|
|
definedProperties.push(prop);
|
|
if (nextCache != null) {
|
|
definedPropertiesChunk.push(prop);
|
|
}
|
|
if (typeof value === "string") {
|
|
classNameChunk += classNameChunk ? " " + value : value;
|
|
}
|
|
}
|
|
} else {
|
|
console.error("styleq: ".concat(prop, " typeof ").concat(String(value), ' is not "string" or "null".'));
|
|
}
|
|
}
|
|
if (nextCache != null) {
|
|
var weakMap = /* @__PURE__ */ new WeakMap();
|
|
nextCache.set(style, [classNameChunk, definedPropertiesChunk, weakMap]);
|
|
nextCache = weakMap;
|
|
}
|
|
}
|
|
if (classNameChunk) {
|
|
className = className ? classNameChunk + " " + className : classNameChunk;
|
|
}
|
|
} else {
|
|
if (disableMix) {
|
|
if (inlineStyle == null) {
|
|
inlineStyle = {};
|
|
}
|
|
inlineStyle = Object.assign({}, style, inlineStyle);
|
|
} else {
|
|
var subStyle = null;
|
|
for (var _prop in style) {
|
|
var _value = style[_prop];
|
|
if (_value !== void 0) {
|
|
if (!definedProperties.includes(_prop)) {
|
|
if (_value != null) {
|
|
if (inlineStyle == null) {
|
|
inlineStyle = {};
|
|
}
|
|
if (subStyle == null) {
|
|
subStyle = {};
|
|
}
|
|
subStyle[_prop] = _value;
|
|
}
|
|
definedProperties.push(_prop);
|
|
nextCache = null;
|
|
}
|
|
}
|
|
}
|
|
if (subStyle != null) {
|
|
inlineStyle = Object.assign(subStyle, inlineStyle);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var styleProps = [className, inlineStyle];
|
|
return styleProps;
|
|
}, "styleq");
|
|
}
|
|
__name(createStyleq, "createStyleq");
|
|
var styleq = createStyleq();
|
|
exports2.styleq = styleq;
|
|
styleq.factory = createStyleq;
|
|
}
|
|
});
|
|
|
|
// node_modules/styleq/styleq.js
|
|
var require_styleq2 = __commonJS({
|
|
"node_modules/styleq/styleq.js"(exports2, module2) {
|
|
module2.exports = require_styleq();
|
|
}
|
|
});
|
|
|
|
// node_modules/postcss-value-parser/lib/parse.js
|
|
var require_parse = __commonJS({
|
|
"node_modules/postcss-value-parser/lib/parse.js"(exports2, module2) {
|
|
var openParentheses = "(".charCodeAt(0);
|
|
var closeParentheses = ")".charCodeAt(0);
|
|
var singleQuote = "'".charCodeAt(0);
|
|
var doubleQuote = '"'.charCodeAt(0);
|
|
var backslash = "\\".charCodeAt(0);
|
|
var slash = "/".charCodeAt(0);
|
|
var comma = ",".charCodeAt(0);
|
|
var colon = ":".charCodeAt(0);
|
|
var star = "*".charCodeAt(0);
|
|
var uLower = "u".charCodeAt(0);
|
|
var uUpper = "U".charCodeAt(0);
|
|
var plus = "+".charCodeAt(0);
|
|
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
|
module2.exports = function(input) {
|
|
var tokens = [];
|
|
var value = input;
|
|
var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
|
|
var pos = 0;
|
|
var code = value.charCodeAt(pos);
|
|
var max2 = value.length;
|
|
var stack = [{ nodes: tokens }];
|
|
var balanced = 0;
|
|
var parent;
|
|
var name = "";
|
|
var before = "";
|
|
var after = "";
|
|
while (pos < max2) {
|
|
if (code <= 32) {
|
|
next = pos;
|
|
do {
|
|
next += 1;
|
|
code = value.charCodeAt(next);
|
|
} while (code <= 32);
|
|
token = value.slice(pos, next);
|
|
prev = tokens[tokens.length - 1];
|
|
if (code === closeParentheses && balanced) {
|
|
after = token;
|
|
} else if (prev && prev.type === "div") {
|
|
prev.after = token;
|
|
prev.sourceEndIndex += token.length;
|
|
} else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) {
|
|
before = token;
|
|
} else {
|
|
tokens.push({
|
|
type: "space",
|
|
sourceIndex: pos,
|
|
sourceEndIndex: next,
|
|
value: token
|
|
});
|
|
}
|
|
pos = next;
|
|
} else if (code === singleQuote || code === doubleQuote) {
|
|
next = pos;
|
|
quote = code === singleQuote ? "'" : '"';
|
|
token = {
|
|
type: "string",
|
|
sourceIndex: pos,
|
|
quote
|
|
};
|
|
do {
|
|
escape = false;
|
|
next = value.indexOf(quote, next + 1);
|
|
if (~next) {
|
|
escapePos = next;
|
|
while (value.charCodeAt(escapePos - 1) === backslash) {
|
|
escapePos -= 1;
|
|
escape = !escape;
|
|
}
|
|
} else {
|
|
value += quote;
|
|
next = value.length - 1;
|
|
token.unclosed = true;
|
|
}
|
|
} while (escape);
|
|
token.value = value.slice(pos + 1, next);
|
|
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
|
tokens.push(token);
|
|
pos = next + 1;
|
|
code = value.charCodeAt(pos);
|
|
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
|
next = value.indexOf("*/", pos);
|
|
token = {
|
|
type: "comment",
|
|
sourceIndex: pos,
|
|
sourceEndIndex: next + 2
|
|
};
|
|
if (next === -1) {
|
|
token.unclosed = true;
|
|
next = value.length;
|
|
token.sourceEndIndex = next;
|
|
}
|
|
token.value = value.slice(pos + 2, next);
|
|
tokens.push(token);
|
|
pos = next + 2;
|
|
code = value.charCodeAt(pos);
|
|
} else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
|
|
token = value[pos];
|
|
tokens.push({
|
|
type: "word",
|
|
sourceIndex: pos - before.length,
|
|
sourceEndIndex: pos + token.length,
|
|
value: token
|
|
});
|
|
pos += 1;
|
|
code = value.charCodeAt(pos);
|
|
} else if (code === slash || code === comma || code === colon) {
|
|
token = value[pos];
|
|
tokens.push({
|
|
type: "div",
|
|
sourceIndex: pos - before.length,
|
|
sourceEndIndex: pos + token.length,
|
|
value: token,
|
|
before,
|
|
after: ""
|
|
});
|
|
before = "";
|
|
pos += 1;
|
|
code = value.charCodeAt(pos);
|
|
} else if (openParentheses === code) {
|
|
next = pos;
|
|
do {
|
|
next += 1;
|
|
code = value.charCodeAt(next);
|
|
} while (code <= 32);
|
|
parenthesesOpenPos = pos;
|
|
token = {
|
|
type: "function",
|
|
sourceIndex: pos - name.length,
|
|
value: name,
|
|
before: value.slice(parenthesesOpenPos + 1, next)
|
|
};
|
|
pos = next;
|
|
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
|
next -= 1;
|
|
do {
|
|
escape = false;
|
|
next = value.indexOf(")", next + 1);
|
|
if (~next) {
|
|
escapePos = next;
|
|
while (value.charCodeAt(escapePos - 1) === backslash) {
|
|
escapePos -= 1;
|
|
escape = !escape;
|
|
}
|
|
} else {
|
|
value += ")";
|
|
next = value.length - 1;
|
|
token.unclosed = true;
|
|
}
|
|
} while (escape);
|
|
whitespacePos = next;
|
|
do {
|
|
whitespacePos -= 1;
|
|
code = value.charCodeAt(whitespacePos);
|
|
} while (code <= 32);
|
|
if (parenthesesOpenPos < whitespacePos) {
|
|
if (pos !== whitespacePos + 1) {
|
|
token.nodes = [
|
|
{
|
|
type: "word",
|
|
sourceIndex: pos,
|
|
sourceEndIndex: whitespacePos + 1,
|
|
value: value.slice(pos, whitespacePos + 1)
|
|
}
|
|
];
|
|
} else {
|
|
token.nodes = [];
|
|
}
|
|
if (token.unclosed && whitespacePos + 1 !== next) {
|
|
token.after = "";
|
|
token.nodes.push({
|
|
type: "space",
|
|
sourceIndex: whitespacePos + 1,
|
|
sourceEndIndex: next,
|
|
value: value.slice(whitespacePos + 1, next)
|
|
});
|
|
} else {
|
|
token.after = value.slice(whitespacePos + 1, next);
|
|
token.sourceEndIndex = next;
|
|
}
|
|
} else {
|
|
token.after = "";
|
|
token.nodes = [];
|
|
}
|
|
pos = next + 1;
|
|
token.sourceEndIndex = token.unclosed ? next : pos;
|
|
code = value.charCodeAt(pos);
|
|
tokens.push(token);
|
|
} else {
|
|
balanced += 1;
|
|
token.after = "";
|
|
token.sourceEndIndex = pos + 1;
|
|
tokens.push(token);
|
|
stack.push(token);
|
|
tokens = token.nodes = [];
|
|
parent = token;
|
|
}
|
|
name = "";
|
|
} else if (closeParentheses === code && balanced) {
|
|
pos += 1;
|
|
code = value.charCodeAt(pos);
|
|
parent.after = after;
|
|
parent.sourceEndIndex += after.length;
|
|
after = "";
|
|
balanced -= 1;
|
|
stack[stack.length - 1].sourceEndIndex = pos;
|
|
stack.pop();
|
|
parent = stack[balanced];
|
|
tokens = parent.nodes;
|
|
} else {
|
|
next = pos;
|
|
do {
|
|
if (code === backslash) {
|
|
next += 1;
|
|
}
|
|
next += 1;
|
|
code = value.charCodeAt(next);
|
|
} while (next < max2 && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced));
|
|
token = value.slice(pos, next);
|
|
if (openParentheses === code) {
|
|
name = token;
|
|
} else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) {
|
|
tokens.push({
|
|
type: "unicode-range",
|
|
sourceIndex: pos,
|
|
sourceEndIndex: next,
|
|
value: token
|
|
});
|
|
} else {
|
|
tokens.push({
|
|
type: "word",
|
|
sourceIndex: pos,
|
|
sourceEndIndex: next,
|
|
value: token
|
|
});
|
|
}
|
|
pos = next;
|
|
}
|
|
}
|
|
for (pos = stack.length - 1; pos; pos -= 1) {
|
|
stack[pos].unclosed = true;
|
|
stack[pos].sourceEndIndex = value.length;
|
|
}
|
|
return stack[0].nodes;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/postcss-value-parser/lib/walk.js
|
|
var require_walk = __commonJS({
|
|
"node_modules/postcss-value-parser/lib/walk.js"(exports2, module2) {
|
|
module2.exports = /* @__PURE__ */ __name(function walk(nodes, cb, bubble) {
|
|
var i, max2, node, result;
|
|
for (i = 0, max2 = nodes.length; i < max2; i += 1) {
|
|
node = nodes[i];
|
|
if (!bubble) {
|
|
result = cb(node, i, nodes);
|
|
}
|
|
if (result !== false && node.type === "function" && Array.isArray(node.nodes)) {
|
|
walk(node.nodes, cb, bubble);
|
|
}
|
|
if (bubble) {
|
|
cb(node, i, nodes);
|
|
}
|
|
}
|
|
}, "walk");
|
|
}
|
|
});
|
|
|
|
// node_modules/postcss-value-parser/lib/stringify.js
|
|
var require_stringify = __commonJS({
|
|
"node_modules/postcss-value-parser/lib/stringify.js"(exports2, module2) {
|
|
function stringifyNode(node, custom) {
|
|
var type = node.type;
|
|
var value = node.value;
|
|
var buf;
|
|
var customResult;
|
|
if (custom && (customResult = custom(node)) !== void 0) {
|
|
return customResult;
|
|
} else if (type === "word" || type === "space") {
|
|
return value;
|
|
} else if (type === "string") {
|
|
buf = node.quote || "";
|
|
return buf + value + (node.unclosed ? "" : buf);
|
|
} else if (type === "comment") {
|
|
return "/*" + value + (node.unclosed ? "" : "*/");
|
|
} else if (type === "div") {
|
|
return (node.before || "") + value + (node.after || "");
|
|
} else if (Array.isArray(node.nodes)) {
|
|
buf = stringify(node.nodes, custom);
|
|
if (type !== "function") {
|
|
return buf;
|
|
}
|
|
return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
|
|
}
|
|
return value;
|
|
}
|
|
__name(stringifyNode, "stringifyNode");
|
|
function stringify(nodes, custom) {
|
|
var result, i;
|
|
if (Array.isArray(nodes)) {
|
|
result = "";
|
|
for (i = nodes.length - 1; ~i; i -= 1) {
|
|
result = stringifyNode(nodes[i], custom) + result;
|
|
}
|
|
return result;
|
|
}
|
|
return stringifyNode(nodes, custom);
|
|
}
|
|
__name(stringify, "stringify");
|
|
module2.exports = stringify;
|
|
}
|
|
});
|
|
|
|
// node_modules/postcss-value-parser/lib/unit.js
|
|
var require_unit = __commonJS({
|
|
"node_modules/postcss-value-parser/lib/unit.js"(exports2, module2) {
|
|
var minus = "-".charCodeAt(0);
|
|
var plus = "+".charCodeAt(0);
|
|
var dot = ".".charCodeAt(0);
|
|
var exp = "e".charCodeAt(0);
|
|
var EXP = "E".charCodeAt(0);
|
|
function likeNumber(value) {
|
|
var code = value.charCodeAt(0);
|
|
var nextCode;
|
|
if (code === plus || code === minus) {
|
|
nextCode = value.charCodeAt(1);
|
|
if (nextCode >= 48 && nextCode <= 57) {
|
|
return true;
|
|
}
|
|
var nextNextCode = value.charCodeAt(2);
|
|
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
if (code === dot) {
|
|
nextCode = value.charCodeAt(1);
|
|
if (nextCode >= 48 && nextCode <= 57) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
if (code >= 48 && code <= 57) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
__name(likeNumber, "likeNumber");
|
|
module2.exports = function(value) {
|
|
var pos = 0;
|
|
var length = value.length;
|
|
var code;
|
|
var nextCode;
|
|
var nextNextCode;
|
|
if (length === 0 || !likeNumber(value)) {
|
|
return false;
|
|
}
|
|
code = value.charCodeAt(pos);
|
|
if (code === plus || code === minus) {
|
|
pos++;
|
|
}
|
|
while (pos < length) {
|
|
code = value.charCodeAt(pos);
|
|
if (code < 48 || code > 57) {
|
|
break;
|
|
}
|
|
pos += 1;
|
|
}
|
|
code = value.charCodeAt(pos);
|
|
nextCode = value.charCodeAt(pos + 1);
|
|
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
|
pos += 2;
|
|
while (pos < length) {
|
|
code = value.charCodeAt(pos);
|
|
if (code < 48 || code > 57) {
|
|
break;
|
|
}
|
|
pos += 1;
|
|
}
|
|
}
|
|
code = value.charCodeAt(pos);
|
|
nextCode = value.charCodeAt(pos + 1);
|
|
nextNextCode = value.charCodeAt(pos + 2);
|
|
if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
|
|
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
|
while (pos < length) {
|
|
code = value.charCodeAt(pos);
|
|
if (code < 48 || code > 57) {
|
|
break;
|
|
}
|
|
pos += 1;
|
|
}
|
|
}
|
|
return {
|
|
number: value.slice(0, pos),
|
|
unit: value.slice(pos)
|
|
};
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/postcss-value-parser/lib/index.js
|
|
var require_lib2 = __commonJS({
|
|
"node_modules/postcss-value-parser/lib/index.js"(exports2, module2) {
|
|
var parse = require_parse();
|
|
var walk = require_walk();
|
|
var stringify = require_stringify();
|
|
function ValueParser(value) {
|
|
if (this instanceof ValueParser) {
|
|
this.nodes = parse(value);
|
|
return this;
|
|
}
|
|
return new ValueParser(value);
|
|
}
|
|
__name(ValueParser, "ValueParser");
|
|
ValueParser.prototype.toString = function() {
|
|
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
|
};
|
|
ValueParser.prototype.walk = function(cb, bubble) {
|
|
walk(this.nodes, cb, bubble);
|
|
return this;
|
|
};
|
|
ValueParser.unit = require_unit();
|
|
ValueParser.walk = walk;
|
|
ValueParser.stringify = stringify;
|
|
module2.exports = ValueParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/validate.js
|
|
var require_validate = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/validate.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.validate = validate;
|
|
var _postcssValueParser = _interopRequireDefault(require_lib2());
|
|
var invalidShortforms = {
|
|
background: true,
|
|
borderBottom: true,
|
|
borderLeft: true,
|
|
borderRight: true,
|
|
borderTop: true,
|
|
font: true,
|
|
grid: true,
|
|
outline: true,
|
|
textDecoration: true
|
|
};
|
|
var invalidMultiValueShortforms = {
|
|
flex: true,
|
|
margin: true,
|
|
padding: true,
|
|
borderColor: true,
|
|
borderRadius: true,
|
|
borderStyle: true,
|
|
borderWidth: true,
|
|
inset: true,
|
|
insetBlock: true,
|
|
insetInline: true,
|
|
marginBlock: true,
|
|
marginInline: true,
|
|
marginHorizontal: true,
|
|
marginVertical: true,
|
|
paddingBlock: true,
|
|
paddingInline: true,
|
|
paddingHorizontal: true,
|
|
paddingVertical: true,
|
|
overflow: true,
|
|
overscrollBehavior: true,
|
|
backgroundPosition: true
|
|
};
|
|
function error4(message) {
|
|
console.error(message);
|
|
}
|
|
__name(error4, "error");
|
|
function validate(obj) {
|
|
for (var k in obj) {
|
|
var prop = k.trim();
|
|
var value = obj[prop];
|
|
var isInvalid = false;
|
|
if (value === null) {
|
|
continue;
|
|
}
|
|
if (typeof value === "string" && value.indexOf("!important") > -1) {
|
|
error4('Invalid style declaration "' + prop + ":" + value + '". Values cannot include "!important"');
|
|
isInvalid = true;
|
|
} else {
|
|
var suggestion = "";
|
|
if (prop === "animation" || prop === "animationName") {
|
|
suggestion = 'Did you mean "animationKeyframes"?';
|
|
isInvalid = true;
|
|
} else if (prop === "direction") {
|
|
suggestion = 'Did you mean "writingDirection"?';
|
|
isInvalid = true;
|
|
} else if (invalidShortforms[prop]) {
|
|
suggestion = "Please use long-form properties.";
|
|
isInvalid = true;
|
|
} else if (invalidMultiValueShortforms[prop]) {
|
|
if (typeof value === "string" && (0, _postcssValueParser.default)(value).nodes.length > 1) {
|
|
suggestion = 'Value is "' + value + '" but only single values are supported.';
|
|
isInvalid = true;
|
|
}
|
|
}
|
|
if (suggestion !== "") {
|
|
error4('Invalid style property of "' + prop + '". ' + suggestion);
|
|
}
|
|
}
|
|
if (isInvalid) {
|
|
delete obj[k];
|
|
}
|
|
}
|
|
}
|
|
__name(validate, "validate");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StyleSheet/index.js
|
|
var require_StyleSheet = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StyleSheet/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _compiler = require_compiler();
|
|
var _dom = require_dom();
|
|
var _transformLocalizeStyle = require_transform_localize_style2();
|
|
var _preprocess = require_preprocess();
|
|
var _styleq = require_styleq2();
|
|
var _validate = require_validate();
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var _excluded = ["writingDirection"];
|
|
var staticStyleMap = /* @__PURE__ */ new WeakMap();
|
|
var sheet = (0, _dom.createSheet)();
|
|
var defaultPreprocessOptions = {
|
|
shadow: true,
|
|
textShadow: true
|
|
};
|
|
function customStyleq(styles, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _options = options, writingDirection = _options.writingDirection, preprocessOptions = (0, _objectWithoutPropertiesLoose2.default)(_options, _excluded);
|
|
var isRTL2 = writingDirection === "rtl";
|
|
return _styleq.styleq.factory({
|
|
transform(style) {
|
|
var compiledStyle = staticStyleMap.get(style);
|
|
if (compiledStyle != null) {
|
|
return (0, _transformLocalizeStyle.localizeStyle)(compiledStyle, isRTL2);
|
|
}
|
|
return (0, _preprocess.preprocess)(style, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultPreprocessOptions), preprocessOptions));
|
|
}
|
|
})(styles);
|
|
}
|
|
__name(customStyleq, "customStyleq");
|
|
function insertRules(compiledOrderedRules) {
|
|
compiledOrderedRules.forEach((_ref) => {
|
|
var rules = _ref[0], order = _ref[1];
|
|
if (sheet != null) {
|
|
rules.forEach((rule) => {
|
|
sheet.insert(rule, order);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
__name(insertRules, "insertRules");
|
|
function compileAndInsertAtomic(style) {
|
|
var _atomic = (0, _compiler.atomic)((0, _preprocess.preprocess)(style, defaultPreprocessOptions)), compiledStyle = _atomic[0], compiledOrderedRules = _atomic[1];
|
|
insertRules(compiledOrderedRules);
|
|
return compiledStyle;
|
|
}
|
|
__name(compileAndInsertAtomic, "compileAndInsertAtomic");
|
|
function compileAndInsertReset(style, key) {
|
|
var _classic = (0, _compiler.classic)(style, key), compiledStyle = _classic[0], compiledOrderedRules = _classic[1];
|
|
insertRules(compiledOrderedRules);
|
|
return compiledStyle;
|
|
}
|
|
__name(compileAndInsertReset, "compileAndInsertReset");
|
|
var absoluteFillObject = {
|
|
position: "absolute",
|
|
left: 0,
|
|
right: 0,
|
|
top: 0,
|
|
bottom: 0
|
|
};
|
|
var absoluteFill = create({
|
|
x: (0, _objectSpread2.default)({}, absoluteFillObject)
|
|
}).x;
|
|
function create(styles) {
|
|
Object.keys(styles).forEach((key) => {
|
|
var styleObj = styles[key];
|
|
if (styleObj != null && styleObj.$$css !== true) {
|
|
var compiledStyles;
|
|
if (key.indexOf("$raw") > -1) {
|
|
compiledStyles = compileAndInsertReset(styleObj, key.split("$raw")[0]);
|
|
} else {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
(0, _validate.validate)(styleObj);
|
|
styles[key] = Object.freeze(styleObj);
|
|
}
|
|
compiledStyles = compileAndInsertAtomic(styleObj);
|
|
}
|
|
staticStyleMap.set(styleObj, compiledStyles);
|
|
}
|
|
});
|
|
return styles;
|
|
}
|
|
__name(create, "create");
|
|
function compose(style1, style2) {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
var len = arguments.length;
|
|
if (len > 2) {
|
|
var readableStyles = [...arguments].map((a) => flatten(a));
|
|
throw new Error("StyleSheet.compose() only accepts 2 arguments, received " + len + ": " + JSON.stringify(readableStyles));
|
|
}
|
|
}
|
|
return [style1, style2];
|
|
}
|
|
__name(compose, "compose");
|
|
function flatten() {
|
|
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
styles[_key] = arguments[_key];
|
|
}
|
|
var flatArray = styles.flat(Infinity);
|
|
var result = {};
|
|
for (var i = 0; i < flatArray.length; i++) {
|
|
var style = flatArray[i];
|
|
if (style != null && typeof style === "object") {
|
|
Object.assign(result, style);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
__name(flatten, "flatten");
|
|
function getSheet() {
|
|
return {
|
|
id: sheet.id,
|
|
textContent: sheet.getTextContent()
|
|
};
|
|
}
|
|
__name(getSheet, "getSheet");
|
|
function StyleSheet(styles, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var isRTL2 = options.writingDirection === "rtl";
|
|
var styleProps = customStyleq(styles, options);
|
|
if (Array.isArray(styleProps) && styleProps[1] != null) {
|
|
styleProps[1] = (0, _compiler.inline)(styleProps[1], isRTL2);
|
|
}
|
|
return styleProps;
|
|
}
|
|
__name(StyleSheet, "StyleSheet");
|
|
StyleSheet.absoluteFill = absoluteFill;
|
|
StyleSheet.absoluteFillObject = absoluteFillObject;
|
|
StyleSheet.create = create;
|
|
StyleSheet.compose = compose;
|
|
StyleSheet.flatten = flatten;
|
|
StyleSheet.getSheet = getSheet;
|
|
StyleSheet.hairlineWidth = 1;
|
|
if (_canUseDom.default && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
|
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;
|
|
}
|
|
var stylesheet = StyleSheet;
|
|
var _default = exports2.default = stylesheet;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/createDOMProps/index.js
|
|
var require_createDOMProps = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/createDOMProps/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _AccessibilityUtil = _interopRequireDefault(require_AccessibilityUtil());
|
|
var _StyleSheet2 = _interopRequireDefault(require_StyleSheet());
|
|
var _warnOnce = require_warnOnce();
|
|
var _excluded = ["aria-activedescendant", "accessibilityActiveDescendant", "aria-atomic", "accessibilityAtomic", "aria-autocomplete", "accessibilityAutoComplete", "aria-busy", "accessibilityBusy", "aria-checked", "accessibilityChecked", "aria-colcount", "accessibilityColumnCount", "aria-colindex", "accessibilityColumnIndex", "aria-colspan", "accessibilityColumnSpan", "aria-controls", "accessibilityControls", "aria-current", "accessibilityCurrent", "aria-describedby", "accessibilityDescribedBy", "aria-details", "accessibilityDetails", "aria-disabled", "accessibilityDisabled", "aria-errormessage", "accessibilityErrorMessage", "aria-expanded", "accessibilityExpanded", "aria-flowto", "accessibilityFlowTo", "aria-haspopup", "accessibilityHasPopup", "aria-hidden", "accessibilityHidden", "aria-invalid", "accessibilityInvalid", "aria-keyshortcuts", "accessibilityKeyShortcuts", "aria-label", "accessibilityLabel", "aria-labelledby", "accessibilityLabelledBy", "aria-level", "accessibilityLevel", "aria-live", "accessibilityLiveRegion", "aria-modal", "accessibilityModal", "aria-multiline", "accessibilityMultiline", "aria-multiselectable", "accessibilityMultiSelectable", "aria-orientation", "accessibilityOrientation", "aria-owns", "accessibilityOwns", "aria-placeholder", "accessibilityPlaceholder", "aria-posinset", "accessibilityPosInSet", "aria-pressed", "accessibilityPressed", "aria-readonly", "accessibilityReadOnly", "aria-required", "accessibilityRequired", "role", "accessibilityRole", "aria-roledescription", "accessibilityRoleDescription", "aria-rowcount", "accessibilityRowCount", "aria-rowindex", "accessibilityRowIndex", "aria-rowspan", "accessibilityRowSpan", "aria-selected", "accessibilitySelected", "aria-setsize", "accessibilitySetSize", "aria-sort", "accessibilitySort", "aria-valuemax", "accessibilityValueMax", "aria-valuemin", "accessibilityValueMin", "aria-valuenow", "accessibilityValueNow", "aria-valuetext", "accessibilityValueText", "dataSet", "focusable", "id", "nativeID", "pointerEvents", "style", "tabIndex", "testID"];
|
|
var emptyObject = {};
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var isArray = Array.isArray;
|
|
var uppercasePattern = /[A-Z]/g;
|
|
function toHyphenLower(match) {
|
|
return "-" + match.toLowerCase();
|
|
}
|
|
__name(toHyphenLower, "toHyphenLower");
|
|
function hyphenateString(str) {
|
|
return str.replace(uppercasePattern, toHyphenLower);
|
|
}
|
|
__name(hyphenateString, "hyphenateString");
|
|
function processIDRefList(idRefList) {
|
|
return isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
}
|
|
__name(processIDRefList, "processIDRefList");
|
|
var pointerEventsStyles = _StyleSheet2.default.create({
|
|
auto: {
|
|
pointerEvents: "auto"
|
|
},
|
|
"box-none": {
|
|
pointerEvents: "box-none"
|
|
},
|
|
"box-only": {
|
|
pointerEvents: "box-only"
|
|
},
|
|
none: {
|
|
pointerEvents: "none"
|
|
}
|
|
});
|
|
var createDOMProps = /* @__PURE__ */ __name((elementType, props, options) => {
|
|
if (!props) {
|
|
props = emptyObject;
|
|
}
|
|
var _props = props, ariaActiveDescendant = _props["aria-activedescendant"], accessibilityActiveDescendant = _props.accessibilityActiveDescendant, ariaAtomic = _props["aria-atomic"], accessibilityAtomic = _props.accessibilityAtomic, ariaAutoComplete = _props["aria-autocomplete"], accessibilityAutoComplete = _props.accessibilityAutoComplete, ariaBusy = _props["aria-busy"], accessibilityBusy = _props.accessibilityBusy, ariaChecked = _props["aria-checked"], accessibilityChecked = _props.accessibilityChecked, ariaColumnCount = _props["aria-colcount"], accessibilityColumnCount = _props.accessibilityColumnCount, ariaColumnIndex = _props["aria-colindex"], accessibilityColumnIndex = _props.accessibilityColumnIndex, ariaColumnSpan = _props["aria-colspan"], accessibilityColumnSpan = _props.accessibilityColumnSpan, ariaControls = _props["aria-controls"], accessibilityControls = _props.accessibilityControls, ariaCurrent = _props["aria-current"], accessibilityCurrent = _props.accessibilityCurrent, ariaDescribedBy = _props["aria-describedby"], accessibilityDescribedBy = _props.accessibilityDescribedBy, ariaDetails = _props["aria-details"], accessibilityDetails = _props.accessibilityDetails, ariaDisabled = _props["aria-disabled"], accessibilityDisabled = _props.accessibilityDisabled, ariaErrorMessage = _props["aria-errormessage"], accessibilityErrorMessage = _props.accessibilityErrorMessage, ariaExpanded = _props["aria-expanded"], accessibilityExpanded = _props.accessibilityExpanded, ariaFlowTo = _props["aria-flowto"], accessibilityFlowTo = _props.accessibilityFlowTo, ariaHasPopup = _props["aria-haspopup"], accessibilityHasPopup = _props.accessibilityHasPopup, ariaHidden = _props["aria-hidden"], accessibilityHidden = _props.accessibilityHidden, ariaInvalid = _props["aria-invalid"], accessibilityInvalid = _props.accessibilityInvalid, ariaKeyShortcuts = _props["aria-keyshortcuts"], accessibilityKeyShortcuts = _props.accessibilityKeyShortcuts, ariaLabel = _props["aria-label"], accessibilityLabel = _props.accessibilityLabel, ariaLabelledBy = _props["aria-labelledby"], accessibilityLabelledBy = _props.accessibilityLabelledBy, ariaLevel = _props["aria-level"], accessibilityLevel = _props.accessibilityLevel, ariaLive = _props["aria-live"], accessibilityLiveRegion = _props.accessibilityLiveRegion, ariaModal = _props["aria-modal"], accessibilityModal = _props.accessibilityModal, ariaMultiline = _props["aria-multiline"], accessibilityMultiline = _props.accessibilityMultiline, ariaMultiSelectable = _props["aria-multiselectable"], accessibilityMultiSelectable = _props.accessibilityMultiSelectable, ariaOrientation = _props["aria-orientation"], accessibilityOrientation = _props.accessibilityOrientation, ariaOwns = _props["aria-owns"], accessibilityOwns = _props.accessibilityOwns, ariaPlaceholder = _props["aria-placeholder"], accessibilityPlaceholder = _props.accessibilityPlaceholder, ariaPosInSet = _props["aria-posinset"], accessibilityPosInSet = _props.accessibilityPosInSet, ariaPressed = _props["aria-pressed"], accessibilityPressed = _props.accessibilityPressed, ariaReadOnly = _props["aria-readonly"], accessibilityReadOnly = _props.accessibilityReadOnly, ariaRequired = _props["aria-required"], accessibilityRequired = _props.accessibilityRequired, ariaRole = _props.role, accessibilityRole = _props.accessibilityRole, ariaRoleDescription = _props["aria-roledescription"], accessibilityRoleDescription = _props.accessibilityRoleDescription, ariaRowCount = _props["aria-rowcount"], accessibilityRowCount = _props.accessibilityRowCount, ariaRowIndex = _props["aria-rowindex"], accessibilityRowIndex = _props.accessibilityRowIndex, ariaRowSpan = _props["aria-rowspan"], accessibilityRowSpan = _props.accessibilityRowSpan, ariaSelected = _props["aria-selected"], accessibilitySelected = _props.accessibilitySelected, ariaSetSize = _props["aria-setsize"], accessibilitySetSize = _props.accessibilitySetSize, ariaSort = _props["aria-sort"], accessibilitySort = _props.accessibilitySort, ariaValueMax = _props["aria-valuemax"], accessibilityValueMax = _props.accessibilityValueMax, ariaValueMin = _props["aria-valuemin"], accessibilityValueMin = _props.accessibilityValueMin, ariaValueNow = _props["aria-valuenow"], accessibilityValueNow = _props.accessibilityValueNow, ariaValueText = _props["aria-valuetext"], accessibilityValueText = _props.accessibilityValueText, dataSet = _props.dataSet, focusable2 = _props.focusable, id = _props.id, nativeID = _props.nativeID, pointerEvents = _props.pointerEvents, style = _props.style, tabIndex = _props.tabIndex, testID = _props.testID, domProps = (0, _objectWithoutPropertiesLoose2.default)(_props, _excluded);
|
|
var disabled = ariaDisabled || accessibilityDisabled;
|
|
var role = _AccessibilityUtil.default.propsToAriaRole(props);
|
|
var _ariaActiveDescendant = ariaActiveDescendant != null ? ariaActiveDescendant : accessibilityActiveDescendant;
|
|
if (_ariaActiveDescendant != null) {
|
|
domProps["aria-activedescendant"] = _ariaActiveDescendant;
|
|
}
|
|
var _ariaAtomic = ariaAtomic != null ? ariaActiveDescendant : accessibilityAtomic;
|
|
if (_ariaAtomic != null) {
|
|
domProps["aria-atomic"] = _ariaAtomic;
|
|
}
|
|
var _ariaAutoComplete = ariaAutoComplete != null ? ariaAutoComplete : accessibilityAutoComplete;
|
|
if (_ariaAutoComplete != null) {
|
|
domProps["aria-autocomplete"] = _ariaAutoComplete;
|
|
}
|
|
var _ariaBusy = ariaBusy != null ? ariaBusy : accessibilityBusy;
|
|
if (_ariaBusy != null) {
|
|
domProps["aria-busy"] = _ariaBusy;
|
|
}
|
|
var _ariaChecked = ariaChecked != null ? ariaChecked : accessibilityChecked;
|
|
if (_ariaChecked != null) {
|
|
domProps["aria-checked"] = _ariaChecked;
|
|
}
|
|
var _ariaColumnCount = ariaColumnCount != null ? ariaColumnCount : accessibilityColumnCount;
|
|
if (_ariaColumnCount != null) {
|
|
domProps["aria-colcount"] = _ariaColumnCount;
|
|
}
|
|
var _ariaColumnIndex = ariaColumnIndex != null ? ariaColumnIndex : accessibilityColumnIndex;
|
|
if (_ariaColumnIndex != null) {
|
|
domProps["aria-colindex"] = _ariaColumnIndex;
|
|
}
|
|
var _ariaColumnSpan = ariaColumnSpan != null ? ariaColumnSpan : accessibilityColumnSpan;
|
|
if (_ariaColumnSpan != null) {
|
|
domProps["aria-colspan"] = _ariaColumnSpan;
|
|
}
|
|
var _ariaControls = ariaControls != null ? ariaControls : accessibilityControls;
|
|
if (_ariaControls != null) {
|
|
domProps["aria-controls"] = processIDRefList(_ariaControls);
|
|
}
|
|
var _ariaCurrent = ariaCurrent != null ? ariaCurrent : accessibilityCurrent;
|
|
if (_ariaCurrent != null) {
|
|
domProps["aria-current"] = _ariaCurrent;
|
|
}
|
|
var _ariaDescribedBy = ariaDescribedBy != null ? ariaDescribedBy : accessibilityDescribedBy;
|
|
if (_ariaDescribedBy != null) {
|
|
domProps["aria-describedby"] = processIDRefList(_ariaDescribedBy);
|
|
}
|
|
var _ariaDetails = ariaDetails != null ? ariaDetails : accessibilityDetails;
|
|
if (_ariaDetails != null) {
|
|
domProps["aria-details"] = _ariaDetails;
|
|
}
|
|
if (disabled === true) {
|
|
domProps["aria-disabled"] = true;
|
|
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
domProps.disabled = true;
|
|
}
|
|
}
|
|
var _ariaErrorMessage = ariaErrorMessage != null ? ariaErrorMessage : accessibilityErrorMessage;
|
|
if (_ariaErrorMessage != null) {
|
|
domProps["aria-errormessage"] = _ariaErrorMessage;
|
|
}
|
|
var _ariaExpanded = ariaExpanded != null ? ariaExpanded : accessibilityExpanded;
|
|
if (_ariaExpanded != null) {
|
|
domProps["aria-expanded"] = _ariaExpanded;
|
|
}
|
|
var _ariaFlowTo = ariaFlowTo != null ? ariaFlowTo : accessibilityFlowTo;
|
|
if (_ariaFlowTo != null) {
|
|
domProps["aria-flowto"] = processIDRefList(_ariaFlowTo);
|
|
}
|
|
var _ariaHasPopup = ariaHasPopup != null ? ariaHasPopup : accessibilityHasPopup;
|
|
if (_ariaHasPopup != null) {
|
|
domProps["aria-haspopup"] = _ariaHasPopup;
|
|
}
|
|
var _ariaHidden = ariaHidden != null ? ariaHidden : accessibilityHidden;
|
|
if (_ariaHidden === true) {
|
|
domProps["aria-hidden"] = _ariaHidden;
|
|
}
|
|
var _ariaInvalid = ariaInvalid != null ? ariaInvalid : accessibilityInvalid;
|
|
if (_ariaInvalid != null) {
|
|
domProps["aria-invalid"] = _ariaInvalid;
|
|
}
|
|
var _ariaKeyShortcuts = ariaKeyShortcuts != null ? ariaKeyShortcuts : accessibilityKeyShortcuts;
|
|
if (_ariaKeyShortcuts != null) {
|
|
domProps["aria-keyshortcuts"] = processIDRefList(_ariaKeyShortcuts);
|
|
}
|
|
var _ariaLabel = ariaLabel != null ? ariaLabel : accessibilityLabel;
|
|
if (_ariaLabel != null) {
|
|
domProps["aria-label"] = _ariaLabel;
|
|
}
|
|
var _ariaLabelledBy = ariaLabelledBy != null ? ariaLabelledBy : accessibilityLabelledBy;
|
|
if (_ariaLabelledBy != null) {
|
|
domProps["aria-labelledby"] = processIDRefList(_ariaLabelledBy);
|
|
}
|
|
var _ariaLevel = ariaLevel != null ? ariaLevel : accessibilityLevel;
|
|
if (_ariaLevel != null) {
|
|
domProps["aria-level"] = _ariaLevel;
|
|
}
|
|
var _ariaLive = ariaLive != null ? ariaLive : accessibilityLiveRegion;
|
|
if (_ariaLive != null) {
|
|
domProps["aria-live"] = _ariaLive === "none" ? "off" : _ariaLive;
|
|
}
|
|
var _ariaModal = ariaModal != null ? ariaModal : accessibilityModal;
|
|
if (_ariaModal != null) {
|
|
domProps["aria-modal"] = _ariaModal;
|
|
}
|
|
var _ariaMultiline = ariaMultiline != null ? ariaMultiline : accessibilityMultiline;
|
|
if (_ariaMultiline != null) {
|
|
domProps["aria-multiline"] = _ariaMultiline;
|
|
}
|
|
var _ariaMultiSelectable = ariaMultiSelectable != null ? ariaMultiSelectable : accessibilityMultiSelectable;
|
|
if (_ariaMultiSelectable != null) {
|
|
domProps["aria-multiselectable"] = _ariaMultiSelectable;
|
|
}
|
|
var _ariaOrientation = ariaOrientation != null ? ariaOrientation : accessibilityOrientation;
|
|
if (_ariaOrientation != null) {
|
|
domProps["aria-orientation"] = _ariaOrientation;
|
|
}
|
|
var _ariaOwns = ariaOwns != null ? ariaOwns : accessibilityOwns;
|
|
if (_ariaOwns != null) {
|
|
domProps["aria-owns"] = processIDRefList(_ariaOwns);
|
|
}
|
|
var _ariaPlaceholder = ariaPlaceholder != null ? ariaPlaceholder : accessibilityPlaceholder;
|
|
if (_ariaPlaceholder != null) {
|
|
domProps["aria-placeholder"] = _ariaPlaceholder;
|
|
}
|
|
var _ariaPosInSet = ariaPosInSet != null ? ariaPosInSet : accessibilityPosInSet;
|
|
if (_ariaPosInSet != null) {
|
|
domProps["aria-posinset"] = _ariaPosInSet;
|
|
}
|
|
var _ariaPressed = ariaPressed != null ? ariaPressed : accessibilityPressed;
|
|
if (_ariaPressed != null) {
|
|
domProps["aria-pressed"] = _ariaPressed;
|
|
}
|
|
var _ariaReadOnly = ariaReadOnly != null ? ariaReadOnly : accessibilityReadOnly;
|
|
if (_ariaReadOnly != null) {
|
|
domProps["aria-readonly"] = _ariaReadOnly;
|
|
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
domProps.readOnly = true;
|
|
}
|
|
}
|
|
var _ariaRequired = ariaRequired != null ? ariaRequired : accessibilityRequired;
|
|
if (_ariaRequired != null) {
|
|
domProps["aria-required"] = _ariaRequired;
|
|
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
domProps.required = accessibilityRequired;
|
|
}
|
|
}
|
|
if (role != null) {
|
|
domProps["role"] = role === "none" ? "presentation" : role;
|
|
}
|
|
var _ariaRoleDescription = ariaRoleDescription != null ? ariaRoleDescription : accessibilityRoleDescription;
|
|
if (_ariaRoleDescription != null) {
|
|
domProps["aria-roledescription"] = _ariaRoleDescription;
|
|
}
|
|
var _ariaRowCount = ariaRowCount != null ? ariaRowCount : accessibilityRowCount;
|
|
if (_ariaRowCount != null) {
|
|
domProps["aria-rowcount"] = _ariaRowCount;
|
|
}
|
|
var _ariaRowIndex = ariaRowIndex != null ? ariaRowIndex : accessibilityRowIndex;
|
|
if (_ariaRowIndex != null) {
|
|
domProps["aria-rowindex"] = _ariaRowIndex;
|
|
}
|
|
var _ariaRowSpan = ariaRowSpan != null ? ariaRowSpan : accessibilityRowSpan;
|
|
if (_ariaRowSpan != null) {
|
|
domProps["aria-rowspan"] = _ariaRowSpan;
|
|
}
|
|
var _ariaSelected = ariaSelected != null ? ariaSelected : accessibilitySelected;
|
|
if (_ariaSelected != null) {
|
|
domProps["aria-selected"] = _ariaSelected;
|
|
}
|
|
var _ariaSetSize = ariaSetSize != null ? ariaSetSize : accessibilitySetSize;
|
|
if (_ariaSetSize != null) {
|
|
domProps["aria-setsize"] = _ariaSetSize;
|
|
}
|
|
var _ariaSort = ariaSort != null ? ariaSort : accessibilitySort;
|
|
if (_ariaSort != null) {
|
|
domProps["aria-sort"] = _ariaSort;
|
|
}
|
|
var _ariaValueMax = ariaValueMax != null ? ariaValueMax : accessibilityValueMax;
|
|
if (_ariaValueMax != null) {
|
|
domProps["aria-valuemax"] = _ariaValueMax;
|
|
}
|
|
var _ariaValueMin = ariaValueMin != null ? ariaValueMin : accessibilityValueMin;
|
|
if (_ariaValueMin != null) {
|
|
domProps["aria-valuemin"] = _ariaValueMin;
|
|
}
|
|
var _ariaValueNow = ariaValueNow != null ? ariaValueNow : accessibilityValueNow;
|
|
if (_ariaValueNow != null) {
|
|
domProps["aria-valuenow"] = _ariaValueNow;
|
|
}
|
|
var _ariaValueText = ariaValueText != null ? ariaValueText : accessibilityValueText;
|
|
if (_ariaValueText != null) {
|
|
domProps["aria-valuetext"] = _ariaValueText;
|
|
}
|
|
if (dataSet != null) {
|
|
for (var dataProp in dataSet) {
|
|
if (hasOwnProperty.call(dataSet, dataProp)) {
|
|
var dataName = hyphenateString(dataProp);
|
|
var dataValue = dataSet[dataProp];
|
|
if (dataValue != null) {
|
|
domProps["data-" + dataName] = dataValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (tabIndex === 0 || tabIndex === "0" || tabIndex === -1 || tabIndex === "-1") {
|
|
domProps.tabIndex = tabIndex;
|
|
} else {
|
|
if (focusable2 === false) {
|
|
domProps.tabIndex = "-1";
|
|
}
|
|
if (
|
|
// These native elements are keyboard focusable by default
|
|
elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea"
|
|
) {
|
|
if (focusable2 === false || accessibilityDisabled === true) {
|
|
domProps.tabIndex = "-1";
|
|
}
|
|
} else if (
|
|
// These roles are made keyboard focusable by default
|
|
role === "button" || role === "checkbox" || role === "link" || role === "radio" || role === "textbox" || role === "switch"
|
|
) {
|
|
if (focusable2 !== false) {
|
|
domProps.tabIndex = "0";
|
|
}
|
|
} else {
|
|
if (focusable2 === true) {
|
|
domProps.tabIndex = "0";
|
|
}
|
|
}
|
|
}
|
|
if (pointerEvents != null) {
|
|
(0, _warnOnce.warnOnce)("pointerEvents", "props.pointerEvents is deprecated. Use style.pointerEvents");
|
|
}
|
|
var _StyleSheet = (0, _StyleSheet2.default)([style, pointerEvents && pointerEventsStyles[pointerEvents]], (0, _objectSpread2.default)({
|
|
writingDirection: "ltr"
|
|
}, options)), className = _StyleSheet[0], inlineStyle = _StyleSheet[1];
|
|
if (className) {
|
|
domProps.className = className;
|
|
}
|
|
if (inlineStyle) {
|
|
domProps.style = inlineStyle;
|
|
}
|
|
var _id = id != null ? id : nativeID;
|
|
if (_id != null) {
|
|
domProps.id = _id;
|
|
}
|
|
if (testID != null) {
|
|
domProps["data-testid"] = testID;
|
|
}
|
|
if (domProps.type == null && elementType === "button") {
|
|
domProps.type = "button";
|
|
}
|
|
return domProps;
|
|
}, "createDOMProps");
|
|
var _default = exports2.default = createDOMProps;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/interopRequireWildcard.js
|
|
var require_interopRequireWildcard = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/interopRequireWildcard.js"(exports2, module2) {
|
|
var _typeof = require_typeof()["default"];
|
|
function _interopRequireWildcard(e, t) {
|
|
if ("function" == typeof WeakMap) var r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
|
|
return (module2.exports = _interopRequireWildcard = /* @__PURE__ */ __name(function _interopRequireWildcard2(e2, t2) {
|
|
if (!t2 && e2 && e2.__esModule) return e2;
|
|
var o, i, f = {
|
|
__proto__: null,
|
|
"default": e2
|
|
};
|
|
if (null === e2 || "object" != _typeof(e2) && "function" != typeof e2) return f;
|
|
if (o = t2 ? n : r) {
|
|
if (o.has(e2)) return o.get(e2);
|
|
o.set(e2, f);
|
|
}
|
|
for (var _t in e2) "default" !== _t && {}.hasOwnProperty.call(e2, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e2, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e2[_t]);
|
|
return f;
|
|
}, "_interopRequireWildcard"), module2.exports.__esModule = true, module2.exports["default"] = module2.exports)(e, t);
|
|
}
|
|
__name(_interopRequireWildcard, "_interopRequireWildcard");
|
|
module2.exports = _interopRequireWildcard, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useLocale/isLocaleRTL.js
|
|
var require_isLocaleRTL = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useLocale/isLocaleRTL.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.isLocaleRTL = isLocaleRTL;
|
|
var rtlScripts = /* @__PURE__ */ new Set(["Arab", "Syrc", "Samr", "Mand", "Thaa", "Mend", "Nkoo", "Adlm", "Rohg", "Hebr"]);
|
|
var rtlLangs = /* @__PURE__ */ new Set([
|
|
"ae",
|
|
// Avestan
|
|
"ar",
|
|
// Arabic
|
|
"arc",
|
|
// Aramaic
|
|
"bcc",
|
|
// Southern Balochi
|
|
"bqi",
|
|
// Bakthiari
|
|
"ckb",
|
|
// Sorani
|
|
"dv",
|
|
// Dhivehi
|
|
"fa",
|
|
"far",
|
|
// Persian
|
|
"glk",
|
|
// Gilaki
|
|
"he",
|
|
"iw",
|
|
// Hebrew
|
|
"khw",
|
|
// Khowar
|
|
"ks",
|
|
// Kashmiri
|
|
"ku",
|
|
// Kurdish
|
|
"mzn",
|
|
// Mazanderani
|
|
"nqo",
|
|
// N'Ko
|
|
"pnb",
|
|
// Western Punjabi
|
|
"ps",
|
|
// Pashto
|
|
"sd",
|
|
// Sindhi
|
|
"ug",
|
|
// Uyghur
|
|
"ur",
|
|
// Urdu
|
|
"yi"
|
|
// Yiddish
|
|
]);
|
|
var cache3 = /* @__PURE__ */ new Map();
|
|
function isLocaleRTL(locale) {
|
|
var cachedRTL = cache3.get(locale);
|
|
if (cachedRTL) {
|
|
return cachedRTL;
|
|
}
|
|
var isRTL2 = false;
|
|
if (Intl.Locale) {
|
|
try {
|
|
var script = new Intl.Locale(locale).maximize().script;
|
|
isRTL2 = rtlScripts.has(script);
|
|
} catch (_unused) {
|
|
var lang = locale.split("-")[0];
|
|
isRTL2 = rtlLangs.has(lang);
|
|
}
|
|
} else {
|
|
var _lang = locale.split("-")[0];
|
|
isRTL2 = rtlLangs.has(_lang);
|
|
}
|
|
cache3.set(locale, isRTL2);
|
|
return isRTL2;
|
|
}
|
|
__name(isLocaleRTL, "isLocaleRTL");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useLocale/index.js
|
|
var require_useLocale = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useLocale/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.LocaleProvider = LocaleProvider;
|
|
exports2.getLocaleDirection = getLocaleDirection;
|
|
exports2.useLocaleContext = useLocaleContext;
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var _isLocaleRTL = require_isLocaleRTL();
|
|
var defaultLocale = {
|
|
direction: "ltr",
|
|
locale: "en-US"
|
|
};
|
|
var LocaleContext = /* @__PURE__ */ (0, _react.createContext)(defaultLocale);
|
|
function getLocaleDirection(locale) {
|
|
return (0, _isLocaleRTL.isLocaleRTL)(locale) ? "rtl" : "ltr";
|
|
}
|
|
__name(getLocaleDirection, "getLocaleDirection");
|
|
function LocaleProvider(props) {
|
|
var direction = props.direction, locale = props.locale, children = props.children;
|
|
var needsContext = direction || locale;
|
|
return needsContext ? /* @__PURE__ */ _react.default.createElement(LocaleContext.Provider, {
|
|
children,
|
|
value: {
|
|
direction: locale ? getLocaleDirection(locale) : direction,
|
|
locale
|
|
}
|
|
}) : children;
|
|
}
|
|
__name(LocaleProvider, "LocaleProvider");
|
|
function useLocaleContext() {
|
|
return (0, _react.useContext)(LocaleContext);
|
|
}
|
|
__name(useLocaleContext, "useLocaleContext");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/createElement/index.js
|
|
var require_createElement = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/createElement/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AccessibilityUtil = _interopRequireDefault(require_AccessibilityUtil());
|
|
var _createDOMProps = _interopRequireDefault(require_createDOMProps());
|
|
var _react = _interopRequireDefault(require("react"));
|
|
var _useLocale = require_useLocale();
|
|
var createElement = /* @__PURE__ */ __name((component, props, options) => {
|
|
var accessibilityComponent;
|
|
if (component && component.constructor === String) {
|
|
accessibilityComponent = _AccessibilityUtil.default.propsToAccessibilityComponent(props);
|
|
}
|
|
var Component = accessibilityComponent || component;
|
|
var domProps = (0, _createDOMProps.default)(Component, props, options);
|
|
var element = /* @__PURE__ */ _react.default.createElement(Component, domProps);
|
|
var elementWithLocaleProvider = domProps.dir ? /* @__PURE__ */ _react.default.createElement(_useLocale.LocaleProvider, {
|
|
children: element,
|
|
direction: domProps.dir,
|
|
locale: domProps.lang
|
|
}) : element;
|
|
return elementWithLocaleProvider;
|
|
}, "createElement");
|
|
var _default = exports2.default = createElement;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/findNodeHandle/index.js
|
|
var require_findNodeHandle = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/findNodeHandle/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var findNodeHandle = /* @__PURE__ */ __name((component) => {
|
|
throw new Error("findNodeHandle is not supported on web. Use the ref property on the component instead.");
|
|
}, "findNodeHandle");
|
|
var _default = exports2.default = findNodeHandle;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/render/index.js
|
|
var require_render = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/render/index.js"(exports2) {
|
|
"use strict";
|
|
"use client";
|
|
exports2.__esModule = true;
|
|
exports2.default = render;
|
|
exports2.hydrate = hydrate;
|
|
var _client = require("react-dom/client");
|
|
var _dom = require_dom();
|
|
function hydrate(element, root) {
|
|
(0, _dom.createSheet)(root);
|
|
return (0, _client.hydrateRoot)(root, element);
|
|
}
|
|
__name(hydrate, "hydrate");
|
|
function render(element, root) {
|
|
(0, _dom.createSheet)(root);
|
|
var reactRoot = (0, _client.createRoot)(root);
|
|
reactRoot.render(element);
|
|
return reactRoot;
|
|
}
|
|
__name(render, "render");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/unmountComponentAtNode/index.js
|
|
var require_unmountComponentAtNode = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/unmountComponentAtNode/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = unmountComponentAtNode;
|
|
function unmountComponentAtNode(rootTag) {
|
|
rootTag.unmount();
|
|
return true;
|
|
}
|
|
__name(unmountComponentAtNode, "unmountComponentAtNode");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/getBoundingClientRect/index.js
|
|
var require_getBoundingClientRect = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/getBoundingClientRect/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var getBoundingClientRect2 = /* @__PURE__ */ __name((node) => {
|
|
if (node != null) {
|
|
var isElement2 = node.nodeType === 1;
|
|
if (isElement2 && typeof node.getBoundingClientRect === "function") {
|
|
return node.getBoundingClientRect();
|
|
}
|
|
}
|
|
}, "getBoundingClientRect");
|
|
var _default = exports2.default = getBoundingClientRect2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/unitlessNumbers/index.js
|
|
var require_unitlessNumbers2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/unitlessNumbers/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var unitlessNumbers = {
|
|
animationIterationCount: true,
|
|
aspectRatio: true,
|
|
borderImageOutset: true,
|
|
borderImageSlice: true,
|
|
borderImageWidth: true,
|
|
boxFlex: true,
|
|
boxFlexGroup: true,
|
|
boxOrdinalGroup: true,
|
|
columnCount: true,
|
|
flex: true,
|
|
flexGrow: true,
|
|
flexOrder: true,
|
|
flexPositive: true,
|
|
flexShrink: true,
|
|
flexNegative: true,
|
|
fontWeight: true,
|
|
gridRow: true,
|
|
gridRowEnd: true,
|
|
gridRowGap: true,
|
|
gridRowStart: true,
|
|
gridColumn: true,
|
|
gridColumnEnd: true,
|
|
gridColumnGap: true,
|
|
gridColumnStart: true,
|
|
lineClamp: true,
|
|
opacity: true,
|
|
order: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
// SVG-related
|
|
fillOpacity: true,
|
|
floodOpacity: true,
|
|
stopOpacity: true,
|
|
strokeDasharray: true,
|
|
strokeDashoffset: true,
|
|
strokeMiterlimit: true,
|
|
strokeOpacity: true,
|
|
strokeWidth: true,
|
|
// transform types
|
|
scale: true,
|
|
scaleX: true,
|
|
scaleY: true,
|
|
scaleZ: true,
|
|
// RN properties
|
|
shadowOpacity: true
|
|
};
|
|
var prefixes = ["ms", "Moz", "O", "Webkit"];
|
|
var prefixKey = /* @__PURE__ */ __name((prefix, key) => {
|
|
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
}, "prefixKey");
|
|
Object.keys(unitlessNumbers).forEach((prop) => {
|
|
prefixes.forEach((prefix) => {
|
|
unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
|
|
});
|
|
});
|
|
var _default = exports2.default = unitlessNumbers;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/setValueForStyles/dangerousStyleValue.js
|
|
var require_dangerousStyleValue = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/setValueForStyles/dangerousStyleValue.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _unitlessNumbers = _interopRequireDefault(require_unitlessNumbers2());
|
|
function dangerousStyleValue(name, value, isCustomProperty) {
|
|
var isEmpty = value == null || typeof value === "boolean" || value === "";
|
|
if (isEmpty) {
|
|
return "";
|
|
}
|
|
if (!isCustomProperty && typeof value === "number" && value !== 0 && !(_unitlessNumbers.default.hasOwnProperty(name) && _unitlessNumbers.default[name])) {
|
|
return value + "px";
|
|
}
|
|
return ("" + value).trim();
|
|
}
|
|
__name(dangerousStyleValue, "dangerousStyleValue");
|
|
var _default = exports2.default = dangerousStyleValue;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/setValueForStyles/index.js
|
|
var require_setValueForStyles = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/setValueForStyles/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _dangerousStyleValue = _interopRequireDefault(require_dangerousStyleValue());
|
|
function setValueForStyles(node, styles) {
|
|
var style = node.style;
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
var styleValue = (0, _dangerousStyleValue.default)(styleName, styles[styleName], isCustomProperty);
|
|
if (styleName === "float") {
|
|
styleName = "cssFloat";
|
|
}
|
|
if (isCustomProperty) {
|
|
style.setProperty(styleName, styleValue);
|
|
} else {
|
|
style[styleName] = styleValue;
|
|
}
|
|
}
|
|
}
|
|
__name(setValueForStyles, "setValueForStyles");
|
|
var _default = exports2.default = setValueForStyles;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/UIManager/index.js
|
|
var require_UIManager = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/UIManager/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _getBoundingClientRect = _interopRequireDefault(require_getBoundingClientRect());
|
|
var _setValueForStyles = _interopRequireDefault(require_setValueForStyles());
|
|
var getRect = /* @__PURE__ */ __name((node) => {
|
|
var height = node.offsetHeight;
|
|
var width = node.offsetWidth;
|
|
var left = node.offsetLeft;
|
|
var top = node.offsetTop;
|
|
node = node.offsetParent;
|
|
while (node && node.nodeType === 1) {
|
|
left += node.offsetLeft + node.clientLeft - node.scrollLeft;
|
|
top += node.offsetTop + node.clientTop - node.scrollTop;
|
|
node = node.offsetParent;
|
|
}
|
|
top -= window.scrollY;
|
|
left -= window.scrollX;
|
|
return {
|
|
width,
|
|
height,
|
|
top,
|
|
left
|
|
};
|
|
}, "getRect");
|
|
var measureLayout = /* @__PURE__ */ __name((node, relativeToNativeNode, callback) => {
|
|
var relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
if (node && relativeNode) {
|
|
setTimeout(() => {
|
|
if (node.isConnected && relativeNode.isConnected) {
|
|
var relativeRect = getRect(relativeNode);
|
|
var _getRect = getRect(node), height = _getRect.height, left = _getRect.left, top = _getRect.top, width = _getRect.width;
|
|
var x = left - relativeRect.left;
|
|
var y = top - relativeRect.top;
|
|
callback(x, y, width, height, left, top);
|
|
}
|
|
}, 0);
|
|
}
|
|
}, "measureLayout");
|
|
var elementsToIgnore = {
|
|
A: true,
|
|
BODY: true,
|
|
INPUT: true,
|
|
SELECT: true,
|
|
TEXTAREA: true
|
|
};
|
|
var UIManager = {
|
|
blur(node) {
|
|
try {
|
|
node.blur();
|
|
} catch (err) {
|
|
}
|
|
},
|
|
focus(node) {
|
|
try {
|
|
var name = node.nodeName;
|
|
if (node.getAttribute("tabIndex") == null && node.isContentEditable !== true && elementsToIgnore[name] == null) {
|
|
node.setAttribute("tabIndex", "-1");
|
|
}
|
|
node.focus();
|
|
} catch (err) {
|
|
}
|
|
},
|
|
measure(node, callback) {
|
|
measureLayout(node, null, callback);
|
|
},
|
|
measureInWindow(node, callback) {
|
|
if (node) {
|
|
setTimeout(() => {
|
|
var _getBoundingClientRec = (0, _getBoundingClientRect.default)(node), height = _getBoundingClientRec.height, left = _getBoundingClientRec.left, top = _getBoundingClientRec.top, width = _getBoundingClientRec.width;
|
|
callback(left, top, width, height);
|
|
}, 0);
|
|
}
|
|
},
|
|
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
},
|
|
updateView(node, props) {
|
|
for (var prop in props) {
|
|
if (!Object.prototype.hasOwnProperty.call(props, prop)) {
|
|
continue;
|
|
}
|
|
var value = props[prop];
|
|
switch (prop) {
|
|
case "style": {
|
|
(0, _setValueForStyles.default)(node, value);
|
|
break;
|
|
}
|
|
case "class":
|
|
case "className": {
|
|
node.setAttribute("class", value);
|
|
break;
|
|
}
|
|
case "text":
|
|
case "value":
|
|
node.value = value;
|
|
break;
|
|
default:
|
|
node.setAttribute(prop, value);
|
|
}
|
|
}
|
|
},
|
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
onAnimationDidEnd();
|
|
},
|
|
// mocks
|
|
setLayoutAnimationEnabledExperimental() {
|
|
}
|
|
};
|
|
var _default = exports2.default = UIManager;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/NativeModules/index.js
|
|
var require_NativeModules = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/NativeModules/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var NativeModules = {
|
|
UIManager: _UIManager.default
|
|
};
|
|
var _default = exports2.default = NativeModules;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/AccessibilityInfo/index.js
|
|
var require_AccessibilityInfo = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/AccessibilityInfo/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
function isScreenReaderEnabled() {
|
|
return new Promise((resolve, reject) => {
|
|
resolve(true);
|
|
});
|
|
}
|
|
__name(isScreenReaderEnabled, "isScreenReaderEnabled");
|
|
var prefersReducedMotionMedia = _canUseDom.default && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
|
|
function isReduceMotionEnabled() {
|
|
return new Promise((resolve, reject) => {
|
|
resolve(prefersReducedMotionMedia ? prefersReducedMotionMedia.matches : true);
|
|
});
|
|
}
|
|
__name(isReduceMotionEnabled, "isReduceMotionEnabled");
|
|
function addChangeListener(fn) {
|
|
if (prefersReducedMotionMedia != null) {
|
|
prefersReducedMotionMedia.addEventListener != null ? prefersReducedMotionMedia.addEventListener("change", fn) : prefersReducedMotionMedia.addListener(fn);
|
|
}
|
|
}
|
|
__name(addChangeListener, "addChangeListener");
|
|
function removeChangeListener(fn) {
|
|
if (prefersReducedMotionMedia != null) {
|
|
prefersReducedMotionMedia.removeEventListener != null ? prefersReducedMotionMedia.removeEventListener("change", fn) : prefersReducedMotionMedia.removeListener(fn);
|
|
}
|
|
}
|
|
__name(removeChangeListener, "removeChangeListener");
|
|
var handlers = {};
|
|
var AccessibilityInfo = {
|
|
/**
|
|
* Query whether a screen reader is currently enabled.
|
|
*
|
|
* Returns a promise which resolves to a boolean.
|
|
* The result is `true` when a screen reader is enabled and `false` otherwise.
|
|
*/
|
|
isScreenReaderEnabled,
|
|
/**
|
|
* Query whether the user prefers reduced motion.
|
|
*
|
|
* Returns a promise which resolves to a boolean.
|
|
* The result is `true` when a screen reader is enabled and `false` otherwise.
|
|
*/
|
|
isReduceMotionEnabled,
|
|
/**
|
|
* Deprecated
|
|
*/
|
|
fetch: isScreenReaderEnabled,
|
|
/**
|
|
* Add an event handler. Supported events: reduceMotionChanged
|
|
*/
|
|
addEventListener: /* @__PURE__ */ __name(function addEventListener(eventName, handler) {
|
|
if (eventName === "reduceMotionChanged") {
|
|
if (!prefersReducedMotionMedia) {
|
|
return;
|
|
}
|
|
var listener = /* @__PURE__ */ __name((event) => {
|
|
handler(event.matches);
|
|
}, "listener");
|
|
addChangeListener(listener);
|
|
handlers[handler] = listener;
|
|
}
|
|
return {
|
|
remove: /* @__PURE__ */ __name(() => AccessibilityInfo.removeEventListener(eventName, handler), "remove")
|
|
};
|
|
}, "addEventListener"),
|
|
/**
|
|
* Set accessibility focus to a react component.
|
|
*/
|
|
setAccessibilityFocus: /* @__PURE__ */ __name(function setAccessibilityFocus(reactTag) {
|
|
}, "setAccessibilityFocus"),
|
|
/**
|
|
* Post a string to be announced by the screen reader.
|
|
*/
|
|
announceForAccessibility: /* @__PURE__ */ __name(function announceForAccessibility(announcement) {
|
|
}, "announceForAccessibility"),
|
|
/**
|
|
* Remove an event handler.
|
|
*/
|
|
removeEventListener: /* @__PURE__ */ __name(function removeEventListener(eventName, handler) {
|
|
if (eventName === "reduceMotionChanged") {
|
|
var listener = handlers[handler];
|
|
if (!listener || !prefersReducedMotionMedia) {
|
|
return;
|
|
}
|
|
removeChangeListener(listener);
|
|
}
|
|
return;
|
|
}, "removeEventListener")
|
|
};
|
|
var _default = exports2.default = AccessibilityInfo;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Alert/index.js
|
|
var require_Alert = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Alert/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var Alert = class {
|
|
static {
|
|
__name(this, "Alert");
|
|
}
|
|
static alert() {
|
|
}
|
|
};
|
|
var _default = exports2.default = Alert;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Platform/index.js
|
|
var require_Platform = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Platform/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var Platform2 = {
|
|
OS: "web",
|
|
select: /* @__PURE__ */ __name((obj) => "web" in obj ? obj.web : obj.default, "select"),
|
|
get isTesting() {
|
|
if (process.env.NODE_ENV === "test") {
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
get Version() {
|
|
return "0.0.0";
|
|
}
|
|
};
|
|
var _default = exports2.default = Platform2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/extends.js
|
|
var require_extends = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/extends.js"(exports2, module2) {
|
|
function _extends() {
|
|
return module2.exports = _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
for (var e = 1; e < arguments.length; e++) {
|
|
var t = arguments[e];
|
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
}
|
|
return n;
|
|
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports, _extends.apply(null, arguments);
|
|
}
|
|
__name(_extends, "_extends");
|
|
module2.exports = _extends, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/forwardedProps/index.js
|
|
var require_forwardedProps = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/forwardedProps/index.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.touchProps = exports2.styleProps = exports2.mouseProps = exports2.keyboardProps = exports2.focusProps = exports2.defaultProps = exports2.clickProps = exports2.accessibilityProps = void 0;
|
|
var defaultProps = exports2.defaultProps = {
|
|
children: true,
|
|
dataSet: true,
|
|
dir: true,
|
|
id: true,
|
|
ref: true,
|
|
suppressHydrationWarning: true,
|
|
tabIndex: true,
|
|
testID: true,
|
|
// @deprecated
|
|
focusable: true,
|
|
nativeID: true
|
|
};
|
|
var accessibilityProps = exports2.accessibilityProps = {
|
|
"aria-activedescendant": true,
|
|
"aria-atomic": true,
|
|
"aria-autocomplete": true,
|
|
"aria-busy": true,
|
|
"aria-checked": true,
|
|
"aria-colcount": true,
|
|
"aria-colindex": true,
|
|
"aria-colspan": true,
|
|
"aria-controls": true,
|
|
"aria-current": true,
|
|
"aria-describedby": true,
|
|
"aria-details": true,
|
|
"aria-disabled": true,
|
|
"aria-errormessage": true,
|
|
"aria-expanded": true,
|
|
"aria-flowto": true,
|
|
"aria-haspopup": true,
|
|
"aria-hidden": true,
|
|
"aria-invalid": true,
|
|
"aria-keyshortcuts": true,
|
|
"aria-label": true,
|
|
"aria-labelledby": true,
|
|
"aria-level": true,
|
|
"aria-live": true,
|
|
"aria-modal": true,
|
|
"aria-multiline": true,
|
|
"aria-multiselectable": true,
|
|
"aria-orientation": true,
|
|
"aria-owns": true,
|
|
"aria-placeholder": true,
|
|
"aria-posinset": true,
|
|
"aria-pressed": true,
|
|
"aria-readonly": true,
|
|
"aria-required": true,
|
|
inert: true,
|
|
role: true,
|
|
"aria-roledescription": true,
|
|
"aria-rowcount": true,
|
|
"aria-rowindex": true,
|
|
"aria-rowspan": true,
|
|
"aria-selected": true,
|
|
"aria-setsize": true,
|
|
"aria-sort": true,
|
|
"aria-valuemax": true,
|
|
"aria-valuemin": true,
|
|
"aria-valuenow": true,
|
|
"aria-valuetext": true,
|
|
// @deprecated
|
|
accessibilityActiveDescendant: true,
|
|
accessibilityAtomic: true,
|
|
accessibilityAutoComplete: true,
|
|
accessibilityBusy: true,
|
|
accessibilityChecked: true,
|
|
accessibilityColumnCount: true,
|
|
accessibilityColumnIndex: true,
|
|
accessibilityColumnSpan: true,
|
|
accessibilityControls: true,
|
|
accessibilityCurrent: true,
|
|
accessibilityDescribedBy: true,
|
|
accessibilityDetails: true,
|
|
accessibilityDisabled: true,
|
|
accessibilityErrorMessage: true,
|
|
accessibilityExpanded: true,
|
|
accessibilityFlowTo: true,
|
|
accessibilityHasPopup: true,
|
|
accessibilityHidden: true,
|
|
accessibilityInvalid: true,
|
|
accessibilityKeyShortcuts: true,
|
|
accessibilityLabel: true,
|
|
accessibilityLabelledBy: true,
|
|
accessibilityLevel: true,
|
|
accessibilityLiveRegion: true,
|
|
accessibilityModal: true,
|
|
accessibilityMultiline: true,
|
|
accessibilityMultiSelectable: true,
|
|
accessibilityOrientation: true,
|
|
accessibilityOwns: true,
|
|
accessibilityPlaceholder: true,
|
|
accessibilityPosInSet: true,
|
|
accessibilityPressed: true,
|
|
accessibilityReadOnly: true,
|
|
accessibilityRequired: true,
|
|
accessibilityRole: true,
|
|
accessibilityRoleDescription: true,
|
|
accessibilityRowCount: true,
|
|
accessibilityRowIndex: true,
|
|
accessibilityRowSpan: true,
|
|
accessibilitySelected: true,
|
|
accessibilitySetSize: true,
|
|
accessibilitySort: true,
|
|
accessibilityValueMax: true,
|
|
accessibilityValueMin: true,
|
|
accessibilityValueNow: true,
|
|
accessibilityValueText: true
|
|
};
|
|
var clickProps = exports2.clickProps = {
|
|
onClick: true,
|
|
onAuxClick: true,
|
|
onContextMenu: true,
|
|
onGotPointerCapture: true,
|
|
onLostPointerCapture: true,
|
|
onPointerCancel: true,
|
|
onPointerDown: true,
|
|
onPointerEnter: true,
|
|
onPointerMove: true,
|
|
onPointerLeave: true,
|
|
onPointerOut: true,
|
|
onPointerOver: true,
|
|
onPointerUp: true
|
|
};
|
|
var focusProps = exports2.focusProps = {
|
|
onBlur: true,
|
|
onFocus: true
|
|
};
|
|
var keyboardProps = exports2.keyboardProps = {
|
|
onKeyDown: true,
|
|
onKeyDownCapture: true,
|
|
onKeyUp: true,
|
|
onKeyUpCapture: true
|
|
};
|
|
var mouseProps = exports2.mouseProps = {
|
|
onMouseDown: true,
|
|
onMouseEnter: true,
|
|
onMouseLeave: true,
|
|
onMouseMove: true,
|
|
onMouseOver: true,
|
|
onMouseOut: true,
|
|
onMouseUp: true
|
|
};
|
|
var touchProps = exports2.touchProps = {
|
|
onTouchCancel: true,
|
|
onTouchCancelCapture: true,
|
|
onTouchEnd: true,
|
|
onTouchEndCapture: true,
|
|
onTouchMove: true,
|
|
onTouchMoveCapture: true,
|
|
onTouchStart: true,
|
|
onTouchStartCapture: true
|
|
};
|
|
var styleProps = exports2.styleProps = {
|
|
style: true
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/pick/index.js
|
|
var require_pick = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/pick/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = pick;
|
|
function pick(obj, list) {
|
|
var nextObj = {};
|
|
for (var key in obj) {
|
|
if (obj.hasOwnProperty(key)) {
|
|
if (list[key] === true) {
|
|
nextObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
return nextObj;
|
|
}
|
|
__name(pick, "pick");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useLayoutEffect/index.js
|
|
var require_useLayoutEffect = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useLayoutEffect/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _react = require("react");
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var useLayoutEffectImpl = _canUseDom.default ? _react.useLayoutEffect : _react.useEffect;
|
|
var _default = exports2.default = useLayoutEffectImpl;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useElementLayout/index.js
|
|
var require_useElementLayout = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useElementLayout/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useElementLayout;
|
|
var _useLayoutEffect = _interopRequireDefault(require_useLayoutEffect());
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var DOM_LAYOUT_HANDLER_NAME = "__reactLayoutHandler";
|
|
var didWarn = !_canUseDom.default;
|
|
var resizeObserver = null;
|
|
function getResizeObserver() {
|
|
if (_canUseDom.default && typeof window.ResizeObserver !== "undefined") {
|
|
if (resizeObserver == null) {
|
|
resizeObserver = new window.ResizeObserver(function(entries) {
|
|
entries.forEach((entry) => {
|
|
var node = entry.target;
|
|
var onLayout = node[DOM_LAYOUT_HANDLER_NAME];
|
|
if (typeof onLayout === "function") {
|
|
_UIManager.default.measure(node, (x, y, width, height, left, top) => {
|
|
var event = {
|
|
// $FlowFixMe
|
|
nativeEvent: {
|
|
layout: {
|
|
x,
|
|
y,
|
|
width,
|
|
height,
|
|
left,
|
|
top
|
|
}
|
|
},
|
|
timeStamp: Date.now()
|
|
};
|
|
Object.defineProperty(event.nativeEvent, "target", {
|
|
enumerable: true,
|
|
get: /* @__PURE__ */ __name(() => entry.target, "get")
|
|
});
|
|
onLayout(event);
|
|
});
|
|
}
|
|
});
|
|
});
|
|
}
|
|
} else if (!didWarn) {
|
|
if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test") {
|
|
console.warn("onLayout relies on ResizeObserver which is not supported by your browser. Please include a polyfill, e.g., https://github.com/que-etc/resize-observer-polyfill.");
|
|
didWarn = true;
|
|
}
|
|
}
|
|
return resizeObserver;
|
|
}
|
|
__name(getResizeObserver, "getResizeObserver");
|
|
function useElementLayout(ref, onLayout) {
|
|
var observer = getResizeObserver();
|
|
(0, _useLayoutEffect.default)(() => {
|
|
var node = ref.current;
|
|
if (node != null) {
|
|
node[DOM_LAYOUT_HANDLER_NAME] = onLayout;
|
|
}
|
|
}, [ref, onLayout]);
|
|
(0, _useLayoutEffect.default)(() => {
|
|
var node = ref.current;
|
|
if (node != null && observer != null) {
|
|
if (typeof node[DOM_LAYOUT_HANDLER_NAME] === "function") {
|
|
observer.observe(node);
|
|
} else {
|
|
observer.unobserve(node);
|
|
}
|
|
}
|
|
return () => {
|
|
if (node != null && observer != null) {
|
|
observer.unobserve(node);
|
|
}
|
|
};
|
|
}, [ref, observer]);
|
|
}
|
|
__name(useElementLayout, "useElementLayout");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/mergeRefs/index.js
|
|
var require_mergeRefs = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/mergeRefs/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = mergeRefs;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
function mergeRefs() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return /* @__PURE__ */ __name(function forwardRef26(node) {
|
|
args.forEach((ref) => {
|
|
if (ref == null) {
|
|
return;
|
|
}
|
|
if (typeof ref === "function") {
|
|
ref(node);
|
|
return;
|
|
}
|
|
if (typeof ref === "object") {
|
|
ref.current = node;
|
|
return;
|
|
}
|
|
console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref " + String(ref));
|
|
});
|
|
}, "forwardRef");
|
|
}
|
|
__name(mergeRefs, "mergeRefs");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useMergeRefs/index.js
|
|
var require_useMergeRefs = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useMergeRefs/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useMergeRefs;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _mergeRefs = _interopRequireDefault(require_mergeRefs());
|
|
function useMergeRefs() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return React83.useMemo(
|
|
() => (0, _mergeRefs.default)(...args),
|
|
|
|
[...args]
|
|
);
|
|
}
|
|
__name(useMergeRefs, "useMergeRefs");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useStable/index.js
|
|
var require_useStable = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useStable/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useStable;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var UNINITIALIZED = typeof Symbol === "function" && typeof Symbol() === "symbol" ? Symbol() : Object.freeze({});
|
|
function useStable(getInitialValue) {
|
|
var ref = React83.useRef(UNINITIALIZED);
|
|
if (ref.current === UNINITIALIZED) {
|
|
ref.current = getInitialValue();
|
|
}
|
|
return ref.current;
|
|
}
|
|
__name(useStable, "useStable");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/usePlatformMethods/index.js
|
|
var require_usePlatformMethods = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/usePlatformMethods/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = usePlatformMethods;
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var _useStable = _interopRequireDefault(require_useStable());
|
|
function usePlatformMethods(_ref) {
|
|
var pointerEvents = _ref.pointerEvents, style = _ref.style;
|
|
var ref = (0, _useStable.default)(() => (hostNode) => {
|
|
if (hostNode != null) {
|
|
hostNode.measure = (callback) => _UIManager.default.measure(hostNode, callback);
|
|
hostNode.measureLayout = (relativeToNode, success, failure) => _UIManager.default.measureLayout(hostNode, relativeToNode, failure, success);
|
|
hostNode.measureInWindow = (callback) => _UIManager.default.measureInWindow(hostNode, callback);
|
|
}
|
|
});
|
|
return ref;
|
|
}
|
|
__name(usePlatformMethods, "usePlatformMethods");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useResponderEvents/createResponderEvent.js
|
|
var require_createResponderEvent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useResponderEvents/createResponderEvent.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = createResponderEvent;
|
|
var _getBoundingClientRect = _interopRequireDefault(require_getBoundingClientRect());
|
|
var emptyFunction = /* @__PURE__ */ __name(() => {
|
|
}, "emptyFunction");
|
|
var emptyObject = {};
|
|
var emptyArray = [];
|
|
function normalizeIdentifier(identifier) {
|
|
return identifier > 20 ? identifier % 20 : identifier;
|
|
}
|
|
__name(normalizeIdentifier, "normalizeIdentifier");
|
|
function createResponderEvent(domEvent, responderTouchHistoryStore) {
|
|
var rect;
|
|
var propagationWasStopped = false;
|
|
var changedTouches;
|
|
var touches;
|
|
var domEventChangedTouches = domEvent.changedTouches;
|
|
var domEventType = domEvent.type;
|
|
var metaKey = domEvent.metaKey === true;
|
|
var shiftKey = domEvent.shiftKey === true;
|
|
var force = domEventChangedTouches && domEventChangedTouches[0].force || 0;
|
|
var identifier = normalizeIdentifier(domEventChangedTouches && domEventChangedTouches[0].identifier || 0);
|
|
var clientX = domEventChangedTouches && domEventChangedTouches[0].clientX || domEvent.clientX;
|
|
var clientY = domEventChangedTouches && domEventChangedTouches[0].clientY || domEvent.clientY;
|
|
var pageX = domEventChangedTouches && domEventChangedTouches[0].pageX || domEvent.pageX;
|
|
var pageY = domEventChangedTouches && domEventChangedTouches[0].pageY || domEvent.pageY;
|
|
var preventDefault = typeof domEvent.preventDefault === "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction;
|
|
var timestamp = domEvent.timeStamp;
|
|
function normalizeTouches(touches2) {
|
|
return Array.prototype.slice.call(touches2).map((touch) => {
|
|
return {
|
|
force: touch.force,
|
|
identifier: normalizeIdentifier(touch.identifier),
|
|
get locationX() {
|
|
return locationX(touch.clientX);
|
|
},
|
|
get locationY() {
|
|
return locationY(touch.clientY);
|
|
},
|
|
pageX: touch.pageX,
|
|
pageY: touch.pageY,
|
|
target: touch.target,
|
|
timestamp
|
|
};
|
|
});
|
|
}
|
|
__name(normalizeTouches, "normalizeTouches");
|
|
if (domEventChangedTouches != null) {
|
|
changedTouches = normalizeTouches(domEventChangedTouches);
|
|
touches = normalizeTouches(domEvent.touches);
|
|
} else {
|
|
var emulatedTouches = [{
|
|
force,
|
|
identifier,
|
|
get locationX() {
|
|
return locationX(clientX);
|
|
},
|
|
get locationY() {
|
|
return locationY(clientY);
|
|
},
|
|
pageX,
|
|
pageY,
|
|
target: domEvent.target,
|
|
timestamp
|
|
}];
|
|
changedTouches = emulatedTouches;
|
|
touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
|
|
}
|
|
var responderEvent = {
|
|
bubbles: true,
|
|
cancelable: true,
|
|
// `currentTarget` is set before dispatch
|
|
currentTarget: null,
|
|
defaultPrevented: domEvent.defaultPrevented,
|
|
dispatchConfig: emptyObject,
|
|
eventPhase: domEvent.eventPhase,
|
|
isDefaultPrevented() {
|
|
return domEvent.defaultPrevented;
|
|
},
|
|
isPropagationStopped() {
|
|
return propagationWasStopped;
|
|
},
|
|
isTrusted: domEvent.isTrusted,
|
|
nativeEvent: {
|
|
altKey: false,
|
|
ctrlKey: false,
|
|
metaKey,
|
|
shiftKey,
|
|
changedTouches,
|
|
force,
|
|
identifier,
|
|
get locationX() {
|
|
return locationX(clientX);
|
|
},
|
|
get locationY() {
|
|
return locationY(clientY);
|
|
},
|
|
pageX,
|
|
pageY,
|
|
target: domEvent.target,
|
|
timestamp,
|
|
touches,
|
|
type: domEventType
|
|
},
|
|
persist: emptyFunction,
|
|
preventDefault,
|
|
stopPropagation() {
|
|
propagationWasStopped = true;
|
|
},
|
|
target: domEvent.target,
|
|
timeStamp: timestamp,
|
|
touchHistory: responderTouchHistoryStore.touchHistory
|
|
};
|
|
function locationX(x) {
|
|
rect = rect || (0, _getBoundingClientRect.default)(responderEvent.currentTarget);
|
|
if (rect) {
|
|
return x - rect.left;
|
|
}
|
|
}
|
|
__name(locationX, "locationX");
|
|
function locationY(y) {
|
|
rect = rect || (0, _getBoundingClientRect.default)(responderEvent.currentTarget);
|
|
if (rect) {
|
|
return y - rect.top;
|
|
}
|
|
}
|
|
__name(locationY, "locationY");
|
|
return responderEvent;
|
|
}
|
|
__name(createResponderEvent, "createResponderEvent");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderEventTypes.js
|
|
var require_ResponderEventTypes = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderEventTypes.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.TOUCH_START = exports2.TOUCH_MOVE = exports2.TOUCH_END = exports2.TOUCH_CANCEL = exports2.SELECTION_CHANGE = exports2.SELECT = exports2.SCROLL = exports2.MOUSE_UP = exports2.MOUSE_MOVE = exports2.MOUSE_DOWN = exports2.MOUSE_CANCEL = exports2.FOCUS_OUT = exports2.CONTEXT_MENU = exports2.BLUR = void 0;
|
|
exports2.isCancelish = isCancelish;
|
|
exports2.isEndish = isEndish;
|
|
exports2.isMoveish = isMoveish;
|
|
exports2.isScroll = isScroll;
|
|
exports2.isSelectionChange = isSelectionChange;
|
|
exports2.isStartish = isStartish;
|
|
var BLUR = exports2.BLUR = "blur";
|
|
var CONTEXT_MENU = exports2.CONTEXT_MENU = "contextmenu";
|
|
var FOCUS_OUT = exports2.FOCUS_OUT = "focusout";
|
|
var MOUSE_DOWN = exports2.MOUSE_DOWN = "mousedown";
|
|
var MOUSE_MOVE = exports2.MOUSE_MOVE = "mousemove";
|
|
var MOUSE_UP = exports2.MOUSE_UP = "mouseup";
|
|
var MOUSE_CANCEL = exports2.MOUSE_CANCEL = "dragstart";
|
|
var TOUCH_START = exports2.TOUCH_START = "touchstart";
|
|
var TOUCH_MOVE = exports2.TOUCH_MOVE = "touchmove";
|
|
var TOUCH_END = exports2.TOUCH_END = "touchend";
|
|
var TOUCH_CANCEL = exports2.TOUCH_CANCEL = "touchcancel";
|
|
var SCROLL = exports2.SCROLL = "scroll";
|
|
var SELECT = exports2.SELECT = "select";
|
|
var SELECTION_CHANGE = exports2.SELECTION_CHANGE = "selectionchange";
|
|
function isStartish(eventType) {
|
|
return eventType === TOUCH_START || eventType === MOUSE_DOWN;
|
|
}
|
|
__name(isStartish, "isStartish");
|
|
function isMoveish(eventType) {
|
|
return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
|
|
}
|
|
__name(isMoveish, "isMoveish");
|
|
function isEndish(eventType) {
|
|
return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
|
|
}
|
|
__name(isEndish, "isEndish");
|
|
function isCancelish(eventType) {
|
|
return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
|
|
}
|
|
__name(isCancelish, "isCancelish");
|
|
function isScroll(eventType) {
|
|
return eventType === SCROLL;
|
|
}
|
|
__name(isScroll, "isScroll");
|
|
function isSelectionChange(eventType) {
|
|
return eventType === SELECT || eventType === SELECTION_CHANGE;
|
|
}
|
|
__name(isSelectionChange, "isSelectionChange");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/isSelectionValid/index.js
|
|
var require_isSelectionValid = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/isSelectionValid/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = isSelectionValid;
|
|
function isSelectionValid() {
|
|
var selection = window.getSelection();
|
|
var string = selection.toString();
|
|
var anchorNode = selection.anchorNode;
|
|
var focusNode = selection.focusNode;
|
|
var isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
|
|
return string.length >= 1 && string !== "\n" && isTextNode;
|
|
}
|
|
__name(isSelectionValid, "isSelectionValid");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useResponderEvents/utils.js
|
|
var require_utils = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useResponderEvents/utils.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.getLowestCommonAncestor = getLowestCommonAncestor;
|
|
exports2.getResponderPaths = getResponderPaths;
|
|
exports2.hasTargetTouches = hasTargetTouches;
|
|
exports2.hasValidSelection = hasValidSelection;
|
|
exports2.isPrimaryPointerDown = isPrimaryPointerDown;
|
|
exports2.setResponderId = setResponderId;
|
|
var _isSelectionValid = _interopRequireDefault(require_isSelectionValid());
|
|
var keyName = "__reactResponderId";
|
|
function getEventPath(domEvent) {
|
|
if (domEvent.type === "selectionchange") {
|
|
var target = window.getSelection().anchorNode;
|
|
return composedPathFallback(target);
|
|
} else {
|
|
var path = domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
|
|
return path;
|
|
}
|
|
}
|
|
__name(getEventPath, "getEventPath");
|
|
function composedPathFallback(target) {
|
|
var path = [];
|
|
while (target != null && target !== document.body) {
|
|
path.push(target);
|
|
target = target.parentNode;
|
|
}
|
|
return path;
|
|
}
|
|
__name(composedPathFallback, "composedPathFallback");
|
|
function getResponderId(node) {
|
|
if (node != null) {
|
|
return node[keyName];
|
|
}
|
|
return null;
|
|
}
|
|
__name(getResponderId, "getResponderId");
|
|
function setResponderId(node, id) {
|
|
if (node != null) {
|
|
node[keyName] = id;
|
|
}
|
|
}
|
|
__name(setResponderId, "setResponderId");
|
|
function getResponderPaths(domEvent) {
|
|
var idPath = [];
|
|
var nodePath = [];
|
|
var eventPath = getEventPath(domEvent);
|
|
for (var i = 0; i < eventPath.length; i++) {
|
|
var node = eventPath[i];
|
|
var id = getResponderId(node);
|
|
if (id != null) {
|
|
idPath.push(id);
|
|
nodePath.push(node);
|
|
}
|
|
}
|
|
return {
|
|
idPath,
|
|
nodePath
|
|
};
|
|
}
|
|
__name(getResponderPaths, "getResponderPaths");
|
|
function getLowestCommonAncestor(pathA, pathB) {
|
|
var pathALength = pathA.length;
|
|
var pathBLength = pathB.length;
|
|
if (
|
|
// If either path is empty
|
|
pathALength === 0 || pathBLength === 0 || // If the last elements aren't the same there can't be a common ancestor
|
|
// that is connected to the responder system
|
|
pathA[pathALength - 1] !== pathB[pathBLength - 1]
|
|
) {
|
|
return null;
|
|
}
|
|
var itemA = pathA[0];
|
|
var indexA = 0;
|
|
var itemB = pathB[0];
|
|
var indexB = 0;
|
|
if (pathALength - pathBLength > 0) {
|
|
indexA = pathALength - pathBLength;
|
|
itemA = pathA[indexA];
|
|
pathALength = pathBLength;
|
|
}
|
|
if (pathBLength - pathALength > 0) {
|
|
indexB = pathBLength - pathALength;
|
|
itemB = pathB[indexB];
|
|
pathBLength = pathALength;
|
|
}
|
|
var depth = pathALength;
|
|
while (depth--) {
|
|
if (itemA === itemB) {
|
|
return itemA;
|
|
}
|
|
itemA = pathA[indexA++];
|
|
itemB = pathB[indexB++];
|
|
}
|
|
return null;
|
|
}
|
|
__name(getLowestCommonAncestor, "getLowestCommonAncestor");
|
|
function hasTargetTouches(target, touches) {
|
|
if (!touches || touches.length === 0) {
|
|
return false;
|
|
}
|
|
for (var i = 0; i < touches.length; i++) {
|
|
var node = touches[i].target;
|
|
if (node != null) {
|
|
if (target.contains(node)) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(hasTargetTouches, "hasTargetTouches");
|
|
function hasValidSelection(domEvent) {
|
|
if (domEvent.type === "selectionchange") {
|
|
return (0, _isSelectionValid.default)();
|
|
}
|
|
return domEvent.type === "select";
|
|
}
|
|
__name(hasValidSelection, "hasValidSelection");
|
|
function isPrimaryPointerDown(domEvent) {
|
|
var altKey = domEvent.altKey, button = domEvent.button, buttons = domEvent.buttons, ctrlKey = domEvent.ctrlKey, type = domEvent.type;
|
|
var isTouch = type === "touchstart" || type === "touchmove";
|
|
var isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1);
|
|
var isPrimaryMouseMove = type === "mousemove" && buttons === 1;
|
|
var noModifiers = altKey === false && ctrlKey === false;
|
|
if (isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
__name(isPrimaryPointerDown, "isPrimaryPointerDown");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderTouchHistoryStore.js
|
|
var require_ResponderTouchHistoryStore = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderTouchHistoryStore.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.ResponderTouchHistoryStore = void 0;
|
|
var _ResponderEventTypes = require_ResponderEventTypes();
|
|
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
var MAX_TOUCH_BANK = 20;
|
|
function timestampForTouch(touch) {
|
|
return touch.timeStamp || touch.timestamp;
|
|
}
|
|
__name(timestampForTouch, "timestampForTouch");
|
|
function createTouchRecord(touch) {
|
|
return {
|
|
touchActive: true,
|
|
startPageX: touch.pageX,
|
|
startPageY: touch.pageY,
|
|
startTimeStamp: timestampForTouch(touch),
|
|
currentPageX: touch.pageX,
|
|
currentPageY: touch.pageY,
|
|
currentTimeStamp: timestampForTouch(touch),
|
|
previousPageX: touch.pageX,
|
|
previousPageY: touch.pageY,
|
|
previousTimeStamp: timestampForTouch(touch)
|
|
};
|
|
}
|
|
__name(createTouchRecord, "createTouchRecord");
|
|
function resetTouchRecord(touchRecord, touch) {
|
|
touchRecord.touchActive = true;
|
|
touchRecord.startPageX = touch.pageX;
|
|
touchRecord.startPageY = touch.pageY;
|
|
touchRecord.startTimeStamp = timestampForTouch(touch);
|
|
touchRecord.currentPageX = touch.pageX;
|
|
touchRecord.currentPageY = touch.pageY;
|
|
touchRecord.currentTimeStamp = timestampForTouch(touch);
|
|
touchRecord.previousPageX = touch.pageX;
|
|
touchRecord.previousPageY = touch.pageY;
|
|
touchRecord.previousTimeStamp = timestampForTouch(touch);
|
|
}
|
|
__name(resetTouchRecord, "resetTouchRecord");
|
|
function getTouchIdentifier(_ref) {
|
|
var identifier = _ref.identifier;
|
|
if (identifier == null) {
|
|
console.error("Touch object is missing identifier.");
|
|
}
|
|
if (__DEV__) {
|
|
if (identifier > MAX_TOUCH_BANK) {
|
|
console.error("Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK);
|
|
}
|
|
}
|
|
return identifier;
|
|
}
|
|
__name(getTouchIdentifier, "getTouchIdentifier");
|
|
function recordTouchStart(touch, touchHistory) {
|
|
var identifier = getTouchIdentifier(touch);
|
|
var touchRecord = touchHistory.touchBank[identifier];
|
|
if (touchRecord) {
|
|
resetTouchRecord(touchRecord, touch);
|
|
} else {
|
|
touchHistory.touchBank[identifier] = createTouchRecord(touch);
|
|
}
|
|
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
}
|
|
__name(recordTouchStart, "recordTouchStart");
|
|
function recordTouchMove(touch, touchHistory) {
|
|
var touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
|
|
if (touchRecord) {
|
|
touchRecord.touchActive = true;
|
|
touchRecord.previousPageX = touchRecord.currentPageX;
|
|
touchRecord.previousPageY = touchRecord.currentPageY;
|
|
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
|
|
touchRecord.currentPageX = touch.pageX;
|
|
touchRecord.currentPageY = touch.pageY;
|
|
touchRecord.currentTimeStamp = timestampForTouch(touch);
|
|
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
} else {
|
|
console.warn("Cannot record touch move without a touch start.\n", "Touch Move: " + printTouch(touch) + "\n", "Touch Bank: " + printTouchBank(touchHistory));
|
|
}
|
|
}
|
|
__name(recordTouchMove, "recordTouchMove");
|
|
function recordTouchEnd(touch, touchHistory) {
|
|
var touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
|
|
if (touchRecord) {
|
|
touchRecord.touchActive = false;
|
|
touchRecord.previousPageX = touchRecord.currentPageX;
|
|
touchRecord.previousPageY = touchRecord.currentPageY;
|
|
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
|
|
touchRecord.currentPageX = touch.pageX;
|
|
touchRecord.currentPageY = touch.pageY;
|
|
touchRecord.currentTimeStamp = timestampForTouch(touch);
|
|
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
} else {
|
|
console.warn("Cannot record touch end without a touch start.\n", "Touch End: " + printTouch(touch) + "\n", "Touch Bank: " + printTouchBank(touchHistory));
|
|
}
|
|
}
|
|
__name(recordTouchEnd, "recordTouchEnd");
|
|
function printTouch(touch) {
|
|
return JSON.stringify({
|
|
identifier: touch.identifier,
|
|
pageX: touch.pageX,
|
|
pageY: touch.pageY,
|
|
timestamp: timestampForTouch(touch)
|
|
});
|
|
}
|
|
__name(printTouch, "printTouch");
|
|
function printTouchBank(touchHistory) {
|
|
var touchBank = touchHistory.touchBank;
|
|
var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
|
|
if (touchBank.length > MAX_TOUCH_BANK) {
|
|
printed += " (original size: " + touchBank.length + ")";
|
|
}
|
|
return printed;
|
|
}
|
|
__name(printTouchBank, "printTouchBank");
|
|
var ResponderTouchHistoryStore = class {
|
|
static {
|
|
__name(this, "ResponderTouchHistoryStore");
|
|
}
|
|
constructor() {
|
|
this._touchHistory = {
|
|
touchBank: [],
|
|
//Array<TouchRecord>
|
|
numberActiveTouches: 0,
|
|
// If there is only one active touch, we remember its location. This prevents
|
|
// us having to loop through all of the touches all the time in the most
|
|
// common case.
|
|
indexOfSingleActiveTouch: -1,
|
|
mostRecentTimeStamp: 0
|
|
};
|
|
}
|
|
recordTouchTrack(topLevelType, nativeEvent) {
|
|
var touchHistory = this._touchHistory;
|
|
if ((0, _ResponderEventTypes.isMoveish)(topLevelType)) {
|
|
nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory));
|
|
} else if ((0, _ResponderEventTypes.isStartish)(topLevelType)) {
|
|
nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory));
|
|
touchHistory.numberActiveTouches = nativeEvent.touches.length;
|
|
if (touchHistory.numberActiveTouches === 1) {
|
|
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier;
|
|
}
|
|
} else if ((0, _ResponderEventTypes.isEndish)(topLevelType)) {
|
|
nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory));
|
|
touchHistory.numberActiveTouches = nativeEvent.touches.length;
|
|
if (touchHistory.numberActiveTouches === 1) {
|
|
var touchBank = touchHistory.touchBank;
|
|
for (var i = 0; i < touchBank.length; i++) {
|
|
var touchTrackToCheck = touchBank[i];
|
|
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
|
|
touchHistory.indexOfSingleActiveTouch = i;
|
|
break;
|
|
}
|
|
}
|
|
if (__DEV__) {
|
|
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
if (!(activeRecord != null && activeRecord.touchActive)) {
|
|
console.error("Cannot find single active touch.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
get touchHistory() {
|
|
return this._touchHistory;
|
|
}
|
|
};
|
|
exports2.ResponderTouchHistoryStore = ResponderTouchHistoryStore;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderSystem.js
|
|
var require_ResponderSystem = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderSystem.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.addNode = addNode;
|
|
exports2.attachListeners = attachListeners;
|
|
exports2.getResponderNode = getResponderNode;
|
|
exports2.removeNode = removeNode;
|
|
exports2.terminateResponder = terminateResponder;
|
|
var _createResponderEvent = _interopRequireDefault(require_createResponderEvent());
|
|
var _ResponderEventTypes = require_ResponderEventTypes();
|
|
var _utils = require_utils();
|
|
var _ResponderTouchHistoryStore = require_ResponderTouchHistoryStore();
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var emptyObject = {};
|
|
var startRegistration = ["onStartShouldSetResponderCapture", "onStartShouldSetResponder", {
|
|
bubbles: true
|
|
}];
|
|
var moveRegistration = ["onMoveShouldSetResponderCapture", "onMoveShouldSetResponder", {
|
|
bubbles: true
|
|
}];
|
|
var scrollRegistration = ["onScrollShouldSetResponderCapture", "onScrollShouldSetResponder", {
|
|
bubbles: false
|
|
}];
|
|
var shouldSetResponderEvents = {
|
|
touchstart: startRegistration,
|
|
mousedown: startRegistration,
|
|
touchmove: moveRegistration,
|
|
mousemove: moveRegistration,
|
|
scroll: scrollRegistration
|
|
};
|
|
var emptyResponder = {
|
|
id: null,
|
|
idPath: null,
|
|
node: null
|
|
};
|
|
var responderListenersMap = /* @__PURE__ */ new Map();
|
|
var isEmulatingMouseEvents = false;
|
|
var trackedTouchCount = 0;
|
|
var currentResponder = {
|
|
id: null,
|
|
node: null,
|
|
idPath: null
|
|
};
|
|
var responderTouchHistoryStore = new _ResponderTouchHistoryStore.ResponderTouchHistoryStore();
|
|
function changeCurrentResponder(responder) {
|
|
currentResponder = responder;
|
|
}
|
|
__name(changeCurrentResponder, "changeCurrentResponder");
|
|
function getResponderConfig(id) {
|
|
var config = responderListenersMap.get(id);
|
|
return config != null ? config : emptyObject;
|
|
}
|
|
__name(getResponderConfig, "getResponderConfig");
|
|
function eventListener(domEvent) {
|
|
var eventType = domEvent.type;
|
|
var eventTarget = domEvent.target;
|
|
if (eventType === "touchstart") {
|
|
isEmulatingMouseEvents = true;
|
|
}
|
|
if (eventType === "touchmove" || trackedTouchCount > 1) {
|
|
isEmulatingMouseEvents = false;
|
|
}
|
|
if (
|
|
// Ignore browser emulated mouse events
|
|
eventType === "mousedown" && isEmulatingMouseEvents || eventType === "mousemove" && isEmulatingMouseEvents || // Ignore mousemove if a mousedown didn't occur first
|
|
eventType === "mousemove" && trackedTouchCount < 1
|
|
) {
|
|
return;
|
|
}
|
|
if (isEmulatingMouseEvents && eventType === "mouseup") {
|
|
if (trackedTouchCount === 0) {
|
|
isEmulatingMouseEvents = false;
|
|
}
|
|
return;
|
|
}
|
|
var isStartEvent = (0, _ResponderEventTypes.isStartish)(eventType) && (0, _utils.isPrimaryPointerDown)(domEvent);
|
|
var isMoveEvent = (0, _ResponderEventTypes.isMoveish)(eventType);
|
|
var isEndEvent = (0, _ResponderEventTypes.isEndish)(eventType);
|
|
var isScrollEvent = (0, _ResponderEventTypes.isScroll)(eventType);
|
|
var isSelectionChangeEvent = (0, _ResponderEventTypes.isSelectionChange)(eventType);
|
|
var responderEvent = (0, _createResponderEvent.default)(domEvent, responderTouchHistoryStore);
|
|
if (isStartEvent || isMoveEvent || isEndEvent) {
|
|
if (domEvent.touches) {
|
|
trackedTouchCount = domEvent.touches.length;
|
|
} else {
|
|
if (isStartEvent) {
|
|
trackedTouchCount = 1;
|
|
} else if (isEndEvent) {
|
|
trackedTouchCount = 0;
|
|
}
|
|
}
|
|
responderTouchHistoryStore.recordTouchTrack(eventType, responderEvent.nativeEvent);
|
|
}
|
|
var eventPaths = (0, _utils.getResponderPaths)(domEvent);
|
|
var wasNegotiated = false;
|
|
var wantsResponder;
|
|
if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
|
|
var currentResponderIdPath = currentResponder.idPath;
|
|
var eventIdPath = eventPaths.idPath;
|
|
if (currentResponderIdPath != null && eventIdPath != null) {
|
|
var lowestCommonAncestor = (0, _utils.getLowestCommonAncestor)(currentResponderIdPath, eventIdPath);
|
|
if (lowestCommonAncestor != null) {
|
|
var indexOfLowestCommonAncestor = eventIdPath.indexOf(lowestCommonAncestor);
|
|
var index5 = indexOfLowestCommonAncestor + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
|
|
eventPaths = {
|
|
idPath: eventIdPath.slice(index5),
|
|
nodePath: eventPaths.nodePath.slice(index5)
|
|
};
|
|
} else {
|
|
eventPaths = null;
|
|
}
|
|
}
|
|
if (eventPaths != null) {
|
|
wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent);
|
|
if (wantsResponder != null) {
|
|
attemptTransfer(responderEvent, wantsResponder);
|
|
wasNegotiated = true;
|
|
}
|
|
}
|
|
}
|
|
if (currentResponder.id != null && currentResponder.node != null) {
|
|
var _currentResponder = currentResponder, id = _currentResponder.id, node = _currentResponder.node;
|
|
var _getResponderConfig = getResponderConfig(id), onResponderStart = _getResponderConfig.onResponderStart, onResponderMove = _getResponderConfig.onResponderMove, onResponderEnd = _getResponderConfig.onResponderEnd, onResponderRelease = _getResponderConfig.onResponderRelease, onResponderTerminate = _getResponderConfig.onResponderTerminate, onResponderTerminationRequest = _getResponderConfig.onResponderTerminationRequest;
|
|
responderEvent.bubbles = false;
|
|
responderEvent.cancelable = false;
|
|
responderEvent.currentTarget = node;
|
|
if (isStartEvent) {
|
|
if (onResponderStart != null) {
|
|
responderEvent.dispatchConfig.registrationName = "onResponderStart";
|
|
onResponderStart(responderEvent);
|
|
}
|
|
} else if (isMoveEvent) {
|
|
if (onResponderMove != null) {
|
|
responderEvent.dispatchConfig.registrationName = "onResponderMove";
|
|
onResponderMove(responderEvent);
|
|
}
|
|
} else {
|
|
var isTerminateEvent = (0, _ResponderEventTypes.isCancelish)(eventType) || // native context menu
|
|
eventType === "contextmenu" || // window blur
|
|
eventType === "blur" && eventTarget === window || // responder (or ancestors) blur
|
|
eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
|
|
isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
|
|
isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
|
|
isSelectionChangeEvent && (0, _utils.hasValidSelection)(domEvent);
|
|
var isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, _utils.hasTargetTouches)(node, domEvent.touches);
|
|
if (isEndEvent) {
|
|
if (onResponderEnd != null) {
|
|
responderEvent.dispatchConfig.registrationName = "onResponderEnd";
|
|
onResponderEnd(responderEvent);
|
|
}
|
|
}
|
|
if (isReleaseEvent) {
|
|
if (onResponderRelease != null) {
|
|
responderEvent.dispatchConfig.registrationName = "onResponderRelease";
|
|
onResponderRelease(responderEvent);
|
|
}
|
|
changeCurrentResponder(emptyResponder);
|
|
}
|
|
if (isTerminateEvent) {
|
|
var shouldTerminate = true;
|
|
if (eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") {
|
|
if (wasNegotiated) {
|
|
shouldTerminate = false;
|
|
} else if (onResponderTerminationRequest != null) {
|
|
responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest";
|
|
if (onResponderTerminationRequest(responderEvent) === false) {
|
|
shouldTerminate = false;
|
|
}
|
|
}
|
|
}
|
|
if (shouldTerminate) {
|
|
if (onResponderTerminate != null) {
|
|
responderEvent.dispatchConfig.registrationName = "onResponderTerminate";
|
|
onResponderTerminate(responderEvent);
|
|
}
|
|
changeCurrentResponder(emptyResponder);
|
|
isEmulatingMouseEvents = false;
|
|
trackedTouchCount = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
__name(eventListener, "eventListener");
|
|
function findWantsResponder(eventPaths, domEvent, responderEvent) {
|
|
var shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
|
|
if (shouldSetCallbacks != null) {
|
|
var idPath = eventPaths.idPath, nodePath = eventPaths.nodePath;
|
|
var shouldSetCallbackCaptureName = shouldSetCallbacks[0];
|
|
var shouldSetCallbackBubbleName = shouldSetCallbacks[1];
|
|
var bubbles = shouldSetCallbacks[2].bubbles;
|
|
var check = /* @__PURE__ */ __name(function check2(id2, node2, callbackName) {
|
|
var config = getResponderConfig(id2);
|
|
var shouldSetCallback = config[callbackName];
|
|
if (shouldSetCallback != null) {
|
|
responderEvent.currentTarget = node2;
|
|
if (shouldSetCallback(responderEvent) === true) {
|
|
var prunedIdPath = idPath.slice(idPath.indexOf(id2));
|
|
return {
|
|
id: id2,
|
|
node: node2,
|
|
idPath: prunedIdPath
|
|
};
|
|
}
|
|
}
|
|
}, "check");
|
|
for (var i = idPath.length - 1; i >= 0; i--) {
|
|
var id = idPath[i];
|
|
var node = nodePath[i];
|
|
var result = check(id, node, shouldSetCallbackCaptureName);
|
|
if (result != null) {
|
|
return result;
|
|
}
|
|
if (responderEvent.isPropagationStopped() === true) {
|
|
return;
|
|
}
|
|
}
|
|
if (bubbles) {
|
|
for (var _i = 0; _i < idPath.length; _i++) {
|
|
var _id = idPath[_i];
|
|
var _node = nodePath[_i];
|
|
var _result = check(_id, _node, shouldSetCallbackBubbleName);
|
|
if (_result != null) {
|
|
return _result;
|
|
}
|
|
if (responderEvent.isPropagationStopped() === true) {
|
|
return;
|
|
}
|
|
}
|
|
} else {
|
|
var _id2 = idPath[0];
|
|
var _node2 = nodePath[0];
|
|
var target = domEvent.target;
|
|
if (target === _node2) {
|
|
return check(_id2, _node2, shouldSetCallbackBubbleName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
__name(findWantsResponder, "findWantsResponder");
|
|
function attemptTransfer(responderEvent, wantsResponder) {
|
|
var _currentResponder2 = currentResponder, currentId = _currentResponder2.id, currentNode = _currentResponder2.node;
|
|
var id = wantsResponder.id, node = wantsResponder.node;
|
|
var _getResponderConfig2 = getResponderConfig(id), onResponderGrant = _getResponderConfig2.onResponderGrant, onResponderReject = _getResponderConfig2.onResponderReject;
|
|
responderEvent.bubbles = false;
|
|
responderEvent.cancelable = false;
|
|
responderEvent.currentTarget = node;
|
|
if (currentId == null) {
|
|
if (onResponderGrant != null) {
|
|
responderEvent.currentTarget = node;
|
|
responderEvent.dispatchConfig.registrationName = "onResponderGrant";
|
|
onResponderGrant(responderEvent);
|
|
}
|
|
changeCurrentResponder(wantsResponder);
|
|
} else {
|
|
var _getResponderConfig3 = getResponderConfig(currentId), onResponderTerminate = _getResponderConfig3.onResponderTerminate, onResponderTerminationRequest = _getResponderConfig3.onResponderTerminationRequest;
|
|
var allowTransfer = true;
|
|
if (onResponderTerminationRequest != null) {
|
|
responderEvent.currentTarget = currentNode;
|
|
responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest";
|
|
if (onResponderTerminationRequest(responderEvent) === false) {
|
|
allowTransfer = false;
|
|
}
|
|
}
|
|
if (allowTransfer) {
|
|
if (onResponderTerminate != null) {
|
|
responderEvent.currentTarget = currentNode;
|
|
responderEvent.dispatchConfig.registrationName = "onResponderTerminate";
|
|
onResponderTerminate(responderEvent);
|
|
}
|
|
if (onResponderGrant != null) {
|
|
responderEvent.currentTarget = node;
|
|
responderEvent.dispatchConfig.registrationName = "onResponderGrant";
|
|
onResponderGrant(responderEvent);
|
|
}
|
|
changeCurrentResponder(wantsResponder);
|
|
} else {
|
|
if (onResponderReject != null) {
|
|
responderEvent.currentTarget = node;
|
|
responderEvent.dispatchConfig.registrationName = "onResponderReject";
|
|
onResponderReject(responderEvent);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
__name(attemptTransfer, "attemptTransfer");
|
|
var documentEventsCapturePhase = ["blur", "scroll"];
|
|
var documentEventsBubblePhase = [
|
|
// mouse
|
|
"mousedown",
|
|
"mousemove",
|
|
"mouseup",
|
|
"dragstart",
|
|
// touch
|
|
"touchstart",
|
|
"touchmove",
|
|
"touchend",
|
|
"touchcancel",
|
|
// other
|
|
"contextmenu",
|
|
"select",
|
|
"selectionchange"
|
|
];
|
|
function attachListeners() {
|
|
if (_canUseDom.default && window.__reactResponderSystemActive == null) {
|
|
window.addEventListener("blur", eventListener);
|
|
documentEventsBubblePhase.forEach((eventType) => {
|
|
document.addEventListener(eventType, eventListener);
|
|
});
|
|
documentEventsCapturePhase.forEach((eventType) => {
|
|
document.addEventListener(eventType, eventListener, true);
|
|
});
|
|
window.__reactResponderSystemActive = true;
|
|
}
|
|
}
|
|
__name(attachListeners, "attachListeners");
|
|
function addNode(id, node, config) {
|
|
(0, _utils.setResponderId)(node, id);
|
|
responderListenersMap.set(id, config);
|
|
}
|
|
__name(addNode, "addNode");
|
|
function removeNode(id) {
|
|
if (currentResponder.id === id) {
|
|
terminateResponder();
|
|
}
|
|
if (responderListenersMap.has(id)) {
|
|
responderListenersMap.delete(id);
|
|
}
|
|
}
|
|
__name(removeNode, "removeNode");
|
|
function terminateResponder() {
|
|
var _currentResponder3 = currentResponder, id = _currentResponder3.id, node = _currentResponder3.node;
|
|
if (id != null && node != null) {
|
|
var _getResponderConfig4 = getResponderConfig(id), onResponderTerminate = _getResponderConfig4.onResponderTerminate;
|
|
if (onResponderTerminate != null) {
|
|
var event = (0, _createResponderEvent.default)({}, responderTouchHistoryStore);
|
|
event.currentTarget = node;
|
|
onResponderTerminate(event);
|
|
}
|
|
changeCurrentResponder(emptyResponder);
|
|
}
|
|
isEmulatingMouseEvents = false;
|
|
trackedTouchCount = 0;
|
|
}
|
|
__name(terminateResponder, "terminateResponder");
|
|
function getResponderNode() {
|
|
return currentResponder.node;
|
|
}
|
|
__name(getResponderNode, "getResponderNode");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useResponderEvents/index.js
|
|
var require_useResponderEvents = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useResponderEvents/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useResponderEvents;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var ResponderSystem = _interopRequireWildcard(require_ResponderSystem());
|
|
var emptyObject = {};
|
|
var idCounter = 0;
|
|
function useStable(getInitialValue) {
|
|
var ref = React83.useRef(null);
|
|
if (ref.current == null) {
|
|
ref.current = getInitialValue();
|
|
}
|
|
return ref.current;
|
|
}
|
|
__name(useStable, "useStable");
|
|
function useResponderEvents(hostRef, config) {
|
|
if (config === void 0) {
|
|
config = emptyObject;
|
|
}
|
|
var id = useStable(() => idCounter++);
|
|
var isAttachedRef = React83.useRef(false);
|
|
React83.useEffect(() => {
|
|
ResponderSystem.attachListeners();
|
|
return () => {
|
|
ResponderSystem.removeNode(id);
|
|
};
|
|
}, [id]);
|
|
React83.useEffect(() => {
|
|
var _config = config, onMoveShouldSetResponder = _config.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = _config.onMoveShouldSetResponderCapture, onScrollShouldSetResponder = _config.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = _config.onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder = _config.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = _config.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = _config.onStartShouldSetResponder, onStartShouldSetResponderCapture = _config.onStartShouldSetResponderCapture;
|
|
var requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null;
|
|
var node = hostRef.current;
|
|
if (requiresResponderSystem) {
|
|
ResponderSystem.addNode(id, node, config);
|
|
isAttachedRef.current = true;
|
|
} else if (isAttachedRef.current) {
|
|
ResponderSystem.removeNode(id);
|
|
isAttachedRef.current = false;
|
|
}
|
|
}, [config, hostRef, id]);
|
|
React83.useDebugValue({
|
|
isResponder: hostRef.current === ResponderSystem.getResponderNode()
|
|
});
|
|
React83.useDebugValue(config);
|
|
}
|
|
__name(useResponderEvents, "useResponderEvents");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Text/TextAncestorContext.js
|
|
var require_TextAncestorContext = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Text/TextAncestorContext.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _react = require("react");
|
|
var TextAncestorContext = /* @__PURE__ */ (0, _react.createContext)(false);
|
|
var _default = exports2.default = TextAncestorContext;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/View/index.js
|
|
var require_View = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/View/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var forwardedProps = _interopRequireWildcard(require_forwardedProps());
|
|
var _pick = _interopRequireDefault(require_pick());
|
|
var _useElementLayout = _interopRequireDefault(require_useElementLayout());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePlatformMethods = _interopRequireDefault(require_usePlatformMethods());
|
|
var _useResponderEvents = _interopRequireDefault(require_useResponderEvents());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _TextAncestorContext = _interopRequireDefault(require_TextAncestorContext());
|
|
var _useLocale = require_useLocale();
|
|
var _excluded = ["hrefAttrs", "onLayout", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture"];
|
|
var forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
|
|
href: true,
|
|
lang: true,
|
|
onScroll: true,
|
|
onWheel: true,
|
|
pointerEvents: true
|
|
});
|
|
var pickProps = /* @__PURE__ */ __name((props) => (0, _pick.default)(props, forwardPropsList), "pickProps");
|
|
var View13 = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var hrefAttrs = props.hrefAttrs, onLayout = props.onLayout, onMoveShouldSetResponder = props.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture, onResponderEnd = props.onResponderEnd, onResponderGrant = props.onResponderGrant, onResponderMove = props.onResponderMove, onResponderReject = props.onResponderReject, onResponderRelease = props.onResponderRelease, onResponderStart = props.onResponderStart, onResponderTerminate = props.onResponderTerminate, onResponderTerminationRequest = props.onResponderTerminationRequest, onScrollShouldSetResponder = props.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = props.onStartShouldSetResponder, onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
if (process.env.NODE_ENV !== "production") {
|
|
React83.Children.toArray(props.children).forEach((item) => {
|
|
if (typeof item === "string") {
|
|
console.error("Unexpected text node: " + item + ". A text node cannot be a child of a <View>.");
|
|
}
|
|
});
|
|
}
|
|
var hasTextAncestor = React83.useContext(_TextAncestorContext.default);
|
|
var hostRef = React83.useRef(null);
|
|
var _useLocaleContext = (0, _useLocale.useLocaleContext)(), contextDirection = _useLocaleContext.direction;
|
|
(0, _useElementLayout.default)(hostRef, onLayout);
|
|
(0, _useResponderEvents.default)(hostRef, {
|
|
onMoveShouldSetResponder,
|
|
onMoveShouldSetResponderCapture,
|
|
onResponderEnd,
|
|
onResponderGrant,
|
|
onResponderMove,
|
|
onResponderReject,
|
|
onResponderRelease,
|
|
onResponderStart,
|
|
onResponderTerminate,
|
|
onResponderTerminationRequest,
|
|
onScrollShouldSetResponder,
|
|
onScrollShouldSetResponderCapture,
|
|
onSelectionChangeShouldSetResponder,
|
|
onSelectionChangeShouldSetResponderCapture,
|
|
onStartShouldSetResponder,
|
|
onStartShouldSetResponderCapture
|
|
});
|
|
var component = "div";
|
|
var langDirection = props.lang != null ? (0, _useLocale.getLocaleDirection)(props.lang) : null;
|
|
var componentDirection = props.dir || langDirection;
|
|
var writingDirection = componentDirection || contextDirection;
|
|
var supportedProps = pickProps(rest);
|
|
supportedProps.dir = componentDirection;
|
|
supportedProps.style = [styles.view$raw, hasTextAncestor && styles.inline, props.style];
|
|
if (props.href != null) {
|
|
component = "a";
|
|
if (hrefAttrs != null) {
|
|
var download = hrefAttrs.download, rel = hrefAttrs.rel, target = hrefAttrs.target;
|
|
if (download != null) {
|
|
supportedProps.download = download;
|
|
}
|
|
if (rel != null) {
|
|
supportedProps.rel = rel;
|
|
}
|
|
if (typeof target === "string") {
|
|
supportedProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
}
|
|
}
|
|
}
|
|
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
|
var setRef2 = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
|
|
supportedProps.ref = setRef2;
|
|
return (0, _createElement.default)(component, supportedProps, {
|
|
writingDirection
|
|
});
|
|
});
|
|
View13.displayName = "View";
|
|
var styles = _StyleSheet.default.create({
|
|
view$raw: {
|
|
alignContent: "flex-start",
|
|
alignItems: "stretch",
|
|
backgroundColor: "transparent",
|
|
border: "0 solid black",
|
|
boxSizing: "border-box",
|
|
display: "flex",
|
|
flexBasis: "auto",
|
|
flexDirection: "column",
|
|
flexShrink: 0,
|
|
listStyle: "none",
|
|
margin: 0,
|
|
minHeight: 0,
|
|
minWidth: 0,
|
|
padding: 0,
|
|
position: "relative",
|
|
textDecoration: "none",
|
|
zIndex: 0
|
|
},
|
|
inline: {
|
|
display: "inline-flex"
|
|
}
|
|
});
|
|
var _default = exports2.default = View13;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/deepDiffer/index.js
|
|
var require_deepDiffer = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/deepDiffer/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var deepDiffer = /* @__PURE__ */ __name(function deepDiffer2(one, two, maxDepth) {
|
|
if (maxDepth === void 0) {
|
|
maxDepth = -1;
|
|
}
|
|
if (maxDepth === 0) {
|
|
return true;
|
|
}
|
|
if (one === two) {
|
|
return false;
|
|
}
|
|
if (typeof one === "function" && typeof two === "function") {
|
|
return false;
|
|
}
|
|
if (typeof one !== "object" || one === null) {
|
|
return one !== two;
|
|
}
|
|
if (typeof two !== "object" || two === null) {
|
|
return true;
|
|
}
|
|
if (one.constructor !== two.constructor) {
|
|
return true;
|
|
}
|
|
if (Array.isArray(one)) {
|
|
var len = one.length;
|
|
if (two.length !== len) {
|
|
return true;
|
|
}
|
|
for (var ii = 0; ii < len; ii++) {
|
|
if (deepDiffer2(one[ii], two[ii], maxDepth - 1)) {
|
|
return true;
|
|
}
|
|
}
|
|
} else {
|
|
for (var key in one) {
|
|
if (deepDiffer2(one[key], two[key], maxDepth - 1)) {
|
|
return true;
|
|
}
|
|
}
|
|
for (var twoKey in two) {
|
|
if (one[twoKey] === void 0 && two[twoKey] !== void 0) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}, "deepDiffer");
|
|
var _default = exports2.default = deepDiffer;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/fbjs/lib/invariant.js
|
|
var require_invariant = __commonJS({
|
|
"node_modules/fbjs/lib/invariant.js"(exports2, module2) {
|
|
"use strict";
|
|
var validateFormat = process.env.NODE_ENV !== "production" ? function(format) {
|
|
if (format === void 0) {
|
|
throw new Error("invariant(...): Second argument must be a string.");
|
|
}
|
|
} : function(format) {
|
|
};
|
|
function invariant(condition, format) {
|
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
args[_key - 2] = arguments[_key];
|
|
}
|
|
validateFormat(format);
|
|
if (!condition) {
|
|
var error4;
|
|
if (format === void 0) {
|
|
error4 = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
|
|
} else {
|
|
var argIndex = 0;
|
|
error4 = new Error(format.replace(/%s/g, function() {
|
|
return String(args[argIndex++]);
|
|
}));
|
|
error4.name = "Invariant Violation";
|
|
}
|
|
error4.framesToPop = 1;
|
|
throw error4;
|
|
}
|
|
}
|
|
__name(invariant, "invariant");
|
|
module2.exports = invariant;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/arrayLikeToArray.js
|
|
var require_arrayLikeToArray = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/arrayLikeToArray.js"(exports2, module2) {
|
|
function _arrayLikeToArray(r, a) {
|
|
(null == a || a > r.length) && (a = r.length);
|
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
module2.exports = _arrayLikeToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js
|
|
var require_unsupportedIterableToArray = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"(exports2, module2) {
|
|
var arrayLikeToArray = require_arrayLikeToArray();
|
|
function _unsupportedIterableToArray(r, a) {
|
|
if (r) {
|
|
if ("string" == typeof r) return arrayLikeToArray(r, a);
|
|
var t = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
|
|
}
|
|
}
|
|
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
module2.exports = _unsupportedIterableToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js
|
|
var require_createForOfIteratorHelperLoose = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js"(exports2, module2) {
|
|
var unsupportedIterableToArray = require_unsupportedIterableToArray();
|
|
function _createForOfIteratorHelperLoose(r, e) {
|
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
if (t) return (t = t.call(r)).next.bind(t);
|
|
if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
t && (r = t);
|
|
var o = 0;
|
|
return function() {
|
|
return o >= r.length ? {
|
|
done: true
|
|
} : {
|
|
done: false,
|
|
value: r[o++]
|
|
};
|
|
};
|
|
}
|
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
__name(_createForOfIteratorHelperLoose, "_createForOfIteratorHelperLoose");
|
|
module2.exports = _createForOfIteratorHelperLoose, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/RefreshControl/index.js
|
|
var require_RefreshControl = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/RefreshControl/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _react = _interopRequireDefault(require("react"));
|
|
var _excluded = ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"];
|
|
function RefreshControl(props) {
|
|
var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size4 = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
return /* @__PURE__ */ _react.default.createElement(_View.default, rest);
|
|
}
|
|
__name(RefreshControl, "RefreshControl");
|
|
var _default = exports2.default = RefreshControl;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Dimensions/index.js
|
|
var require_Dimensions = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Dimensions/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var dimensions = {
|
|
window: {
|
|
fontScale: 1,
|
|
height: 0,
|
|
scale: 1,
|
|
width: 0
|
|
},
|
|
screen: {
|
|
fontScale: 1,
|
|
height: 0,
|
|
scale: 1,
|
|
width: 0
|
|
}
|
|
};
|
|
var listeners = {};
|
|
var shouldInit = _canUseDom.default;
|
|
function update() {
|
|
if (!_canUseDom.default) {
|
|
return;
|
|
}
|
|
var win = window;
|
|
var height;
|
|
var width;
|
|
if (win.visualViewport) {
|
|
var visualViewport = win.visualViewport;
|
|
height = Math.round(visualViewport.height * visualViewport.scale);
|
|
width = Math.round(visualViewport.width * visualViewport.scale);
|
|
} else {
|
|
var docEl2 = win.document.documentElement;
|
|
height = docEl2.clientHeight;
|
|
width = docEl2.clientWidth;
|
|
}
|
|
dimensions.window = {
|
|
fontScale: 1,
|
|
height,
|
|
scale: win.devicePixelRatio || 1,
|
|
width
|
|
};
|
|
dimensions.screen = {
|
|
fontScale: 1,
|
|
height: win.screen.height,
|
|
scale: win.devicePixelRatio || 1,
|
|
width: win.screen.width
|
|
};
|
|
}
|
|
__name(update, "update");
|
|
function handleResize() {
|
|
update();
|
|
if (Array.isArray(listeners["change"])) {
|
|
listeners["change"].forEach((handler) => handler(dimensions));
|
|
}
|
|
}
|
|
__name(handleResize, "handleResize");
|
|
var Dimensions2 = class {
|
|
static {
|
|
__name(this, "Dimensions");
|
|
}
|
|
static get(dimension) {
|
|
if (shouldInit) {
|
|
shouldInit = false;
|
|
update();
|
|
}
|
|
(0, _invariant.default)(dimensions[dimension], "No dimension set for key " + dimension);
|
|
return dimensions[dimension];
|
|
}
|
|
static set(initialDimensions) {
|
|
if (initialDimensions) {
|
|
if (_canUseDom.default) {
|
|
(0, _invariant.default)(false, "Dimensions cannot be set in the browser");
|
|
} else {
|
|
if (initialDimensions.screen != null) {
|
|
dimensions.screen = initialDimensions.screen;
|
|
}
|
|
if (initialDimensions.window != null) {
|
|
dimensions.window = initialDimensions.window;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
static addEventListener(type, handler) {
|
|
listeners[type] = listeners[type] || [];
|
|
listeners[type].push(handler);
|
|
return {
|
|
remove: /* @__PURE__ */ __name(() => {
|
|
this.removeEventListener(type, handler);
|
|
}, "remove")
|
|
};
|
|
}
|
|
static removeEventListener(type, handler) {
|
|
if (Array.isArray(listeners[type])) {
|
|
listeners[type] = listeners[type].filter((_handler) => _handler !== handler);
|
|
}
|
|
}
|
|
};
|
|
exports2.default = Dimensions2;
|
|
if (_canUseDom.default) {
|
|
if (window.visualViewport) {
|
|
window.visualViewport.addEventListener("resize", handleResize, false);
|
|
} else {
|
|
window.addEventListener("resize", handleResize, false);
|
|
}
|
|
}
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/TextInputState/index.js
|
|
var require_TextInputState = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/TextInputState/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var TextInputState = {
|
|
/**
|
|
* Internal state
|
|
*/
|
|
_currentlyFocusedNode: null,
|
|
/**
|
|
* Returns the ID of the currently focused text field, if one exists
|
|
* If no text field is focused it returns null
|
|
*/
|
|
currentlyFocusedField() {
|
|
if (document.activeElement !== this._currentlyFocusedNode) {
|
|
this._currentlyFocusedNode = null;
|
|
}
|
|
return this._currentlyFocusedNode;
|
|
},
|
|
/**
|
|
* @param {Object} TextInputID id of the text field to focus
|
|
* Focuses the specified text field
|
|
* noop if the text field was already focused
|
|
*/
|
|
focusTextInput(textFieldNode) {
|
|
if (textFieldNode !== null) {
|
|
this._currentlyFocusedNode = textFieldNode;
|
|
if (document.activeElement !== textFieldNode) {
|
|
_UIManager.default.focus(textFieldNode);
|
|
}
|
|
}
|
|
},
|
|
/**
|
|
* @param {Object} textFieldNode id of the text field to focus
|
|
* Unfocuses the specified text field
|
|
* noop if it wasn't focused
|
|
*/
|
|
blurTextInput(textFieldNode) {
|
|
if (textFieldNode !== null) {
|
|
this._currentlyFocusedNode = null;
|
|
if (document.activeElement === textFieldNode) {
|
|
_UIManager.default.blur(textFieldNode);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
var _default = exports2.default = TextInputState;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/dismissKeyboard/index.js
|
|
var require_dismissKeyboard = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/dismissKeyboard/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _TextInputState = _interopRequireDefault(require_TextInputState());
|
|
var dismissKeyboard = /* @__PURE__ */ __name(() => {
|
|
_TextInputState.default.blurTextInput(_TextInputState.default.currentlyFocusedField());
|
|
}, "dismissKeyboard");
|
|
var _default = exports2.default = dismissKeyboard;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/ScrollView/ScrollViewBase.js
|
|
var require_ScrollViewBase = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/ScrollView/ScrollViewBase.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _excluded = ["onScroll", "onTouchMove", "onWheel", "scrollEnabled", "scrollEventThrottle", "showsHorizontalScrollIndicator", "showsVerticalScrollIndicator", "style"];
|
|
function normalizeScrollEvent(e) {
|
|
return {
|
|
nativeEvent: {
|
|
contentOffset: {
|
|
get x() {
|
|
return e.target.scrollLeft;
|
|
},
|
|
get y() {
|
|
return e.target.scrollTop;
|
|
}
|
|
},
|
|
contentSize: {
|
|
get height() {
|
|
return e.target.scrollHeight;
|
|
},
|
|
get width() {
|
|
return e.target.scrollWidth;
|
|
}
|
|
},
|
|
layoutMeasurement: {
|
|
get height() {
|
|
return e.target.offsetHeight;
|
|
},
|
|
get width() {
|
|
return e.target.offsetWidth;
|
|
}
|
|
}
|
|
},
|
|
timeStamp: Date.now()
|
|
};
|
|
}
|
|
__name(normalizeScrollEvent, "normalizeScrollEvent");
|
|
function shouldEmitScrollEvent(lastTick, eventThrottle) {
|
|
var timeSinceLastTick = Date.now() - lastTick;
|
|
return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;
|
|
}
|
|
__name(shouldEmitScrollEvent, "shouldEmitScrollEvent");
|
|
var ScrollViewBase = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var onScroll = props.onScroll, onTouchMove = props.onTouchMove, onWheel = props.onWheel, _props$scrollEnabled = props.scrollEnabled, scrollEnabled = _props$scrollEnabled === void 0 ? true : _props$scrollEnabled, _props$scrollEventThr = props.scrollEventThrottle, scrollEventThrottle = _props$scrollEventThr === void 0 ? 0 : _props$scrollEventThr, showsHorizontalScrollIndicator = props.showsHorizontalScrollIndicator, showsVerticalScrollIndicator = props.showsVerticalScrollIndicator, style = props.style, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var scrollState = React83.useRef({
|
|
isScrolling: false,
|
|
scrollLastTick: 0
|
|
});
|
|
var scrollTimeout = React83.useRef(null);
|
|
var scrollRef = React83.useRef(null);
|
|
function createPreventableScrollHandler(handler) {
|
|
return (e) => {
|
|
if (scrollEnabled) {
|
|
if (handler) {
|
|
handler(e);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
__name(createPreventableScrollHandler, "createPreventableScrollHandler");
|
|
function handleScroll(e) {
|
|
e.stopPropagation();
|
|
if (e.target === scrollRef.current) {
|
|
e.persist();
|
|
if (scrollTimeout.current != null) {
|
|
clearTimeout(scrollTimeout.current);
|
|
}
|
|
scrollTimeout.current = setTimeout(() => {
|
|
handleScrollEnd(e);
|
|
}, 100);
|
|
if (scrollState.current.isScrolling) {
|
|
if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {
|
|
handleScrollTick(e);
|
|
}
|
|
} else {
|
|
handleScrollStart(e);
|
|
}
|
|
}
|
|
}
|
|
__name(handleScroll, "handleScroll");
|
|
function handleScrollStart(e) {
|
|
scrollState.current.isScrolling = true;
|
|
handleScrollTick(e);
|
|
}
|
|
__name(handleScrollStart, "handleScrollStart");
|
|
function handleScrollTick(e) {
|
|
scrollState.current.scrollLastTick = Date.now();
|
|
if (onScroll) {
|
|
onScroll(normalizeScrollEvent(e));
|
|
}
|
|
}
|
|
__name(handleScrollTick, "handleScrollTick");
|
|
function handleScrollEnd(e) {
|
|
scrollState.current.isScrolling = false;
|
|
if (onScroll) {
|
|
onScroll(normalizeScrollEvent(e));
|
|
}
|
|
}
|
|
__name(handleScrollEnd, "handleScrollEnd");
|
|
var hideScrollbar = showsHorizontalScrollIndicator === false || showsVerticalScrollIndicator === false;
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, {
|
|
onScroll: handleScroll,
|
|
onTouchMove: createPreventableScrollHandler(onTouchMove),
|
|
onWheel: createPreventableScrollHandler(onWheel),
|
|
ref: (0, _useMergeRefs.default)(scrollRef, forwardedRef),
|
|
style: [style, !scrollEnabled && styles.scrollDisabled, hideScrollbar && styles.hideScrollbar]
|
|
}));
|
|
});
|
|
var styles = _StyleSheet.default.create({
|
|
scrollDisabled: {
|
|
overflowX: "hidden",
|
|
overflowY: "hidden",
|
|
touchAction: "none"
|
|
},
|
|
hideScrollbar: {
|
|
scrollbarWidth: "none"
|
|
}
|
|
});
|
|
var _default = exports2.default = ScrollViewBase;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/fbjs/lib/emptyFunction.js
|
|
var require_emptyFunction = __commonJS({
|
|
"node_modules/fbjs/lib/emptyFunction.js"(exports2, module2) {
|
|
"use strict";
|
|
function makeEmptyFunction(arg) {
|
|
return function() {
|
|
return arg;
|
|
};
|
|
}
|
|
__name(makeEmptyFunction, "makeEmptyFunction");
|
|
var emptyFunction = /* @__PURE__ */ __name(function emptyFunction2() {
|
|
}, "emptyFunction");
|
|
emptyFunction.thatReturns = makeEmptyFunction;
|
|
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
|
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
|
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
|
emptyFunction.thatReturnsThis = function() {
|
|
return this;
|
|
};
|
|
emptyFunction.thatReturnsArgument = function(arg) {
|
|
return arg;
|
|
};
|
|
module2.exports = emptyFunction;
|
|
}
|
|
});
|
|
|
|
// node_modules/fbjs/lib/warning.js
|
|
var require_warning = __commonJS({
|
|
"node_modules/fbjs/lib/warning.js"(exports2, module2) {
|
|
"use strict";
|
|
var emptyFunction = require_emptyFunction();
|
|
function printWarning(format) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
var argIndex = 0;
|
|
var message = "Warning: " + format.replace(/%s/g, function() {
|
|
return args[argIndex++];
|
|
});
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x) {
|
|
}
|
|
}
|
|
__name(printWarning, "printWarning");
|
|
var warning = process.env.NODE_ENV !== "production" ? function(condition, format) {
|
|
if (format === void 0) {
|
|
throw new Error("`warning(condition, format, ...args)` requires a warning message argument");
|
|
}
|
|
if (!condition) {
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
args[_key2 - 2] = arguments[_key2];
|
|
}
|
|
printWarning.apply(void 0, [format].concat(args));
|
|
}
|
|
} : emptyFunction;
|
|
module2.exports = warning;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/ScrollView/index.js
|
|
var require_ScrollView = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/ScrollView/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _Dimensions = _interopRequireDefault(require_Dimensions());
|
|
var _dismissKeyboard = _interopRequireDefault(require_dismissKeyboard());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _mergeRefs = _interopRequireDefault(require_mergeRefs());
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var _ScrollViewBase = _interopRequireDefault(require_ScrollViewBase());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _TextInputState = _interopRequireDefault(require_TextInputState());
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _react = _interopRequireDefault(require("react"));
|
|
var _warning = _interopRequireDefault(require_warning());
|
|
var _excluded = ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "forwardedRef", "keyboardDismissMode", "onScroll", "centerContent"];
|
|
var emptyObject = {};
|
|
var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
|
|
var ScrollView3 = class extends _react.default.Component {
|
|
static {
|
|
__name(this, "ScrollView");
|
|
}
|
|
constructor() {
|
|
super(...arguments);
|
|
this._scrollNodeRef = null;
|
|
this._innerViewRef = null;
|
|
this.isTouching = false;
|
|
this.lastMomentumScrollBeginTime = 0;
|
|
this.lastMomentumScrollEndTime = 0;
|
|
this.observedScrollSinceBecomingResponder = false;
|
|
this.becameResponderWhileAnimating = false;
|
|
this.scrollResponderHandleScrollShouldSetResponder = () => {
|
|
return this.isTouching;
|
|
};
|
|
this.scrollResponderHandleStartShouldSetResponderCapture = (e) => {
|
|
return this.scrollResponderIsAnimating();
|
|
};
|
|
this.scrollResponderHandleTerminationRequest = () => {
|
|
return !this.observedScrollSinceBecomingResponder;
|
|
};
|
|
this.scrollResponderHandleTouchEnd = (e) => {
|
|
var nativeEvent = e.nativeEvent;
|
|
this.isTouching = nativeEvent.touches.length !== 0;
|
|
this.props.onTouchEnd && this.props.onTouchEnd(e);
|
|
};
|
|
this.scrollResponderHandleResponderRelease = (e) => {
|
|
this.props.onResponderRelease && this.props.onResponderRelease(e);
|
|
var currentlyFocusedTextInput = _TextInputState.default.currentlyFocusedField();
|
|
if (!this.props.keyboardShouldPersistTaps && currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput && !this.observedScrollSinceBecomingResponder && !this.becameResponderWhileAnimating) {
|
|
this.props.onScrollResponderKeyboardDismissed && this.props.onScrollResponderKeyboardDismissed(e);
|
|
_TextInputState.default.blurTextInput(currentlyFocusedTextInput);
|
|
}
|
|
};
|
|
this.scrollResponderHandleScroll = (e) => {
|
|
this.observedScrollSinceBecomingResponder = true;
|
|
this.props.onScroll && this.props.onScroll(e);
|
|
};
|
|
this.scrollResponderHandleResponderGrant = (e) => {
|
|
this.observedScrollSinceBecomingResponder = false;
|
|
this.props.onResponderGrant && this.props.onResponderGrant(e);
|
|
this.becameResponderWhileAnimating = this.scrollResponderIsAnimating();
|
|
};
|
|
this.scrollResponderHandleScrollBeginDrag = (e) => {
|
|
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
|
|
};
|
|
this.scrollResponderHandleScrollEndDrag = (e) => {
|
|
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
|
|
};
|
|
this.scrollResponderHandleMomentumScrollBegin = (e) => {
|
|
this.lastMomentumScrollBeginTime = Date.now();
|
|
this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);
|
|
};
|
|
this.scrollResponderHandleMomentumScrollEnd = (e) => {
|
|
this.lastMomentumScrollEndTime = Date.now();
|
|
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);
|
|
};
|
|
this.scrollResponderHandleTouchStart = (e) => {
|
|
this.isTouching = true;
|
|
this.props.onTouchStart && this.props.onTouchStart(e);
|
|
};
|
|
this.scrollResponderHandleTouchMove = (e) => {
|
|
this.props.onTouchMove && this.props.onTouchMove(e);
|
|
};
|
|
this.scrollResponderIsAnimating = () => {
|
|
var now = Date.now();
|
|
var timeSinceLastMomentumScrollEnd = now - this.lastMomentumScrollEndTime;
|
|
var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || this.lastMomentumScrollEndTime < this.lastMomentumScrollBeginTime;
|
|
return isAnimating;
|
|
};
|
|
this.scrollResponderScrollTo = (x, y, animated) => {
|
|
if (typeof x === "number") {
|
|
console.warn("`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.");
|
|
} else {
|
|
var _ref = x || emptyObject;
|
|
x = _ref.x;
|
|
y = _ref.y;
|
|
animated = _ref.animated;
|
|
}
|
|
var node = this.getScrollableNode();
|
|
var left = x || 0;
|
|
var top = y || 0;
|
|
if (node != null) {
|
|
if (typeof node.scroll === "function") {
|
|
node.scroll({
|
|
top,
|
|
left,
|
|
behavior: !animated ? "auto" : "smooth"
|
|
});
|
|
} else {
|
|
node.scrollLeft = left;
|
|
node.scrollTop = top;
|
|
}
|
|
}
|
|
};
|
|
this.scrollResponderZoomTo = (rect, animated) => {
|
|
if (_Platform.default.OS !== "ios") {
|
|
(0, _invariant.default)("zoomToRect is not implemented");
|
|
}
|
|
};
|
|
this.scrollResponderScrollNativeHandleToKeyboard = (nodeHandle, additionalOffset, preventNegativeScrollOffset) => {
|
|
this.additionalScrollOffset = additionalOffset || 0;
|
|
this.preventNegativeScrollOffset = !!preventNegativeScrollOffset;
|
|
_UIManager.default.measureLayout(nodeHandle, this.getInnerViewNode(), this.scrollResponderTextInputFocusError, this.scrollResponderInputMeasureAndScrollToKeyboard);
|
|
};
|
|
this.scrollResponderInputMeasureAndScrollToKeyboard = (left, top, width, height) => {
|
|
var keyboardScreenY = _Dimensions.default.get("window").height;
|
|
if (this.keyboardWillOpenTo) {
|
|
keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY;
|
|
}
|
|
var scrollOffsetY = top - keyboardScreenY + height + this.additionalScrollOffset;
|
|
if (this.preventNegativeScrollOffset) {
|
|
scrollOffsetY = Math.max(0, scrollOffsetY);
|
|
}
|
|
this.scrollResponderScrollTo({
|
|
x: 0,
|
|
y: scrollOffsetY,
|
|
animated: true
|
|
});
|
|
this.additionalOffset = 0;
|
|
this.preventNegativeScrollOffset = false;
|
|
};
|
|
this.scrollResponderKeyboardWillShow = (e) => {
|
|
this.keyboardWillOpenTo = e;
|
|
this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);
|
|
};
|
|
this.scrollResponderKeyboardWillHide = (e) => {
|
|
this.keyboardWillOpenTo = null;
|
|
this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);
|
|
};
|
|
this.scrollResponderKeyboardDidShow = (e) => {
|
|
if (e) {
|
|
this.keyboardWillOpenTo = e;
|
|
}
|
|
this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e);
|
|
};
|
|
this.scrollResponderKeyboardDidHide = (e) => {
|
|
this.keyboardWillOpenTo = null;
|
|
this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);
|
|
};
|
|
this.flashScrollIndicators = () => {
|
|
this.scrollResponderFlashScrollIndicators();
|
|
};
|
|
this.getScrollResponder = () => {
|
|
return this;
|
|
};
|
|
this.getScrollableNode = () => {
|
|
return this._scrollNodeRef;
|
|
};
|
|
this.getInnerViewRef = () => {
|
|
return this._innerViewRef;
|
|
};
|
|
this.getInnerViewNode = () => {
|
|
return this._innerViewRef;
|
|
};
|
|
this.getNativeScrollRef = () => {
|
|
return this._scrollNodeRef;
|
|
};
|
|
this.scrollTo = (y, x, animated) => {
|
|
if (typeof y === "number") {
|
|
console.warn("`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.");
|
|
} else {
|
|
var _ref2 = y || emptyObject;
|
|
x = _ref2.x;
|
|
y = _ref2.y;
|
|
animated = _ref2.animated;
|
|
}
|
|
this.scrollResponderScrollTo({
|
|
x: x || 0,
|
|
y: y || 0,
|
|
animated: animated !== false
|
|
});
|
|
};
|
|
this.scrollToEnd = (options) => {
|
|
var animated = (options && options.animated) !== false;
|
|
var horizontal = this.props.horizontal;
|
|
var scrollResponderNode = this.getScrollableNode();
|
|
var x = horizontal ? scrollResponderNode.scrollWidth : 0;
|
|
var y = horizontal ? 0 : scrollResponderNode.scrollHeight;
|
|
this.scrollResponderScrollTo({
|
|
x,
|
|
y,
|
|
animated
|
|
});
|
|
};
|
|
this._handleContentOnLayout = (e) => {
|
|
var _e$nativeEvent$layout = e.nativeEvent.layout, width = _e$nativeEvent$layout.width, height = _e$nativeEvent$layout.height;
|
|
this.props.onContentSizeChange(width, height);
|
|
};
|
|
this._handleScroll = (e) => {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
if (this.props.onScroll && this.props.scrollEventThrottle == null) {
|
|
console.log("You specified `onScroll` on a <ScrollView> but not `scrollEventThrottle`. You will only receive one event. Using `16` you get all the events but be aware that it may cause frame drops, use a bigger number if you don't need as much precision.");
|
|
}
|
|
}
|
|
if (this.props.keyboardDismissMode === "on-drag") {
|
|
(0, _dismissKeyboard.default)();
|
|
}
|
|
this.scrollResponderHandleScroll(e);
|
|
};
|
|
this._setInnerViewRef = (node) => {
|
|
this._innerViewRef = node;
|
|
};
|
|
this._setScrollNodeRef = (node) => {
|
|
this._scrollNodeRef = node;
|
|
if (node != null) {
|
|
node.getScrollResponder = this.getScrollResponder;
|
|
node.getInnerViewNode = this.getInnerViewNode;
|
|
node.getInnerViewRef = this.getInnerViewRef;
|
|
node.getNativeScrollRef = this.getNativeScrollRef;
|
|
node.getScrollableNode = this.getScrollableNode;
|
|
node.scrollTo = this.scrollTo;
|
|
node.scrollToEnd = this.scrollToEnd;
|
|
node.flashScrollIndicators = this.flashScrollIndicators;
|
|
node.scrollResponderZoomTo = this.scrollResponderZoomTo;
|
|
node.scrollResponderScrollNativeHandleToKeyboard = this.scrollResponderScrollNativeHandleToKeyboard;
|
|
}
|
|
var ref = (0, _mergeRefs.default)(this.props.forwardedRef);
|
|
ref(node);
|
|
};
|
|
}
|
|
/**
|
|
* ------------------------------------------------------
|
|
* START SCROLLRESPONDER
|
|
* ------------------------------------------------------
|
|
*/
|
|
// Reset to false every time becomes responder. This is used to:
|
|
// - Determine if the scroll view has been scrolled and therefore should
|
|
// refuse to give up its responder lock.
|
|
// - Determine if releasing should dismiss the keyboard when we are in
|
|
// tap-to-dismiss mode (!this.props.keyboardShouldPersistTaps).
|
|
/**
|
|
* Invoke this from an `onScroll` event.
|
|
*/
|
|
/**
|
|
* Merely touch starting is not sufficient for a scroll view to become the
|
|
* responder. Being the "responder" means that the very next touch move/end
|
|
* event will result in an action/movement.
|
|
*
|
|
* Invoke this from an `onStartShouldSetResponder` event.
|
|
*
|
|
* `onStartShouldSetResponder` is used when the next move/end will trigger
|
|
* some UI movement/action, but when you want to yield priority to views
|
|
* nested inside of the view.
|
|
*
|
|
* There may be some cases where scroll views actually should return `true`
|
|
* from `onStartShouldSetResponder`: Any time we are detecting a standard tap
|
|
* that gives priority to nested views.
|
|
*
|
|
* - If a single tap on the scroll view triggers an action such as
|
|
* recentering a map style view yet wants to give priority to interaction
|
|
* views inside (such as dropped pins or labels), then we would return true
|
|
* from this method when there is a single touch.
|
|
*
|
|
* - Similar to the previous case, if a two finger "tap" should trigger a
|
|
* zoom, we would check the `touches` count, and if `>= 2`, we would return
|
|
* true.
|
|
*
|
|
*/
|
|
scrollResponderHandleStartShouldSetResponder() {
|
|
return false;
|
|
}
|
|
/**
|
|
* There are times when the scroll view wants to become the responder
|
|
* (meaning respond to the next immediate `touchStart/touchEnd`), in a way
|
|
* that *doesn't* give priority to nested views (hence the capture phase):
|
|
*
|
|
* - Currently animating.
|
|
* - Tapping anywhere that is not the focused input, while the keyboard is
|
|
* up (which should dismiss the keyboard).
|
|
*
|
|
* Invoke this from an `onStartShouldSetResponderCapture` event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onResponderReject` event.
|
|
*
|
|
* Some other element is not yielding its role as responder. Normally, we'd
|
|
* just disable the `UIScrollView`, but a touch has already began on it, the
|
|
* `UIScrollView` will not accept being disabled after that. The easiest
|
|
* solution for now is to accept the limitation of disallowing this
|
|
* altogether. To improve this, find a way to disable the `UIScrollView` after
|
|
* a touch has already started.
|
|
*/
|
|
scrollResponderHandleResponderReject() {
|
|
(0, _warning.default)(false, "ScrollView doesn't take rejection well - scrolls anyway");
|
|
}
|
|
/**
|
|
* We will allow the scroll view to give up its lock iff it acquired the lock
|
|
* during an animation. This is a very useful default that happens to satisfy
|
|
* many common user experiences.
|
|
*
|
|
* - Stop a scroll on the left edge, then turn that into an outer view's
|
|
* backswipe.
|
|
* - Stop a scroll mid-bounce at the top, continue pulling to have the outer
|
|
* view dismiss.
|
|
* - However, without catching the scroll view mid-bounce (while it is
|
|
* motionless), if you drag far enough for the scroll view to become
|
|
* responder (and therefore drag the scroll view a bit), any backswipe
|
|
* navigation of a swipe gesture higher in the view hierarchy, should be
|
|
* rejected.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onTouchEnd` event.
|
|
*
|
|
* @param {SyntheticEvent} e Event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onResponderRelease` event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onResponderGrant` event.
|
|
*/
|
|
/**
|
|
* Unfortunately, `onScrollBeginDrag` also fires when *stopping* the scroll
|
|
* animation, and there's not an easy way to distinguish a drag vs. stopping
|
|
* momentum.
|
|
*
|
|
* Invoke this from an `onScrollBeginDrag` event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onScrollEndDrag` event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onMomentumScrollBegin` event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onMomentumScrollEnd` event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onTouchStart` event.
|
|
*
|
|
* Since we know that the `SimpleEventPlugin` occurs later in the plugin
|
|
* order, after `ResponderEventPlugin`, we can detect that we were *not*
|
|
* permitted to be the responder (presumably because a contained view became
|
|
* responder). The `onResponderReject` won't fire in that case - it only
|
|
* fires when a *current* responder rejects our request.
|
|
*
|
|
* @param {SyntheticEvent} e Touch Start event.
|
|
*/
|
|
/**
|
|
* Invoke this from an `onTouchMove` event.
|
|
*
|
|
* Since we know that the `SimpleEventPlugin` occurs later in the plugin
|
|
* order, after `ResponderEventPlugin`, we can detect that we were *not*
|
|
* permitted to be the responder (presumably because a contained view became
|
|
* responder). The `onResponderReject` won't fire in that case - it only
|
|
* fires when a *current* responder rejects our request.
|
|
*
|
|
* @param {SyntheticEvent} e Touch Start event.
|
|
*/
|
|
/**
|
|
* A helper function for this class that lets us quickly determine if the
|
|
* view is currently animating. This is particularly useful to know when
|
|
* a touch has just started or ended.
|
|
*/
|
|
/**
|
|
* A helper function to scroll to a specific point in the scrollview.
|
|
* This is currently used to help focus on child textviews, but can also
|
|
* be used to quickly scroll to any element we want to focus. Syntax:
|
|
*
|
|
* scrollResponderScrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})
|
|
*
|
|
* Note: The weird argument signature is due to the fact that, for historical reasons,
|
|
* the function also accepts separate arguments as as alternative to the options object.
|
|
* This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.
|
|
*/
|
|
/**
|
|
* A helper function to zoom to a specific rect in the scrollview. The argument has the shape
|
|
* {x: number; y: number; width: number; height: number; animated: boolean = true}
|
|
*
|
|
* @platform ios
|
|
*/
|
|
/**
|
|
* Displays the scroll indicators momentarily.
|
|
*/
|
|
scrollResponderFlashScrollIndicators() {
|
|
}
|
|
/**
|
|
* This method should be used as the callback to onFocus in a TextInputs'
|
|
* parent view. Note that any module using this mixin needs to return
|
|
* the parent view's ref in getScrollViewRef() in order to use this method.
|
|
* @param {any} nodeHandle The TextInput node handle
|
|
* @param {number} additionalOffset The scroll view's top "contentInset".
|
|
* Default is 0.
|
|
* @param {bool} preventNegativeScrolling Whether to allow pulling the content
|
|
* down to make it meet the keyboard's top. Default is false.
|
|
*/
|
|
/**
|
|
* The calculations performed here assume the scroll view takes up the entire
|
|
* screen - even if has some content inset. We then measure the offsets of the
|
|
* keyboard, and compensate both for the scroll view's "contentInset".
|
|
*
|
|
* @param {number} left Position of input w.r.t. table view.
|
|
* @param {number} top Position of input w.r.t. table view.
|
|
* @param {number} width Width of the text input.
|
|
* @param {number} height Height of the text input.
|
|
*/
|
|
scrollResponderTextInputFocusError(e) {
|
|
console.error("Error measuring text field: ", e);
|
|
}
|
|
/**
|
|
* Warning, this may be called several times for a single keyboard opening.
|
|
* It's best to store the information in this method and then take any action
|
|
* at a later point (either in `keyboardDidShow` or other).
|
|
*
|
|
* Here's the order that events occur in:
|
|
* - focus
|
|
* - willShow {startCoordinates, endCoordinates} several times
|
|
* - didShow several times
|
|
* - blur
|
|
* - willHide {startCoordinates, endCoordinates} several times
|
|
* - didHide several times
|
|
*
|
|
* The `ScrollResponder` providesModule callbacks for each of these events.
|
|
* Even though any user could have easily listened to keyboard events
|
|
* themselves, using these `props` callbacks ensures that ordering of events
|
|
* is consistent - and not dependent on the order that the keyboard events are
|
|
* subscribed to. This matters when telling the scroll view to scroll to where
|
|
* the keyboard is headed - the scroll responder better have been notified of
|
|
* the keyboard destination before being instructed to scroll to where the
|
|
* keyboard will be. Stick to the `ScrollResponder` callbacks, and everything
|
|
* will work.
|
|
*
|
|
* WARNING: These callbacks will fire even if a keyboard is displayed in a
|
|
* different navigation pane. Filter out the events to determine if they are
|
|
* relevant to you. (For example, only if you receive these callbacks after
|
|
* you had explicitly focused a node etc).
|
|
*/
|
|
/**
|
|
* ------------------------------------------------------
|
|
* END SCROLLRESPONDER
|
|
* ------------------------------------------------------
|
|
*/
|
|
/**
|
|
* Returns a reference to the underlying scroll responder, which supports
|
|
* operations like `scrollTo`. All ScrollView-like components should
|
|
* implement this method so that they can be composed while providing access
|
|
* to the underlying scroll responder's methods.
|
|
*/
|
|
/**
|
|
* Scrolls to a given x, y offset, either immediately or with a smooth animation.
|
|
* Syntax:
|
|
*
|
|
* scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})
|
|
*
|
|
* Note: The weird argument signature is due to the fact that, for historical reasons,
|
|
* the function also accepts separate arguments as as alternative to the options object.
|
|
* This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.
|
|
*/
|
|
/**
|
|
* If this is a vertical ScrollView scrolls to the bottom.
|
|
* If this is a horizontal ScrollView scrolls to the right.
|
|
*
|
|
* Use `scrollToEnd({ animated: true })` for smooth animated scrolling,
|
|
* `scrollToEnd({ animated: false })` for immediate scrolling.
|
|
* If no options are passed, `animated` defaults to true.
|
|
*/
|
|
render() {
|
|
var _this$props = this.props, contentContainerStyle = _this$props.contentContainerStyle, horizontal = _this$props.horizontal, onContentSizeChange = _this$props.onContentSizeChange, refreshControl = _this$props.refreshControl, stickyHeaderIndices = _this$props.stickyHeaderIndices, pagingEnabled = _this$props.pagingEnabled, forwardedRef = _this$props.forwardedRef, keyboardDismissMode = _this$props.keyboardDismissMode, onScroll = _this$props.onScroll, centerContent = _this$props.centerContent, other = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
|
|
if (process.env.NODE_ENV !== "production" && this.props.style) {
|
|
var style = _StyleSheet.default.flatten(this.props.style);
|
|
var childLayoutProps = ["alignItems", "justifyContent"].filter((prop) => style && style[prop] !== void 0);
|
|
(0, _invariant.default)(childLayoutProps.length === 0, "ScrollView child layout (" + JSON.stringify(childLayoutProps) + ") must be applied through the contentContainerStyle prop.");
|
|
}
|
|
var contentSizeChangeProps = {};
|
|
if (onContentSizeChange) {
|
|
contentSizeChangeProps = {
|
|
onLayout: this._handleContentOnLayout
|
|
};
|
|
}
|
|
var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
|
|
var children = hasStickyHeaderIndices || pagingEnabled ? _react.default.Children.map(this.props.children, (child, i) => {
|
|
var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
|
|
if (child != null && (isSticky || pagingEnabled)) {
|
|
return /* @__PURE__ */ _react.default.createElement(_View.default, {
|
|
style: [isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild]
|
|
}, child);
|
|
} else {
|
|
return child;
|
|
}
|
|
}) : this.props.children;
|
|
var contentContainer = /* @__PURE__ */ _react.default.createElement(_View.default, (0, _extends2.default)({}, contentSizeChangeProps, {
|
|
children,
|
|
collapsable: false,
|
|
ref: this._setInnerViewRef,
|
|
style: [horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle]
|
|
}));
|
|
var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;
|
|
var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;
|
|
var props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, other), {}, {
|
|
style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],
|
|
onTouchStart: this.scrollResponderHandleTouchStart,
|
|
onTouchMove: this.scrollResponderHandleTouchMove,
|
|
onTouchEnd: this.scrollResponderHandleTouchEnd,
|
|
onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,
|
|
onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,
|
|
onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,
|
|
onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,
|
|
onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder,
|
|
onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture,
|
|
onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder,
|
|
onScroll: this._handleScroll,
|
|
onResponderGrant: this.scrollResponderHandleResponderGrant,
|
|
onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,
|
|
onResponderTerminate: this.scrollResponderHandleTerminate,
|
|
onResponderRelease: this.scrollResponderHandleResponderRelease,
|
|
onResponderReject: this.scrollResponderHandleResponderReject
|
|
});
|
|
var ScrollViewClass = _ScrollViewBase.default;
|
|
(0, _invariant.default)(ScrollViewClass !== void 0, "ScrollViewClass must not be undefined");
|
|
var scrollView = /* @__PURE__ */ _react.default.createElement(ScrollViewClass, (0, _extends2.default)({}, props, {
|
|
ref: this._setScrollNodeRef
|
|
}), contentContainer);
|
|
if (refreshControl) {
|
|
return /* @__PURE__ */ _react.default.cloneElement(refreshControl, {
|
|
style: props.style
|
|
}, scrollView);
|
|
}
|
|
return scrollView;
|
|
}
|
|
};
|
|
var commonStyle = {
|
|
flexGrow: 1,
|
|
flexShrink: 1,
|
|
// Enable hardware compositing in modern browsers.
|
|
// Creates a new layer with its own backing surface that can significantly
|
|
// improve scroll performance.
|
|
transform: "translateZ(0)",
|
|
// iOS native scrolling
|
|
WebkitOverflowScrolling: "touch"
|
|
};
|
|
var styles = _StyleSheet.default.create({
|
|
baseVertical: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, commonStyle), {}, {
|
|
flexDirection: "column",
|
|
overflowX: "hidden",
|
|
overflowY: "auto"
|
|
}),
|
|
baseHorizontal: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, commonStyle), {}, {
|
|
flexDirection: "row",
|
|
overflowX: "auto",
|
|
overflowY: "hidden"
|
|
}),
|
|
contentContainerHorizontal: {
|
|
flexDirection: "row"
|
|
},
|
|
contentContainerCenterContent: {
|
|
justifyContent: "center",
|
|
flexGrow: 1
|
|
},
|
|
stickyHeader: {
|
|
position: "sticky",
|
|
top: 0,
|
|
zIndex: 10
|
|
},
|
|
pagingEnabledHorizontal: {
|
|
scrollSnapType: "x mandatory"
|
|
},
|
|
pagingEnabledVertical: {
|
|
scrollSnapType: "y mandatory"
|
|
},
|
|
pagingEnabledChild: {
|
|
scrollSnapAlign: "start"
|
|
}
|
|
});
|
|
var ForwardedScrollView = /* @__PURE__ */ _react.default.forwardRef((props, forwardedRef) => {
|
|
return /* @__PURE__ */ _react.default.createElement(ScrollView3, (0, _extends2.default)({}, props, {
|
|
forwardedRef
|
|
}));
|
|
});
|
|
ForwardedScrollView.displayName = "ScrollView";
|
|
var _default = exports2.default = ForwardedScrollView;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/InteractionManager/TaskQueue.js
|
|
var require_TaskQueue = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/InteractionManager/TaskQueue.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var TaskQueue = class {
|
|
static {
|
|
__name(this, "TaskQueue");
|
|
}
|
|
constructor(_ref) {
|
|
var onMoreTasks = _ref.onMoreTasks;
|
|
this._onMoreTasks = onMoreTasks;
|
|
this._queueStack = [{
|
|
tasks: [],
|
|
popable: true
|
|
}];
|
|
}
|
|
enqueue(task) {
|
|
this._getCurrentQueue().push(task);
|
|
}
|
|
enqueueTasks(tasks) {
|
|
tasks.forEach((task) => this.enqueue(task));
|
|
}
|
|
cancelTasks(tasksToCancel) {
|
|
this._queueStack = this._queueStack.map((queue) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, queue), {}, {
|
|
tasks: queue.tasks.filter((task) => tasksToCancel.indexOf(task) === -1)
|
|
})).filter((queue, idx) => queue.tasks.length > 0 || idx === 0);
|
|
}
|
|
hasTasksToProcess() {
|
|
return this._getCurrentQueue().length > 0;
|
|
}
|
|
/**
|
|
* Executes the next task in the queue.
|
|
*/
|
|
processNext() {
|
|
var queue = this._getCurrentQueue();
|
|
if (queue.length) {
|
|
var task = queue.shift();
|
|
try {
|
|
if (typeof task === "object" && task.gen) {
|
|
this._genPromise(task);
|
|
} else if (typeof task === "object" && task.run) {
|
|
task.run();
|
|
} else {
|
|
(0, _invariant.default)(typeof task === "function", "Expected Function, SimpleTask, or PromiseTask, but got:\n" + JSON.stringify(task, null, 2));
|
|
task();
|
|
}
|
|
} catch (e) {
|
|
e.message = "TaskQueue: Error with task " + (task.name || "") + ": " + e.message;
|
|
throw e;
|
|
}
|
|
}
|
|
}
|
|
_getCurrentQueue() {
|
|
var stackIdx = this._queueStack.length - 1;
|
|
var queue = this._queueStack[stackIdx];
|
|
if (queue.popable && queue.tasks.length === 0 && stackIdx > 0) {
|
|
this._queueStack.pop();
|
|
return this._getCurrentQueue();
|
|
} else {
|
|
return queue.tasks;
|
|
}
|
|
}
|
|
_genPromise(task) {
|
|
var length = this._queueStack.push({
|
|
tasks: [],
|
|
popable: false
|
|
});
|
|
var stackIdx = length - 1;
|
|
var stackItem = this._queueStack[stackIdx];
|
|
task.gen().then(() => {
|
|
stackItem.popable = true;
|
|
this.hasTasksToProcess() && this._onMoreTasks();
|
|
}).catch((ex) => {
|
|
setTimeout(() => {
|
|
ex.message = "TaskQueue: Error resolving Promise in task " + task.name + ": " + ex.message;
|
|
throw ex;
|
|
}, 0);
|
|
});
|
|
}
|
|
};
|
|
var _default = exports2.default = TaskQueue;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/vendor/emitter/EventEmitter.js
|
|
var require_EventEmitter = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/vendor/emitter/EventEmitter.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var EventEmitter = class {
|
|
static {
|
|
__name(this, "EventEmitter");
|
|
}
|
|
constructor() {
|
|
this._registry = {};
|
|
}
|
|
/**
|
|
* Registers a listener that is called when the supplied event is emitted.
|
|
* Returns a subscription that has a `remove` method to undo registration.
|
|
*/
|
|
addListener(eventType, listener, context2) {
|
|
var registrations = allocate(this._registry, eventType);
|
|
var registration = {
|
|
context: context2,
|
|
listener,
|
|
remove() {
|
|
registrations.delete(registration);
|
|
}
|
|
};
|
|
registrations.add(registration);
|
|
return registration;
|
|
}
|
|
/**
|
|
* Emits the supplied event. Additional arguments supplied to `emit` will be
|
|
* passed through to each of the registered listeners.
|
|
*
|
|
* If a listener modifies the listeners registered for the same event, those
|
|
* changes will not be reflected in the current invocation of `emit`.
|
|
*/
|
|
emit(eventType) {
|
|
var registrations = this._registry[eventType];
|
|
if (registrations != null) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
for (var _i = 0, _arr = [...registrations]; _i < _arr.length; _i++) {
|
|
var registration = _arr[_i];
|
|
registration.listener.apply(registration.context, args);
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Removes all registered listeners.
|
|
*/
|
|
removeAllListeners(eventType) {
|
|
if (eventType == null) {
|
|
this._registry = {};
|
|
} else {
|
|
delete this._registry[eventType];
|
|
}
|
|
}
|
|
/**
|
|
* Returns the number of registered listeners for the supplied event.
|
|
*/
|
|
listenerCount(eventType) {
|
|
var registrations = this._registry[eventType];
|
|
return registrations == null ? 0 : registrations.size;
|
|
}
|
|
};
|
|
exports2.default = EventEmitter;
|
|
function allocate(registry, eventType) {
|
|
var registrations = registry[eventType];
|
|
if (registrations == null) {
|
|
registrations = /* @__PURE__ */ new Set();
|
|
registry[eventType] = registrations;
|
|
}
|
|
return registrations;
|
|
}
|
|
__name(allocate, "allocate");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/requestIdleCallback/index.js
|
|
var require_requestIdleCallback = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/requestIdleCallback/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = exports2.cancelIdleCallback = void 0;
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var _requestIdleCallback = /* @__PURE__ */ __name(function _requestIdleCallback2(cb, options) {
|
|
return setTimeout(() => {
|
|
var start = Date.now();
|
|
cb({
|
|
didTimeout: false,
|
|
timeRemaining() {
|
|
return Math.max(0, 50 - (Date.now() - start));
|
|
}
|
|
});
|
|
}, 1);
|
|
}, "_requestIdleCallback");
|
|
var _cancelIdleCallback = /* @__PURE__ */ __name(function _cancelIdleCallback2(id) {
|
|
clearTimeout(id);
|
|
}, "_cancelIdleCallback");
|
|
var isSupported = _canUseDom.default && typeof window.requestIdleCallback !== "undefined";
|
|
var requestIdleCallback2 = isSupported ? window.requestIdleCallback : _requestIdleCallback;
|
|
var cancelIdleCallback = exports2.cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;
|
|
var _default = exports2.default = requestIdleCallback2;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/InteractionManager/index.js
|
|
var require_InteractionManager = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/InteractionManager/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _TaskQueue = _interopRequireDefault(require_TaskQueue());
|
|
var _EventEmitter = _interopRequireDefault(require_EventEmitter());
|
|
var _requestIdleCallback = _interopRequireDefault(require_requestIdleCallback());
|
|
var _emitter = new _EventEmitter.default();
|
|
var InteractionManager = {
|
|
Events: {
|
|
interactionStart: "interactionStart",
|
|
interactionComplete: "interactionComplete"
|
|
},
|
|
/**
|
|
* Schedule a function to run after all interactions have completed.
|
|
*/
|
|
runAfterInteractions(task) {
|
|
var tasks = [];
|
|
var promise = new Promise((resolve) => {
|
|
_scheduleUpdate();
|
|
if (task) {
|
|
tasks.push(task);
|
|
}
|
|
tasks.push({
|
|
run: resolve,
|
|
name: "resolve " + (task && task.name || "?")
|
|
});
|
|
_taskQueue.enqueueTasks(tasks);
|
|
});
|
|
return {
|
|
then: promise.then.bind(promise),
|
|
done: promise.then.bind(promise),
|
|
cancel: /* @__PURE__ */ __name(() => {
|
|
_taskQueue.cancelTasks(tasks);
|
|
}, "cancel")
|
|
};
|
|
},
|
|
/**
|
|
* Notify manager that an interaction has started.
|
|
*/
|
|
createInteractionHandle() {
|
|
_scheduleUpdate();
|
|
var handle = ++_inc;
|
|
_addInteractionSet.add(handle);
|
|
return handle;
|
|
},
|
|
/**
|
|
* Notify manager that an interaction has completed.
|
|
*/
|
|
clearInteractionHandle(handle) {
|
|
(0, _invariant.default)(!!handle, "Must provide a handle to clear.");
|
|
_scheduleUpdate();
|
|
_addInteractionSet.delete(handle);
|
|
_deleteInteractionSet.add(handle);
|
|
},
|
|
addListener: _emitter.addListener.bind(_emitter),
|
|
/**
|
|
*
|
|
* @param deadline
|
|
*/
|
|
setDeadline(deadline) {
|
|
_deadline = deadline;
|
|
}
|
|
};
|
|
var _interactionSet = /* @__PURE__ */ new Set();
|
|
var _addInteractionSet = /* @__PURE__ */ new Set();
|
|
var _deleteInteractionSet = /* @__PURE__ */ new Set();
|
|
var _taskQueue = new _TaskQueue.default({
|
|
onMoreTasks: _scheduleUpdate
|
|
});
|
|
var _nextUpdateHandle = 0;
|
|
var _inc = 0;
|
|
var _deadline = -1;
|
|
function _scheduleUpdate() {
|
|
if (!_nextUpdateHandle) {
|
|
if (_deadline > 0) {
|
|
_nextUpdateHandle = setTimeout(_processUpdate);
|
|
} else {
|
|
_nextUpdateHandle = (0, _requestIdleCallback.default)(_processUpdate);
|
|
}
|
|
}
|
|
}
|
|
__name(_scheduleUpdate, "_scheduleUpdate");
|
|
function _processUpdate() {
|
|
_nextUpdateHandle = 0;
|
|
var interactionCount = _interactionSet.size;
|
|
_addInteractionSet.forEach((handle) => _interactionSet.add(handle));
|
|
_deleteInteractionSet.forEach((handle) => _interactionSet.delete(handle));
|
|
var nextInteractionCount = _interactionSet.size;
|
|
if (interactionCount !== 0 && nextInteractionCount === 0) {
|
|
_emitter.emit(InteractionManager.Events.interactionComplete);
|
|
} else if (interactionCount === 0 && nextInteractionCount !== 0) {
|
|
_emitter.emit(InteractionManager.Events.interactionStart);
|
|
}
|
|
if (nextInteractionCount === 0) {
|
|
var begin = Date.now();
|
|
while (_taskQueue.hasTasksToProcess()) {
|
|
_taskQueue.processNext();
|
|
if (_deadline > 0 && Date.now() - begin >= _deadline) {
|
|
_scheduleUpdate();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
_addInteractionSet.clear();
|
|
_deleteInteractionSet.clear();
|
|
}
|
|
__name(_processUpdate, "_processUpdate");
|
|
var _default = exports2.default = InteractionManager;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Batchinator/index.js
|
|
var require_Batchinator = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Batchinator/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _InteractionManager = _interopRequireDefault(require_InteractionManager());
|
|
var Batchinator = class {
|
|
static {
|
|
__name(this, "Batchinator");
|
|
}
|
|
constructor(callback, delayMS) {
|
|
this._delay = delayMS;
|
|
this._callback = callback;
|
|
}
|
|
/*
|
|
* Cleanup any pending tasks.
|
|
*
|
|
* By default, if there is a pending task the callback is run immediately. Set the option abort to
|
|
* true to not call the callback if it was pending.
|
|
*/
|
|
dispose(options) {
|
|
if (options === void 0) {
|
|
options = {
|
|
abort: false
|
|
};
|
|
}
|
|
if (this._taskHandle) {
|
|
this._taskHandle.cancel();
|
|
if (!options.abort) {
|
|
this._callback();
|
|
}
|
|
this._taskHandle = null;
|
|
}
|
|
}
|
|
schedule() {
|
|
if (this._taskHandle) {
|
|
return;
|
|
}
|
|
var timeoutHandle = setTimeout(() => {
|
|
this._taskHandle = _InteractionManager.default.runAfterInteractions(() => {
|
|
this._taskHandle = null;
|
|
this._callback();
|
|
});
|
|
}, this._delay);
|
|
this._taskHandle = {
|
|
cancel: /* @__PURE__ */ __name(() => clearTimeout(timeoutHandle), "cancel")
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = Batchinator;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/clamp.js
|
|
var require_clamp = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/clamp.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
function clamp3(min2, value, max2) {
|
|
if (value < min2) {
|
|
return min2;
|
|
}
|
|
if (value > max2) {
|
|
return max2;
|
|
}
|
|
return value;
|
|
}
|
|
__name(clamp3, "clamp");
|
|
var _default = exports2.default = clamp3;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/infoLog/index.js
|
|
var require_infoLog = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/infoLog/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
function infoLog() {
|
|
return console.log(...arguments);
|
|
}
|
|
__name(infoLog, "infoLog");
|
|
var _default = exports2.default = infoLog;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js
|
|
var require_CellRenderMask = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.CellRenderMask = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var CellRenderMask = class {
|
|
static {
|
|
__name(this, "CellRenderMask");
|
|
}
|
|
constructor(numCells) {
|
|
(0, _invariant.default)(numCells >= 0, "CellRenderMask must contain a non-negative number os cells");
|
|
this._numCells = numCells;
|
|
if (numCells === 0) {
|
|
this._regions = [];
|
|
} else {
|
|
this._regions = [{
|
|
first: 0,
|
|
last: numCells - 1,
|
|
isSpacer: true
|
|
}];
|
|
}
|
|
}
|
|
enumerateRegions() {
|
|
return this._regions;
|
|
}
|
|
addCells(cells) {
|
|
(0, _invariant.default)(cells.first >= 0 && cells.first < this._numCells && cells.last >= -1 && cells.last < this._numCells && cells.last >= cells.first - 1, "CellRenderMask.addCells called with invalid cell range");
|
|
if (cells.last < cells.first) {
|
|
return;
|
|
}
|
|
var _this$_findRegion = this._findRegion(cells.first), firstIntersect = _this$_findRegion[0], firstIntersectIdx = _this$_findRegion[1];
|
|
var _this$_findRegion2 = this._findRegion(cells.last), lastIntersect = _this$_findRegion2[0], lastIntersectIdx = _this$_findRegion2[1];
|
|
if (firstIntersectIdx === lastIntersectIdx && !firstIntersect.isSpacer) {
|
|
return;
|
|
}
|
|
var newLeadRegion = [];
|
|
var newTailRegion = [];
|
|
var newMainRegion = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cells), {}, {
|
|
isSpacer: false
|
|
});
|
|
if (firstIntersect.first < newMainRegion.first) {
|
|
if (firstIntersect.isSpacer) {
|
|
newLeadRegion.push({
|
|
first: firstIntersect.first,
|
|
last: newMainRegion.first - 1,
|
|
isSpacer: true
|
|
});
|
|
} else {
|
|
newMainRegion.first = firstIntersect.first;
|
|
}
|
|
}
|
|
if (lastIntersect.last > newMainRegion.last) {
|
|
if (lastIntersect.isSpacer) {
|
|
newTailRegion.push({
|
|
first: newMainRegion.last + 1,
|
|
last: lastIntersect.last,
|
|
isSpacer: true
|
|
});
|
|
} else {
|
|
newMainRegion.last = lastIntersect.last;
|
|
}
|
|
}
|
|
var replacementRegions = [...newLeadRegion, newMainRegion, ...newTailRegion];
|
|
var numRegionsToDelete = lastIntersectIdx - firstIntersectIdx + 1;
|
|
this._regions.splice(firstIntersectIdx, numRegionsToDelete, ...replacementRegions);
|
|
}
|
|
numCells() {
|
|
return this._numCells;
|
|
}
|
|
equals(other) {
|
|
return this._numCells === other._numCells && this._regions.length === other._regions.length && this._regions.every((region, i) => region.first === other._regions[i].first && region.last === other._regions[i].last && region.isSpacer === other._regions[i].isSpacer);
|
|
}
|
|
_findRegion(cellIdx) {
|
|
var firstIdx = 0;
|
|
var lastIdx = this._regions.length - 1;
|
|
while (firstIdx <= lastIdx) {
|
|
var middleIdx = Math.floor((firstIdx + lastIdx) / 2);
|
|
var middleRegion = this._regions[middleIdx];
|
|
if (cellIdx >= middleRegion.first && cellIdx <= middleRegion.last) {
|
|
return [middleRegion, middleIdx];
|
|
} else if (cellIdx < middleRegion.first) {
|
|
lastIdx = middleIdx - 1;
|
|
} else if (cellIdx > middleRegion.last) {
|
|
firstIdx = middleIdx + 1;
|
|
}
|
|
}
|
|
(0, _invariant.default)(false, "A region was not found containing cellIdx " + cellIdx);
|
|
}
|
|
};
|
|
exports2.CellRenderMask = CellRenderMask;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js
|
|
var require_ChildListCollection = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require_createForOfIteratorHelperLoose());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var ChildListCollection = class {
|
|
static {
|
|
__name(this, "ChildListCollection");
|
|
}
|
|
constructor() {
|
|
this._cellKeyToChildren = /* @__PURE__ */ new Map();
|
|
this._childrenToCellKey = /* @__PURE__ */ new Map();
|
|
}
|
|
add(list, cellKey) {
|
|
var _this$_cellKeyToChild;
|
|
(0, _invariant.default)(!this._childrenToCellKey.has(list), "Trying to add already present child list");
|
|
var cellLists = (_this$_cellKeyToChild = this._cellKeyToChildren.get(cellKey)) !== null && _this$_cellKeyToChild !== void 0 ? _this$_cellKeyToChild : /* @__PURE__ */ new Set();
|
|
cellLists.add(list);
|
|
this._cellKeyToChildren.set(cellKey, cellLists);
|
|
this._childrenToCellKey.set(list, cellKey);
|
|
}
|
|
remove(list) {
|
|
var cellKey = this._childrenToCellKey.get(list);
|
|
(0, _invariant.default)(cellKey != null, "Trying to remove non-present child list");
|
|
this._childrenToCellKey.delete(list);
|
|
var cellLists = this._cellKeyToChildren.get(cellKey);
|
|
(0, _invariant.default)(cellLists, "_cellKeyToChildren should contain cellKey");
|
|
cellLists.delete(list);
|
|
if (cellLists.size === 0) {
|
|
this._cellKeyToChildren.delete(cellKey);
|
|
}
|
|
}
|
|
forEach(fn) {
|
|
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(this._cellKeyToChildren.values()), _step; !(_step = _iterator()).done; ) {
|
|
var listSet = _step.value;
|
|
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(listSet), _step2; !(_step2 = _iterator2()).done; ) {
|
|
var list = _step2.value;
|
|
fn(list);
|
|
}
|
|
}
|
|
}
|
|
forEachInCell(cellKey, fn) {
|
|
var _this$_cellKeyToChild2;
|
|
var listSet = (_this$_cellKeyToChild2 = this._cellKeyToChildren.get(cellKey)) !== null && _this$_cellKeyToChild2 !== void 0 ? _this$_cellKeyToChild2 : [];
|
|
for (var _iterator3 = (0, _createForOfIteratorHelperLoose2.default)(listSet), _step3; !(_step3 = _iterator3()).done; ) {
|
|
var list = _step3.value;
|
|
fn(list);
|
|
}
|
|
}
|
|
anyInCell(cellKey, fn) {
|
|
var _this$_cellKeyToChild3;
|
|
var listSet = (_this$_cellKeyToChild3 = this._cellKeyToChildren.get(cellKey)) !== null && _this$_cellKeyToChild3 !== void 0 ? _this$_cellKeyToChild3 : [];
|
|
for (var _iterator4 = (0, _createForOfIteratorHelperLoose2.default)(listSet), _step4; !(_step4 = _iterator4()).done; ) {
|
|
var list = _step4.value;
|
|
if (fn(list)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
size() {
|
|
return this._childrenToCellKey.size;
|
|
}
|
|
};
|
|
exports2.default = ChildListCollection;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/FillRateHelper/index.js
|
|
var require_FillRateHelper = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/FillRateHelper/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var Info = class {
|
|
static {
|
|
__name(this, "Info");
|
|
}
|
|
constructor() {
|
|
this.any_blank_count = 0;
|
|
this.any_blank_ms = 0;
|
|
this.any_blank_speed_sum = 0;
|
|
this.mostly_blank_count = 0;
|
|
this.mostly_blank_ms = 0;
|
|
this.pixels_blank = 0;
|
|
this.pixels_sampled = 0;
|
|
this.pixels_scrolled = 0;
|
|
this.total_time_spent = 0;
|
|
this.sample_count = 0;
|
|
}
|
|
};
|
|
var DEBUG = false;
|
|
var _listeners = [];
|
|
var _minSampleCount = 10;
|
|
var _sampleRate = DEBUG ? 1 : null;
|
|
var FillRateHelper = class {
|
|
static {
|
|
__name(this, "FillRateHelper");
|
|
}
|
|
static addListener(callback) {
|
|
if (_sampleRate === null) {
|
|
console.warn("Call `FillRateHelper.setSampleRate` before `addListener`.");
|
|
}
|
|
_listeners.push(callback);
|
|
return {
|
|
remove: /* @__PURE__ */ __name(() => {
|
|
_listeners = _listeners.filter((listener) => callback !== listener);
|
|
}, "remove")
|
|
};
|
|
}
|
|
static setSampleRate(sampleRate) {
|
|
_sampleRate = sampleRate;
|
|
}
|
|
static setMinSampleCount(minSampleCount) {
|
|
_minSampleCount = minSampleCount;
|
|
}
|
|
constructor(getFrameMetrics) {
|
|
this._anyBlankStartTime = null;
|
|
this._enabled = false;
|
|
this._info = new Info();
|
|
this._mostlyBlankStartTime = null;
|
|
this._samplesStartTime = null;
|
|
this._getFrameMetrics = getFrameMetrics;
|
|
this._enabled = (_sampleRate || 0) > Math.random();
|
|
this._resetData();
|
|
}
|
|
activate() {
|
|
if (this._enabled && this._samplesStartTime == null) {
|
|
DEBUG && console.debug("FillRateHelper: activate");
|
|
this._samplesStartTime = global.performance.now();
|
|
}
|
|
}
|
|
deactivateAndFlush() {
|
|
if (!this._enabled) {
|
|
return;
|
|
}
|
|
var start = this._samplesStartTime;
|
|
if (start == null) {
|
|
DEBUG && console.debug("FillRateHelper: bail on deactivate with no start time");
|
|
return;
|
|
}
|
|
if (this._info.sample_count < _minSampleCount) {
|
|
this._resetData();
|
|
return;
|
|
}
|
|
var total_time_spent = global.performance.now() - start;
|
|
var info = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this._info), {}, {
|
|
total_time_spent
|
|
});
|
|
if (DEBUG) {
|
|
var derived = {
|
|
avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,
|
|
avg_speed: this._info.pixels_scrolled / (total_time_spent / 1e3),
|
|
avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count,
|
|
any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1e3 / 60),
|
|
any_blank_time_frac: this._info.any_blank_ms / total_time_spent,
|
|
mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1e3 / 60),
|
|
mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent
|
|
};
|
|
for (var key in derived) {
|
|
derived[key] = Math.round(1e3 * derived[key]) / 1e3;
|
|
}
|
|
console.debug("FillRateHelper deactivateAndFlush: ", {
|
|
derived,
|
|
info
|
|
});
|
|
}
|
|
_listeners.forEach((listener) => listener(info));
|
|
this._resetData();
|
|
}
|
|
computeBlankness(props, cellsAroundViewport, scrollMetrics) {
|
|
if (!this._enabled || props.getItemCount(props.data) === 0 || cellsAroundViewport.last < cellsAroundViewport.first || this._samplesStartTime == null) {
|
|
return 0;
|
|
}
|
|
var dOffset = scrollMetrics.dOffset, offset4 = scrollMetrics.offset, velocity = scrollMetrics.velocity, visibleLength = scrollMetrics.visibleLength;
|
|
this._info.sample_count++;
|
|
this._info.pixels_sampled += Math.round(visibleLength);
|
|
this._info.pixels_scrolled += Math.round(Math.abs(dOffset));
|
|
var scrollSpeed = Math.round(Math.abs(velocity) * 1e3);
|
|
var now = global.performance.now();
|
|
if (this._anyBlankStartTime != null) {
|
|
this._info.any_blank_ms += now - this._anyBlankStartTime;
|
|
}
|
|
this._anyBlankStartTime = null;
|
|
if (this._mostlyBlankStartTime != null) {
|
|
this._info.mostly_blank_ms += now - this._mostlyBlankStartTime;
|
|
}
|
|
this._mostlyBlankStartTime = null;
|
|
var blankTop = 0;
|
|
var first = cellsAroundViewport.first;
|
|
var firstFrame = this._getFrameMetrics(first, props);
|
|
while (first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.inLayout)) {
|
|
firstFrame = this._getFrameMetrics(first, props);
|
|
first++;
|
|
}
|
|
if (firstFrame && first > 0) {
|
|
blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset4));
|
|
}
|
|
var blankBottom = 0;
|
|
var last = cellsAroundViewport.last;
|
|
var lastFrame = this._getFrameMetrics(last, props);
|
|
while (last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.inLayout)) {
|
|
lastFrame = this._getFrameMetrics(last, props);
|
|
last--;
|
|
}
|
|
if (lastFrame && last < props.getItemCount(props.data) - 1) {
|
|
var bottomEdge = lastFrame.offset + lastFrame.length;
|
|
blankBottom = Math.min(visibleLength, Math.max(0, offset4 + visibleLength - bottomEdge));
|
|
}
|
|
var pixels_blank = Math.round(blankTop + blankBottom);
|
|
var blankness = pixels_blank / visibleLength;
|
|
if (blankness > 0) {
|
|
this._anyBlankStartTime = now;
|
|
this._info.any_blank_speed_sum += scrollSpeed;
|
|
this._info.any_blank_count++;
|
|
this._info.pixels_blank += pixels_blank;
|
|
if (blankness > 0.5) {
|
|
this._mostlyBlankStartTime = now;
|
|
this._info.mostly_blank_count++;
|
|
}
|
|
} else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) {
|
|
this.deactivateAndFlush();
|
|
}
|
|
return blankness;
|
|
}
|
|
enabled() {
|
|
return this._enabled;
|
|
}
|
|
_resetData() {
|
|
this._anyBlankStartTime = null;
|
|
this._info = new Info();
|
|
this._mostlyBlankStartTime = null;
|
|
this._samplesStartTime = null;
|
|
}
|
|
};
|
|
var _default = exports2.default = FillRateHelper;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js
|
|
var require_StateSafePureComponent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var StateSafePureComponent = class extends React83.PureComponent {
|
|
static {
|
|
__name(this, "StateSafePureComponent");
|
|
}
|
|
constructor(props) {
|
|
super(props);
|
|
this._inAsyncStateUpdate = false;
|
|
this._installSetStateHooks();
|
|
}
|
|
setState(partialState, callback) {
|
|
if (typeof partialState === "function") {
|
|
super.setState((state, props) => {
|
|
this._inAsyncStateUpdate = true;
|
|
var ret;
|
|
try {
|
|
ret = partialState(state, props);
|
|
} catch (err) {
|
|
throw err;
|
|
} finally {
|
|
this._inAsyncStateUpdate = false;
|
|
}
|
|
return ret;
|
|
}, callback);
|
|
} else {
|
|
super.setState(partialState, callback);
|
|
}
|
|
}
|
|
_installSetStateHooks() {
|
|
var that = this;
|
|
var props = this.props, state = this.state;
|
|
Object.defineProperty(this, "props", {
|
|
get() {
|
|
(0, _invariant.default)(!that._inAsyncStateUpdate, '"this.props" should not be accessed during state updates');
|
|
return props;
|
|
},
|
|
set(newProps) {
|
|
props = newProps;
|
|
}
|
|
});
|
|
Object.defineProperty(this, "state", {
|
|
get() {
|
|
(0, _invariant.default)(!that._inAsyncStateUpdate, '"this.state" should not be acceessed during state updates');
|
|
return state;
|
|
},
|
|
set(newState) {
|
|
state = newState;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
exports2.default = StateSafePureComponent;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/ViewabilityHelper/index.js
|
|
var require_ViewabilityHelper = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/ViewabilityHelper/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require_createForOfIteratorHelperLoose());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var ViewabilityHelper = class {
|
|
static {
|
|
__name(this, "ViewabilityHelper");
|
|
}
|
|
constructor(config) {
|
|
if (config === void 0) {
|
|
config = {
|
|
viewAreaCoveragePercentThreshold: 0
|
|
};
|
|
}
|
|
this._hasInteracted = false;
|
|
this._timers = /* @__PURE__ */ new Set();
|
|
this._viewableIndices = [];
|
|
this._viewableItems = /* @__PURE__ */ new Map();
|
|
this._config = config;
|
|
}
|
|
/**
|
|
* Cleanup, e.g. on unmount. Clears any pending timers.
|
|
*/
|
|
dispose() {
|
|
this._timers.forEach(clearTimeout);
|
|
}
|
|
/**
|
|
* Determines which items are viewable based on the current metrics and config.
|
|
*/
|
|
computeViewableItems(props, scrollOffset, viewportHeight, getFrameMetrics, renderRange) {
|
|
var itemCount = props.getItemCount(props.data);
|
|
var _this$_config = this._config, itemVisiblePercentThreshold = _this$_config.itemVisiblePercentThreshold, viewAreaCoveragePercentThreshold = _this$_config.viewAreaCoveragePercentThreshold;
|
|
var viewAreaMode = viewAreaCoveragePercentThreshold != null;
|
|
var viewablePercentThreshold = viewAreaMode ? viewAreaCoveragePercentThreshold : itemVisiblePercentThreshold;
|
|
(0, _invariant.default)(viewablePercentThreshold != null && itemVisiblePercentThreshold != null !== (viewAreaCoveragePercentThreshold != null), "Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold");
|
|
var viewableIndices = [];
|
|
if (itemCount === 0) {
|
|
return viewableIndices;
|
|
}
|
|
var firstVisible = -1;
|
|
var _ref = renderRange || {
|
|
first: 0,
|
|
last: itemCount - 1
|
|
}, first = _ref.first, last = _ref.last;
|
|
if (last >= itemCount) {
|
|
console.warn("Invalid render range computing viewability " + JSON.stringify({
|
|
renderRange,
|
|
itemCount
|
|
}));
|
|
return [];
|
|
}
|
|
for (var idx = first; idx <= last; idx++) {
|
|
var metrics = getFrameMetrics(idx, props);
|
|
if (!metrics) {
|
|
continue;
|
|
}
|
|
var top = metrics.offset - scrollOffset;
|
|
var bottom = top + metrics.length;
|
|
if (top < viewportHeight && bottom > 0) {
|
|
firstVisible = idx;
|
|
if (_isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, metrics.length)) {
|
|
viewableIndices.push(idx);
|
|
}
|
|
} else if (firstVisible >= 0) {
|
|
break;
|
|
}
|
|
}
|
|
return viewableIndices;
|
|
}
|
|
/**
|
|
* Figures out which items are viewable and how that has changed from before and calls
|
|
* `onViewableItemsChanged` as appropriate.
|
|
*/
|
|
onUpdate(props, scrollOffset, viewportHeight, getFrameMetrics, createViewToken, onViewableItemsChanged, renderRange) {
|
|
var itemCount = props.getItemCount(props.data);
|
|
if (this._config.waitForInteraction && !this._hasInteracted || itemCount === 0 || !getFrameMetrics(0, props)) {
|
|
return;
|
|
}
|
|
var viewableIndices = [];
|
|
if (itemCount) {
|
|
viewableIndices = this.computeViewableItems(props, scrollOffset, viewportHeight, getFrameMetrics, renderRange);
|
|
}
|
|
if (this._viewableIndices.length === viewableIndices.length && this._viewableIndices.every((v, ii) => v === viewableIndices[ii])) {
|
|
return;
|
|
}
|
|
this._viewableIndices = viewableIndices;
|
|
if (this._config.minimumViewTime) {
|
|
var handle = setTimeout(() => {
|
|
this._timers.delete(handle);
|
|
this._onUpdateSync(props, viewableIndices, onViewableItemsChanged, createViewToken);
|
|
}, this._config.minimumViewTime);
|
|
this._timers.add(handle);
|
|
} else {
|
|
this._onUpdateSync(props, viewableIndices, onViewableItemsChanged, createViewToken);
|
|
}
|
|
}
|
|
/**
|
|
* clean-up cached _viewableIndices to evaluate changed items on next update
|
|
*/
|
|
resetViewableIndices() {
|
|
this._viewableIndices = [];
|
|
}
|
|
/**
|
|
* Records that an interaction has happened even if there has been no scroll.
|
|
*/
|
|
recordInteraction() {
|
|
this._hasInteracted = true;
|
|
}
|
|
_onUpdateSync(props, viewableIndicesToCheck, onViewableItemsChanged, createViewToken) {
|
|
viewableIndicesToCheck = viewableIndicesToCheck.filter((ii) => this._viewableIndices.includes(ii));
|
|
var prevItems = this._viewableItems;
|
|
var nextItems = new Map(viewableIndicesToCheck.map((ii) => {
|
|
var viewable2 = createViewToken(ii, true, props);
|
|
return [viewable2.key, viewable2];
|
|
}));
|
|
var changed = [];
|
|
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(nextItems), _step; !(_step = _iterator()).done; ) {
|
|
var _step$value = _step.value, key = _step$value[0], viewable = _step$value[1];
|
|
if (!prevItems.has(key)) {
|
|
changed.push(viewable);
|
|
}
|
|
}
|
|
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(prevItems), _step2; !(_step2 = _iterator2()).done; ) {
|
|
var _step2$value = _step2.value, _key = _step2$value[0], _viewable = _step2$value[1];
|
|
if (!nextItems.has(_key)) {
|
|
changed.push((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _viewable), {}, {
|
|
isViewable: false
|
|
}));
|
|
}
|
|
}
|
|
if (changed.length > 0) {
|
|
this._viewableItems = nextItems;
|
|
onViewableItemsChanged({
|
|
viewableItems: Array.from(nextItems.values()),
|
|
changed,
|
|
viewabilityConfig: this._config
|
|
});
|
|
}
|
|
}
|
|
};
|
|
function _isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, itemLength) {
|
|
if (_isEntirelyVisible(top, bottom, viewportHeight)) {
|
|
return true;
|
|
} else {
|
|
var pixels = _getPixelsVisible(top, bottom, viewportHeight);
|
|
var percent = 100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength);
|
|
return percent >= viewablePercentThreshold;
|
|
}
|
|
}
|
|
__name(_isViewable, "_isViewable");
|
|
function _getPixelsVisible(top, bottom, viewportHeight) {
|
|
var visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0);
|
|
return Math.max(0, visibleHeight);
|
|
}
|
|
__name(_getPixelsVisible, "_getPixelsVisible");
|
|
function _isEntirelyVisible(top, bottom, viewportHeight) {
|
|
return top >= 0 && bottom <= viewportHeight && bottom > top;
|
|
}
|
|
__name(_isEntirelyVisible, "_isEntirelyVisible");
|
|
var _default = exports2.default = ViewabilityHelper;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js
|
|
var require_VirtualizedListContext = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.VirtualizedListCellContextProvider = VirtualizedListCellContextProvider;
|
|
exports2.VirtualizedListContext = void 0;
|
|
exports2.VirtualizedListContextProvider = VirtualizedListContextProvider;
|
|
exports2.VirtualizedListContextResetter = VirtualizedListContextResetter;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var React83 = _react;
|
|
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
var VirtualizedListContext = exports2.VirtualizedListContext = /* @__PURE__ */ React83.createContext(null);
|
|
if (__DEV__) {
|
|
VirtualizedListContext.displayName = "VirtualizedListContext";
|
|
}
|
|
function VirtualizedListContextResetter(_ref) {
|
|
var children = _ref.children;
|
|
return /* @__PURE__ */ React83.createElement(VirtualizedListContext.Provider, {
|
|
value: null
|
|
}, children);
|
|
}
|
|
__name(VirtualizedListContextResetter, "VirtualizedListContextResetter");
|
|
function VirtualizedListContextProvider(_ref2) {
|
|
var children = _ref2.children, value = _ref2.value;
|
|
var context2 = (0, _react.useMemo)(() => ({
|
|
cellKey: null,
|
|
getScrollMetrics: value.getScrollMetrics,
|
|
horizontal: value.horizontal,
|
|
getOutermostParentListRef: value.getOutermostParentListRef,
|
|
registerAsNestedChild: value.registerAsNestedChild,
|
|
unregisterAsNestedChild: value.unregisterAsNestedChild
|
|
}), [value.getScrollMetrics, value.horizontal, value.getOutermostParentListRef, value.registerAsNestedChild, value.unregisterAsNestedChild]);
|
|
return /* @__PURE__ */ React83.createElement(VirtualizedListContext.Provider, {
|
|
value: context2
|
|
}, children);
|
|
}
|
|
__name(VirtualizedListContextProvider, "VirtualizedListContextProvider");
|
|
function VirtualizedListCellContextProvider(_ref3) {
|
|
var cellKey = _ref3.cellKey, children = _ref3.children;
|
|
var currContext = (0, _react.useContext)(VirtualizedListContext);
|
|
var context2 = (0, _react.useMemo)(() => currContext == null ? null : (0, _objectSpread2.default)((0, _objectSpread2.default)({}, currContext), {}, {
|
|
cellKey
|
|
}), [currContext, cellKey]);
|
|
return /* @__PURE__ */ React83.createElement(VirtualizedListContext.Provider, {
|
|
value: context2
|
|
}, children);
|
|
}
|
|
__name(VirtualizedListCellContextProvider, "VirtualizedListCellContextProvider");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js
|
|
var require_VirtualizedListCellRenderer = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _VirtualizedListContext = require_VirtualizedListContext();
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var CellRenderer = class extends React83.Component {
|
|
static {
|
|
__name(this, "CellRenderer");
|
|
}
|
|
constructor() {
|
|
super(...arguments);
|
|
this.state = {
|
|
separatorProps: {
|
|
highlighted: false,
|
|
leadingItem: this.props.item
|
|
}
|
|
};
|
|
this._separators = {
|
|
highlight: /* @__PURE__ */ __name(() => {
|
|
var _this$props = this.props, cellKey = _this$props.cellKey, prevCellKey = _this$props.prevCellKey;
|
|
this.props.onUpdateSeparators([cellKey, prevCellKey], {
|
|
highlighted: true
|
|
});
|
|
}, "highlight"),
|
|
unhighlight: /* @__PURE__ */ __name(() => {
|
|
var _this$props2 = this.props, cellKey = _this$props2.cellKey, prevCellKey = _this$props2.prevCellKey;
|
|
this.props.onUpdateSeparators([cellKey, prevCellKey], {
|
|
highlighted: false
|
|
});
|
|
}, "unhighlight"),
|
|
updateProps: /* @__PURE__ */ __name((select, newProps) => {
|
|
var _this$props3 = this.props, cellKey = _this$props3.cellKey, prevCellKey = _this$props3.prevCellKey;
|
|
this.props.onUpdateSeparators([select === "leading" ? prevCellKey : cellKey], newProps);
|
|
}, "updateProps")
|
|
};
|
|
this._onLayout = (nativeEvent) => {
|
|
this.props.onCellLayout && this.props.onCellLayout(nativeEvent, this.props.cellKey, this.props.index);
|
|
};
|
|
}
|
|
static getDerivedStateFromProps(props, prevState) {
|
|
return {
|
|
separatorProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prevState.separatorProps), {}, {
|
|
leadingItem: props.item
|
|
})
|
|
};
|
|
}
|
|
// TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not
|
|
// reused by SectionList and we can keep VirtualizedList simpler.
|
|
// $FlowFixMe[missing-local-annot]
|
|
updateSeparatorProps(newProps) {
|
|
this.setState((state) => ({
|
|
separatorProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.separatorProps), newProps)
|
|
}));
|
|
}
|
|
componentWillUnmount() {
|
|
this.props.onUnmount(this.props.cellKey);
|
|
}
|
|
_renderElement(renderItem, ListItemComponent2, item, index5) {
|
|
if (renderItem && ListItemComponent2) {
|
|
console.warn("VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take precedence over renderItem.");
|
|
}
|
|
if (ListItemComponent2) {
|
|
return /* @__PURE__ */ React83.createElement(ListItemComponent2, {
|
|
item,
|
|
index: index5,
|
|
separators: this._separators
|
|
});
|
|
}
|
|
if (renderItem) {
|
|
return renderItem({
|
|
item,
|
|
index: index5,
|
|
separators: this._separators
|
|
});
|
|
}
|
|
(0, _invariant.default)(false, "VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.");
|
|
}
|
|
render() {
|
|
var _this$props4 = this.props, CellRendererComponent = _this$props4.CellRendererComponent, ItemSeparatorComponent = _this$props4.ItemSeparatorComponent, ListItemComponent2 = _this$props4.ListItemComponent, cellKey = _this$props4.cellKey, horizontal = _this$props4.horizontal, item = _this$props4.item, index5 = _this$props4.index, inversionStyle = _this$props4.inversionStyle, onCellFocusCapture = _this$props4.onCellFocusCapture, onCellLayout = _this$props4.onCellLayout, renderItem = _this$props4.renderItem;
|
|
var element = this._renderElement(renderItem, ListItemComponent2, item, index5);
|
|
var itemSeparator = /* @__PURE__ */ React83.isValidElement(ItemSeparatorComponent) ? (
|
|
// $FlowFixMe[incompatible-type]
|
|
ItemSeparatorComponent
|
|
) : (
|
|
// $FlowFixMe[incompatible-type]
|
|
ItemSeparatorComponent && /* @__PURE__ */ React83.createElement(ItemSeparatorComponent, this.state.separatorProps)
|
|
);
|
|
var cellStyle = inversionStyle ? horizontal ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal ? [styles.row, inversionStyle] : inversionStyle;
|
|
var result = !CellRendererComponent ? /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({
|
|
style: cellStyle,
|
|
onFocusCapture: onCellFocusCapture
|
|
}, onCellLayout && {
|
|
onLayout: this._onLayout
|
|
}), element, itemSeparator) : /* @__PURE__ */ React83.createElement(CellRendererComponent, (0, _extends2.default)({
|
|
cellKey,
|
|
index: index5,
|
|
item,
|
|
style: cellStyle,
|
|
onFocusCapture: onCellFocusCapture
|
|
}, onCellLayout && {
|
|
onLayout: this._onLayout
|
|
}), element, itemSeparator);
|
|
return /* @__PURE__ */ React83.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
|
|
cellKey: this.props.cellKey
|
|
}, result);
|
|
}
|
|
};
|
|
exports2.default = CellRenderer;
|
|
var styles = _StyleSheet.default.create({
|
|
row: {
|
|
flexDirection: "row"
|
|
},
|
|
rowReverse: {
|
|
flexDirection: "row-reverse"
|
|
},
|
|
columnReverse: {
|
|
flexDirection: "column-reverse"
|
|
}
|
|
});
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizeUtils/index.js
|
|
var require_VirtualizeUtils = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizeUtils/index.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.computeWindowedRenderLimits = computeWindowedRenderLimits;
|
|
exports2.elementsThatOverlapOffsets = elementsThatOverlapOffsets;
|
|
exports2.keyExtractor = keyExtractor;
|
|
exports2.newRangeCount = newRangeCount;
|
|
function elementsThatOverlapOffsets(offsets, props, getFrameMetrics, zoomScale) {
|
|
if (zoomScale === void 0) {
|
|
zoomScale = 1;
|
|
}
|
|
var itemCount = props.getItemCount(props.data);
|
|
var result = [];
|
|
for (var offsetIndex = 0; offsetIndex < offsets.length; offsetIndex++) {
|
|
var currentOffset = offsets[offsetIndex];
|
|
var left = 0;
|
|
var right = itemCount - 1;
|
|
while (left <= right) {
|
|
var mid = left + (right - left >>> 1);
|
|
var frame = getFrameMetrics(mid, props);
|
|
var scaledOffsetStart = frame.offset * zoomScale;
|
|
var scaledOffsetEnd = (frame.offset + frame.length) * zoomScale;
|
|
if (mid === 0 && currentOffset < scaledOffsetStart || mid !== 0 && currentOffset <= scaledOffsetStart) {
|
|
right = mid - 1;
|
|
} else if (currentOffset > scaledOffsetEnd) {
|
|
left = mid + 1;
|
|
} else {
|
|
result[offsetIndex] = mid;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
__name(elementsThatOverlapOffsets, "elementsThatOverlapOffsets");
|
|
function newRangeCount(prev, next) {
|
|
return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first));
|
|
}
|
|
__name(newRangeCount, "newRangeCount");
|
|
function computeWindowedRenderLimits(props, maxToRenderPerBatch, windowSize, prev, getFrameMetricsApprox, scrollMetrics) {
|
|
var itemCount = props.getItemCount(props.data);
|
|
if (itemCount === 0) {
|
|
return {
|
|
first: 0,
|
|
last: -1
|
|
};
|
|
}
|
|
var offset4 = scrollMetrics.offset, velocity = scrollMetrics.velocity, visibleLength = scrollMetrics.visibleLength, _scrollMetrics$zoomSc = scrollMetrics.zoomScale, zoomScale = _scrollMetrics$zoomSc === void 0 ? 1 : _scrollMetrics$zoomSc;
|
|
var visibleBegin = Math.max(0, offset4);
|
|
var visibleEnd = visibleBegin + visibleLength;
|
|
var overscanLength = (windowSize - 1) * visibleLength;
|
|
var leadFactor = 0.5;
|
|
var fillPreference = velocity > 1 ? "after" : velocity < -1 ? "before" : "none";
|
|
var overscanBegin = Math.max(0, visibleBegin - (1 - leadFactor) * overscanLength);
|
|
var overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength);
|
|
var lastItemOffset = getFrameMetricsApprox(itemCount - 1, props).offset * zoomScale;
|
|
if (lastItemOffset < overscanBegin) {
|
|
return {
|
|
first: Math.max(0, itemCount - 1 - maxToRenderPerBatch),
|
|
last: itemCount - 1
|
|
};
|
|
}
|
|
var _elementsThatOverlapO = elementsThatOverlapOffsets([overscanBegin, visibleBegin, visibleEnd, overscanEnd], props, getFrameMetricsApprox, zoomScale), overscanFirst = _elementsThatOverlapO[0], first = _elementsThatOverlapO[1], last = _elementsThatOverlapO[2], overscanLast = _elementsThatOverlapO[3];
|
|
overscanFirst = overscanFirst == null ? 0 : overscanFirst;
|
|
first = first == null ? Math.max(0, overscanFirst) : first;
|
|
overscanLast = overscanLast == null ? itemCount - 1 : overscanLast;
|
|
last = last == null ? Math.min(overscanLast, first + maxToRenderPerBatch - 1) : last;
|
|
var visible = {
|
|
first,
|
|
last
|
|
};
|
|
var newCellCount = newRangeCount(prev, visible);
|
|
while (true) {
|
|
if (first <= overscanFirst && last >= overscanLast) {
|
|
break;
|
|
}
|
|
var maxNewCells = newCellCount >= maxToRenderPerBatch;
|
|
var firstWillAddMore = first <= prev.first || first > prev.last;
|
|
var firstShouldIncrement = first > overscanFirst && (!maxNewCells || !firstWillAddMore);
|
|
var lastWillAddMore = last >= prev.last || last < prev.first;
|
|
var lastShouldIncrement = last < overscanLast && (!maxNewCells || !lastWillAddMore);
|
|
if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) {
|
|
break;
|
|
}
|
|
if (firstShouldIncrement && !(fillPreference === "after" && lastShouldIncrement && lastWillAddMore)) {
|
|
if (firstWillAddMore) {
|
|
newCellCount++;
|
|
}
|
|
first--;
|
|
}
|
|
if (lastShouldIncrement && !(fillPreference === "before" && firstShouldIncrement && firstWillAddMore)) {
|
|
if (lastWillAddMore) {
|
|
newCellCount++;
|
|
}
|
|
last++;
|
|
}
|
|
}
|
|
if (!(last >= first && first >= 0 && last < itemCount && first >= overscanFirst && last <= overscanLast && first <= visible.first && last >= visible.last)) {
|
|
throw new Error("Bad window calculation " + JSON.stringify({
|
|
first,
|
|
last,
|
|
itemCount,
|
|
overscanFirst,
|
|
overscanLast,
|
|
visible
|
|
}));
|
|
}
|
|
return {
|
|
first,
|
|
last
|
|
};
|
|
}
|
|
__name(computeWindowedRenderLimits, "computeWindowedRenderLimits");
|
|
function keyExtractor(item, index5) {
|
|
if (typeof item === "object" && (item == null ? void 0 : item.key) != null) {
|
|
return item.key;
|
|
}
|
|
if (typeof item === "object" && (item == null ? void 0 : item.id) != null) {
|
|
return item.id;
|
|
}
|
|
return String(index5);
|
|
}
|
|
__name(keyExtractor, "keyExtractor");
|
|
}
|
|
});
|
|
|
|
// node_modules/nullthrows/nullthrows.js
|
|
var require_nullthrows = __commonJS({
|
|
"node_modules/nullthrows/nullthrows.js"(exports2, module2) {
|
|
"use strict";
|
|
function nullthrows(x, message) {
|
|
if (x != null) {
|
|
return x;
|
|
}
|
|
var error4 = new Error(message !== void 0 ? message : "Got unexpected " + x);
|
|
error4.framesToPop = 1;
|
|
throw error4;
|
|
}
|
|
__name(nullthrows, "nullthrows");
|
|
module2.exports = nullthrows;
|
|
module2.exports.default = nullthrows;
|
|
Object.defineProperty(module2.exports, "__esModule", { value: true });
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/index.js
|
|
var require_VirtualizedList = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require_createForOfIteratorHelperLoose());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _RefreshControl = _interopRequireDefault(require_RefreshControl());
|
|
var _ScrollView = _interopRequireDefault(require_ScrollView());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _Batchinator = _interopRequireDefault(require_Batchinator());
|
|
var _clamp = _interopRequireDefault(require_clamp());
|
|
var _infoLog = _interopRequireDefault(require_infoLog());
|
|
var _CellRenderMask = require_CellRenderMask();
|
|
var _ChildListCollection = _interopRequireDefault(require_ChildListCollection());
|
|
var _FillRateHelper = _interopRequireDefault(require_FillRateHelper());
|
|
var _StateSafePureComponent = _interopRequireDefault(require_StateSafePureComponent());
|
|
var _ViewabilityHelper = _interopRequireDefault(require_ViewabilityHelper());
|
|
var _VirtualizedListCellRenderer = _interopRequireDefault(require_VirtualizedListCellRenderer());
|
|
var _VirtualizedListContext = require_VirtualizedListContext();
|
|
var _VirtualizeUtils = require_VirtualizeUtils();
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _nullthrows = _interopRequireDefault(require_nullthrows());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
var ON_EDGE_REACHED_EPSILON = 1e-3;
|
|
var _usedIndexForKey = false;
|
|
var _keylessItemComponentName = "";
|
|
function horizontalOrDefault(horizontal) {
|
|
return horizontal !== null && horizontal !== void 0 ? horizontal : false;
|
|
}
|
|
__name(horizontalOrDefault, "horizontalOrDefault");
|
|
function initialNumToRenderOrDefault(initialNumToRender) {
|
|
return initialNumToRender !== null && initialNumToRender !== void 0 ? initialNumToRender : 10;
|
|
}
|
|
__name(initialNumToRenderOrDefault, "initialNumToRenderOrDefault");
|
|
function maxToRenderPerBatchOrDefault(maxToRenderPerBatch) {
|
|
return maxToRenderPerBatch !== null && maxToRenderPerBatch !== void 0 ? maxToRenderPerBatch : 10;
|
|
}
|
|
__name(maxToRenderPerBatchOrDefault, "maxToRenderPerBatchOrDefault");
|
|
function onStartReachedThresholdOrDefault(onStartReachedThreshold) {
|
|
return onStartReachedThreshold !== null && onStartReachedThreshold !== void 0 ? onStartReachedThreshold : 2;
|
|
}
|
|
__name(onStartReachedThresholdOrDefault, "onStartReachedThresholdOrDefault");
|
|
function onEndReachedThresholdOrDefault(onEndReachedThreshold) {
|
|
return onEndReachedThreshold !== null && onEndReachedThreshold !== void 0 ? onEndReachedThreshold : 2;
|
|
}
|
|
__name(onEndReachedThresholdOrDefault, "onEndReachedThresholdOrDefault");
|
|
function getScrollingThreshold(threshold, visibleLength) {
|
|
return threshold * visibleLength / 2;
|
|
}
|
|
__name(getScrollingThreshold, "getScrollingThreshold");
|
|
function scrollEventThrottleOrDefault(scrollEventThrottle) {
|
|
return scrollEventThrottle !== null && scrollEventThrottle !== void 0 ? scrollEventThrottle : 50;
|
|
}
|
|
__name(scrollEventThrottleOrDefault, "scrollEventThrottleOrDefault");
|
|
function windowSizeOrDefault(windowSize) {
|
|
return windowSize !== null && windowSize !== void 0 ? windowSize : 21;
|
|
}
|
|
__name(windowSizeOrDefault, "windowSizeOrDefault");
|
|
function findLastWhere(arr, predicate) {
|
|
for (var i = arr.length - 1; i >= 0; i--) {
|
|
if (predicate(arr[i])) {
|
|
return arr[i];
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
__name(findLastWhere, "findLastWhere");
|
|
var VirtualizedList = class _VirtualizedList extends _StateSafePureComponent.default {
|
|
static {
|
|
__name(this, "VirtualizedList");
|
|
}
|
|
// scrollToEnd may be janky without getItemLayout prop
|
|
scrollToEnd(params) {
|
|
var animated = params ? params.animated : true;
|
|
var veryLast = this.props.getItemCount(this.props.data) - 1;
|
|
if (veryLast < 0) {
|
|
return;
|
|
}
|
|
var frame = this.__getFrameMetricsApprox(veryLast, this.props);
|
|
var offset4 = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength);
|
|
if (this._scrollRef == null) {
|
|
return;
|
|
}
|
|
if (this._scrollRef.scrollTo == null) {
|
|
console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo.");
|
|
return;
|
|
}
|
|
this._scrollRef.scrollTo(horizontalOrDefault(this.props.horizontal) ? {
|
|
x: offset4,
|
|
animated
|
|
} : {
|
|
y: offset4,
|
|
animated
|
|
});
|
|
}
|
|
// scrollToIndex may be janky without getItemLayout prop
|
|
scrollToIndex(params) {
|
|
var _this$props = this.props, data = _this$props.data, horizontal = _this$props.horizontal, getItemCount = _this$props.getItemCount, getItemLayout = _this$props.getItemLayout, onScrollToIndexFailed = _this$props.onScrollToIndexFailed;
|
|
var animated = params.animated, index5 = params.index, viewOffset = params.viewOffset, viewPosition = params.viewPosition;
|
|
(0, _invariant.default)(index5 >= 0, "scrollToIndex out of range: requested index " + index5 + " but minimum is 0");
|
|
(0, _invariant.default)(getItemCount(data) >= 1, "scrollToIndex out of range: item length " + getItemCount(data) + " but minimum is 1");
|
|
(0, _invariant.default)(index5 < getItemCount(data), "scrollToIndex out of range: requested index " + index5 + " is out of 0 to " + (getItemCount(data) - 1));
|
|
if (!getItemLayout && index5 > this._highestMeasuredFrameIndex) {
|
|
(0, _invariant.default)(!!onScrollToIndexFailed, "scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.");
|
|
onScrollToIndexFailed({
|
|
averageItemLength: this._averageCellLength,
|
|
highestMeasuredFrameIndex: this._highestMeasuredFrameIndex,
|
|
index: index5
|
|
});
|
|
return;
|
|
}
|
|
var frame = this.__getFrameMetricsApprox(Math.floor(index5), this.props);
|
|
var offset4 = Math.max(0, this._getOffsetApprox(index5, this.props) - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0);
|
|
if (this._scrollRef == null) {
|
|
return;
|
|
}
|
|
if (this._scrollRef.scrollTo == null) {
|
|
console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo.");
|
|
return;
|
|
}
|
|
this._scrollRef.scrollTo(horizontal ? {
|
|
x: offset4,
|
|
animated
|
|
} : {
|
|
y: offset4,
|
|
animated
|
|
});
|
|
}
|
|
// scrollToItem may be janky without getItemLayout prop. Required linear scan through items -
|
|
// use scrollToIndex instead if possible.
|
|
scrollToItem(params) {
|
|
var item = params.item;
|
|
var _this$props2 = this.props, data = _this$props2.data, getItem = _this$props2.getItem, getItemCount = _this$props2.getItemCount;
|
|
var itemCount = getItemCount(data);
|
|
for (var _index = 0; _index < itemCount; _index++) {
|
|
if (getItem(data, _index) === item) {
|
|
this.scrollToIndex((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
index: _index
|
|
}));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Scroll to a specific content pixel offset in the list.
|
|
*
|
|
* Param `offset` expects the offset to scroll to.
|
|
* In case of `horizontal` is true, the offset is the x-value,
|
|
* in any other case the offset is the y-value.
|
|
*
|
|
* Param `animated` (`true` by default) defines whether the list
|
|
* should do an animation while scrolling.
|
|
*/
|
|
scrollToOffset(params) {
|
|
var animated = params.animated, offset4 = params.offset;
|
|
if (this._scrollRef == null) {
|
|
return;
|
|
}
|
|
if (this._scrollRef.scrollTo == null) {
|
|
console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo.");
|
|
return;
|
|
}
|
|
this._scrollRef.scrollTo(horizontalOrDefault(this.props.horizontal) ? {
|
|
x: offset4,
|
|
animated
|
|
} : {
|
|
y: offset4,
|
|
animated
|
|
});
|
|
}
|
|
recordInteraction() {
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList.recordInteraction();
|
|
});
|
|
this._viewabilityTuples.forEach((t) => {
|
|
t.viewabilityHelper.recordInteraction();
|
|
});
|
|
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
|
|
}
|
|
flashScrollIndicators() {
|
|
if (this._scrollRef == null) {
|
|
return;
|
|
}
|
|
this._scrollRef.flashScrollIndicators();
|
|
}
|
|
/**
|
|
* Provides a handle to the underlying scroll responder.
|
|
* Note that `this._scrollRef` might not be a `ScrollView`, so we
|
|
* need to check that it responds to `getScrollResponder` before calling it.
|
|
*/
|
|
getScrollResponder() {
|
|
if (this._scrollRef && this._scrollRef.getScrollResponder) {
|
|
return this._scrollRef.getScrollResponder();
|
|
}
|
|
}
|
|
getScrollableNode() {
|
|
if (this._scrollRef && this._scrollRef.getScrollableNode) {
|
|
return this._scrollRef.getScrollableNode();
|
|
} else {
|
|
return this._scrollRef;
|
|
}
|
|
}
|
|
getScrollRef() {
|
|
if (this._scrollRef && this._scrollRef.getScrollRef) {
|
|
return this._scrollRef.getScrollRef();
|
|
} else {
|
|
return this._scrollRef;
|
|
}
|
|
}
|
|
_getCellKey() {
|
|
var _this$context;
|
|
return ((_this$context = this.context) == null ? void 0 : _this$context.cellKey) || "rootList";
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
hasMore() {
|
|
return this._hasMore;
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
|
|
constructor(_props) {
|
|
var _this$props$updateCel;
|
|
super(_props);
|
|
this._getScrollMetrics = () => {
|
|
return this._scrollMetrics;
|
|
};
|
|
this._getOutermostParentListRef = () => {
|
|
if (this._isNestedWithSameOrientation()) {
|
|
return this.context.getOutermostParentListRef();
|
|
} else {
|
|
return this;
|
|
}
|
|
};
|
|
this._registerAsNestedChild = (childList) => {
|
|
this._nestedChildLists.add(childList.ref, childList.cellKey);
|
|
if (this._hasInteracted) {
|
|
childList.ref.recordInteraction();
|
|
}
|
|
};
|
|
this._unregisterAsNestedChild = (childList) => {
|
|
this._nestedChildLists.remove(childList.ref);
|
|
};
|
|
this._onUpdateSeparators = (keys, newProps) => {
|
|
keys.forEach((key) => {
|
|
var ref = key != null && this._cellRefs[key];
|
|
ref && ref.updateSeparatorProps(newProps);
|
|
});
|
|
};
|
|
this._getSpacerKey = (isVertical) => isVertical ? "height" : "width";
|
|
this._averageCellLength = 0;
|
|
this._cellRefs = {};
|
|
this._frames = {};
|
|
this._footerLength = 0;
|
|
this._hasTriggeredInitialScrollToIndex = false;
|
|
this._hasInteracted = false;
|
|
this._hasMore = false;
|
|
this._hasWarned = {};
|
|
this._headerLength = 0;
|
|
this._hiPriInProgress = false;
|
|
this._highestMeasuredFrameIndex = 0;
|
|
this._indicesToKeys = /* @__PURE__ */ new Map();
|
|
this._lastFocusedCellKey = null;
|
|
this._nestedChildLists = new _ChildListCollection.default();
|
|
this._offsetFromParentVirtualizedList = 0;
|
|
this._prevParentOffset = 0;
|
|
this._scrollMetrics = {
|
|
contentLength: 0,
|
|
dOffset: 0,
|
|
dt: 10,
|
|
offset: 0,
|
|
timestamp: 0,
|
|
velocity: 0,
|
|
visibleLength: 0,
|
|
zoomScale: 1
|
|
};
|
|
this._scrollRef = null;
|
|
this._sentStartForContentLength = 0;
|
|
this._sentEndForContentLength = 0;
|
|
this._totalCellLength = 0;
|
|
this._totalCellsMeasured = 0;
|
|
this._viewabilityTuples = [];
|
|
this._captureScrollRef = (ref) => {
|
|
this._scrollRef = ref;
|
|
};
|
|
this._defaultRenderScrollComponent = (props) => {
|
|
var onRefresh = props.onRefresh;
|
|
if (this._isNestedWithSameOrientation()) {
|
|
return /* @__PURE__ */ React83.createElement(_View.default, props);
|
|
} else if (onRefresh) {
|
|
var _props$refreshing;
|
|
(0, _invariant.default)(typeof props.refreshing === "boolean", "`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `" + JSON.stringify((_props$refreshing = props.refreshing) !== null && _props$refreshing !== void 0 ? _props$refreshing : "undefined") + "`");
|
|
return (
|
|
// $FlowFixMe[prop-missing] Invalid prop usage
|
|
// $FlowFixMe[incompatible-use]
|
|
/* @__PURE__ */ React83.createElement(_ScrollView.default, (0, _extends2.default)({}, props, {
|
|
refreshControl: props.refreshControl == null ? /* @__PURE__ */ React83.createElement(
|
|
_RefreshControl.default,
|
|
{
|
|
refreshing: props.refreshing,
|
|
onRefresh,
|
|
progressViewOffset: props.progressViewOffset
|
|
}
|
|
) : props.refreshControl
|
|
}))
|
|
);
|
|
} else {
|
|
return /* @__PURE__ */ React83.createElement(_ScrollView.default, props);
|
|
}
|
|
};
|
|
this._onCellLayout = (e, cellKey, index5) => {
|
|
var layout = e.nativeEvent.layout;
|
|
var next = {
|
|
offset: this._selectOffset(layout),
|
|
length: this._selectLength(layout),
|
|
index: index5,
|
|
inLayout: true
|
|
};
|
|
var curr = this._frames[cellKey];
|
|
if (!curr || next.offset !== curr.offset || next.length !== curr.length || index5 !== curr.index) {
|
|
this._totalCellLength += next.length - (curr ? curr.length : 0);
|
|
this._totalCellsMeasured += curr ? 0 : 1;
|
|
this._averageCellLength = this._totalCellLength / this._totalCellsMeasured;
|
|
this._frames[cellKey] = next;
|
|
this._highestMeasuredFrameIndex = Math.max(this._highestMeasuredFrameIndex, index5);
|
|
this._scheduleCellsToRenderUpdate();
|
|
} else {
|
|
this._frames[cellKey].inLayout = true;
|
|
}
|
|
this._triggerRemeasureForChildListsInCell(cellKey);
|
|
this._computeBlankness();
|
|
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
|
|
};
|
|
this._onCellUnmount = (cellKey) => {
|
|
delete this._cellRefs[cellKey];
|
|
var curr = this._frames[cellKey];
|
|
if (curr) {
|
|
this._frames[cellKey] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, curr), {}, {
|
|
inLayout: false
|
|
});
|
|
}
|
|
};
|
|
this._onLayout = (e) => {
|
|
if (this._isNestedWithSameOrientation()) {
|
|
this.measureLayoutRelativeToContainingList();
|
|
} else {
|
|
this._scrollMetrics.visibleLength = this._selectLength(e.nativeEvent.layout);
|
|
}
|
|
this.props.onLayout && this.props.onLayout(e);
|
|
this._scheduleCellsToRenderUpdate();
|
|
this._maybeCallOnEdgeReached();
|
|
};
|
|
this._onLayoutEmpty = (e) => {
|
|
this.props.onLayout && this.props.onLayout(e);
|
|
};
|
|
this._onLayoutFooter = (e) => {
|
|
this._triggerRemeasureForChildListsInCell(this._getFooterCellKey());
|
|
this._footerLength = this._selectLength(e.nativeEvent.layout);
|
|
};
|
|
this._onLayoutHeader = (e) => {
|
|
this._headerLength = this._selectLength(e.nativeEvent.layout);
|
|
};
|
|
this._onContentSizeChange = (width, height) => {
|
|
if (width > 0 && height > 0 && this.props.initialScrollIndex != null && this.props.initialScrollIndex > 0 && !this._hasTriggeredInitialScrollToIndex) {
|
|
if (this.props.contentOffset == null) {
|
|
if (this.props.initialScrollIndex < this.props.getItemCount(this.props.data)) {
|
|
this.scrollToIndex({
|
|
animated: false,
|
|
index: (0, _nullthrows.default)(this.props.initialScrollIndex)
|
|
});
|
|
} else {
|
|
this.scrollToEnd({
|
|
animated: false
|
|
});
|
|
}
|
|
}
|
|
this._hasTriggeredInitialScrollToIndex = true;
|
|
}
|
|
if (this.props.onContentSizeChange) {
|
|
this.props.onContentSizeChange(width, height);
|
|
}
|
|
this._scrollMetrics.contentLength = this._selectLength({
|
|
height,
|
|
width
|
|
});
|
|
this._scheduleCellsToRenderUpdate();
|
|
this._maybeCallOnEdgeReached();
|
|
};
|
|
this._convertParentScrollMetrics = (metrics) => {
|
|
var offset4 = metrics.offset - this._offsetFromParentVirtualizedList;
|
|
var visibleLength = metrics.visibleLength;
|
|
var dOffset = offset4 - this._scrollMetrics.offset;
|
|
var contentLength = this._scrollMetrics.contentLength;
|
|
return {
|
|
visibleLength,
|
|
contentLength,
|
|
offset: offset4,
|
|
dOffset
|
|
};
|
|
};
|
|
this._onScroll = (e) => {
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList._onScroll(e);
|
|
});
|
|
if (this.props.onScroll) {
|
|
this.props.onScroll(e);
|
|
}
|
|
var timestamp = e.timeStamp;
|
|
var visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);
|
|
var contentLength = this._selectLength(e.nativeEvent.contentSize);
|
|
var offset4 = this._selectOffset(e.nativeEvent.contentOffset);
|
|
var dOffset = offset4 - this._scrollMetrics.offset;
|
|
if (this._isNestedWithSameOrientation()) {
|
|
if (this._scrollMetrics.contentLength === 0) {
|
|
return;
|
|
}
|
|
var _this$_convertParentS = this._convertParentScrollMetrics({
|
|
visibleLength,
|
|
offset: offset4
|
|
});
|
|
visibleLength = _this$_convertParentS.visibleLength;
|
|
contentLength = _this$_convertParentS.contentLength;
|
|
offset4 = _this$_convertParentS.offset;
|
|
dOffset = _this$_convertParentS.dOffset;
|
|
}
|
|
var dt = this._scrollMetrics.timestamp ? Math.max(1, timestamp - this._scrollMetrics.timestamp) : 1;
|
|
var velocity = dOffset / dt;
|
|
if (dt > 500 && this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !this._hasWarned.perf) {
|
|
(0, _infoLog.default)("VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.", {
|
|
dt,
|
|
prevDt: this._scrollMetrics.dt,
|
|
contentLength
|
|
});
|
|
this._hasWarned.perf = true;
|
|
}
|
|
var zoomScale = e.nativeEvent.zoomScale < 0 ? 1 : e.nativeEvent.zoomScale;
|
|
this._scrollMetrics = {
|
|
contentLength,
|
|
dt,
|
|
dOffset,
|
|
offset: offset4,
|
|
timestamp,
|
|
velocity,
|
|
visibleLength,
|
|
zoomScale
|
|
};
|
|
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
|
|
if (!this.props) {
|
|
return;
|
|
}
|
|
this._maybeCallOnEdgeReached();
|
|
if (velocity !== 0) {
|
|
this._fillRateHelper.activate();
|
|
}
|
|
this._computeBlankness();
|
|
this._scheduleCellsToRenderUpdate();
|
|
};
|
|
this._onScrollBeginDrag = (e) => {
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList._onScrollBeginDrag(e);
|
|
});
|
|
this._viewabilityTuples.forEach((tuple) => {
|
|
tuple.viewabilityHelper.recordInteraction();
|
|
});
|
|
this._hasInteracted = true;
|
|
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
|
|
};
|
|
this._onScrollEndDrag = (e) => {
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList._onScrollEndDrag(e);
|
|
});
|
|
var velocity = e.nativeEvent.velocity;
|
|
if (velocity) {
|
|
this._scrollMetrics.velocity = this._selectOffset(velocity);
|
|
}
|
|
this._computeBlankness();
|
|
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
|
|
};
|
|
this._onMomentumScrollBegin = (e) => {
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList._onMomentumScrollBegin(e);
|
|
});
|
|
this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);
|
|
};
|
|
this._onMomentumScrollEnd = (e) => {
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList._onMomentumScrollEnd(e);
|
|
});
|
|
this._scrollMetrics.velocity = 0;
|
|
this._computeBlankness();
|
|
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);
|
|
};
|
|
this._updateCellsToRender = () => {
|
|
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
|
|
this.setState((state, props) => {
|
|
var cellsAroundViewport = this._adjustCellsAroundViewport(props, state.cellsAroundViewport);
|
|
var renderMask = _VirtualizedList._createRenderMask(props, cellsAroundViewport, this._getNonViewportRenderRegions(props));
|
|
if (cellsAroundViewport.first === state.cellsAroundViewport.first && cellsAroundViewport.last === state.cellsAroundViewport.last && renderMask.equals(state.renderMask)) {
|
|
return null;
|
|
}
|
|
return {
|
|
cellsAroundViewport,
|
|
renderMask
|
|
};
|
|
});
|
|
};
|
|
this._createViewToken = (index5, isViewable, props) => {
|
|
var data = props.data, getItem = props.getItem;
|
|
var item = getItem(data, index5);
|
|
return {
|
|
index: index5,
|
|
item,
|
|
key: this._keyExtractor(item, index5, props),
|
|
isViewable
|
|
};
|
|
};
|
|
this._getOffsetApprox = (index5, props) => {
|
|
if (Number.isInteger(index5)) {
|
|
return this.__getFrameMetricsApprox(index5, props).offset;
|
|
} else {
|
|
var frameMetrics = this.__getFrameMetricsApprox(Math.floor(index5), props);
|
|
var remainder = index5 - Math.floor(index5);
|
|
return frameMetrics.offset + remainder * frameMetrics.length;
|
|
}
|
|
};
|
|
this.__getFrameMetricsApprox = (index5, props) => {
|
|
var frame = this._getFrameMetrics(index5, props);
|
|
if (frame && frame.index === index5) {
|
|
return frame;
|
|
} else {
|
|
var data = props.data, getItemCount = props.getItemCount, getItemLayout = props.getItemLayout;
|
|
(0, _invariant.default)(index5 >= 0 && index5 < getItemCount(data), "Tried to get frame for out of range index " + index5);
|
|
(0, _invariant.default)(!getItemLayout, "Should not have to estimate frames when a measurement metrics function is provided");
|
|
return {
|
|
length: this._averageCellLength,
|
|
offset: this._averageCellLength * index5
|
|
};
|
|
}
|
|
};
|
|
this._getFrameMetrics = (index5, props) => {
|
|
var data = props.data, getItem = props.getItem, getItemCount = props.getItemCount, getItemLayout = props.getItemLayout;
|
|
(0, _invariant.default)(index5 >= 0 && index5 < getItemCount(data), "Tried to get frame for out of range index " + index5);
|
|
var item = getItem(data, index5);
|
|
var frame = this._frames[this._keyExtractor(item, index5, props)];
|
|
if (!frame || frame.index !== index5) {
|
|
if (getItemLayout) {
|
|
return getItemLayout(data, index5);
|
|
}
|
|
}
|
|
return frame;
|
|
};
|
|
this._getNonViewportRenderRegions = (props) => {
|
|
if (!(this._lastFocusedCellKey && this._cellRefs[this._lastFocusedCellKey])) {
|
|
return [];
|
|
}
|
|
var lastFocusedCellRenderer = this._cellRefs[this._lastFocusedCellKey];
|
|
var focusedCellIndex = lastFocusedCellRenderer.props.index;
|
|
var itemCount = props.getItemCount(props.data);
|
|
if (focusedCellIndex >= itemCount || this._keyExtractor(props.getItem(props.data, focusedCellIndex), focusedCellIndex, props) !== this._lastFocusedCellKey) {
|
|
return [];
|
|
}
|
|
var first = focusedCellIndex;
|
|
var heightOfCellsBeforeFocused = 0;
|
|
for (var i = first - 1; i >= 0 && heightOfCellsBeforeFocused < this._scrollMetrics.visibleLength; i--) {
|
|
first--;
|
|
heightOfCellsBeforeFocused += this.__getFrameMetricsApprox(i, props).length;
|
|
}
|
|
var last = focusedCellIndex;
|
|
var heightOfCellsAfterFocused = 0;
|
|
for (var _i = last + 1; _i < itemCount && heightOfCellsAfterFocused < this._scrollMetrics.visibleLength; _i++) {
|
|
last++;
|
|
heightOfCellsAfterFocused += this.__getFrameMetricsApprox(_i, props).length;
|
|
}
|
|
return [{
|
|
first,
|
|
last
|
|
}];
|
|
};
|
|
this._checkProps(_props);
|
|
this._fillRateHelper = new _FillRateHelper.default(this._getFrameMetrics);
|
|
this._updateCellsToRenderBatcher = new _Batchinator.default(this._updateCellsToRender, (_this$props$updateCel = this.props.updateCellsBatchingPeriod) !== null && _this$props$updateCel !== void 0 ? _this$props$updateCel : 50);
|
|
if (this.props.viewabilityConfigCallbackPairs) {
|
|
this._viewabilityTuples = this.props.viewabilityConfigCallbackPairs.map((pair) => ({
|
|
viewabilityHelper: new _ViewabilityHelper.default(pair.viewabilityConfig),
|
|
onViewableItemsChanged: pair.onViewableItemsChanged
|
|
}));
|
|
} else {
|
|
var _this$props3 = this.props, onViewableItemsChanged = _this$props3.onViewableItemsChanged, viewabilityConfig = _this$props3.viewabilityConfig;
|
|
if (onViewableItemsChanged) {
|
|
this._viewabilityTuples.push({
|
|
viewabilityHelper: new _ViewabilityHelper.default(viewabilityConfig),
|
|
onViewableItemsChanged
|
|
});
|
|
}
|
|
}
|
|
var initialRenderRegion = _VirtualizedList._initialRenderRegion(_props);
|
|
this.state = {
|
|
cellsAroundViewport: initialRenderRegion,
|
|
renderMask: _VirtualizedList._createRenderMask(_props, initialRenderRegion)
|
|
};
|
|
this.invertedWheelEventHandler = (ev) => {
|
|
var scrollOffset = this.props.horizontal ? ev.target.scrollLeft : ev.target.scrollTop;
|
|
var scrollLength = this.props.horizontal ? ev.target.scrollWidth : ev.target.scrollHeight;
|
|
var clientLength = this.props.horizontal ? ev.target.clientWidth : ev.target.clientHeight;
|
|
var isEventTargetScrollable = scrollLength > clientLength;
|
|
var delta = this.props.horizontal ? ev.deltaX || ev.wheelDeltaX : ev.deltaY || ev.wheelDeltaY;
|
|
var leftoverDelta = delta;
|
|
if (isEventTargetScrollable) {
|
|
leftoverDelta = delta < 0 ? Math.min(delta + scrollOffset, 0) : Math.max(delta - (scrollLength - clientLength - scrollOffset), 0);
|
|
}
|
|
var targetDelta = delta - leftoverDelta;
|
|
if (this.props.inverted && this._scrollRef && this._scrollRef.getScrollableNode) {
|
|
var node = this._scrollRef.getScrollableNode();
|
|
if (this.props.horizontal) {
|
|
ev.target.scrollLeft += targetDelta;
|
|
var nextScrollLeft = node.scrollLeft - leftoverDelta;
|
|
node.scrollLeft = !this.props.getItemLayout ? Math.min(nextScrollLeft, this._totalCellLength) : nextScrollLeft;
|
|
} else {
|
|
ev.target.scrollTop += targetDelta;
|
|
var nextScrollTop = node.scrollTop - leftoverDelta;
|
|
node.scrollTop = !this.props.getItemLayout ? Math.min(nextScrollTop, this._totalCellLength) : nextScrollTop;
|
|
}
|
|
ev.preventDefault();
|
|
}
|
|
};
|
|
}
|
|
_checkProps(props) {
|
|
var onScroll = props.onScroll, windowSize = props.windowSize, getItemCount = props.getItemCount, data = props.data, initialScrollIndex = props.initialScrollIndex;
|
|
(0, _invariant.default)(
|
|
// $FlowFixMe[prop-missing]
|
|
!onScroll || !onScroll.__isNative,
|
|
"Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent to support native onScroll events with useNativeDriver"
|
|
);
|
|
(0, _invariant.default)(windowSizeOrDefault(windowSize) > 0, "VirtualizedList: The windowSize prop must be present and set to a value greater than 0.");
|
|
(0, _invariant.default)(getItemCount, 'VirtualizedList: The "getItemCount" prop must be provided');
|
|
var itemCount = getItemCount(data);
|
|
if (initialScrollIndex != null && !this._hasTriggeredInitialScrollToIndex && (initialScrollIndex < 0 || itemCount > 0 && initialScrollIndex >= itemCount) && !this._hasWarned.initialScrollIndex) {
|
|
console.warn('initialScrollIndex "' + initialScrollIndex + '" is not valid (list has ' + itemCount + " items)");
|
|
this._hasWarned.initialScrollIndex = true;
|
|
}
|
|
if (__DEV__ && !this._hasWarned.flexWrap) {
|
|
var flatStyles = _StyleSheet.default.flatten(this.props.contentContainerStyle);
|
|
if (flatStyles != null && flatStyles.flexWrap === "wrap") {
|
|
console.warn("`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.Consider using `numColumns` with `FlatList` instead.");
|
|
this._hasWarned.flexWrap = true;
|
|
}
|
|
}
|
|
}
|
|
static _createRenderMask(props, cellsAroundViewport, additionalRegions) {
|
|
var itemCount = props.getItemCount(props.data);
|
|
(0, _invariant.default)(cellsAroundViewport.first >= 0 && cellsAroundViewport.last >= cellsAroundViewport.first - 1 && cellsAroundViewport.last < itemCount, 'Invalid cells around viewport "[' + cellsAroundViewport.first + ", " + cellsAroundViewport.last + ']" was passed to VirtualizedList._createRenderMask');
|
|
var renderMask = new _CellRenderMask.CellRenderMask(itemCount);
|
|
if (itemCount > 0) {
|
|
var allRegions = [cellsAroundViewport, ...additionalRegions !== null && additionalRegions !== void 0 ? additionalRegions : []];
|
|
for (var _i2 = 0, _allRegions = allRegions; _i2 < _allRegions.length; _i2++) {
|
|
var region = _allRegions[_i2];
|
|
renderMask.addCells(region);
|
|
}
|
|
if (props.initialScrollIndex == null || props.initialScrollIndex <= 0) {
|
|
var initialRegion = _VirtualizedList._initialRenderRegion(props);
|
|
renderMask.addCells(initialRegion);
|
|
}
|
|
var stickyIndicesSet = new Set(props.stickyHeaderIndices);
|
|
_VirtualizedList._ensureClosestStickyHeader(props, stickyIndicesSet, renderMask, cellsAroundViewport.first);
|
|
}
|
|
return renderMask;
|
|
}
|
|
static _initialRenderRegion(props) {
|
|
var _props$initialScrollI;
|
|
var itemCount = props.getItemCount(props.data);
|
|
var firstCellIndex = Math.max(0, Math.min(itemCount - 1, Math.floor((_props$initialScrollI = props.initialScrollIndex) !== null && _props$initialScrollI !== void 0 ? _props$initialScrollI : 0)));
|
|
var lastCellIndex = Math.min(itemCount, firstCellIndex + initialNumToRenderOrDefault(props.initialNumToRender)) - 1;
|
|
return {
|
|
first: firstCellIndex,
|
|
last: lastCellIndex
|
|
};
|
|
}
|
|
static _ensureClosestStickyHeader(props, stickyIndicesSet, renderMask, cellIdx) {
|
|
var stickyOffset = props.ListHeaderComponent ? 1 : 0;
|
|
for (var itemIdx = cellIdx - 1; itemIdx >= 0; itemIdx--) {
|
|
if (stickyIndicesSet.has(itemIdx + stickyOffset)) {
|
|
renderMask.addCells({
|
|
first: itemIdx,
|
|
last: itemIdx
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
_adjustCellsAroundViewport(props, cellsAroundViewport) {
|
|
var data = props.data, getItemCount = props.getItemCount;
|
|
var onEndReachedThreshold = onEndReachedThresholdOrDefault(props.onEndReachedThreshold);
|
|
var _this$_scrollMetrics = this._scrollMetrics, contentLength = _this$_scrollMetrics.contentLength, offset4 = _this$_scrollMetrics.offset, visibleLength = _this$_scrollMetrics.visibleLength;
|
|
var distanceFromEnd = contentLength - visibleLength - offset4;
|
|
if (visibleLength <= 0 || contentLength <= 0) {
|
|
return cellsAroundViewport.last >= getItemCount(data) ? _VirtualizedList._constrainToItemCount(cellsAroundViewport, props) : cellsAroundViewport;
|
|
}
|
|
var newCellsAroundViewport;
|
|
if (props.disableVirtualization) {
|
|
var renderAhead = distanceFromEnd < onEndReachedThreshold * visibleLength ? maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch) : 0;
|
|
newCellsAroundViewport = {
|
|
first: 0,
|
|
last: Math.min(cellsAroundViewport.last + renderAhead, getItemCount(data) - 1)
|
|
};
|
|
} else {
|
|
if (props.initialScrollIndex && !this._scrollMetrics.offset && Math.abs(distanceFromEnd) >= Number.EPSILON) {
|
|
return cellsAroundViewport.last >= getItemCount(data) ? _VirtualizedList._constrainToItemCount(cellsAroundViewport, props) : cellsAroundViewport;
|
|
}
|
|
newCellsAroundViewport = (0, _VirtualizeUtils.computeWindowedRenderLimits)(props, maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch), windowSizeOrDefault(props.windowSize), cellsAroundViewport, this.__getFrameMetricsApprox, this._scrollMetrics);
|
|
(0, _invariant.default)(newCellsAroundViewport.last < getItemCount(data), "computeWindowedRenderLimits() should return range in-bounds");
|
|
}
|
|
if (this._nestedChildLists.size() > 0) {
|
|
var childIdx = this._findFirstChildWithMore(newCellsAroundViewport.first, newCellsAroundViewport.last);
|
|
newCellsAroundViewport.last = childIdx !== null && childIdx !== void 0 ? childIdx : newCellsAroundViewport.last;
|
|
}
|
|
return newCellsAroundViewport;
|
|
}
|
|
_findFirstChildWithMore(first, last) {
|
|
for (var ii = first; ii <= last; ii++) {
|
|
var cellKeyForIndex = this._indicesToKeys.get(ii);
|
|
if (cellKeyForIndex != null && this._nestedChildLists.anyInCell(cellKeyForIndex, (childList) => childList.hasMore())) {
|
|
return ii;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
componentDidMount() {
|
|
if (this._isNestedWithSameOrientation()) {
|
|
this.context.registerAsNestedChild({
|
|
ref: this,
|
|
cellKey: this.context.cellKey
|
|
});
|
|
}
|
|
this.setupWebWheelHandler();
|
|
}
|
|
componentWillUnmount() {
|
|
if (this._isNestedWithSameOrientation()) {
|
|
this.context.unregisterAsNestedChild({
|
|
ref: this
|
|
});
|
|
}
|
|
this._updateCellsToRenderBatcher.dispose({
|
|
abort: true
|
|
});
|
|
this._viewabilityTuples.forEach((tuple) => {
|
|
tuple.viewabilityHelper.dispose();
|
|
});
|
|
this._fillRateHelper.deactivateAndFlush();
|
|
this.teardownWebWheelHandler();
|
|
}
|
|
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
|
|
setupWebWheelHandler() {
|
|
if (this._scrollRef && this._scrollRef.getScrollableNode) {
|
|
this._scrollRef.getScrollableNode().addEventListener("wheel", this.invertedWheelEventHandler);
|
|
} else {
|
|
setTimeout(() => this.setupWebWheelHandler(), 50);
|
|
return;
|
|
}
|
|
}
|
|
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
|
|
teardownWebWheelHandler() {
|
|
if (this._scrollRef && this._scrollRef.getScrollableNode) {
|
|
this._scrollRef.getScrollableNode().removeEventListener("wheel", this.invertedWheelEventHandler);
|
|
}
|
|
}
|
|
static getDerivedStateFromProps(newProps, prevState) {
|
|
var itemCount = newProps.getItemCount(newProps.data);
|
|
if (itemCount === prevState.renderMask.numCells()) {
|
|
return prevState;
|
|
}
|
|
var constrainedCells = _VirtualizedList._constrainToItemCount(prevState.cellsAroundViewport, newProps);
|
|
return {
|
|
cellsAroundViewport: constrainedCells,
|
|
renderMask: _VirtualizedList._createRenderMask(newProps, constrainedCells)
|
|
};
|
|
}
|
|
_pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) {
|
|
var _this = this;
|
|
var _this$props4 = this.props, CellRendererComponent = _this$props4.CellRendererComponent, ItemSeparatorComponent = _this$props4.ItemSeparatorComponent, ListHeaderComponent = _this$props4.ListHeaderComponent, ListItemComponent2 = _this$props4.ListItemComponent, data = _this$props4.data, debug = _this$props4.debug, getItem = _this$props4.getItem, getItemCount = _this$props4.getItemCount, getItemLayout = _this$props4.getItemLayout, horizontal = _this$props4.horizontal, renderItem = _this$props4.renderItem;
|
|
var stickyOffset = ListHeaderComponent ? 1 : 0;
|
|
var end = getItemCount(data) - 1;
|
|
var prevCellKey;
|
|
last = Math.min(end, last);
|
|
var _loop = /* @__PURE__ */ __name(function _loop2() {
|
|
var item = getItem(data, ii);
|
|
var key = _this._keyExtractor(item, ii, _this.props);
|
|
_this._indicesToKeys.set(ii, key);
|
|
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
|
|
stickyHeaderIndices.push(cells.length);
|
|
}
|
|
var shouldListenForLayout = getItemLayout == null || debug || _this._fillRateHelper.enabled();
|
|
cells.push(/* @__PURE__ */ React83.createElement(_VirtualizedListCellRenderer.default, (0, _extends2.default)({
|
|
CellRendererComponent,
|
|
ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : void 0,
|
|
ListItemComponent: ListItemComponent2,
|
|
cellKey: key,
|
|
horizontal,
|
|
index: ii,
|
|
inversionStyle,
|
|
item,
|
|
key,
|
|
prevCellKey,
|
|
onUpdateSeparators: _this._onUpdateSeparators,
|
|
onCellFocusCapture: /* @__PURE__ */ __name((e) => _this._onCellFocusCapture(key), "onCellFocusCapture"),
|
|
onUnmount: _this._onCellUnmount,
|
|
ref: /* @__PURE__ */ __name((_ref) => {
|
|
_this._cellRefs[key] = _ref;
|
|
}, "ref"),
|
|
renderItem
|
|
}, shouldListenForLayout && {
|
|
onCellLayout: _this._onCellLayout
|
|
})));
|
|
prevCellKey = key;
|
|
}, "_loop");
|
|
for (var ii = first; ii <= last; ii++) {
|
|
_loop();
|
|
}
|
|
}
|
|
static _constrainToItemCount(cells, props) {
|
|
var itemCount = props.getItemCount(props.data);
|
|
var last = Math.min(itemCount - 1, cells.last);
|
|
var maxToRenderPerBatch = maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch);
|
|
return {
|
|
first: (0, _clamp.default)(0, itemCount - 1 - maxToRenderPerBatch, cells.first),
|
|
last
|
|
};
|
|
}
|
|
_isNestedWithSameOrientation() {
|
|
var nestedContext = this.context;
|
|
return !!(nestedContext && !!nestedContext.horizontal === horizontalOrDefault(this.props.horizontal));
|
|
}
|
|
_keyExtractor(item, index5, props) {
|
|
if (props.keyExtractor != null) {
|
|
return props.keyExtractor(item, index5);
|
|
}
|
|
var key = (0, _VirtualizeUtils.keyExtractor)(item, index5);
|
|
if (key === String(index5)) {
|
|
_usedIndexForKey = true;
|
|
if (item.type && item.type.displayName) {
|
|
_keylessItemComponentName = item.type.displayName;
|
|
}
|
|
}
|
|
return key;
|
|
}
|
|
render() {
|
|
this._checkProps(this.props);
|
|
var _this$props5 = this.props, ListEmptyComponent = _this$props5.ListEmptyComponent, ListFooterComponent = _this$props5.ListFooterComponent, ListHeaderComponent = _this$props5.ListHeaderComponent;
|
|
var _this$props6 = this.props, data = _this$props6.data, horizontal = _this$props6.horizontal;
|
|
var inversionStyle = this.props.inverted ? horizontalOrDefault(this.props.horizontal) ? styles.horizontallyInverted : styles.verticallyInverted : null;
|
|
var cells = [];
|
|
var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
|
|
var stickyHeaderIndices = [];
|
|
if (ListHeaderComponent) {
|
|
if (stickyIndicesFromProps.has(0)) {
|
|
stickyHeaderIndices.push(0);
|
|
}
|
|
var _element = /* @__PURE__ */ React83.isValidElement(ListHeaderComponent) ? ListHeaderComponent : (
|
|
// $FlowFixMe[not-a-component]
|
|
// $FlowFixMe[incompatible-type-arg]
|
|
/* @__PURE__ */ React83.createElement(ListHeaderComponent, null)
|
|
);
|
|
cells.push(/* @__PURE__ */ React83.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
|
|
cellKey: this._getCellKey() + "-header",
|
|
key: "$header"
|
|
}, /* @__PURE__ */ React83.createElement(
|
|
_View.default,
|
|
{
|
|
onLayout: this._onLayoutHeader,
|
|
style: [inversionStyle, this.props.ListHeaderComponentStyle]
|
|
},
|
|
// $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors
|
|
_element
|
|
)));
|
|
}
|
|
var itemCount = this.props.getItemCount(data);
|
|
if (itemCount === 0 && ListEmptyComponent) {
|
|
var _element2 = /* @__PURE__ */ React83.isValidElement(ListEmptyComponent) ? ListEmptyComponent : (
|
|
// $FlowFixMe[not-a-component]
|
|
// $FlowFixMe[incompatible-type-arg]
|
|
/* @__PURE__ */ React83.createElement(ListEmptyComponent, null)
|
|
);
|
|
cells.push(/* @__PURE__ */ React83.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
|
|
cellKey: this._getCellKey() + "-empty",
|
|
key: "$empty"
|
|
}, /* @__PURE__ */ React83.cloneElement(_element2, {
|
|
onLayout: /* @__PURE__ */ __name((event) => {
|
|
this._onLayoutEmpty(event);
|
|
if (_element2.props.onLayout) {
|
|
_element2.props.onLayout(event);
|
|
}
|
|
}, "onLayout"),
|
|
style: [inversionStyle, _element2.props.style]
|
|
})));
|
|
}
|
|
if (itemCount > 0) {
|
|
_usedIndexForKey = false;
|
|
_keylessItemComponentName = "";
|
|
var spacerKey = this._getSpacerKey(!horizontal);
|
|
var renderRegions = this.state.renderMask.enumerateRegions();
|
|
var lastSpacer = findLastWhere(renderRegions, (r) => r.isSpacer);
|
|
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(renderRegions), _step; !(_step = _iterator()).done; ) {
|
|
var section = _step.value;
|
|
if (section.isSpacer) {
|
|
if (this.props.disableVirtualization) {
|
|
continue;
|
|
}
|
|
var isLastSpacer = section === lastSpacer;
|
|
var constrainToMeasured = isLastSpacer && !this.props.getItemLayout;
|
|
var last = constrainToMeasured ? (0, _clamp.default)(section.first - 1, section.last, this._highestMeasuredFrameIndex) : section.last;
|
|
var firstMetrics = this.__getFrameMetricsApprox(section.first, this.props);
|
|
var lastMetrics = this.__getFrameMetricsApprox(last, this.props);
|
|
var spacerSize = lastMetrics.offset + lastMetrics.length - firstMetrics.offset;
|
|
cells.push(/* @__PURE__ */ React83.createElement(_View.default, {
|
|
key: "$spacer-" + section.first,
|
|
style: {
|
|
[spacerKey]: spacerSize
|
|
}
|
|
}));
|
|
} else {
|
|
this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, section.first, section.last, inversionStyle);
|
|
}
|
|
}
|
|
if (!this._hasWarned.keys && _usedIndexForKey) {
|
|
console.warn("VirtualizedList: missing keys for items, make sure to specify a key or id property on each item or provide a custom keyExtractor.", _keylessItemComponentName);
|
|
this._hasWarned.keys = true;
|
|
}
|
|
}
|
|
if (ListFooterComponent) {
|
|
var _element3 = /* @__PURE__ */ React83.isValidElement(ListFooterComponent) ? ListFooterComponent : (
|
|
// $FlowFixMe[not-a-component]
|
|
// $FlowFixMe[incompatible-type-arg]
|
|
/* @__PURE__ */ React83.createElement(ListFooterComponent, null)
|
|
);
|
|
cells.push(/* @__PURE__ */ React83.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
|
|
cellKey: this._getFooterCellKey(),
|
|
key: "$footer"
|
|
}, /* @__PURE__ */ React83.createElement(
|
|
_View.default,
|
|
{
|
|
onLayout: this._onLayoutFooter,
|
|
style: [inversionStyle, this.props.ListFooterComponentStyle]
|
|
},
|
|
// $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors
|
|
_element3
|
|
)));
|
|
}
|
|
var scrollProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props), {}, {
|
|
onContentSizeChange: this._onContentSizeChange,
|
|
onLayout: this._onLayout,
|
|
onScroll: this._onScroll,
|
|
onScrollBeginDrag: this._onScrollBeginDrag,
|
|
onScrollEndDrag: this._onScrollEndDrag,
|
|
onMomentumScrollBegin: this._onMomentumScrollBegin,
|
|
onMomentumScrollEnd: this._onMomentumScrollEnd,
|
|
scrollEventThrottle: scrollEventThrottleOrDefault(this.props.scrollEventThrottle),
|
|
// TODO: Android support
|
|
invertStickyHeaders: this.props.invertStickyHeaders !== void 0 ? this.props.invertStickyHeaders : this.props.inverted,
|
|
stickyHeaderIndices,
|
|
style: inversionStyle ? [inversionStyle, this.props.style] : this.props.style
|
|
});
|
|
this._hasMore = this.state.cellsAroundViewport.last < itemCount - 1;
|
|
var innerRet = /* @__PURE__ */ React83.createElement(_VirtualizedListContext.VirtualizedListContextProvider, {
|
|
value: {
|
|
cellKey: null,
|
|
getScrollMetrics: this._getScrollMetrics,
|
|
horizontal: horizontalOrDefault(this.props.horizontal),
|
|
getOutermostParentListRef: this._getOutermostParentListRef,
|
|
registerAsNestedChild: this._registerAsNestedChild,
|
|
unregisterAsNestedChild: this._unregisterAsNestedChild
|
|
}
|
|
}, /* @__PURE__ */ React83.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), {
|
|
ref: this._captureScrollRef
|
|
}, cells));
|
|
var ret = innerRet;
|
|
if (this.props.debug) {
|
|
return /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: styles.debug
|
|
}, ret, this._renderDebugOverlay());
|
|
} else {
|
|
return ret;
|
|
}
|
|
}
|
|
componentDidUpdate(prevProps) {
|
|
var _this$props7 = this.props, data = _this$props7.data, extraData = _this$props7.extraData;
|
|
if (data !== prevProps.data || extraData !== prevProps.extraData) {
|
|
this._viewabilityTuples.forEach((tuple) => {
|
|
tuple.viewabilityHelper.resetViewableIndices();
|
|
});
|
|
}
|
|
var hiPriInProgress = this._hiPriInProgress;
|
|
this._scheduleCellsToRenderUpdate();
|
|
if (hiPriInProgress) {
|
|
this._hiPriInProgress = false;
|
|
}
|
|
}
|
|
// Used for preventing scrollToIndex from being called multiple times for initialScrollIndex
|
|
// flag to prevent infinite hiPri cell limit update
|
|
// $FlowFixMe[missing-local-annot]
|
|
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
* LTI update could not be added via codemod */
|
|
_computeBlankness() {
|
|
this._fillRateHelper.computeBlankness(this.props, this.state.cellsAroundViewport, this._scrollMetrics);
|
|
}
|
|
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
* LTI update could not be added via codemod */
|
|
_onCellFocusCapture(cellKey) {
|
|
this._lastFocusedCellKey = cellKey;
|
|
this._updateCellsToRender();
|
|
}
|
|
_triggerRemeasureForChildListsInCell(cellKey) {
|
|
this._nestedChildLists.forEachInCell(cellKey, (childList) => {
|
|
childList.measureLayoutRelativeToContainingList();
|
|
});
|
|
}
|
|
measureLayoutRelativeToContainingList() {
|
|
try {
|
|
if (!this._scrollRef) {
|
|
return;
|
|
}
|
|
this._scrollRef.measureLayout(this.context.getOutermostParentListRef().getScrollRef(), (x, y, width, height) => {
|
|
this._offsetFromParentVirtualizedList = this._selectOffset({
|
|
x,
|
|
y
|
|
});
|
|
this._scrollMetrics.contentLength = this._selectLength({
|
|
width,
|
|
height
|
|
});
|
|
var scrollMetrics = this._convertParentScrollMetrics(this.context.getScrollMetrics());
|
|
var metricsChanged = this._scrollMetrics.visibleLength !== scrollMetrics.visibleLength || this._scrollMetrics.offset !== scrollMetrics.offset;
|
|
if (metricsChanged) {
|
|
this._scrollMetrics.visibleLength = scrollMetrics.visibleLength;
|
|
this._scrollMetrics.offset = scrollMetrics.offset;
|
|
this._nestedChildLists.forEach((childList) => {
|
|
childList.measureLayoutRelativeToContainingList();
|
|
});
|
|
}
|
|
}, (error4) => {
|
|
console.warn("VirtualizedList: Encountered an error while measuring a list's offset from its containing VirtualizedList.");
|
|
});
|
|
} catch (error4) {
|
|
console.warn("measureLayoutRelativeToContainingList threw an error", error4.stack);
|
|
}
|
|
}
|
|
_getFooterCellKey() {
|
|
return this._getCellKey() + "-footer";
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
_renderDebugOverlay() {
|
|
var normalize = this._scrollMetrics.visibleLength / (this._scrollMetrics.contentLength || 1);
|
|
var framesInLayout = [];
|
|
var itemCount = this.props.getItemCount(this.props.data);
|
|
for (var ii = 0; ii < itemCount; ii++) {
|
|
var frame = this.__getFrameMetricsApprox(ii, this.props);
|
|
if (frame.inLayout) {
|
|
framesInLayout.push(frame);
|
|
}
|
|
}
|
|
var windowTop = this.__getFrameMetricsApprox(this.state.cellsAroundViewport.first, this.props).offset;
|
|
var frameLast = this.__getFrameMetricsApprox(this.state.cellsAroundViewport.last, this.props);
|
|
var windowLen = frameLast.offset + frameLast.length - windowTop;
|
|
var visTop = this._scrollMetrics.offset;
|
|
var visLen = this._scrollMetrics.visibleLength;
|
|
return /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [styles.debugOverlayBase, styles.debugOverlay]
|
|
}, framesInLayout.map((f, ii2) => /* @__PURE__ */ React83.createElement(_View.default, {
|
|
key: "f" + ii2,
|
|
style: [styles.debugOverlayBase, styles.debugOverlayFrame, {
|
|
top: f.offset * normalize,
|
|
height: f.length * normalize
|
|
}]
|
|
})), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [styles.debugOverlayBase, styles.debugOverlayFrameLast, {
|
|
top: windowTop * normalize,
|
|
height: windowLen * normalize
|
|
}]
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [styles.debugOverlayBase, styles.debugOverlayFrameVis, {
|
|
top: visTop * normalize,
|
|
height: visLen * normalize
|
|
}]
|
|
}));
|
|
}
|
|
_selectLength(metrics) {
|
|
return !horizontalOrDefault(this.props.horizontal) ? metrics.height : metrics.width;
|
|
}
|
|
_selectOffset(metrics) {
|
|
return !horizontalOrDefault(this.props.horizontal) ? metrics.y : metrics.x;
|
|
}
|
|
_maybeCallOnEdgeReached() {
|
|
var _this$props8 = this.props, data = _this$props8.data, getItemCount = _this$props8.getItemCount, onStartReached = _this$props8.onStartReached, onStartReachedThreshold = _this$props8.onStartReachedThreshold, onEndReached = _this$props8.onEndReached, onEndReachedThreshold = _this$props8.onEndReachedThreshold, initialScrollIndex = _this$props8.initialScrollIndex;
|
|
var _this$_scrollMetrics2 = this._scrollMetrics, contentLength = _this$_scrollMetrics2.contentLength, visibleLength = _this$_scrollMetrics2.visibleLength, offset4 = _this$_scrollMetrics2.offset;
|
|
var distanceFromStart = offset4;
|
|
var distanceFromEnd = contentLength - visibleLength - offset4;
|
|
if (distanceFromStart < ON_EDGE_REACHED_EPSILON) {
|
|
distanceFromStart = 0;
|
|
}
|
|
if (distanceFromEnd < ON_EDGE_REACHED_EPSILON) {
|
|
distanceFromEnd = 0;
|
|
}
|
|
var DEFAULT_THRESHOLD_PX = 2;
|
|
var startThreshold = onStartReachedThreshold != null ? onStartReachedThreshold * visibleLength : DEFAULT_THRESHOLD_PX;
|
|
var endThreshold = onEndReachedThreshold != null ? onEndReachedThreshold * visibleLength : DEFAULT_THRESHOLD_PX;
|
|
var isWithinStartThreshold = distanceFromStart <= startThreshold;
|
|
var isWithinEndThreshold = distanceFromEnd <= endThreshold;
|
|
if (onEndReached && this.state.cellsAroundViewport.last === getItemCount(data) - 1 && isWithinEndThreshold && this._scrollMetrics.contentLength !== this._sentEndForContentLength) {
|
|
this._sentEndForContentLength = this._scrollMetrics.contentLength;
|
|
onEndReached({
|
|
distanceFromEnd
|
|
});
|
|
} else if (onStartReached != null && this.state.cellsAroundViewport.first === 0 && isWithinStartThreshold && this._scrollMetrics.contentLength !== this._sentStartForContentLength) {
|
|
if (!initialScrollIndex || this._scrollMetrics.timestamp !== 0) {
|
|
this._sentStartForContentLength = this._scrollMetrics.contentLength;
|
|
onStartReached({
|
|
distanceFromStart
|
|
});
|
|
}
|
|
} else {
|
|
this._sentStartForContentLength = isWithinStartThreshold ? this._sentStartForContentLength : 0;
|
|
this._sentEndForContentLength = isWithinEndThreshold ? this._sentEndForContentLength : 0;
|
|
}
|
|
}
|
|
/* Translates metrics from a scroll event in a parent VirtualizedList into
|
|
* coordinates relative to the child list.
|
|
*/
|
|
_scheduleCellsToRenderUpdate() {
|
|
var _this$state$cellsArou = this.state.cellsAroundViewport, first = _this$state$cellsArou.first, last = _this$state$cellsArou.last;
|
|
var _this$_scrollMetrics3 = this._scrollMetrics, offset4 = _this$_scrollMetrics3.offset, visibleLength = _this$_scrollMetrics3.visibleLength, velocity = _this$_scrollMetrics3.velocity;
|
|
var itemCount = this.props.getItemCount(this.props.data);
|
|
var hiPri = false;
|
|
var onStartReachedThreshold = onStartReachedThresholdOrDefault(this.props.onStartReachedThreshold);
|
|
var onEndReachedThreshold = onEndReachedThresholdOrDefault(this.props.onEndReachedThreshold);
|
|
if (first > 0) {
|
|
var distTop = offset4 - this.__getFrameMetricsApprox(first, this.props).offset;
|
|
hiPri = distTop < 0 || velocity < -2 && distTop < getScrollingThreshold(onStartReachedThreshold, visibleLength);
|
|
}
|
|
if (!hiPri && last >= 0 && last < itemCount - 1) {
|
|
var distBottom = this.__getFrameMetricsApprox(last, this.props).offset - (offset4 + visibleLength);
|
|
hiPri = distBottom < 0 || velocity > 2 && distBottom < getScrollingThreshold(onEndReachedThreshold, visibleLength);
|
|
}
|
|
if (hiPri && (this._averageCellLength || this.props.getItemLayout) && !this._hiPriInProgress) {
|
|
this._hiPriInProgress = true;
|
|
this._updateCellsToRenderBatcher.dispose({
|
|
abort: true
|
|
});
|
|
this._updateCellsToRender();
|
|
return;
|
|
} else {
|
|
this._updateCellsToRenderBatcher.schedule();
|
|
}
|
|
}
|
|
/**
|
|
* Gets an approximate offset to an item at a given index. Supports
|
|
* fractional indices.
|
|
*/
|
|
_updateViewableItems(props, cellsAroundViewport) {
|
|
this._viewabilityTuples.forEach((tuple) => {
|
|
tuple.viewabilityHelper.onUpdate(props, this._scrollMetrics.offset, this._scrollMetrics.visibleLength, this._getFrameMetrics, this._createViewToken, tuple.onViewableItemsChanged, cellsAroundViewport);
|
|
});
|
|
}
|
|
};
|
|
VirtualizedList.contextType = _VirtualizedListContext.VirtualizedListContext;
|
|
var styles = _StyleSheet.default.create({
|
|
verticallyInverted: {
|
|
transform: "scaleY(-1)"
|
|
},
|
|
horizontallyInverted: {
|
|
transform: "scaleX(-1)"
|
|
},
|
|
debug: {
|
|
flex: 1
|
|
},
|
|
debugOverlayBase: {
|
|
position: "absolute",
|
|
top: 0,
|
|
right: 0
|
|
},
|
|
debugOverlay: {
|
|
bottom: 0,
|
|
width: 20,
|
|
borderColor: "blue",
|
|
borderWidth: 1
|
|
},
|
|
debugOverlayFrame: {
|
|
left: 0,
|
|
backgroundColor: "orange"
|
|
},
|
|
debugOverlayFrameLast: {
|
|
left: 0,
|
|
borderColor: "green",
|
|
borderWidth: 2
|
|
},
|
|
debugOverlayFrameVis: {
|
|
left: 0,
|
|
borderColor: "red",
|
|
borderWidth: 2
|
|
}
|
|
});
|
|
var _default = exports2.default = VirtualizedList;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/memoize-one/dist/memoize-one.cjs.js
|
|
var require_memoize_one_cjs = __commonJS({
|
|
"node_modules/memoize-one/dist/memoize-one.cjs.js"(exports2, module2) {
|
|
"use strict";
|
|
var safeIsNaN = Number.isNaN || /* @__PURE__ */ __name(function ponyfill(value) {
|
|
return typeof value === "number" && value !== value;
|
|
}, "ponyfill");
|
|
function isEqual(first, second) {
|
|
if (first === second) {
|
|
return true;
|
|
}
|
|
if (safeIsNaN(first) && safeIsNaN(second)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
__name(isEqual, "isEqual");
|
|
function areInputsEqual(newInputs, lastInputs) {
|
|
if (newInputs.length !== lastInputs.length) {
|
|
return false;
|
|
}
|
|
for (var i = 0; i < newInputs.length; i++) {
|
|
if (!isEqual(newInputs[i], lastInputs[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
__name(areInputsEqual, "areInputsEqual");
|
|
function memoizeOne(resultFn, isEqual2) {
|
|
if (isEqual2 === void 0) {
|
|
isEqual2 = areInputsEqual;
|
|
}
|
|
var cache3 = null;
|
|
function memoized() {
|
|
var newArgs = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
newArgs[_i] = arguments[_i];
|
|
}
|
|
if (cache3 && cache3.lastThis === this && isEqual2(newArgs, cache3.lastArgs)) {
|
|
return cache3.lastResult;
|
|
}
|
|
var lastResult = resultFn.apply(this, newArgs);
|
|
cache3 = {
|
|
lastResult,
|
|
lastArgs: newArgs,
|
|
lastThis: this
|
|
};
|
|
return lastResult;
|
|
}
|
|
__name(memoized, "memoized");
|
|
memoized.clear = /* @__PURE__ */ __name(function clear() {
|
|
cache3 = null;
|
|
}, "clear");
|
|
return memoized;
|
|
}
|
|
__name(memoizeOne, "memoizeOne");
|
|
module2.exports = memoizeOne;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/FlatList/index.js
|
|
var require_FlatList = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/FlatList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _deepDiffer = _interopRequireDefault(require_deepDiffer());
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _VirtualizedList = _interopRequireDefault(require_VirtualizedList());
|
|
var _VirtualizeUtils = require_VirtualizeUtils();
|
|
var _memoizeOne = _interopRequireDefault(require_memoize_one_cjs());
|
|
var _excluded = ["numColumns", "columnWrapperStyle", "removeClippedSubviews", "strictMode"];
|
|
function removeClippedSubviewsOrDefault(removeClippedSubviews) {
|
|
return removeClippedSubviews !== null && removeClippedSubviews !== void 0 ? removeClippedSubviews : _Platform.default.OS === "android";
|
|
}
|
|
__name(removeClippedSubviewsOrDefault, "removeClippedSubviewsOrDefault");
|
|
function numColumnsOrDefault(numColumns) {
|
|
return numColumns !== null && numColumns !== void 0 ? numColumns : 1;
|
|
}
|
|
__name(numColumnsOrDefault, "numColumnsOrDefault");
|
|
function isArrayLike(data) {
|
|
return typeof Object(data).length === "number";
|
|
}
|
|
__name(isArrayLike, "isArrayLike");
|
|
var FlatList = class extends React83.PureComponent {
|
|
static {
|
|
__name(this, "FlatList");
|
|
}
|
|
/**
|
|
* Scrolls to the end of the content. May be janky without `getItemLayout` prop.
|
|
*/
|
|
scrollToEnd(params) {
|
|
if (this._listRef) {
|
|
this._listRef.scrollToEnd(params);
|
|
}
|
|
}
|
|
/**
|
|
* Scrolls to the item at the specified index such that it is positioned in the viewable area
|
|
* such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the
|
|
* middle. `viewOffset` is a fixed number of pixels to offset the final target position.
|
|
*
|
|
* Note: cannot scroll to locations outside the render window without specifying the
|
|
* `getItemLayout` prop.
|
|
*/
|
|
scrollToIndex(params) {
|
|
if (this._listRef) {
|
|
this._listRef.scrollToIndex(params);
|
|
}
|
|
}
|
|
/**
|
|
* Requires linear scan through data - use `scrollToIndex` instead if possible.
|
|
*
|
|
* Note: cannot scroll to locations outside the render window without specifying the
|
|
* `getItemLayout` prop.
|
|
*/
|
|
scrollToItem(params) {
|
|
if (this._listRef) {
|
|
this._listRef.scrollToItem(params);
|
|
}
|
|
}
|
|
/**
|
|
* Scroll to a specific content pixel offset in the list.
|
|
*
|
|
* Check out [scrollToOffset](docs/virtualizedlist.html#scrolltooffset) of VirtualizedList
|
|
*/
|
|
scrollToOffset(params) {
|
|
if (this._listRef) {
|
|
this._listRef.scrollToOffset(params);
|
|
}
|
|
}
|
|
/**
|
|
* Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.
|
|
* if `waitForInteractions` is true and the user has not scrolled. This is typically called by
|
|
* taps on items or by navigation actions.
|
|
*/
|
|
recordInteraction() {
|
|
if (this._listRef) {
|
|
this._listRef.recordInteraction();
|
|
}
|
|
}
|
|
/**
|
|
* Displays the scroll indicators momentarily.
|
|
*
|
|
* @platform ios
|
|
*/
|
|
flashScrollIndicators() {
|
|
if (this._listRef) {
|
|
this._listRef.flashScrollIndicators();
|
|
}
|
|
}
|
|
/**
|
|
* Provides a handle to the underlying scroll responder.
|
|
*/
|
|
getScrollResponder() {
|
|
if (this._listRef) {
|
|
return this._listRef.getScrollResponder();
|
|
}
|
|
}
|
|
/**
|
|
* Provides a reference to the underlying host component
|
|
*/
|
|
getNativeScrollRef() {
|
|
if (this._listRef) {
|
|
return this._listRef.getScrollRef();
|
|
}
|
|
}
|
|
getScrollableNode() {
|
|
if (this._listRef) {
|
|
return this._listRef.getScrollableNode();
|
|
}
|
|
}
|
|
constructor(_props) {
|
|
super(_props);
|
|
this._virtualizedListPairs = [];
|
|
this._captureRef = (ref) => {
|
|
this._listRef = ref;
|
|
};
|
|
this._getItem = (data, index5) => {
|
|
var numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
if (numColumns > 1) {
|
|
var ret = [];
|
|
for (var kk = 0; kk < numColumns; kk++) {
|
|
var itemIndex = index5 * numColumns + kk;
|
|
if (itemIndex < data.length) {
|
|
var _item = data[itemIndex];
|
|
ret.push(_item);
|
|
}
|
|
}
|
|
return ret;
|
|
} else {
|
|
return data[index5];
|
|
}
|
|
};
|
|
this._getItemCount = (data) => {
|
|
if (data != null && isArrayLike(data)) {
|
|
var numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length;
|
|
} else {
|
|
return 0;
|
|
}
|
|
};
|
|
this._keyExtractor = (items, index5) => {
|
|
var _this$props$keyExtrac;
|
|
var numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
var keyExtractor = (_this$props$keyExtrac = this.props.keyExtractor) !== null && _this$props$keyExtrac !== void 0 ? _this$props$keyExtrac : _VirtualizeUtils.keyExtractor;
|
|
if (numColumns > 1) {
|
|
(0, _invariant.default)(Array.isArray(items), "FlatList: Encountered internal consistency error, expected each item to consist of an array with 1-%s columns; instead, received a single item.", numColumns);
|
|
return items.map((item, kk) => keyExtractor(item, index5 * numColumns + kk)).join(":");
|
|
}
|
|
return keyExtractor(items, index5);
|
|
};
|
|
this._renderer = (ListItemComponent2, renderItem, columnWrapperStyle, numColumns, extraData) => {
|
|
var cols = numColumnsOrDefault(numColumns);
|
|
var render = /* @__PURE__ */ __name((props) => {
|
|
if (ListItemComponent2) {
|
|
return /* @__PURE__ */ React83.createElement(ListItemComponent2, props);
|
|
} else if (renderItem) {
|
|
return renderItem(props);
|
|
} else {
|
|
return null;
|
|
}
|
|
}, "render");
|
|
var renderProp = /* @__PURE__ */ __name((info) => {
|
|
if (cols > 1) {
|
|
var _item2 = info.item, _index = info.index;
|
|
(0, _invariant.default)(Array.isArray(_item2), "Expected array of items with numColumns > 1");
|
|
return /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [styles.row, columnWrapperStyle]
|
|
}, _item2.map((it, kk) => {
|
|
var element = render({
|
|
// $FlowFixMe[incompatible-call]
|
|
item: it,
|
|
index: _index * cols + kk,
|
|
separators: info.separators
|
|
});
|
|
return element != null ? /* @__PURE__ */ React83.createElement(React83.Fragment, {
|
|
key: kk
|
|
}, element) : null;
|
|
}));
|
|
} else {
|
|
return render(info);
|
|
}
|
|
}, "renderProp");
|
|
return ListItemComponent2 ? {
|
|
ListItemComponent: renderProp
|
|
} : {
|
|
renderItem: renderProp
|
|
};
|
|
};
|
|
this._memoizedRenderer = (0, _memoizeOne.default)(this._renderer);
|
|
this._checkProps(this.props);
|
|
if (this.props.viewabilityConfigCallbackPairs) {
|
|
this._virtualizedListPairs = this.props.viewabilityConfigCallbackPairs.map((pair) => ({
|
|
viewabilityConfig: pair.viewabilityConfig,
|
|
onViewableItemsChanged: this._createOnViewableItemsChanged(pair.onViewableItemsChanged)
|
|
}));
|
|
} else if (this.props.onViewableItemsChanged) {
|
|
this._virtualizedListPairs.push({
|
|
/* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This
|
|
* comment suppresses an error found when Flow v0.63 was deployed. To
|
|
* see the error delete this comment and run Flow. */
|
|
viewabilityConfig: this.props.viewabilityConfig,
|
|
onViewableItemsChanged: this._createOnViewableItemsChanged(this.props.onViewableItemsChanged)
|
|
});
|
|
}
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
componentDidUpdate(prevProps) {
|
|
(0, _invariant.default)(prevProps.numColumns === this.props.numColumns, "Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component.");
|
|
(0, _invariant.default)(prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged, "Changing onViewableItemsChanged on the fly is not supported");
|
|
(0, _invariant.default)(!(0, _deepDiffer.default)(prevProps.viewabilityConfig, this.props.viewabilityConfig), "Changing viewabilityConfig on the fly is not supported");
|
|
(0, _invariant.default)(prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, "Changing viewabilityConfigCallbackPairs on the fly is not supported");
|
|
this._checkProps(this.props);
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
_checkProps(props) {
|
|
var getItem = props.getItem, getItemCount = props.getItemCount, horizontal = props.horizontal, columnWrapperStyle = props.columnWrapperStyle, onViewableItemsChanged = props.onViewableItemsChanged, viewabilityConfigCallbackPairs = props.viewabilityConfigCallbackPairs;
|
|
var numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
(0, _invariant.default)(!getItem && !getItemCount, "FlatList does not support custom data formats.");
|
|
if (numColumns > 1) {
|
|
(0, _invariant.default)(!horizontal, "numColumns does not support horizontal.");
|
|
} else {
|
|
(0, _invariant.default)(!columnWrapperStyle, "columnWrapperStyle not supported for single column lists");
|
|
}
|
|
(0, _invariant.default)(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), "FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs.");
|
|
}
|
|
_pushMultiColumnViewable(arr, v) {
|
|
var _this$props$keyExtrac2;
|
|
var numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
var keyExtractor = (_this$props$keyExtrac2 = this.props.keyExtractor) !== null && _this$props$keyExtrac2 !== void 0 ? _this$props$keyExtrac2 : _VirtualizeUtils.keyExtractor;
|
|
v.item.forEach((item, ii) => {
|
|
(0, _invariant.default)(v.index != null, "Missing index!");
|
|
var index5 = v.index * numColumns + ii;
|
|
arr.push((0, _objectSpread2.default)((0, _objectSpread2.default)({}, v), {}, {
|
|
item,
|
|
key: keyExtractor(item, index5),
|
|
index: index5
|
|
}));
|
|
});
|
|
}
|
|
_createOnViewableItemsChanged(onViewableItemsChanged) {
|
|
return (info) => {
|
|
var numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
if (onViewableItemsChanged) {
|
|
if (numColumns > 1) {
|
|
var changed = [];
|
|
var viewableItems = [];
|
|
info.viewableItems.forEach((v) => this._pushMultiColumnViewable(viewableItems, v));
|
|
info.changed.forEach((v) => this._pushMultiColumnViewable(changed, v));
|
|
onViewableItemsChanged({
|
|
viewableItems,
|
|
changed
|
|
});
|
|
} else {
|
|
onViewableItemsChanged(info);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
render() {
|
|
var _this$props = this.props, numColumns = _this$props.numColumns, columnWrapperStyle = _this$props.columnWrapperStyle, _removeClippedSubviews = _this$props.removeClippedSubviews, _this$props$strictMod = _this$props.strictMode, strictMode = _this$props$strictMod === void 0 ? false : _this$props$strictMod, restProps = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
|
|
var renderer = strictMode ? this._memoizedRenderer : this._renderer;
|
|
return (
|
|
// $FlowFixMe[incompatible-exact] - `restProps` (`Props`) is inexact.
|
|
/* @__PURE__ */ React83.createElement(_VirtualizedList.default, (0, _extends2.default)({}, restProps, {
|
|
getItem: this._getItem,
|
|
getItemCount: this._getItemCount,
|
|
keyExtractor: this._keyExtractor,
|
|
ref: this._captureRef,
|
|
viewabilityConfigCallbackPairs: this._virtualizedListPairs,
|
|
removeClippedSubviews: removeClippedSubviewsOrDefault(_removeClippedSubviews)
|
|
}, renderer(this.props.ListItemComponent, this.props.renderItem, columnWrapperStyle, numColumns, this.props.extraData)))
|
|
);
|
|
}
|
|
};
|
|
var styles = _StyleSheet.default.create({
|
|
row: {
|
|
flexDirection: "row"
|
|
}
|
|
});
|
|
var _default = exports2.default = FlatList;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/FlatList/index.js
|
|
var require_FlatList2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/FlatList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _FlatList = _interopRequireDefault(require_FlatList());
|
|
var _default = exports2.default = _FlatList.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/TurboModule/TurboModuleRegistry.js
|
|
var require_TurboModuleRegistry = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/TurboModule/TurboModuleRegistry.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.get = get;
|
|
exports2.getEnforcing = getEnforcing;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
function get(name) {
|
|
return null;
|
|
}
|
|
__name(get, "get");
|
|
function getEnforcing(name) {
|
|
var module3 = get(name);
|
|
(0, _invariant.default)(module3 != null, "TurboModuleRegistry.getEnforcing(...): '" + name + "' could not be found. Verify that a module by this name is registered in the native binary.");
|
|
return module3;
|
|
}
|
|
__name(getEnforcing, "getEnforcing");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedModule.js
|
|
var require_NativeAnimatedModule = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedModule.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var TurboModuleRegistry = _interopRequireWildcard(require_TurboModuleRegistry());
|
|
var _default = exports2.default = TurboModuleRegistry.get("NativeAnimatedModule");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedTurboModule.js
|
|
var require_NativeAnimatedTurboModule = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedTurboModule.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var TurboModuleRegistry = _interopRequireWildcard(require_TurboModuleRegistry());
|
|
var _default = exports2.default = TurboModuleRegistry.get("NativeAnimatedTurboModule");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.js
|
|
var require_RCTDeviceEventEmitter = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _EventEmitter = _interopRequireDefault(require_EventEmitter());
|
|
var _default = exports2.default = new _EventEmitter.default();
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/EventEmitter/NativeEventEmitter.js
|
|
var require_NativeEventEmitter = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/EventEmitter/NativeEventEmitter.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var _RCTDeviceEventEmitter = _interopRequireDefault(require_RCTDeviceEventEmitter());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var NativeEventEmitter = class {
|
|
static {
|
|
__name(this, "NativeEventEmitter");
|
|
}
|
|
constructor(nativeModule) {
|
|
if (_Platform.default.OS === "ios") {
|
|
(0, _invariant.default)(nativeModule != null, "`new NativeEventEmitter()` requires a non-null argument.");
|
|
this._nativeModule = nativeModule;
|
|
}
|
|
}
|
|
addListener(eventType, listener, context2) {
|
|
var _this$_nativeModule;
|
|
(_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);
|
|
var subscription = _RCTDeviceEventEmitter.default.addListener(eventType, listener, context2);
|
|
return {
|
|
remove: /* @__PURE__ */ __name(() => {
|
|
if (subscription != null) {
|
|
var _this$_nativeModule2;
|
|
(_this$_nativeModule2 = this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);
|
|
subscription.remove();
|
|
subscription = null;
|
|
}
|
|
}, "remove")
|
|
};
|
|
}
|
|
/**
|
|
* @deprecated Use `remove` on the EventSubscription from `addListener`.
|
|
*/
|
|
removeListener(eventType, listener) {
|
|
var _this$_nativeModule3;
|
|
(_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);
|
|
_RCTDeviceEventEmitter.default.removeListener(eventType, listener);
|
|
}
|
|
emit(eventType) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
_RCTDeviceEventEmitter.default.emit(eventType, ...args);
|
|
}
|
|
removeAllListeners(eventType) {
|
|
var _this$_nativeModule4;
|
|
(0, _invariant.default)(eventType != null, "`NativeEventEmitter.removeAllListener()` requires a non-null argument.");
|
|
(_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));
|
|
_RCTDeviceEventEmitter.default.removeAllListeners(eventType);
|
|
}
|
|
listenerCount(eventType) {
|
|
return _RCTDeviceEventEmitter.default.listenerCount(eventType);
|
|
}
|
|
};
|
|
exports2.default = NativeEventEmitter;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/Platform.js
|
|
var require_Platform2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/Platform.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var _default = exports2.default = _Platform.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/ReactNative/ReactNativeFeatureFlags.js
|
|
var require_ReactNativeFeatureFlags = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/ReactNative/ReactNativeFeatureFlags.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var ReactNativeFeatureFlags = {
|
|
isLayoutAnimationEnabled: /* @__PURE__ */ __name(() => true, "isLayoutAnimationEnabled"),
|
|
shouldEmitW3CPointerEvents: /* @__PURE__ */ __name(() => false, "shouldEmitW3CPointerEvents"),
|
|
shouldPressibilityUseW3CPointerEventsForHover: /* @__PURE__ */ __name(() => false, "shouldPressibilityUseW3CPointerEventsForHover"),
|
|
animatedShouldDebounceQueueFlush: /* @__PURE__ */ __name(() => false, "animatedShouldDebounceQueueFlush"),
|
|
animatedShouldUseSingleOp: /* @__PURE__ */ __name(() => false, "animatedShouldUseSingleOp")
|
|
};
|
|
var _default = exports2.default = ReactNativeFeatureFlags;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedHelper.js
|
|
var require_NativeAnimatedHelper = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedHelper.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.API = void 0;
|
|
exports2.addWhitelistedInterpolationParam = addWhitelistedInterpolationParam;
|
|
exports2.addWhitelistedStyleProp = addWhitelistedStyleProp;
|
|
exports2.addWhitelistedTransformProp = addWhitelistedTransformProp;
|
|
exports2.assertNativeAnimatedModule = assertNativeAnimatedModule;
|
|
exports2.default = void 0;
|
|
exports2.generateNewAnimationId = generateNewAnimationId;
|
|
exports2.generateNewNodeTag = generateNewNodeTag;
|
|
exports2.isSupportedColorStyleProp = isSupportedColorStyleProp;
|
|
exports2.isSupportedInterpolationParam = isSupportedInterpolationParam;
|
|
exports2.isSupportedStyleProp = isSupportedStyleProp;
|
|
exports2.isSupportedTransformProp = isSupportedTransformProp;
|
|
exports2.shouldUseNativeDriver = shouldUseNativeDriver;
|
|
exports2.transformDataType = transformDataType;
|
|
exports2.validateInterpolation = validateInterpolation;
|
|
exports2.validateStyles = validateStyles;
|
|
exports2.validateTransform = validateTransform;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _NativeAnimatedModule = _interopRequireDefault(require_NativeAnimatedModule());
|
|
var _NativeAnimatedTurboModule = _interopRequireDefault(require_NativeAnimatedTurboModule());
|
|
var _NativeEventEmitter = _interopRequireDefault(require_NativeEventEmitter());
|
|
var _Platform = _interopRequireDefault(require_Platform2());
|
|
var _ReactNativeFeatureFlags = _interopRequireDefault(require_ReactNativeFeatureFlags());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _RCTDeviceEventEmitter = _interopRequireDefault(require_RCTDeviceEventEmitter());
|
|
var NativeAnimatedModule = _Platform.default.OS === "ios" && global.RN$Bridgeless === true ? _NativeAnimatedTurboModule.default : _NativeAnimatedModule.default;
|
|
var __nativeAnimatedNodeTagCount = 1;
|
|
var __nativeAnimationIdCount = 1;
|
|
var nativeEventEmitter;
|
|
var waitingForQueuedOperations = /* @__PURE__ */ new Set();
|
|
var queueOperations = false;
|
|
var queue = [];
|
|
var singleOpQueue = [];
|
|
var useSingleOpBatching = false;
|
|
_Platform.default.OS === "android" && !!(NativeAnimatedModule != null && NativeAnimatedModule.queueAndExecuteBatchedOperations) && _ReactNativeFeatureFlags.default.animatedShouldUseSingleOp();
|
|
var flushQueueTimeout = null;
|
|
var eventListenerGetValueCallbacks = {};
|
|
var eventListenerAnimationFinishedCallbacks = {};
|
|
var nativeOps = useSingleOpBatching ? (function() {
|
|
var apis = [
|
|
"createAnimatedNode",
|
|
// 1
|
|
"updateAnimatedNodeConfig",
|
|
// 2
|
|
"getValue",
|
|
// 3
|
|
"startListeningToAnimatedNodeValue",
|
|
// 4
|
|
"stopListeningToAnimatedNodeValue",
|
|
// 5
|
|
"connectAnimatedNodes",
|
|
// 6
|
|
"disconnectAnimatedNodes",
|
|
// 7
|
|
"startAnimatingNode",
|
|
// 8
|
|
"stopAnimation",
|
|
// 9
|
|
"setAnimatedNodeValue",
|
|
// 10
|
|
"setAnimatedNodeOffset",
|
|
// 11
|
|
"flattenAnimatedNodeOffset",
|
|
// 12
|
|
"extractAnimatedNodeOffset",
|
|
// 13
|
|
"connectAnimatedNodeToView",
|
|
// 14
|
|
"disconnectAnimatedNodeFromView",
|
|
// 15
|
|
"restoreDefaultValues",
|
|
// 16
|
|
"dropAnimatedNode",
|
|
// 17
|
|
"addAnimatedEventToView",
|
|
// 18
|
|
"removeAnimatedEventFromView",
|
|
// 19
|
|
"addListener",
|
|
// 20
|
|
"removeListener"
|
|
// 21
|
|
];
|
|
return apis.reduce((acc, functionName, i) => {
|
|
acc[functionName] = i + 1;
|
|
return acc;
|
|
}, {});
|
|
})() : NativeAnimatedModule;
|
|
var API = exports2.API = {
|
|
getValue: /* @__PURE__ */ __name(function getValue(tag, saveValueCallback) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
if (useSingleOpBatching) {
|
|
if (saveValueCallback) {
|
|
eventListenerGetValueCallbacks[tag] = saveValueCallback;
|
|
}
|
|
API.queueOperation(nativeOps.getValue, tag);
|
|
} else {
|
|
API.queueOperation(nativeOps.getValue, tag, saveValueCallback);
|
|
}
|
|
}, "getValue"),
|
|
setWaitingForIdentifier: /* @__PURE__ */ __name(function setWaitingForIdentifier(id) {
|
|
waitingForQueuedOperations.add(id);
|
|
queueOperations = true;
|
|
if (_ReactNativeFeatureFlags.default.animatedShouldDebounceQueueFlush() && flushQueueTimeout) {
|
|
clearTimeout(flushQueueTimeout);
|
|
}
|
|
}, "setWaitingForIdentifier"),
|
|
unsetWaitingForIdentifier: /* @__PURE__ */ __name(function unsetWaitingForIdentifier(id) {
|
|
waitingForQueuedOperations.delete(id);
|
|
if (waitingForQueuedOperations.size === 0) {
|
|
queueOperations = false;
|
|
API.disableQueue();
|
|
}
|
|
}, "unsetWaitingForIdentifier"),
|
|
disableQueue: /* @__PURE__ */ __name(function disableQueue() {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
if (_ReactNativeFeatureFlags.default.animatedShouldDebounceQueueFlush()) {
|
|
var prevTimeout = flushQueueTimeout;
|
|
clearImmediate(prevTimeout);
|
|
flushQueueTimeout = setImmediate(API.flushQueue);
|
|
} else {
|
|
API.flushQueue();
|
|
}
|
|
}, "disableQueue"),
|
|
flushQueue: /* @__PURE__ */ __name(function flushQueue() {
|
|
}, "flushQueue"),
|
|
queueOperation: /* @__PURE__ */ __name(function queueOperation(fn) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
if (useSingleOpBatching) {
|
|
singleOpQueue.push(fn, ...args);
|
|
return;
|
|
}
|
|
if (queueOperations || queue.length !== 0) {
|
|
queue.push(() => fn(...args));
|
|
} else {
|
|
fn(...args);
|
|
}
|
|
}, "queueOperation"),
|
|
createAnimatedNode: /* @__PURE__ */ __name(function createAnimatedNode(tag, config) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.createAnimatedNode, tag, config);
|
|
}, "createAnimatedNode"),
|
|
updateAnimatedNodeConfig: /* @__PURE__ */ __name(function updateAnimatedNodeConfig(tag, config) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
}, "updateAnimatedNodeConfig"),
|
|
startListeningToAnimatedNodeValue: /* @__PURE__ */ __name(function startListeningToAnimatedNodeValue(tag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.startListeningToAnimatedNodeValue, tag);
|
|
}, "startListeningToAnimatedNodeValue"),
|
|
stopListeningToAnimatedNodeValue: /* @__PURE__ */ __name(function stopListeningToAnimatedNodeValue(tag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.stopListeningToAnimatedNodeValue, tag);
|
|
}, "stopListeningToAnimatedNodeValue"),
|
|
connectAnimatedNodes: /* @__PURE__ */ __name(function connectAnimatedNodes(parentTag, childTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.connectAnimatedNodes, parentTag, childTag);
|
|
}, "connectAnimatedNodes"),
|
|
disconnectAnimatedNodes: /* @__PURE__ */ __name(function disconnectAnimatedNodes(parentTag, childTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.disconnectAnimatedNodes, parentTag, childTag);
|
|
}, "disconnectAnimatedNodes"),
|
|
startAnimatingNode: /* @__PURE__ */ __name(function startAnimatingNode(animationId, nodeTag, config, endCallback) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
if (useSingleOpBatching) {
|
|
if (endCallback) {
|
|
eventListenerAnimationFinishedCallbacks[animationId] = endCallback;
|
|
}
|
|
API.queueOperation(nativeOps.startAnimatingNode, animationId, nodeTag, config);
|
|
} else {
|
|
API.queueOperation(nativeOps.startAnimatingNode, animationId, nodeTag, config, endCallback);
|
|
}
|
|
}, "startAnimatingNode"),
|
|
stopAnimation: /* @__PURE__ */ __name(function stopAnimation(animationId) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.stopAnimation, animationId);
|
|
}, "stopAnimation"),
|
|
setAnimatedNodeValue: /* @__PURE__ */ __name(function setAnimatedNodeValue(nodeTag, value) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.setAnimatedNodeValue, nodeTag, value);
|
|
}, "setAnimatedNodeValue"),
|
|
setAnimatedNodeOffset: /* @__PURE__ */ __name(function setAnimatedNodeOffset(nodeTag, offset4) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.setAnimatedNodeOffset, nodeTag, offset4);
|
|
}, "setAnimatedNodeOffset"),
|
|
flattenAnimatedNodeOffset: /* @__PURE__ */ __name(function flattenAnimatedNodeOffset(nodeTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.flattenAnimatedNodeOffset, nodeTag);
|
|
}, "flattenAnimatedNodeOffset"),
|
|
extractAnimatedNodeOffset: /* @__PURE__ */ __name(function extractAnimatedNodeOffset(nodeTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.extractAnimatedNodeOffset, nodeTag);
|
|
}, "extractAnimatedNodeOffset"),
|
|
connectAnimatedNodeToView: /* @__PURE__ */ __name(function connectAnimatedNodeToView(nodeTag, viewTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.connectAnimatedNodeToView, nodeTag, viewTag);
|
|
}, "connectAnimatedNodeToView"),
|
|
disconnectAnimatedNodeFromView: /* @__PURE__ */ __name(function disconnectAnimatedNodeFromView(nodeTag, viewTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.disconnectAnimatedNodeFromView, nodeTag, viewTag);
|
|
}, "disconnectAnimatedNodeFromView"),
|
|
restoreDefaultValues: /* @__PURE__ */ __name(function restoreDefaultValues(nodeTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
if (nativeOps.restoreDefaultValues != null) {
|
|
API.queueOperation(nativeOps.restoreDefaultValues, nodeTag);
|
|
}
|
|
}, "restoreDefaultValues"),
|
|
dropAnimatedNode: /* @__PURE__ */ __name(function dropAnimatedNode(tag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.dropAnimatedNode, tag);
|
|
}, "dropAnimatedNode"),
|
|
addAnimatedEventToView: /* @__PURE__ */ __name(function addAnimatedEventToView(viewTag, eventName, eventMapping) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.addAnimatedEventToView, viewTag, eventName, eventMapping);
|
|
}, "addAnimatedEventToView"),
|
|
removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag) {
|
|
(0, _invariant.default)(nativeOps, "Native animated module is not available");
|
|
API.queueOperation(nativeOps.removeAnimatedEventFromView, viewTag, eventName, animatedNodeTag);
|
|
}
|
|
};
|
|
var SUPPORTED_COLOR_STYLES = {
|
|
backgroundColor: true,
|
|
borderBottomColor: true,
|
|
borderColor: true,
|
|
borderEndColor: true,
|
|
borderLeftColor: true,
|
|
borderRightColor: true,
|
|
borderStartColor: true,
|
|
borderTopColor: true,
|
|
color: true,
|
|
tintColor: true
|
|
};
|
|
var SUPPORTED_STYLES = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, SUPPORTED_COLOR_STYLES), {}, {
|
|
borderBottomEndRadius: true,
|
|
borderBottomLeftRadius: true,
|
|
borderBottomRightRadius: true,
|
|
borderBottomStartRadius: true,
|
|
borderRadius: true,
|
|
borderTopEndRadius: true,
|
|
borderTopLeftRadius: true,
|
|
borderTopRightRadius: true,
|
|
borderTopStartRadius: true,
|
|
elevation: true,
|
|
opacity: true,
|
|
transform: true,
|
|
zIndex: true,
|
|
/* ios styles */
|
|
shadowOpacity: true,
|
|
shadowRadius: true,
|
|
/* legacy android transform properties */
|
|
scaleX: true,
|
|
scaleY: true,
|
|
translateX: true,
|
|
translateY: true
|
|
});
|
|
var SUPPORTED_TRANSFORMS = {
|
|
translateX: true,
|
|
translateY: true,
|
|
scale: true,
|
|
scaleX: true,
|
|
scaleY: true,
|
|
rotate: true,
|
|
rotateX: true,
|
|
rotateY: true,
|
|
rotateZ: true,
|
|
perspective: true
|
|
};
|
|
var SUPPORTED_INTERPOLATION_PARAMS = {
|
|
inputRange: true,
|
|
outputRange: true,
|
|
extrapolate: true,
|
|
extrapolateRight: true,
|
|
extrapolateLeft: true
|
|
};
|
|
function addWhitelistedStyleProp(prop) {
|
|
SUPPORTED_STYLES[prop] = true;
|
|
}
|
|
__name(addWhitelistedStyleProp, "addWhitelistedStyleProp");
|
|
function addWhitelistedTransformProp(prop) {
|
|
SUPPORTED_TRANSFORMS[prop] = true;
|
|
}
|
|
__name(addWhitelistedTransformProp, "addWhitelistedTransformProp");
|
|
function addWhitelistedInterpolationParam(param) {
|
|
SUPPORTED_INTERPOLATION_PARAMS[param] = true;
|
|
}
|
|
__name(addWhitelistedInterpolationParam, "addWhitelistedInterpolationParam");
|
|
function isSupportedColorStyleProp(prop) {
|
|
return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);
|
|
}
|
|
__name(isSupportedColorStyleProp, "isSupportedColorStyleProp");
|
|
function isSupportedStyleProp(prop) {
|
|
return SUPPORTED_STYLES.hasOwnProperty(prop);
|
|
}
|
|
__name(isSupportedStyleProp, "isSupportedStyleProp");
|
|
function isSupportedTransformProp(prop) {
|
|
return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);
|
|
}
|
|
__name(isSupportedTransformProp, "isSupportedTransformProp");
|
|
function isSupportedInterpolationParam(param) {
|
|
return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);
|
|
}
|
|
__name(isSupportedInterpolationParam, "isSupportedInterpolationParam");
|
|
function validateTransform(configs) {
|
|
configs.forEach((config) => {
|
|
if (!isSupportedTransformProp(config.property)) {
|
|
throw new Error("Property '" + config.property + "' is not supported by native animated module");
|
|
}
|
|
});
|
|
}
|
|
__name(validateTransform, "validateTransform");
|
|
function validateStyles(styles) {
|
|
for (var _key2 in styles) {
|
|
if (!isSupportedStyleProp(_key2)) {
|
|
throw new Error("Style property '" + _key2 + "' is not supported by native animated module");
|
|
}
|
|
}
|
|
}
|
|
__name(validateStyles, "validateStyles");
|
|
function validateInterpolation(config) {
|
|
for (var _key3 in config) {
|
|
if (!isSupportedInterpolationParam(_key3)) {
|
|
throw new Error("Interpolation property '" + _key3 + "' is not supported by native animated module");
|
|
}
|
|
}
|
|
}
|
|
__name(validateInterpolation, "validateInterpolation");
|
|
function generateNewNodeTag() {
|
|
return __nativeAnimatedNodeTagCount++;
|
|
}
|
|
__name(generateNewNodeTag, "generateNewNodeTag");
|
|
function generateNewAnimationId() {
|
|
return __nativeAnimationIdCount++;
|
|
}
|
|
__name(generateNewAnimationId, "generateNewAnimationId");
|
|
function assertNativeAnimatedModule() {
|
|
(0, _invariant.default)(NativeAnimatedModule, "Native animated module is not available");
|
|
}
|
|
__name(assertNativeAnimatedModule, "assertNativeAnimatedModule");
|
|
var _warnedMissingNativeAnimated = false;
|
|
function shouldUseNativeDriver(config) {
|
|
if (config.useNativeDriver == null) {
|
|
console.warn("Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`");
|
|
}
|
|
if (config.useNativeDriver === true && !NativeAnimatedModule) {
|
|
if (!_warnedMissingNativeAnimated) {
|
|
console.warn("Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md");
|
|
_warnedMissingNativeAnimated = true;
|
|
}
|
|
return false;
|
|
}
|
|
return config.useNativeDriver || false;
|
|
}
|
|
__name(shouldUseNativeDriver, "shouldUseNativeDriver");
|
|
function transformDataType(value) {
|
|
if (typeof value !== "string") {
|
|
return value;
|
|
}
|
|
if (/deg$/.test(value)) {
|
|
var degrees = parseFloat(value) || 0;
|
|
var radians = degrees * Math.PI / 180;
|
|
return radians;
|
|
} else {
|
|
return value;
|
|
}
|
|
}
|
|
__name(transformDataType, "transformDataType");
|
|
var _default = exports2.default = {
|
|
API,
|
|
isSupportedColorStyleProp,
|
|
isSupportedStyleProp,
|
|
isSupportedTransformProp,
|
|
isSupportedInterpolationParam,
|
|
addWhitelistedStyleProp,
|
|
addWhitelistedTransformProp,
|
|
addWhitelistedInterpolationParam,
|
|
validateStyles,
|
|
validateTransform,
|
|
validateInterpolation,
|
|
generateNewNodeTag,
|
|
generateNewAnimationId,
|
|
assertNativeAnimatedModule,
|
|
shouldUseNativeDriver,
|
|
transformDataType,
|
|
// $FlowExpectedError[unsafe-getters-setters] - unsafe getter lint suppresion
|
|
// $FlowExpectedError[missing-type-arg] - unsafe getter lint suppresion
|
|
get nativeEventEmitter() {
|
|
if (!nativeEventEmitter) {
|
|
nativeEventEmitter = new _NativeEventEmitter.default(
|
|
// T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior
|
|
// If you want to use the native module on other platforms, please remove this condition and test its behavior
|
|
_Platform.default.OS !== "ios" ? null : NativeAnimatedModule
|
|
);
|
|
}
|
|
return nativeEventEmitter;
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedNode.js
|
|
var require_AnimatedNode = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedNode.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var NativeAnimatedAPI = _NativeAnimatedHelper.default.API;
|
|
var _uniqueId = 1;
|
|
var AnimatedNode = class {
|
|
static {
|
|
__name(this, "AnimatedNode");
|
|
}
|
|
__attach() {
|
|
}
|
|
__detach() {
|
|
if (this.__isNative && this.__nativeTag != null) {
|
|
_NativeAnimatedHelper.default.API.dropAnimatedNode(this.__nativeTag);
|
|
this.__nativeTag = void 0;
|
|
}
|
|
}
|
|
__getValue() {
|
|
}
|
|
__getAnimatedValue() {
|
|
return this.__getValue();
|
|
}
|
|
__addChild(child) {
|
|
}
|
|
__removeChild(child) {
|
|
}
|
|
__getChildren() {
|
|
return [];
|
|
}
|
|
/* Methods and props used by native Animated impl */
|
|
constructor() {
|
|
this._listeners = {};
|
|
}
|
|
__makeNative(platformConfig) {
|
|
if (!this.__isNative) {
|
|
throw new Error('This node cannot be made a "native" animated node');
|
|
}
|
|
this._platformConfig = platformConfig;
|
|
if (this.hasListeners()) {
|
|
this._startListeningToNativeValueUpdates();
|
|
}
|
|
}
|
|
/**
|
|
* Adds an asynchronous listener to the value so you can observe updates from
|
|
* animations. This is useful because there is no way to
|
|
* synchronously read the value because it might be driven natively.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#addlistener
|
|
*/
|
|
addListener(callback) {
|
|
var id = String(_uniqueId++);
|
|
this._listeners[id] = callback;
|
|
if (this.__isNative) {
|
|
this._startListeningToNativeValueUpdates();
|
|
}
|
|
return id;
|
|
}
|
|
/**
|
|
* Unregister a listener. The `id` param shall match the identifier
|
|
* previously returned by `addListener()`.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#removelistener
|
|
*/
|
|
removeListener(id) {
|
|
delete this._listeners[id];
|
|
if (this.__isNative && !this.hasListeners()) {
|
|
this._stopListeningForNativeValueUpdates();
|
|
}
|
|
}
|
|
/**
|
|
* Remove all registered listeners.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#removealllisteners
|
|
*/
|
|
removeAllListeners() {
|
|
this._listeners = {};
|
|
if (this.__isNative) {
|
|
this._stopListeningForNativeValueUpdates();
|
|
}
|
|
}
|
|
hasListeners() {
|
|
return !!Object.keys(this._listeners).length;
|
|
}
|
|
_startListeningToNativeValueUpdates() {
|
|
if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {
|
|
return;
|
|
}
|
|
if (this.__shouldUpdateListenersForNewNativeTag) {
|
|
this.__shouldUpdateListenersForNewNativeTag = false;
|
|
this._stopListeningForNativeValueUpdates();
|
|
}
|
|
NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());
|
|
this.__nativeAnimatedValueListener = _NativeAnimatedHelper.default.nativeEventEmitter.addListener("onAnimatedValueUpdate", (data) => {
|
|
if (data.tag !== this.__getNativeTag()) {
|
|
return;
|
|
}
|
|
this.__onAnimatedValueUpdateReceived(data.value);
|
|
});
|
|
}
|
|
__onAnimatedValueUpdateReceived(value) {
|
|
this.__callListeners(value);
|
|
}
|
|
__callListeners(value) {
|
|
for (var _key in this._listeners) {
|
|
this._listeners[_key]({
|
|
value
|
|
});
|
|
}
|
|
}
|
|
_stopListeningForNativeValueUpdates() {
|
|
if (!this.__nativeAnimatedValueListener) {
|
|
return;
|
|
}
|
|
this.__nativeAnimatedValueListener.remove();
|
|
this.__nativeAnimatedValueListener = null;
|
|
NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());
|
|
}
|
|
__getNativeTag() {
|
|
var _this$__nativeTag;
|
|
_NativeAnimatedHelper.default.assertNativeAnimatedModule();
|
|
(0, _invariant.default)(this.__isNative, 'Attempt to get native tag from node not marked as "native"');
|
|
var nativeTag = (_this$__nativeTag = this.__nativeTag) !== null && _this$__nativeTag !== void 0 ? _this$__nativeTag : _NativeAnimatedHelper.default.generateNewNodeTag();
|
|
if (this.__nativeTag == null) {
|
|
this.__nativeTag = nativeTag;
|
|
var config = this.__getNativeConfig();
|
|
if (this._platformConfig) {
|
|
config.platformConfig = this._platformConfig;
|
|
}
|
|
_NativeAnimatedHelper.default.API.createAnimatedNode(nativeTag, config);
|
|
this.__shouldUpdateListenersForNewNativeTag = true;
|
|
}
|
|
return nativeTag;
|
|
}
|
|
__getNativeConfig() {
|
|
throw new Error("This JS animated node type cannot be used as native animated node");
|
|
}
|
|
toJSON() {
|
|
return this.__getValue();
|
|
}
|
|
__getPlatformConfig() {
|
|
return this._platformConfig;
|
|
}
|
|
__setPlatformConfig(platformConfig) {
|
|
this._platformConfig = platformConfig;
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedNode;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedWithChildren.js
|
|
var require_AnimatedWithChildren = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedWithChildren.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require_createForOfIteratorHelperLoose());
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var AnimatedWithChildren = class extends _AnimatedNode.default {
|
|
static {
|
|
__name(this, "AnimatedWithChildren");
|
|
}
|
|
constructor() {
|
|
super();
|
|
this._children = [];
|
|
}
|
|
__makeNative(platformConfig) {
|
|
if (!this.__isNative) {
|
|
this.__isNative = true;
|
|
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(this._children), _step; !(_step = _iterator()).done; ) {
|
|
var child = _step.value;
|
|
child.__makeNative(platformConfig);
|
|
_NativeAnimatedHelper.default.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
|
|
}
|
|
}
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__addChild(child) {
|
|
if (this._children.length === 0) {
|
|
this.__attach();
|
|
}
|
|
this._children.push(child);
|
|
if (this.__isNative) {
|
|
child.__makeNative(this.__getPlatformConfig());
|
|
_NativeAnimatedHelper.default.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
|
|
}
|
|
}
|
|
__removeChild(child) {
|
|
var index5 = this._children.indexOf(child);
|
|
if (index5 === -1) {
|
|
console.warn("Trying to remove a child that doesn't exist");
|
|
return;
|
|
}
|
|
if (this.__isNative && child.__isNative) {
|
|
_NativeAnimatedHelper.default.API.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
|
|
}
|
|
this._children.splice(index5, 1);
|
|
if (this._children.length === 0) {
|
|
this.__detach();
|
|
}
|
|
}
|
|
__getChildren() {
|
|
return this._children;
|
|
}
|
|
__callListeners(value) {
|
|
super.__callListeners(value);
|
|
if (!this.__isNative) {
|
|
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(this._children), _step2; !(_step2 = _iterator2()).done; ) {
|
|
var child = _step2.value;
|
|
if (child.__getValue) {
|
|
child.__callListeners(child.__getValue());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedWithChildren;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedInterpolation.js
|
|
var require_AnimatedInterpolation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedInterpolation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _normalizeColors = _interopRequireDefault(require_normalize_colors());
|
|
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
var linear = /* @__PURE__ */ __name((t) => t, "linear");
|
|
function createInterpolation(config) {
|
|
if (config.outputRange && typeof config.outputRange[0] === "string") {
|
|
return createInterpolationFromStringOutputRange(config);
|
|
}
|
|
var outputRange = config.outputRange;
|
|
var inputRange = config.inputRange;
|
|
if (__DEV__) {
|
|
checkInfiniteRange("outputRange", outputRange);
|
|
checkInfiniteRange("inputRange", inputRange);
|
|
checkValidInputRange(inputRange);
|
|
(0, _invariant.default)(inputRange.length === outputRange.length, "inputRange (" + inputRange.length + ") and outputRange (" + outputRange.length + ") must have the same length");
|
|
}
|
|
var easing = config.easing || linear;
|
|
var extrapolateLeft = "extend";
|
|
if (config.extrapolateLeft !== void 0) {
|
|
extrapolateLeft = config.extrapolateLeft;
|
|
} else if (config.extrapolate !== void 0) {
|
|
extrapolateLeft = config.extrapolate;
|
|
}
|
|
var extrapolateRight = "extend";
|
|
if (config.extrapolateRight !== void 0) {
|
|
extrapolateRight = config.extrapolateRight;
|
|
} else if (config.extrapolate !== void 0) {
|
|
extrapolateRight = config.extrapolate;
|
|
}
|
|
return (input) => {
|
|
(0, _invariant.default)(typeof input === "number", "Cannot interpolation an input which is not a number");
|
|
var range = findRange(input, inputRange);
|
|
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight);
|
|
};
|
|
}
|
|
__name(createInterpolation, "createInterpolation");
|
|
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) {
|
|
var result = input;
|
|
if (result < inputMin) {
|
|
if (extrapolateLeft === "identity") {
|
|
return result;
|
|
} else if (extrapolateLeft === "clamp") {
|
|
result = inputMin;
|
|
} else if (extrapolateLeft === "extend") {
|
|
}
|
|
}
|
|
if (result > inputMax) {
|
|
if (extrapolateRight === "identity") {
|
|
return result;
|
|
} else if (extrapolateRight === "clamp") {
|
|
result = inputMax;
|
|
} else if (extrapolateRight === "extend") {
|
|
}
|
|
}
|
|
if (outputMin === outputMax) {
|
|
return outputMin;
|
|
}
|
|
if (inputMin === inputMax) {
|
|
if (input <= inputMin) {
|
|
return outputMin;
|
|
}
|
|
return outputMax;
|
|
}
|
|
if (inputMin === -Infinity) {
|
|
result = -result;
|
|
} else if (inputMax === Infinity) {
|
|
result = result - inputMin;
|
|
} else {
|
|
result = (result - inputMin) / (inputMax - inputMin);
|
|
}
|
|
result = easing(result);
|
|
if (outputMin === -Infinity) {
|
|
result = -result;
|
|
} else if (outputMax === Infinity) {
|
|
result = result + outputMin;
|
|
} else {
|
|
result = result * (outputMax - outputMin) + outputMin;
|
|
}
|
|
return result;
|
|
}
|
|
__name(interpolate, "interpolate");
|
|
function colorToRgba(input) {
|
|
var normalizedColor = (0, _normalizeColors.default)(input);
|
|
if (normalizedColor === null || typeof normalizedColor !== "number") {
|
|
return input;
|
|
}
|
|
normalizedColor = normalizedColor || 0;
|
|
var r = (normalizedColor & 4278190080) >>> 24;
|
|
var g = (normalizedColor & 16711680) >>> 16;
|
|
var b = (normalizedColor & 65280) >>> 8;
|
|
var a = (normalizedColor & 255) / 255;
|
|
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
|
|
}
|
|
__name(colorToRgba, "colorToRgba");
|
|
var stringShapeRegex = /[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;
|
|
function createInterpolationFromStringOutputRange(config) {
|
|
var outputRange = config.outputRange;
|
|
(0, _invariant.default)(outputRange.length >= 2, "Bad output range");
|
|
outputRange = outputRange.map(colorToRgba);
|
|
checkPattern(outputRange);
|
|
var outputRanges = outputRange[0].match(stringShapeRegex).map(() => []);
|
|
outputRange.forEach((value) => {
|
|
value.match(stringShapeRegex).forEach((number, i) => {
|
|
outputRanges[i].push(+number);
|
|
});
|
|
});
|
|
var interpolations = outputRange[0].match(stringShapeRegex).map((value, i) => {
|
|
return createInterpolation((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
|
outputRange: outputRanges[i]
|
|
}));
|
|
});
|
|
var shouldRound = isRgbOrRgba(outputRange[0]);
|
|
return (input) => {
|
|
var i = 0;
|
|
return outputRange[0].replace(stringShapeRegex, () => {
|
|
var val = +interpolations[i++](input);
|
|
if (shouldRound) {
|
|
val = i < 4 ? Math.round(val) : Math.round(val * 1e3) / 1e3;
|
|
}
|
|
return String(val);
|
|
});
|
|
};
|
|
}
|
|
__name(createInterpolationFromStringOutputRange, "createInterpolationFromStringOutputRange");
|
|
function isRgbOrRgba(range) {
|
|
return typeof range === "string" && range.startsWith("rgb");
|
|
}
|
|
__name(isRgbOrRgba, "isRgbOrRgba");
|
|
function checkPattern(arr) {
|
|
var pattern = arr[0].replace(stringShapeRegex, "");
|
|
for (var i = 1; i < arr.length; ++i) {
|
|
(0, _invariant.default)(pattern === arr[i].replace(stringShapeRegex, ""), "invalid pattern " + arr[0] + " and " + arr[i]);
|
|
}
|
|
}
|
|
__name(checkPattern, "checkPattern");
|
|
function findRange(input, inputRange) {
|
|
var i;
|
|
for (i = 1; i < inputRange.length - 1; ++i) {
|
|
if (inputRange[i] >= input) {
|
|
break;
|
|
}
|
|
}
|
|
return i - 1;
|
|
}
|
|
__name(findRange, "findRange");
|
|
function checkValidInputRange(arr) {
|
|
(0, _invariant.default)(arr.length >= 2, "inputRange must have at least 2 elements");
|
|
var message = "inputRange must be monotonically non-decreasing " + String(arr);
|
|
for (var i = 1; i < arr.length; ++i) {
|
|
(0, _invariant.default)(arr[i] >= arr[i - 1], message);
|
|
}
|
|
}
|
|
__name(checkValidInputRange, "checkValidInputRange");
|
|
function checkInfiniteRange(name, arr) {
|
|
(0, _invariant.default)(arr.length >= 2, name + " must have at least 2 elements");
|
|
(0, _invariant.default)(
|
|
arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity,
|
|
/* $FlowFixMe[incompatible-type] (>=0.13.0) - In the addition expression
|
|
* below this comment, one or both of the operands may be something that
|
|
* doesn't cleanly convert to a string, like undefined, null, and object,
|
|
* etc. If you really mean this implicit string conversion, you can do
|
|
* something like String(myThing) */
|
|
name + "cannot be ]-infinity;+infinity[ " + arr
|
|
);
|
|
}
|
|
__name(checkInfiniteRange, "checkInfiniteRange");
|
|
var AnimatedInterpolation = class _AnimatedInterpolation extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedInterpolation");
|
|
}
|
|
// Export for testing.
|
|
constructor(parent, config) {
|
|
super();
|
|
this._parent = parent;
|
|
this._config = config;
|
|
this._interpolation = createInterpolation(config);
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._parent.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getValue() {
|
|
var parentValue = this._parent.__getValue();
|
|
(0, _invariant.default)(typeof parentValue === "number", "Cannot interpolate an input which is not a number.");
|
|
return this._interpolation(parentValue);
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation(this, config);
|
|
}
|
|
__attach() {
|
|
this._parent.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._parent.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__transformDataType(range) {
|
|
return range.map(_NativeAnimatedHelper.default.transformDataType);
|
|
}
|
|
__getNativeConfig() {
|
|
if (__DEV__) {
|
|
_NativeAnimatedHelper.default.validateInterpolation(this._config);
|
|
}
|
|
return {
|
|
inputRange: this._config.inputRange,
|
|
// Only the `outputRange` can contain strings so we don't need to transform `inputRange` here
|
|
outputRange: this.__transformDataType(this._config.outputRange),
|
|
extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || "extend",
|
|
extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || "extend",
|
|
type: "interpolation"
|
|
};
|
|
}
|
|
};
|
|
AnimatedInterpolation.__createInterpolation = createInterpolation;
|
|
var _default = exports2.default = AnimatedInterpolation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValue.js
|
|
var require_AnimatedValue = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValue.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var _InteractionManager = _interopRequireDefault(require_InteractionManager());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var NativeAnimatedAPI = _NativeAnimatedHelper.default.API;
|
|
function _flush(rootNode) {
|
|
var animatedStyles = /* @__PURE__ */ new Set();
|
|
function findAnimatedStyles(node) {
|
|
if (typeof node.update === "function") {
|
|
animatedStyles.add(node);
|
|
} else {
|
|
node.__getChildren().forEach(findAnimatedStyles);
|
|
}
|
|
}
|
|
__name(findAnimatedStyles, "findAnimatedStyles");
|
|
findAnimatedStyles(rootNode);
|
|
animatedStyles.forEach((animatedStyle) => animatedStyle.update());
|
|
}
|
|
__name(_flush, "_flush");
|
|
function _executeAsAnimatedBatch(id, operation) {
|
|
NativeAnimatedAPI.setWaitingForIdentifier(id);
|
|
operation();
|
|
NativeAnimatedAPI.unsetWaitingForIdentifier(id);
|
|
}
|
|
__name(_executeAsAnimatedBatch, "_executeAsAnimatedBatch");
|
|
var AnimatedValue = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedValue");
|
|
}
|
|
constructor(value, config) {
|
|
super();
|
|
if (typeof value !== "number") {
|
|
throw new Error("AnimatedValue: Attempting to set value to undefined");
|
|
}
|
|
this._startingValue = this._value = value;
|
|
this._offset = 0;
|
|
this._animation = null;
|
|
if (config && config.useNativeDriver) {
|
|
this.__makeNative();
|
|
}
|
|
}
|
|
__detach() {
|
|
if (this.__isNative) {
|
|
NativeAnimatedAPI.getValue(this.__getNativeTag(), (value) => {
|
|
this._value = value - this._offset;
|
|
});
|
|
}
|
|
this.stopAnimation();
|
|
super.__detach();
|
|
}
|
|
__getValue() {
|
|
return this._value + this._offset;
|
|
}
|
|
/**
|
|
* Directly set the value. This will stop any animations running on the value
|
|
* and update all the bound properties.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#setvalue
|
|
*/
|
|
setValue(value) {
|
|
if (this._animation) {
|
|
this._animation.stop();
|
|
this._animation = null;
|
|
}
|
|
this._updateValue(
|
|
value,
|
|
!this.__isNative
|
|
/* don't perform a flush for natively driven values */
|
|
);
|
|
if (this.__isNative) {
|
|
_executeAsAnimatedBatch(this.__getNativeTag().toString(), () => NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value));
|
|
}
|
|
}
|
|
/**
|
|
* Sets an offset that is applied on top of whatever value is set, whether via
|
|
* `setValue`, an animation, or `Animated.event`. Useful for compensating
|
|
* things like the start of a pan gesture.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#setoffset
|
|
*/
|
|
setOffset(offset4) {
|
|
this._offset = offset4;
|
|
if (this.__isNative) {
|
|
NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset4);
|
|
}
|
|
}
|
|
/**
|
|
* Merges the offset value into the base value and resets the offset to zero.
|
|
* The final output of the value is unchanged.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#flattenoffset
|
|
*/
|
|
flattenOffset() {
|
|
this._value += this._offset;
|
|
this._offset = 0;
|
|
if (this.__isNative) {
|
|
NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());
|
|
}
|
|
}
|
|
/**
|
|
* Sets the offset value to the base value, and resets the base value to zero.
|
|
* The final output of the value is unchanged.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#extractoffset
|
|
*/
|
|
extractOffset() {
|
|
this._offset += this._value;
|
|
this._value = 0;
|
|
if (this.__isNative) {
|
|
NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag());
|
|
}
|
|
}
|
|
/**
|
|
* Stops any running animation or tracking. `callback` is invoked with the
|
|
* final value after stopping the animation, which is useful for updating
|
|
* state to match the animation position with layout.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#stopanimation
|
|
*/
|
|
stopAnimation(callback) {
|
|
this.stopTracking();
|
|
this._animation && this._animation.stop();
|
|
this._animation = null;
|
|
if (callback) {
|
|
if (this.__isNative) {
|
|
NativeAnimatedAPI.getValue(this.__getNativeTag(), callback);
|
|
} else {
|
|
callback(this.__getValue());
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Stops any animation and resets the value to its original.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#resetanimation
|
|
*/
|
|
resetAnimation(callback) {
|
|
this.stopAnimation(callback);
|
|
this._value = this._startingValue;
|
|
if (this.__isNative) {
|
|
NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), this._startingValue);
|
|
}
|
|
}
|
|
__onAnimatedValueUpdateReceived(value) {
|
|
this._updateValue(
|
|
value,
|
|
false
|
|
/*flush*/
|
|
);
|
|
}
|
|
/**
|
|
* Interpolates the value before updating the property, e.g. mapping 0-1 to
|
|
* 0-10.
|
|
*/
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
/**
|
|
* Typically only used internally, but could be used by a custom Animation
|
|
* class.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvalue#animate
|
|
*/
|
|
animate(animation, callback) {
|
|
var handle = null;
|
|
if (animation.__isInteraction) {
|
|
handle = _InteractionManager.default.createInteractionHandle();
|
|
}
|
|
var previousAnimation = this._animation;
|
|
this._animation && this._animation.stop();
|
|
this._animation = animation;
|
|
animation.start(this._value, (value) => {
|
|
this._updateValue(
|
|
value,
|
|
true
|
|
/* flush */
|
|
);
|
|
}, (result) => {
|
|
this._animation = null;
|
|
if (handle !== null) {
|
|
_InteractionManager.default.clearInteractionHandle(handle);
|
|
}
|
|
callback && callback(result);
|
|
}, previousAnimation, this);
|
|
}
|
|
/**
|
|
* Typically only used internally.
|
|
*/
|
|
stopTracking() {
|
|
this._tracking && this._tracking.__detach();
|
|
this._tracking = null;
|
|
}
|
|
/**
|
|
* Typically only used internally.
|
|
*/
|
|
track(tracking) {
|
|
this.stopTracking();
|
|
this._tracking = tracking;
|
|
this._tracking && this._tracking.update();
|
|
}
|
|
_updateValue(value, flush) {
|
|
if (value === void 0) {
|
|
throw new Error("AnimatedValue: Attempting to set value to undefined");
|
|
}
|
|
this._value = value;
|
|
if (flush) {
|
|
_flush(this);
|
|
}
|
|
super.__callListeners(this.__getValue());
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "value",
|
|
value: this._value,
|
|
offset: this._offset
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedValue;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedEvent.js
|
|
var require_AnimatedEvent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedEvent.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.AnimatedEvent = void 0;
|
|
exports2.attachNativeEvent = attachNativeEvent;
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _NativeAnimatedHelper = _interopRequireWildcard(require_NativeAnimatedHelper());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
function attachNativeEvent(viewRef, eventName, argMapping) {
|
|
var eventMappings = [];
|
|
var traverse = /* @__PURE__ */ __name((value, path) => {
|
|
if (value instanceof _AnimatedValue.default) {
|
|
value.__makeNative();
|
|
eventMappings.push({
|
|
nativeEventPath: path,
|
|
animatedValueTag: value.__getNativeTag()
|
|
});
|
|
} else if (typeof value === "object") {
|
|
for (var _key in value) {
|
|
traverse(value[_key], path.concat(_key));
|
|
}
|
|
}
|
|
}, "traverse");
|
|
(0, _invariant.default)(argMapping[0] && argMapping[0].nativeEvent, "Native driven events only support animated values contained inside `nativeEvent`.");
|
|
traverse(argMapping[0].nativeEvent, []);
|
|
if (viewRef != null) {
|
|
eventMappings.forEach((mapping) => {
|
|
_NativeAnimatedHelper.default.API.addAnimatedEventToView(viewRef, eventName, mapping);
|
|
});
|
|
}
|
|
return {
|
|
detach() {
|
|
if (viewRef != null) {
|
|
eventMappings.forEach((mapping) => {
|
|
_NativeAnimatedHelper.default.API.removeAnimatedEventFromView(
|
|
viewRef,
|
|
eventName,
|
|
// $FlowFixMe[incompatible-call]
|
|
mapping.animatedValueTag
|
|
);
|
|
});
|
|
}
|
|
}
|
|
};
|
|
}
|
|
__name(attachNativeEvent, "attachNativeEvent");
|
|
function validateMapping(argMapping, args) {
|
|
var validate = /* @__PURE__ */ __name((recMapping, recEvt, key) => {
|
|
if (recMapping instanceof _AnimatedValue.default) {
|
|
(0, _invariant.default)(typeof recEvt === "number", "Bad mapping of event key " + key + ", should be number but got " + typeof recEvt);
|
|
return;
|
|
}
|
|
if (typeof recEvt === "number") {
|
|
(0, _invariant.default)(recMapping instanceof _AnimatedValue.default, "Bad mapping of type " + typeof recMapping + " for key " + key + ", event value must map to AnimatedValue");
|
|
return;
|
|
}
|
|
(0, _invariant.default)(typeof recMapping === "object", "Bad mapping of type " + typeof recMapping + " for key " + key);
|
|
(0, _invariant.default)(typeof recEvt === "object", "Bad event of type " + typeof recEvt + " for key " + key);
|
|
for (var mappingKey in recMapping) {
|
|
validate(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
|
|
}
|
|
}, "validate");
|
|
(0, _invariant.default)(args.length >= argMapping.length, "Event has less arguments than mapping");
|
|
argMapping.forEach((mapping, idx) => {
|
|
validate(mapping, args[idx], "arg" + idx);
|
|
});
|
|
}
|
|
__name(validateMapping, "validateMapping");
|
|
var AnimatedEvent = class {
|
|
static {
|
|
__name(this, "AnimatedEvent");
|
|
}
|
|
constructor(argMapping, config) {
|
|
this._listeners = [];
|
|
this._argMapping = argMapping;
|
|
if (config == null) {
|
|
console.warn("Animated.event now requires a second argument for options");
|
|
config = {
|
|
useNativeDriver: false
|
|
};
|
|
}
|
|
if (config.listener) {
|
|
this.__addListener(config.listener);
|
|
}
|
|
this._callListeners = this._callListeners.bind(this);
|
|
this._attachedEvent = null;
|
|
this.__isNative = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
|
|
}
|
|
__addListener(callback) {
|
|
this._listeners.push(callback);
|
|
}
|
|
__removeListener(callback) {
|
|
this._listeners = this._listeners.filter((listener) => listener !== callback);
|
|
}
|
|
__attach(viewRef, eventName) {
|
|
(0, _invariant.default)(this.__isNative, "Only native driven events need to be attached.");
|
|
this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping);
|
|
}
|
|
__detach(viewTag, eventName) {
|
|
(0, _invariant.default)(this.__isNative, "Only native driven events need to be detached.");
|
|
this._attachedEvent && this._attachedEvent.detach();
|
|
}
|
|
__getHandler() {
|
|
var _this = this;
|
|
if (this.__isNative) {
|
|
if (__DEV__) {
|
|
var _validatedMapping = false;
|
|
return function() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
|
args[_key2] = arguments[_key2];
|
|
}
|
|
if (!_validatedMapping) {
|
|
validateMapping(_this._argMapping, args);
|
|
_validatedMapping = true;
|
|
}
|
|
_this._callListeners(...args);
|
|
};
|
|
} else {
|
|
return this._callListeners;
|
|
}
|
|
}
|
|
var validatedMapping = false;
|
|
return function() {
|
|
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
args[_key3] = arguments[_key3];
|
|
}
|
|
if (__DEV__ && !validatedMapping) {
|
|
validateMapping(_this._argMapping, args);
|
|
validatedMapping = true;
|
|
}
|
|
var traverse = /* @__PURE__ */ __name((recMapping, recEvt, key) => {
|
|
if (recMapping instanceof _AnimatedValue.default) {
|
|
if (typeof recEvt === "number") {
|
|
recMapping.setValue(recEvt);
|
|
}
|
|
} else if (typeof recMapping === "object") {
|
|
for (var mappingKey in recMapping) {
|
|
traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
|
|
}
|
|
}
|
|
}, "traverse");
|
|
_this._argMapping.forEach((mapping, idx) => {
|
|
traverse(mapping, args[idx], "arg" + idx);
|
|
});
|
|
_this._callListeners(...args);
|
|
};
|
|
}
|
|
_callListeners() {
|
|
for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
|
|
args[_key4] = arguments[_key4];
|
|
}
|
|
this._listeners.forEach((listener) => listener(...args));
|
|
}
|
|
};
|
|
exports2.AnimatedEvent = AnimatedEvent;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTransform.js
|
|
var require_AnimatedTransform = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTransform.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var AnimatedTransform = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedTransform");
|
|
}
|
|
constructor(transforms) {
|
|
super();
|
|
this._transforms = transforms;
|
|
}
|
|
__makeNative() {
|
|
this._transforms.forEach((transform) => {
|
|
for (var key in transform) {
|
|
var value = transform[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__makeNative();
|
|
}
|
|
}
|
|
});
|
|
super.__makeNative();
|
|
}
|
|
__getValue() {
|
|
return this._transforms.map((transform) => {
|
|
var result = {};
|
|
for (var key in transform) {
|
|
var value = transform[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
result[key] = value.__getValue();
|
|
} else {
|
|
result[key] = value;
|
|
}
|
|
}
|
|
return result;
|
|
});
|
|
}
|
|
__getAnimatedValue() {
|
|
return this._transforms.map((transform) => {
|
|
var result = {};
|
|
for (var key in transform) {
|
|
var value = transform[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
result[key] = value.__getAnimatedValue();
|
|
} else {
|
|
result[key] = value;
|
|
}
|
|
}
|
|
return result;
|
|
});
|
|
}
|
|
__attach() {
|
|
this._transforms.forEach((transform) => {
|
|
for (var key in transform) {
|
|
var value = transform[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__addChild(this);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
__detach() {
|
|
this._transforms.forEach((transform) => {
|
|
for (var key in transform) {
|
|
var value = transform[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__removeChild(this);
|
|
}
|
|
}
|
|
});
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
var transConfigs = [];
|
|
this._transforms.forEach((transform) => {
|
|
for (var key in transform) {
|
|
var value = transform[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
transConfigs.push({
|
|
type: "animated",
|
|
property: key,
|
|
nodeTag: value.__getNativeTag()
|
|
});
|
|
} else {
|
|
transConfigs.push({
|
|
type: "static",
|
|
property: key,
|
|
value: _NativeAnimatedHelper.default.transformDataType(value)
|
|
});
|
|
}
|
|
}
|
|
});
|
|
_NativeAnimatedHelper.default.validateTransform(transConfigs);
|
|
return {
|
|
type: "transform",
|
|
transforms: transConfigs
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedTransform;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedStyle.js
|
|
var require_AnimatedStyle = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedStyle.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _AnimatedTransform = _interopRequireDefault(require_AnimatedTransform());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var flattenStyle = _StyleSheet.default.flatten;
|
|
function createAnimatedStyle(inputStyle) {
|
|
var style = flattenStyle(inputStyle);
|
|
var animatedStyles = {};
|
|
for (var key in style) {
|
|
var value = style[key];
|
|
if (key === "transform" && Array.isArray(value)) {
|
|
animatedStyles[key] = new _AnimatedTransform.default(value);
|
|
} else if (value instanceof _AnimatedNode.default) {
|
|
animatedStyles[key] = value;
|
|
} else if (value && !Array.isArray(value) && typeof value === "object") {
|
|
animatedStyles[key] = createAnimatedStyle(value);
|
|
}
|
|
}
|
|
return animatedStyles;
|
|
}
|
|
__name(createAnimatedStyle, "createAnimatedStyle");
|
|
var AnimatedStyle = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedStyle");
|
|
}
|
|
constructor(style) {
|
|
super();
|
|
this._inputStyle = style;
|
|
this._style = createAnimatedStyle(style);
|
|
}
|
|
// Recursively get values for nested styles (like iOS's shadowOffset)
|
|
_walkStyleAndGetValues(style) {
|
|
var updatedStyle = {};
|
|
for (var key in style) {
|
|
var value = style[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
if (!value.__isNative) {
|
|
updatedStyle[key] = value.__getValue();
|
|
}
|
|
} else if (value && !Array.isArray(value) && typeof value === "object") {
|
|
updatedStyle[key] = this._walkStyleAndGetValues(value);
|
|
} else {
|
|
updatedStyle[key] = value;
|
|
}
|
|
}
|
|
return updatedStyle;
|
|
}
|
|
__getValue() {
|
|
return [this._inputStyle, this._walkStyleAndGetValues(this._style)];
|
|
}
|
|
// Recursively get animated values for nested styles (like iOS's shadowOffset)
|
|
_walkStyleAndGetAnimatedValues(style) {
|
|
var updatedStyle = {};
|
|
for (var key in style) {
|
|
var value = style[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
updatedStyle[key] = value.__getAnimatedValue();
|
|
} else if (value && !Array.isArray(value) && typeof value === "object") {
|
|
updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);
|
|
}
|
|
}
|
|
return updatedStyle;
|
|
}
|
|
__getAnimatedValue() {
|
|
return this._walkStyleAndGetAnimatedValues(this._style);
|
|
}
|
|
__attach() {
|
|
for (var key in this._style) {
|
|
var value = this._style[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__addChild(this);
|
|
}
|
|
}
|
|
}
|
|
__detach() {
|
|
for (var key in this._style) {
|
|
var value = this._style[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__removeChild(this);
|
|
}
|
|
}
|
|
super.__detach();
|
|
}
|
|
__makeNative() {
|
|
for (var key in this._style) {
|
|
var value = this._style[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__makeNative();
|
|
}
|
|
}
|
|
super.__makeNative();
|
|
}
|
|
__getNativeConfig() {
|
|
var styleConfig = {};
|
|
for (var styleKey in this._style) {
|
|
if (this._style[styleKey] instanceof _AnimatedNode.default) {
|
|
var style = this._style[styleKey];
|
|
style.__makeNative();
|
|
styleConfig[styleKey] = style.__getNativeTag();
|
|
}
|
|
}
|
|
_NativeAnimatedHelper.default.validateStyles(styleConfig);
|
|
return {
|
|
type: "style",
|
|
style: styleConfig
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedStyle;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedProps.js
|
|
var require_AnimatedProps = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedProps.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AnimatedEvent = require_AnimatedEvent();
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _AnimatedStyle = _interopRequireDefault(require_AnimatedStyle());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var AnimatedProps = class extends _AnimatedNode.default {
|
|
static {
|
|
__name(this, "AnimatedProps");
|
|
}
|
|
constructor(props, callback) {
|
|
super();
|
|
if (props.style) {
|
|
props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
style: new _AnimatedStyle.default(props.style)
|
|
});
|
|
}
|
|
this._props = props;
|
|
this._callback = callback;
|
|
}
|
|
__getValue() {
|
|
var props = {};
|
|
for (var key in this._props) {
|
|
var value = this._props[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
if (!value.__isNative || value instanceof _AnimatedStyle.default) {
|
|
props[key] = value.__getValue();
|
|
}
|
|
} else if (value instanceof _AnimatedEvent.AnimatedEvent) {
|
|
props[key] = value.__getHandler();
|
|
} else {
|
|
props[key] = value;
|
|
}
|
|
}
|
|
return props;
|
|
}
|
|
__getAnimatedValue() {
|
|
var props = {};
|
|
for (var key in this._props) {
|
|
var value = this._props[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
props[key] = value.__getAnimatedValue();
|
|
}
|
|
}
|
|
return props;
|
|
}
|
|
__attach() {
|
|
for (var key in this._props) {
|
|
var value = this._props[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__addChild(this);
|
|
}
|
|
}
|
|
}
|
|
__detach() {
|
|
if (this.__isNative && this._animatedView) {
|
|
this.__disconnectAnimatedView();
|
|
}
|
|
this._animatedView = null;
|
|
for (var key in this._props) {
|
|
var value = this._props[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__removeChild(this);
|
|
}
|
|
}
|
|
super.__detach();
|
|
}
|
|
update() {
|
|
this._callback();
|
|
}
|
|
__makeNative() {
|
|
if (!this.__isNative) {
|
|
this.__isNative = true;
|
|
for (var key in this._props) {
|
|
var value = this._props[key];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__makeNative();
|
|
}
|
|
}
|
|
if (this._animatedView) {
|
|
this.__connectAnimatedView();
|
|
}
|
|
}
|
|
}
|
|
setNativeView(animatedView) {
|
|
if (this._animatedView === animatedView) {
|
|
return;
|
|
}
|
|
this._animatedView = animatedView;
|
|
if (this.__isNative) {
|
|
this.__connectAnimatedView();
|
|
}
|
|
}
|
|
__connectAnimatedView() {
|
|
(0, _invariant.default)(this.__isNative, 'Expected node to be marked as "native"');
|
|
var nativeViewTag = this._animatedView;
|
|
(0, _invariant.default)(nativeViewTag != null, "Unable to locate attached view in the native tree");
|
|
_NativeAnimatedHelper.default.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);
|
|
}
|
|
__disconnectAnimatedView() {
|
|
(0, _invariant.default)(this.__isNative, 'Expected node to be marked as "native"');
|
|
var nativeViewTag = this._animatedView;
|
|
(0, _invariant.default)(nativeViewTag != null, "Unable to locate attached view in the native tree");
|
|
_NativeAnimatedHelper.default.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);
|
|
}
|
|
__restoreDefaultValues() {
|
|
if (this.__isNative) {
|
|
_NativeAnimatedHelper.default.API.restoreDefaultValues(this.__getNativeTag());
|
|
}
|
|
}
|
|
__getNativeConfig() {
|
|
var propsConfig = {};
|
|
for (var propKey in this._props) {
|
|
var value = this._props[propKey];
|
|
if (value instanceof _AnimatedNode.default) {
|
|
value.__makeNative();
|
|
propsConfig[propKey] = value.__getNativeTag();
|
|
}
|
|
}
|
|
return {
|
|
type: "props",
|
|
props: propsConfig
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedProps;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/useRefEffect.js
|
|
var require_useRefEffect = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/useRefEffect.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = useRefEffect;
|
|
var _react = require("react");
|
|
function useRefEffect(effect) {
|
|
var cleanupRef = (0, _react.useRef)(void 0);
|
|
return (0, _react.useCallback)((instance) => {
|
|
if (cleanupRef.current) {
|
|
cleanupRef.current();
|
|
cleanupRef.current = void 0;
|
|
}
|
|
if (instance != null) {
|
|
cleanupRef.current = effect(instance);
|
|
}
|
|
}, [effect]);
|
|
}
|
|
__name(useRefEffect, "useRefEffect");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/useAnimatedProps.js
|
|
var require_useAnimatedProps = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/useAnimatedProps.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useAnimatedProps;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AnimatedProps = _interopRequireDefault(require_AnimatedProps());
|
|
var _AnimatedEvent = require_AnimatedEvent();
|
|
var _useRefEffect = _interopRequireDefault(require_useRefEffect());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var _react = require("react");
|
|
var _useLayoutEffect = _interopRequireDefault(require_useLayoutEffect());
|
|
function useAnimatedProps(props) {
|
|
var _useReducer = (0, _react.useReducer)((count4) => count4 + 1, 0), scheduleUpdate = _useReducer[1];
|
|
var onUpdateRef = (0, _react.useRef)(null);
|
|
var node = (0, _react.useMemo)(() => new _AnimatedProps.default(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
|
|
useAnimatedPropsLifecycle(node);
|
|
var refEffect = (0, _react.useCallback)((instance) => {
|
|
node.setNativeView(instance);
|
|
onUpdateRef.current = () => {
|
|
scheduleUpdate();
|
|
};
|
|
var target = getEventTarget(instance);
|
|
var events = [];
|
|
for (var propName in props) {
|
|
var propValue = props[propName];
|
|
if (propValue instanceof _AnimatedEvent.AnimatedEvent && propValue.__isNative) {
|
|
propValue.__attach(target, propName);
|
|
events.push([propName, propValue]);
|
|
}
|
|
}
|
|
return () => {
|
|
onUpdateRef.current = null;
|
|
for (var _i = 0, _events = events; _i < _events.length; _i++) {
|
|
var _events$_i = _events[_i], _propName = _events$_i[0], _propValue = _events$_i[1];
|
|
_propValue.__detach(target, _propName);
|
|
}
|
|
};
|
|
}, [props, node]);
|
|
var callbackRef = (0, _useRefEffect.default)(refEffect);
|
|
return [reduceAnimatedProps(node), callbackRef];
|
|
}
|
|
__name(useAnimatedProps, "useAnimatedProps");
|
|
function reduceAnimatedProps(node) {
|
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, node.__getValue()), {}, {
|
|
collapsable: false
|
|
});
|
|
}
|
|
__name(reduceAnimatedProps, "reduceAnimatedProps");
|
|
function useAnimatedPropsLifecycle(node) {
|
|
var prevNodeRef = (0, _react.useRef)(null);
|
|
var isUnmountingRef = (0, _react.useRef)(false);
|
|
(0, _react.useEffect)(() => {
|
|
_NativeAnimatedHelper.default.API.flushQueue();
|
|
});
|
|
(0, _useLayoutEffect.default)(() => {
|
|
isUnmountingRef.current = false;
|
|
return () => {
|
|
isUnmountingRef.current = true;
|
|
};
|
|
}, []);
|
|
(0, _useLayoutEffect.default)(() => {
|
|
node.__attach();
|
|
if (prevNodeRef.current != null) {
|
|
var prevNode = prevNodeRef.current;
|
|
prevNode.__restoreDefaultValues();
|
|
prevNode.__detach();
|
|
prevNodeRef.current = null;
|
|
}
|
|
return () => {
|
|
if (isUnmountingRef.current) {
|
|
node.__detach();
|
|
} else {
|
|
prevNodeRef.current = node;
|
|
}
|
|
};
|
|
}, [node]);
|
|
}
|
|
__name(useAnimatedPropsLifecycle, "useAnimatedPropsLifecycle");
|
|
function getEventTarget(instance) {
|
|
return typeof instance === "object" && typeof (instance == null ? void 0 : instance.getScrollableNode) === "function" ? (
|
|
// $FlowFixMe[incompatible-use] - Legacy instance assumptions.
|
|
instance.getScrollableNode()
|
|
) : instance;
|
|
}
|
|
__name(getEventTarget, "getEventTarget");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/useMergeRefs.js
|
|
var require_useMergeRefs2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/useMergeRefs.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = useMergeRefs;
|
|
var _react = require("react");
|
|
function useMergeRefs() {
|
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
refs[_key] = arguments[_key];
|
|
}
|
|
return (0, _react.useCallback)(
|
|
(current) => {
|
|
for (var _i = 0, _refs = refs; _i < _refs.length; _i++) {
|
|
var ref = _refs[_i];
|
|
if (ref != null) {
|
|
if (typeof ref === "function") {
|
|
ref(current);
|
|
} else {
|
|
ref.current = current;
|
|
}
|
|
}
|
|
}
|
|
},
|
|
[...refs]
|
|
|
|
);
|
|
}
|
|
__name(useMergeRefs, "useMergeRefs");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/createAnimatedComponent.js
|
|
var require_createAnimatedComponent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/createAnimatedComponent.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = createAnimatedComponent;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _useAnimatedProps2 = _interopRequireDefault(require_useAnimatedProps());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs2());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _excluded = ["style"];
|
|
function createAnimatedComponent(Component) {
|
|
return /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var _useAnimatedProps = (0, _useAnimatedProps2.default)(props), reducedProps = _useAnimatedProps[0], callbackRef = _useAnimatedProps[1];
|
|
var ref = (0, _useMergeRefs.default)(callbackRef, forwardedRef);
|
|
var passthroughAnimatedPropExplicitValues = reducedProps.passthroughAnimatedPropExplicitValues, style = reducedProps.style;
|
|
var _ref = passthroughAnimatedPropExplicitValues !== null && passthroughAnimatedPropExplicitValues !== void 0 ? passthroughAnimatedPropExplicitValues : {}, passthroughStyle = _ref.style, passthroughProps = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
var mergedStyle = [style, passthroughStyle];
|
|
return /* @__PURE__ */ React83.createElement(Component, (0, _extends2.default)({}, reducedProps, passthroughProps, {
|
|
style: mergedStyle,
|
|
ref
|
|
}));
|
|
});
|
|
}
|
|
__name(createAnimatedComponent, "createAnimatedComponent");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedFlatList.js
|
|
var require_AnimatedFlatList = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedFlatList.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _FlatList = _interopRequireDefault(require_FlatList2());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var FlatListWithEventThrottle = /* @__PURE__ */ React83.forwardRef((props, ref) => /* @__PURE__ */ React83.createElement(_FlatList.default, (0, _extends2.default)({
|
|
scrollEventThrottle: 1e-4
|
|
}, props, {
|
|
ref
|
|
})));
|
|
var _default = exports2.default = (0, _createAnimatedComponent.default)(FlatListWithEventThrottle);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/AssetRegistry/index.js
|
|
var require_AssetRegistry = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/AssetRegistry/index.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.getAssetByID = getAssetByID;
|
|
exports2.registerAsset = registerAsset;
|
|
var assets = [];
|
|
function registerAsset(asset) {
|
|
return assets.push(asset);
|
|
}
|
|
__name(registerAsset, "registerAsset");
|
|
function getAssetByID(assetId) {
|
|
return assets[assetId - 1];
|
|
}
|
|
__name(getAssetByID, "getAssetByID");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/ImageLoader/index.js
|
|
var require_ImageLoader = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/ImageLoader/index.js"(exports2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = exports2.ImageUriCache = void 0;
|
|
var dataUriPattern = /^data:/;
|
|
var ImageUriCache = class _ImageUriCache {
|
|
static {
|
|
__name(this, "ImageUriCache");
|
|
}
|
|
static has(uri) {
|
|
var entries = _ImageUriCache._entries;
|
|
var isDataUri = dataUriPattern.test(uri);
|
|
return isDataUri || Boolean(entries[uri]);
|
|
}
|
|
static add(uri) {
|
|
var entries = _ImageUriCache._entries;
|
|
var lastUsedTimestamp = Date.now();
|
|
if (entries[uri]) {
|
|
entries[uri].lastUsedTimestamp = lastUsedTimestamp;
|
|
entries[uri].refCount += 1;
|
|
} else {
|
|
entries[uri] = {
|
|
lastUsedTimestamp,
|
|
refCount: 1
|
|
};
|
|
}
|
|
}
|
|
static remove(uri) {
|
|
var entries = _ImageUriCache._entries;
|
|
if (entries[uri]) {
|
|
entries[uri].refCount -= 1;
|
|
}
|
|
_ImageUriCache._cleanUpIfNeeded();
|
|
}
|
|
static _cleanUpIfNeeded() {
|
|
var entries = _ImageUriCache._entries;
|
|
var imageUris = Object.keys(entries);
|
|
if (imageUris.length + 1 > _ImageUriCache._maximumEntries) {
|
|
var leastRecentlyUsedKey;
|
|
var leastRecentlyUsedEntry;
|
|
imageUris.forEach((uri) => {
|
|
var entry = entries[uri];
|
|
if ((!leastRecentlyUsedEntry || entry.lastUsedTimestamp < leastRecentlyUsedEntry.lastUsedTimestamp) && entry.refCount === 0) {
|
|
leastRecentlyUsedKey = uri;
|
|
leastRecentlyUsedEntry = entry;
|
|
}
|
|
});
|
|
if (leastRecentlyUsedKey) {
|
|
delete entries[leastRecentlyUsedKey];
|
|
}
|
|
}
|
|
}
|
|
};
|
|
exports2.ImageUriCache = ImageUriCache;
|
|
ImageUriCache._maximumEntries = 256;
|
|
ImageUriCache._entries = {};
|
|
var id = 0;
|
|
var requests = {};
|
|
var ImageLoader = {
|
|
abort(requestId) {
|
|
var image = requests["" + requestId];
|
|
if (image) {
|
|
image.onerror = null;
|
|
image.onload = null;
|
|
image = null;
|
|
delete requests["" + requestId];
|
|
}
|
|
},
|
|
getSize(uri, success, failure) {
|
|
var complete = false;
|
|
var interval = setInterval(callback, 16);
|
|
var requestId = ImageLoader.load(uri, callback, errorCallback);
|
|
function callback() {
|
|
var image = requests["" + requestId];
|
|
if (image) {
|
|
var naturalHeight = image.naturalHeight, naturalWidth = image.naturalWidth;
|
|
if (naturalHeight && naturalWidth) {
|
|
success(naturalWidth, naturalHeight);
|
|
complete = true;
|
|
}
|
|
}
|
|
if (complete) {
|
|
ImageLoader.abort(requestId);
|
|
clearInterval(interval);
|
|
}
|
|
}
|
|
__name(callback, "callback");
|
|
function errorCallback() {
|
|
if (typeof failure === "function") {
|
|
failure();
|
|
}
|
|
ImageLoader.abort(requestId);
|
|
clearInterval(interval);
|
|
}
|
|
__name(errorCallback, "errorCallback");
|
|
},
|
|
has(uri) {
|
|
return ImageUriCache.has(uri);
|
|
},
|
|
load(uri, onLoad, onError) {
|
|
id += 1;
|
|
var image = new window.Image();
|
|
image.onerror = onError;
|
|
image.onload = (e) => {
|
|
var onDecode = /* @__PURE__ */ __name(() => onLoad({
|
|
nativeEvent: e
|
|
}), "onDecode");
|
|
if (typeof image.decode === "function") {
|
|
image.decode().then(onDecode, onDecode);
|
|
} else {
|
|
setTimeout(onDecode, 0);
|
|
}
|
|
};
|
|
image.src = uri;
|
|
requests["" + id] = image;
|
|
return id;
|
|
},
|
|
prefetch(uri) {
|
|
return new Promise((resolve, reject) => {
|
|
ImageLoader.load(uri, () => {
|
|
ImageUriCache.add(uri);
|
|
ImageUriCache.remove(uri);
|
|
resolve();
|
|
}, reject);
|
|
});
|
|
},
|
|
queryCache(uris) {
|
|
var result = {};
|
|
uris.forEach((u) => {
|
|
if (ImageUriCache.has(u)) {
|
|
result[u] = "disk/memory";
|
|
}
|
|
});
|
|
return Promise.resolve(result);
|
|
}
|
|
};
|
|
var _default = exports2.default = ImageLoader;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/PixelRatio/index.js
|
|
var require_PixelRatio = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/PixelRatio/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Dimensions = _interopRequireDefault(require_Dimensions());
|
|
var PixelRatio = class _PixelRatio {
|
|
static {
|
|
__name(this, "PixelRatio");
|
|
}
|
|
/**
|
|
* Returns the device pixel density.
|
|
*/
|
|
static get() {
|
|
return _Dimensions.default.get("window").scale;
|
|
}
|
|
/**
|
|
* No equivalent for Web
|
|
*/
|
|
static getFontScale() {
|
|
return _Dimensions.default.get("window").fontScale || _PixelRatio.get();
|
|
}
|
|
/**
|
|
* Converts a layout size (dp) to pixel size (px).
|
|
* Guaranteed to return an integer number.
|
|
*/
|
|
static getPixelSizeForLayoutSize(layoutSize) {
|
|
return Math.round(layoutSize * _PixelRatio.get());
|
|
}
|
|
/**
|
|
* Rounds a layout size (dp) to the nearest layout size that corresponds to
|
|
* an integer number of pixels. For example, on a device with a PixelRatio
|
|
* of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to
|
|
* exactly (8.33 * 3) = 25 pixels.
|
|
*/
|
|
static roundToNearestPixel(layoutSize) {
|
|
var ratio = _PixelRatio.get();
|
|
return Math.round(layoutSize * ratio) / ratio;
|
|
}
|
|
};
|
|
exports2.default = PixelRatio;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Image/index.js
|
|
var require_Image = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Image/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var _AssetRegistry = require_AssetRegistry();
|
|
var _preprocess = require_preprocess();
|
|
var _ImageLoader = _interopRequireDefault(require_ImageLoader());
|
|
var _PixelRatio = _interopRequireDefault(require_PixelRatio());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _TextAncestorContext = _interopRequireDefault(require_TextAncestorContext());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _warnOnce = require_warnOnce();
|
|
var _excluded = ["aria-label", "accessibilityLabel", "blurRadius", "defaultSource", "draggable", "onError", "onLayout", "onLoad", "onLoadEnd", "onLoadStart", "pointerEvents", "source", "style"];
|
|
var ERRORED = "ERRORED";
|
|
var LOADED = "LOADED";
|
|
var LOADING = "LOADING";
|
|
var IDLE = "IDLE";
|
|
var _filterId = 0;
|
|
var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
|
|
function createTintColorSVG(tintColor, id) {
|
|
return tintColor && id != null ? /* @__PURE__ */ React83.createElement("svg", {
|
|
style: {
|
|
position: "absolute",
|
|
height: 0,
|
|
visibility: "hidden",
|
|
width: 0
|
|
}
|
|
}, /* @__PURE__ */ React83.createElement("defs", null, /* @__PURE__ */ React83.createElement("filter", {
|
|
id: "tint-" + id,
|
|
suppressHydrationWarning: true
|
|
}, /* @__PURE__ */ React83.createElement("feFlood", {
|
|
floodColor: "" + tintColor,
|
|
key: tintColor
|
|
}), /* @__PURE__ */ React83.createElement("feComposite", {
|
|
in2: "SourceAlpha",
|
|
operator: "in"
|
|
})))) : null;
|
|
}
|
|
__name(createTintColorSVG, "createTintColorSVG");
|
|
function extractNonStandardStyleProps(style, blurRadius, filterId, tintColorProp) {
|
|
var flatStyle = _StyleSheet.default.flatten(style);
|
|
var filter = flatStyle.filter, resizeMode = flatStyle.resizeMode, shadowOffset = flatStyle.shadowOffset, tintColor = flatStyle.tintColor;
|
|
if (flatStyle.resizeMode) {
|
|
(0, _warnOnce.warnOnce)("Image.style.resizeMode", "Image: style.resizeMode is deprecated. Please use props.resizeMode.");
|
|
}
|
|
if (flatStyle.tintColor) {
|
|
(0, _warnOnce.warnOnce)("Image.style.tintColor", "Image: style.tintColor is deprecated. Please use props.tintColor.");
|
|
}
|
|
var filters = [];
|
|
var _filter = null;
|
|
if (filter) {
|
|
filters.push(filter);
|
|
}
|
|
if (blurRadius) {
|
|
filters.push("blur(" + blurRadius + "px)");
|
|
}
|
|
if (shadowOffset) {
|
|
var shadowString = (0, _preprocess.createBoxShadowValue)(flatStyle);
|
|
if (shadowString) {
|
|
filters.push("drop-shadow(" + shadowString + ")");
|
|
}
|
|
}
|
|
if ((tintColorProp || tintColor) && filterId != null) {
|
|
filters.push("url(#tint-" + filterId + ")");
|
|
}
|
|
if (filters.length > 0) {
|
|
_filter = filters.join(" ");
|
|
}
|
|
return [resizeMode, _filter, tintColor];
|
|
}
|
|
__name(extractNonStandardStyleProps, "extractNonStandardStyleProps");
|
|
function resolveAssetDimensions(source) {
|
|
if (typeof source === "number") {
|
|
var _getAssetByID = (0, _AssetRegistry.getAssetByID)(source), _height = _getAssetByID.height, _width = _getAssetByID.width;
|
|
return {
|
|
height: _height,
|
|
width: _width
|
|
};
|
|
} else if (source != null && !Array.isArray(source) && typeof source === "object") {
|
|
var _height2 = source.height, _width2 = source.width;
|
|
return {
|
|
height: _height2,
|
|
width: _width2
|
|
};
|
|
}
|
|
}
|
|
__name(resolveAssetDimensions, "resolveAssetDimensions");
|
|
function resolveAssetUri(source) {
|
|
var uri = null;
|
|
if (typeof source === "number") {
|
|
var asset = (0, _AssetRegistry.getAssetByID)(source);
|
|
if (asset == null) {
|
|
throw new Error('Image: asset with ID "' + source + '" could not be found. Please check the image source or packager.');
|
|
}
|
|
var scale = asset.scales[0];
|
|
if (asset.scales.length > 1) {
|
|
var preferredScale = _PixelRatio.default.get();
|
|
scale = asset.scales.reduce((prev, curr) => Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev);
|
|
}
|
|
var scaleSuffix = scale !== 1 ? "@" + scale + "x" : "";
|
|
uri = asset ? asset.httpServerLocation + "/" + asset.name + scaleSuffix + "." + asset.type : "";
|
|
} else if (typeof source === "string") {
|
|
uri = source;
|
|
} else if (source && typeof source.uri === "string") {
|
|
uri = source.uri;
|
|
}
|
|
if (uri) {
|
|
var match = uri.match(svgDataUriPattern);
|
|
if (match) {
|
|
var prefix = match[1], svg = match[2];
|
|
var encodedSvg = encodeURIComponent(svg);
|
|
return "" + prefix + encodedSvg;
|
|
}
|
|
}
|
|
return uri;
|
|
}
|
|
__name(resolveAssetUri, "resolveAssetUri");
|
|
var Image2 = /* @__PURE__ */ React83.forwardRef((props, ref) => {
|
|
var _ariaLabel = props["aria-label"], accessibilityLabel = props.accessibilityLabel, blurRadius = props.blurRadius, defaultSource = props.defaultSource, draggable = props.draggable, onError = props.onError, onLayout = props.onLayout, onLoad = props.onLoad, onLoadEnd = props.onLoadEnd, onLoadStart = props.onLoadStart, pointerEvents = props.pointerEvents, source = props.source, style = props.style, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var ariaLabel = _ariaLabel || accessibilityLabel;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
if (props.children) {
|
|
throw new Error("The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.");
|
|
}
|
|
}
|
|
var _React$useState = React83.useState(() => {
|
|
var uri2 = resolveAssetUri(source);
|
|
if (uri2 != null) {
|
|
var isLoaded = _ImageLoader.default.has(uri2);
|
|
if (isLoaded) {
|
|
return LOADED;
|
|
}
|
|
}
|
|
return IDLE;
|
|
}), state = _React$useState[0], updateState = _React$useState[1];
|
|
var _React$useState2 = React83.useState({}), layout = _React$useState2[0], updateLayout = _React$useState2[1];
|
|
var hasTextAncestor = React83.useContext(_TextAncestorContext.default);
|
|
var hiddenImageRef = React83.useRef(null);
|
|
var filterRef = React83.useRef(_filterId++);
|
|
var requestRef = React83.useRef(null);
|
|
var shouldDisplaySource = state === LOADED || state === LOADING && defaultSource == null;
|
|
var _extractNonStandardSt = extractNonStandardStyleProps(style, blurRadius, filterRef.current, props.tintColor), _resizeMode = _extractNonStandardSt[0], filter = _extractNonStandardSt[1], _tintColor = _extractNonStandardSt[2];
|
|
var resizeMode = props.resizeMode || _resizeMode || "cover";
|
|
var tintColor = props.tintColor || _tintColor;
|
|
var selectedSource = shouldDisplaySource ? source : defaultSource;
|
|
var displayImageUri = resolveAssetUri(selectedSource);
|
|
var imageSizeStyle = resolveAssetDimensions(selectedSource);
|
|
var backgroundImage = displayImageUri ? 'url("' + displayImageUri + '")' : null;
|
|
var backgroundSize = getBackgroundSize();
|
|
var hiddenImage = displayImageUri ? (0, _createElement.default)("img", {
|
|
alt: ariaLabel || "",
|
|
style: styles.accessibilityImage$raw,
|
|
draggable: draggable || false,
|
|
ref: hiddenImageRef,
|
|
src: displayImageUri
|
|
}) : null;
|
|
function getBackgroundSize() {
|
|
if (hiddenImageRef.current != null && (resizeMode === "center" || resizeMode === "repeat")) {
|
|
var _hiddenImageRef$curre = hiddenImageRef.current, naturalHeight = _hiddenImageRef$curre.naturalHeight, naturalWidth = _hiddenImageRef$curre.naturalWidth;
|
|
var _height3 = layout.height, _width3 = layout.width;
|
|
if (naturalHeight && naturalWidth && _height3 && _width3) {
|
|
var scaleFactor = Math.min(1, _width3 / naturalWidth, _height3 / naturalHeight);
|
|
var x = Math.ceil(scaleFactor * naturalWidth);
|
|
var y = Math.ceil(scaleFactor * naturalHeight);
|
|
return x + "px " + y + "px";
|
|
}
|
|
}
|
|
}
|
|
__name(getBackgroundSize, "getBackgroundSize");
|
|
function handleLayout(e) {
|
|
if (resizeMode === "center" || resizeMode === "repeat" || onLayout) {
|
|
var _layout = e.nativeEvent.layout;
|
|
onLayout && onLayout(e);
|
|
updateLayout(_layout);
|
|
}
|
|
}
|
|
__name(handleLayout, "handleLayout");
|
|
var uri = resolveAssetUri(source);
|
|
React83.useEffect(() => {
|
|
abortPendingRequest();
|
|
if (uri != null) {
|
|
updateState(LOADING);
|
|
if (onLoadStart) {
|
|
onLoadStart();
|
|
}
|
|
requestRef.current = _ImageLoader.default.load(uri, /* @__PURE__ */ __name(function load(e) {
|
|
updateState(LOADED);
|
|
if (onLoad) {
|
|
onLoad(e);
|
|
}
|
|
if (onLoadEnd) {
|
|
onLoadEnd();
|
|
}
|
|
}, "load"), /* @__PURE__ */ __name(function error4() {
|
|
updateState(ERRORED);
|
|
if (onError) {
|
|
onError({
|
|
nativeEvent: {
|
|
error: "Failed to load resource " + uri
|
|
}
|
|
});
|
|
}
|
|
if (onLoadEnd) {
|
|
onLoadEnd();
|
|
}
|
|
}, "error"));
|
|
}
|
|
function abortPendingRequest() {
|
|
if (requestRef.current != null) {
|
|
_ImageLoader.default.abort(requestRef.current);
|
|
requestRef.current = null;
|
|
}
|
|
}
|
|
__name(abortPendingRequest, "abortPendingRequest");
|
|
return abortPendingRequest;
|
|
}, [uri, requestRef, updateState, onError, onLoad, onLoadEnd, onLoadStart]);
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, {
|
|
"aria-label": ariaLabel,
|
|
onLayout: handleLayout,
|
|
pointerEvents,
|
|
ref,
|
|
style: [
|
|
styles.root,
|
|
hasTextAncestor && styles.inline,
|
|
imageSizeStyle,
|
|
style,
|
|
styles.undo,
|
|
// TEMP: avoid deprecated shadow props regression
|
|
// until Image refactored to use createElement.
|
|
{
|
|
boxShadow: null
|
|
}
|
|
]
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [styles.image, resizeModeStyles[resizeMode], {
|
|
backgroundImage,
|
|
filter
|
|
}, backgroundSize != null && {
|
|
backgroundSize
|
|
}],
|
|
suppressHydrationWarning: true
|
|
}), hiddenImage, createTintColorSVG(tintColor, filterRef.current));
|
|
});
|
|
Image2.displayName = "Image";
|
|
var ImageWithStatics = Image2;
|
|
ImageWithStatics.getSize = function(uri, success, failure) {
|
|
_ImageLoader.default.getSize(uri, success, failure);
|
|
};
|
|
ImageWithStatics.prefetch = function(uri) {
|
|
return _ImageLoader.default.prefetch(uri);
|
|
};
|
|
ImageWithStatics.queryCache = function(uris) {
|
|
return _ImageLoader.default.queryCache(uris);
|
|
};
|
|
var styles = _StyleSheet.default.create({
|
|
root: {
|
|
flexBasis: "auto",
|
|
overflow: "hidden",
|
|
zIndex: 0
|
|
},
|
|
inline: {
|
|
display: "inline-flex"
|
|
},
|
|
undo: {
|
|
// These styles are converted to CSS filters applied to the
|
|
// element displaying the background image.
|
|
blurRadius: null,
|
|
shadowColor: null,
|
|
shadowOpacity: null,
|
|
shadowOffset: null,
|
|
shadowRadius: null,
|
|
tintColor: null,
|
|
// These styles are not supported
|
|
overlayColor: null,
|
|
resizeMode: null
|
|
},
|
|
image: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
|
|
backgroundColor: "transparent",
|
|
backgroundPosition: "center",
|
|
backgroundRepeat: "no-repeat",
|
|
backgroundSize: "cover",
|
|
height: "100%",
|
|
width: "100%",
|
|
zIndex: -1
|
|
}),
|
|
accessibilityImage$raw: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
|
|
height: "100%",
|
|
opacity: 0,
|
|
width: "100%",
|
|
zIndex: -1
|
|
})
|
|
});
|
|
var resizeModeStyles = _StyleSheet.default.create({
|
|
center: {
|
|
backgroundSize: "auto"
|
|
},
|
|
contain: {
|
|
backgroundSize: "contain"
|
|
},
|
|
cover: {
|
|
backgroundSize: "cover"
|
|
},
|
|
none: {
|
|
backgroundPosition: "0",
|
|
backgroundSize: "auto"
|
|
},
|
|
repeat: {
|
|
backgroundPosition: "0",
|
|
backgroundRepeat: "repeat",
|
|
backgroundSize: "auto"
|
|
},
|
|
stretch: {
|
|
backgroundSize: "100% 100%"
|
|
}
|
|
});
|
|
var _default = exports2.default = ImageWithStatics;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedImage.js
|
|
var require_AnimatedImage = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedImage.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _Image = _interopRequireDefault(require_Image());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var _default = exports2.default = (0, _createAnimatedComponent.default)(_Image.default);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedScrollView.js
|
|
var require_AnimatedScrollView = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedScrollView.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _ScrollView = _interopRequireDefault(require_ScrollView());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var ScrollViewWithEventThrottle = /* @__PURE__ */ React83.forwardRef((props, ref) => /* @__PURE__ */ React83.createElement(_ScrollView.default, (0, _extends2.default)({
|
|
scrollEventThrottle: 1e-4
|
|
}, props, {
|
|
ref
|
|
})));
|
|
var _default = exports2.default = (0, _createAnimatedComponent.default)(ScrollViewWithEventThrottle);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedSectionList/index.js
|
|
var require_VirtualizedSectionList = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedSectionList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require_createForOfIteratorHelperLoose());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _VirtualizedList = _interopRequireDefault(require_VirtualizedList());
|
|
var _VirtualizeUtils = require_VirtualizeUtils();
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _excluded = ["ItemSeparatorComponent", "SectionSeparatorComponent", "renderItem", "renderSectionFooter", "renderSectionHeader", "sections", "stickySectionHeadersEnabled"];
|
|
var VirtualizedSectionList = class extends React83.PureComponent {
|
|
static {
|
|
__name(this, "VirtualizedSectionList");
|
|
}
|
|
constructor() {
|
|
super(...arguments);
|
|
this._keyExtractor = (item, index5) => {
|
|
var info = this._subExtractor(index5);
|
|
return info && info.key || String(index5);
|
|
};
|
|
this._convertViewable = (viewable) => {
|
|
var _info$index;
|
|
(0, _invariant.default)(viewable.index != null, "Received a broken ViewToken");
|
|
var info = this._subExtractor(viewable.index);
|
|
if (!info) {
|
|
return null;
|
|
}
|
|
var keyExtractorWithNullableIndex = info.section.keyExtractor;
|
|
var keyExtractorWithNonNullableIndex = this.props.keyExtractor || _VirtualizeUtils.keyExtractor;
|
|
var key = keyExtractorWithNullableIndex != null ? keyExtractorWithNullableIndex(viewable.item, info.index) : keyExtractorWithNonNullableIndex(viewable.item, (_info$index = info.index) !== null && _info$index !== void 0 ? _info$index : 0);
|
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, viewable), {}, {
|
|
index: info.index,
|
|
key,
|
|
section: info.section
|
|
});
|
|
};
|
|
this._onViewableItemsChanged = (_ref) => {
|
|
var viewableItems = _ref.viewableItems, changed = _ref.changed;
|
|
var onViewableItemsChanged = this.props.onViewableItemsChanged;
|
|
if (onViewableItemsChanged != null) {
|
|
onViewableItemsChanged({
|
|
viewableItems: viewableItems.map(this._convertViewable, this).filter(Boolean),
|
|
changed: changed.map(this._convertViewable, this).filter(Boolean)
|
|
});
|
|
}
|
|
};
|
|
this._renderItem = (listItemCount) => (
|
|
|
|
(_ref2) => {
|
|
var item = _ref2.item, index5 = _ref2.index;
|
|
var info = this._subExtractor(index5);
|
|
if (!info) {
|
|
return null;
|
|
}
|
|
var infoIndex = info.index;
|
|
if (infoIndex == null) {
|
|
var section = info.section;
|
|
if (info.header === true) {
|
|
var renderSectionHeader = this.props.renderSectionHeader;
|
|
return renderSectionHeader ? renderSectionHeader({
|
|
section
|
|
}) : null;
|
|
} else {
|
|
var renderSectionFooter = this.props.renderSectionFooter;
|
|
return renderSectionFooter ? renderSectionFooter({
|
|
section
|
|
}) : null;
|
|
}
|
|
} else {
|
|
var renderItem = info.section.renderItem || this.props.renderItem;
|
|
var SeparatorComponent = this._getSeparatorComponent(index5, info, listItemCount);
|
|
(0, _invariant.default)(renderItem, "no renderItem!");
|
|
return /* @__PURE__ */ React83.createElement(ItemWithSeparator, {
|
|
SeparatorComponent,
|
|
LeadingSeparatorComponent: infoIndex === 0 ? this.props.SectionSeparatorComponent : void 0,
|
|
cellKey: info.key,
|
|
index: infoIndex,
|
|
item,
|
|
leadingItem: info.leadingItem,
|
|
leadingSection: info.leadingSection,
|
|
prevCellKey: (this._subExtractor(index5 - 1) || {}).key,
|
|
setSelfHighlightCallback: this._setUpdateHighlightFor,
|
|
setSelfUpdatePropsCallback: this._setUpdatePropsFor,
|
|
updateHighlightFor: this._updateHighlightFor,
|
|
updatePropsFor: this._updatePropsFor,
|
|
renderItem,
|
|
section: info.section,
|
|
trailingItem: info.trailingItem,
|
|
trailingSection: info.trailingSection,
|
|
inverted: !!this.props.inverted
|
|
});
|
|
}
|
|
}
|
|
);
|
|
this._updatePropsFor = (cellKey, value) => {
|
|
var updateProps = this._updatePropsMap[cellKey];
|
|
if (updateProps != null) {
|
|
updateProps(value);
|
|
}
|
|
};
|
|
this._updateHighlightFor = (cellKey, value) => {
|
|
var updateHighlight = this._updateHighlightMap[cellKey];
|
|
if (updateHighlight != null) {
|
|
updateHighlight(value);
|
|
}
|
|
};
|
|
this._setUpdateHighlightFor = (cellKey, updateHighlightFn) => {
|
|
if (updateHighlightFn != null) {
|
|
this._updateHighlightMap[cellKey] = updateHighlightFn;
|
|
} else {
|
|
delete this._updateHighlightFor[cellKey];
|
|
}
|
|
};
|
|
this._setUpdatePropsFor = (cellKey, updatePropsFn) => {
|
|
if (updatePropsFn != null) {
|
|
this._updatePropsMap[cellKey] = updatePropsFn;
|
|
} else {
|
|
delete this._updatePropsMap[cellKey];
|
|
}
|
|
};
|
|
this._updateHighlightMap = {};
|
|
this._updatePropsMap = {};
|
|
this._captureRef = (ref) => {
|
|
this._listRef = ref;
|
|
};
|
|
}
|
|
scrollToLocation(params) {
|
|
var index5 = params.itemIndex;
|
|
for (var i = 0; i < params.sectionIndex; i++) {
|
|
index5 += this.props.getItemCount(this.props.sections[i].data) + 2;
|
|
}
|
|
var viewOffset = params.viewOffset || 0;
|
|
if (this._listRef == null) {
|
|
return;
|
|
}
|
|
if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) {
|
|
var frame = this._listRef.__getFrameMetricsApprox(index5 - params.itemIndex, this._listRef.props);
|
|
viewOffset += frame.length;
|
|
}
|
|
var toIndexParams = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
viewOffset,
|
|
index: index5
|
|
});
|
|
this._listRef.scrollToIndex(toIndexParams);
|
|
}
|
|
getListRef() {
|
|
return this._listRef;
|
|
}
|
|
render() {
|
|
var _this$props = this.props, ItemSeparatorComponent = _this$props.ItemSeparatorComponent, SectionSeparatorComponent = _this$props.SectionSeparatorComponent, _renderItem = _this$props.renderItem, renderSectionFooter = _this$props.renderSectionFooter, renderSectionHeader = _this$props.renderSectionHeader, _sections = _this$props.sections, stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled, passThroughProps = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
|
|
var listHeaderOffset = this.props.ListHeaderComponent ? 1 : 0;
|
|
var stickyHeaderIndices = this.props.stickySectionHeadersEnabled ? [] : void 0;
|
|
var itemCount = 0;
|
|
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(this.props.sections), _step; !(_step = _iterator()).done; ) {
|
|
var section = _step.value;
|
|
if (stickyHeaderIndices != null) {
|
|
stickyHeaderIndices.push(itemCount + listHeaderOffset);
|
|
}
|
|
itemCount += 2;
|
|
itemCount += this.props.getItemCount(section.data);
|
|
}
|
|
var renderItem = this._renderItem(itemCount);
|
|
return /* @__PURE__ */ React83.createElement(_VirtualizedList.default, (0, _extends2.default)({}, passThroughProps, {
|
|
keyExtractor: this._keyExtractor,
|
|
stickyHeaderIndices,
|
|
renderItem,
|
|
data: this.props.sections,
|
|
getItem: /* @__PURE__ */ __name((sections, index5) => this._getItem(this.props, sections, index5), "getItem"),
|
|
getItemCount: /* @__PURE__ */ __name(() => itemCount, "getItemCount"),
|
|
onViewableItemsChanged: this.props.onViewableItemsChanged ? this._onViewableItemsChanged : void 0,
|
|
ref: this._captureRef
|
|
}));
|
|
}
|
|
_getItem(props, sections, index5) {
|
|
if (!sections) {
|
|
return null;
|
|
}
|
|
var itemIdx = index5 - 1;
|
|
for (var i = 0; i < sections.length; i++) {
|
|
var section = sections[i];
|
|
var sectionData = section.data;
|
|
var itemCount = props.getItemCount(sectionData);
|
|
if (itemIdx === -1 || itemIdx === itemCount) {
|
|
return section;
|
|
} else if (itemIdx < itemCount) {
|
|
return props.getItem(sectionData, itemIdx);
|
|
} else {
|
|
itemIdx -= itemCount + 2;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
// $FlowFixMe[missing-local-annot]
|
|
_subExtractor(index5) {
|
|
var itemIndex = index5;
|
|
var _this$props2 = this.props, getItem = _this$props2.getItem, getItemCount = _this$props2.getItemCount, keyExtractor = _this$props2.keyExtractor, sections = _this$props2.sections;
|
|
for (var i = 0; i < sections.length; i++) {
|
|
var section = sections[i];
|
|
var sectionData = section.data;
|
|
var key = section.key || String(i);
|
|
itemIndex -= 1;
|
|
if (itemIndex >= getItemCount(sectionData) + 1) {
|
|
itemIndex -= getItemCount(sectionData) + 1;
|
|
} else if (itemIndex === -1) {
|
|
return {
|
|
section,
|
|
key: key + ":header",
|
|
index: null,
|
|
header: true,
|
|
trailingSection: sections[i + 1]
|
|
};
|
|
} else if (itemIndex === getItemCount(sectionData)) {
|
|
return {
|
|
section,
|
|
key: key + ":footer",
|
|
index: null,
|
|
header: false,
|
|
trailingSection: sections[i + 1]
|
|
};
|
|
} else {
|
|
var extractor = section.keyExtractor || keyExtractor || _VirtualizeUtils.keyExtractor;
|
|
return {
|
|
section,
|
|
key: key + ":" + extractor(getItem(sectionData, itemIndex), itemIndex),
|
|
index: itemIndex,
|
|
leadingItem: getItem(sectionData, itemIndex - 1),
|
|
leadingSection: sections[i - 1],
|
|
trailingItem: getItem(sectionData, itemIndex + 1),
|
|
trailingSection: sections[i + 1]
|
|
};
|
|
}
|
|
}
|
|
}
|
|
_getSeparatorComponent(index5, info, listItemCount) {
|
|
info = info || this._subExtractor(index5);
|
|
if (!info) {
|
|
return null;
|
|
}
|
|
var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent;
|
|
var SectionSeparatorComponent = this.props.SectionSeparatorComponent;
|
|
var isLastItemInList = index5 === listItemCount - 1;
|
|
var isLastItemInSection = info.index === this.props.getItemCount(info.section.data) - 1;
|
|
if (SectionSeparatorComponent && isLastItemInSection) {
|
|
return SectionSeparatorComponent;
|
|
}
|
|
if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {
|
|
return ItemSeparatorComponent;
|
|
}
|
|
return null;
|
|
}
|
|
};
|
|
function ItemWithSeparator(props) {
|
|
var LeadingSeparatorComponent = props.LeadingSeparatorComponent, SeparatorComponent = props.SeparatorComponent, cellKey = props.cellKey, prevCellKey = props.prevCellKey, setSelfHighlightCallback = props.setSelfHighlightCallback, updateHighlightFor = props.updateHighlightFor, setSelfUpdatePropsCallback = props.setSelfUpdatePropsCallback, updatePropsFor = props.updatePropsFor, item = props.item, index5 = props.index, section = props.section, inverted = props.inverted;
|
|
var _React$useState = React83.useState(false), leadingSeparatorHiglighted = _React$useState[0], setLeadingSeparatorHighlighted = _React$useState[1];
|
|
var _React$useState2 = React83.useState(false), separatorHighlighted = _React$useState2[0], setSeparatorHighlighted = _React$useState2[1];
|
|
var _React$useState3 = React83.useState({
|
|
leadingItem: props.leadingItem,
|
|
leadingSection: props.leadingSection,
|
|
section: props.section,
|
|
trailingItem: props.item,
|
|
trailingSection: props.trailingSection
|
|
}), leadingSeparatorProps = _React$useState3[0], setLeadingSeparatorProps = _React$useState3[1];
|
|
var _React$useState4 = React83.useState({
|
|
leadingItem: props.item,
|
|
leadingSection: props.leadingSection,
|
|
section: props.section,
|
|
trailingItem: props.trailingItem,
|
|
trailingSection: props.trailingSection
|
|
}), separatorProps = _React$useState4[0], setSeparatorProps = _React$useState4[1];
|
|
React83.useEffect(() => {
|
|
setSelfHighlightCallback(cellKey, setSeparatorHighlighted);
|
|
setSelfUpdatePropsCallback(cellKey, setSeparatorProps);
|
|
return () => {
|
|
setSelfUpdatePropsCallback(cellKey, null);
|
|
setSelfHighlightCallback(cellKey, null);
|
|
};
|
|
}, [cellKey, setSelfHighlightCallback, setSeparatorProps, setSelfUpdatePropsCallback]);
|
|
var separators = {
|
|
highlight: /* @__PURE__ */ __name(() => {
|
|
setLeadingSeparatorHighlighted(true);
|
|
setSeparatorHighlighted(true);
|
|
if (prevCellKey != null) {
|
|
updateHighlightFor(prevCellKey, true);
|
|
}
|
|
}, "highlight"),
|
|
unhighlight: /* @__PURE__ */ __name(() => {
|
|
setLeadingSeparatorHighlighted(false);
|
|
setSeparatorHighlighted(false);
|
|
if (prevCellKey != null) {
|
|
updateHighlightFor(prevCellKey, false);
|
|
}
|
|
}, "unhighlight"),
|
|
updateProps: /* @__PURE__ */ __name((select, newProps) => {
|
|
if (select === "leading") {
|
|
if (LeadingSeparatorComponent != null) {
|
|
setLeadingSeparatorProps((0, _objectSpread2.default)((0, _objectSpread2.default)({}, leadingSeparatorProps), newProps));
|
|
} else if (prevCellKey != null) {
|
|
updatePropsFor(prevCellKey, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, leadingSeparatorProps), newProps));
|
|
}
|
|
} else if (select === "trailing" && SeparatorComponent != null) {
|
|
setSeparatorProps((0, _objectSpread2.default)((0, _objectSpread2.default)({}, separatorProps), newProps));
|
|
}
|
|
}, "updateProps")
|
|
};
|
|
var element = props.renderItem({
|
|
item,
|
|
index: index5,
|
|
section,
|
|
separators
|
|
});
|
|
var leadingSeparator = LeadingSeparatorComponent != null && /* @__PURE__ */ React83.createElement(LeadingSeparatorComponent, (0, _extends2.default)({
|
|
highlighted: leadingSeparatorHiglighted
|
|
}, leadingSeparatorProps));
|
|
var separator = SeparatorComponent != null && /* @__PURE__ */ React83.createElement(SeparatorComponent, (0, _extends2.default)({
|
|
highlighted: separatorHighlighted
|
|
}, separatorProps));
|
|
return leadingSeparator || separator ? /* @__PURE__ */ React83.createElement(_View.default, null, inverted === false ? leadingSeparator : separator, element, inverted === false ? separator : leadingSeparator) : element;
|
|
}
|
|
__name(ItemWithSeparator, "ItemWithSeparator");
|
|
var _default = exports2.default = VirtualizedSectionList;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/SectionList/index.js
|
|
var require_SectionList = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/SectionList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _VirtualizedSectionList = _interopRequireDefault(require_VirtualizedSectionList());
|
|
var _excluded = ["stickySectionHeadersEnabled"];
|
|
var SectionList = class extends React83.PureComponent {
|
|
static {
|
|
__name(this, "SectionList");
|
|
}
|
|
constructor() {
|
|
super(...arguments);
|
|
this._captureRef = (ref) => {
|
|
this._wrapperListRef = ref;
|
|
};
|
|
}
|
|
/**
|
|
* Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section)
|
|
* positioned in the viewable area such that `viewPosition` 0 places it at the top (and may be
|
|
* covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. `viewOffset` is a
|
|
* fixed number of pixels to offset the final target position, e.g. to compensate for sticky
|
|
* headers.
|
|
*
|
|
* Note: cannot scroll to locations outside the render window without specifying the
|
|
* `getItemLayout` prop.
|
|
*/
|
|
scrollToLocation(params) {
|
|
if (this._wrapperListRef != null) {
|
|
this._wrapperListRef.scrollToLocation(params);
|
|
}
|
|
}
|
|
/**
|
|
* Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.
|
|
* if `waitForInteractions` is true and the user has not scrolled. This is typically called by
|
|
* taps on items or by navigation actions.
|
|
*/
|
|
recordInteraction() {
|
|
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
|
|
listRef && listRef.recordInteraction();
|
|
}
|
|
/**
|
|
* Displays the scroll indicators momentarily.
|
|
*
|
|
* @platform ios
|
|
*/
|
|
flashScrollIndicators() {
|
|
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
|
|
listRef && listRef.flashScrollIndicators();
|
|
}
|
|
/**
|
|
* Provides a handle to the underlying scroll responder.
|
|
*/
|
|
getScrollResponder() {
|
|
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
|
|
if (listRef) {
|
|
return listRef.getScrollResponder();
|
|
}
|
|
}
|
|
getScrollableNode() {
|
|
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
|
|
if (listRef) {
|
|
return listRef.getScrollableNode();
|
|
}
|
|
}
|
|
render() {
|
|
var _this$props = this.props, _stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled, restProps = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
|
|
var stickySectionHeadersEnabled = _stickySectionHeadersEnabled !== null && _stickySectionHeadersEnabled !== void 0 ? _stickySectionHeadersEnabled : _Platform.default.OS === "ios";
|
|
return /* @__PURE__ */ React83.createElement(_VirtualizedSectionList.default, (0, _extends2.default)({}, restProps, {
|
|
stickySectionHeadersEnabled,
|
|
ref: this._captureRef,
|
|
getItemCount: /* @__PURE__ */ __name((items) => items.length, "getItemCount"),
|
|
getItem: /* @__PURE__ */ __name((items, index5) => items[index5], "getItem")
|
|
}));
|
|
}
|
|
};
|
|
exports2.default = SectionList;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/SectionList/index.js
|
|
var require_SectionList2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/SectionList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _SectionList = _interopRequireDefault(require_SectionList());
|
|
var _default = exports2.default = _SectionList.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedSectionList.js
|
|
var require_AnimatedSectionList = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedSectionList.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _SectionList = _interopRequireDefault(require_SectionList2());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var SectionListWithEventThrottle = /* @__PURE__ */ React83.forwardRef((props, ref) => /* @__PURE__ */ React83.createElement(_SectionList.default, (0, _extends2.default)({
|
|
scrollEventThrottle: 1e-4
|
|
}, props, {
|
|
ref
|
|
})));
|
|
var _default = exports2.default = (0, _createAnimatedComponent.default)(SectionListWithEventThrottle);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Text/index.js
|
|
var require_Text = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Text/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var forwardedProps = _interopRequireWildcard(require_forwardedProps());
|
|
var _pick = _interopRequireDefault(require_pick());
|
|
var _useElementLayout = _interopRequireDefault(require_useElementLayout());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePlatformMethods = _interopRequireDefault(require_usePlatformMethods());
|
|
var _useResponderEvents = _interopRequireDefault(require_useResponderEvents());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _TextAncestorContext = _interopRequireDefault(require_TextAncestorContext());
|
|
var _useLocale = require_useLocale();
|
|
var _excluded = ["hrefAttrs", "numberOfLines", "onClick", "onLayout", "onPress", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture", "selectable"];
|
|
var forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
|
|
href: true,
|
|
lang: true,
|
|
pointerEvents: true
|
|
});
|
|
var pickProps = /* @__PURE__ */ __name((props) => (0, _pick.default)(props, forwardPropsList), "pickProps");
|
|
var Text6 = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var hrefAttrs = props.hrefAttrs, numberOfLines = props.numberOfLines, onClick = props.onClick, onLayout = props.onLayout, onPress = props.onPress, onMoveShouldSetResponder = props.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture, onResponderEnd = props.onResponderEnd, onResponderGrant = props.onResponderGrant, onResponderMove = props.onResponderMove, onResponderReject = props.onResponderReject, onResponderRelease = props.onResponderRelease, onResponderStart = props.onResponderStart, onResponderTerminate = props.onResponderTerminate, onResponderTerminationRequest = props.onResponderTerminationRequest, onScrollShouldSetResponder = props.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = props.onStartShouldSetResponder, onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture, selectable = props.selectable, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var hasTextAncestor = React83.useContext(_TextAncestorContext.default);
|
|
var hostRef = React83.useRef(null);
|
|
var _useLocaleContext = (0, _useLocale.useLocaleContext)(), contextDirection = _useLocaleContext.direction;
|
|
(0, _useElementLayout.default)(hostRef, onLayout);
|
|
(0, _useResponderEvents.default)(hostRef, {
|
|
onMoveShouldSetResponder,
|
|
onMoveShouldSetResponderCapture,
|
|
onResponderEnd,
|
|
onResponderGrant,
|
|
onResponderMove,
|
|
onResponderReject,
|
|
onResponderRelease,
|
|
onResponderStart,
|
|
onResponderTerminate,
|
|
onResponderTerminationRequest,
|
|
onScrollShouldSetResponder,
|
|
onScrollShouldSetResponderCapture,
|
|
onSelectionChangeShouldSetResponder,
|
|
onSelectionChangeShouldSetResponderCapture,
|
|
onStartShouldSetResponder,
|
|
onStartShouldSetResponderCapture
|
|
});
|
|
var handleClick = React83.useCallback((e) => {
|
|
if (onClick != null) {
|
|
onClick(e);
|
|
} else if (onPress != null) {
|
|
e.stopPropagation();
|
|
onPress(e);
|
|
}
|
|
}, [onClick, onPress]);
|
|
var component = hasTextAncestor ? "span" : "div";
|
|
var langDirection = props.lang != null ? (0, _useLocale.getLocaleDirection)(props.lang) : null;
|
|
var componentDirection = props.dir || langDirection;
|
|
var writingDirection = componentDirection || contextDirection;
|
|
var supportedProps = pickProps(rest);
|
|
supportedProps.dir = componentDirection;
|
|
if (!hasTextAncestor) {
|
|
supportedProps.dir = componentDirection != null ? componentDirection : "auto";
|
|
}
|
|
if (onClick || onPress) {
|
|
supportedProps.onClick = handleClick;
|
|
}
|
|
supportedProps.style = [numberOfLines != null && numberOfLines > 1 && {
|
|
WebkitLineClamp: numberOfLines
|
|
}, hasTextAncestor === true ? styles.textHasAncestor$raw : styles.text$raw, numberOfLines === 1 && styles.textOneLine, numberOfLines != null && numberOfLines > 1 && styles.textMultiLine, props.style, selectable === true && styles.selectable, selectable === false && styles.notSelectable, onPress && styles.pressable];
|
|
if (props.href != null) {
|
|
component = "a";
|
|
if (hrefAttrs != null) {
|
|
var download = hrefAttrs.download, rel = hrefAttrs.rel, target = hrefAttrs.target;
|
|
if (download != null) {
|
|
supportedProps.download = download;
|
|
}
|
|
if (rel != null) {
|
|
supportedProps.rel = rel;
|
|
}
|
|
if (typeof target === "string") {
|
|
supportedProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
}
|
|
}
|
|
}
|
|
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
|
var setRef2 = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
|
|
supportedProps.ref = setRef2;
|
|
var element = (0, _createElement.default)(component, supportedProps, {
|
|
writingDirection
|
|
});
|
|
return hasTextAncestor ? element : /* @__PURE__ */ React83.createElement(_TextAncestorContext.default.Provider, {
|
|
value: true
|
|
}, element);
|
|
});
|
|
Text6.displayName = "Text";
|
|
var textStyle = {
|
|
backgroundColor: "transparent",
|
|
border: "0 solid black",
|
|
boxSizing: "border-box",
|
|
color: "black",
|
|
display: "inline",
|
|
font: "14px System",
|
|
listStyle: "none",
|
|
margin: 0,
|
|
padding: 0,
|
|
position: "relative",
|
|
textAlign: "start",
|
|
textDecoration: "none",
|
|
whiteSpace: "pre-wrap",
|
|
wordWrap: "break-word"
|
|
};
|
|
var styles = _StyleSheet.default.create({
|
|
text$raw: textStyle,
|
|
textHasAncestor$raw: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, textStyle), {}, {
|
|
color: "inherit",
|
|
font: "inherit",
|
|
textAlign: "inherit",
|
|
whiteSpace: "inherit"
|
|
}),
|
|
textOneLine: {
|
|
maxWidth: "100%",
|
|
overflow: "hidden",
|
|
textOverflow: "ellipsis",
|
|
whiteSpace: "nowrap",
|
|
wordWrap: "normal"
|
|
},
|
|
// See #13
|
|
textMultiLine: {
|
|
display: "-webkit-box",
|
|
maxWidth: "100%",
|
|
overflow: "clip",
|
|
textOverflow: "ellipsis",
|
|
WebkitBoxOrient: "vertical"
|
|
},
|
|
notSelectable: {
|
|
userSelect: "none"
|
|
},
|
|
selectable: {
|
|
userSelect: "text"
|
|
},
|
|
pressable: {
|
|
cursor: "pointer"
|
|
}
|
|
});
|
|
var _default = exports2.default = Text6;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedText.js
|
|
var require_AnimatedText = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedText.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _Text = _interopRequireDefault(require_Text());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var _default = exports2.default = (0, _createAnimatedComponent.default)(_Text.default);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedView.js
|
|
var require_AnimatedView = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedView.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var _default = exports2.default = (0, _createAnimatedComponent.default)(_View.default);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedAddition.js
|
|
var require_AnimatedAddition = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedAddition.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var AnimatedAddition = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedAddition");
|
|
}
|
|
constructor(a, b) {
|
|
super();
|
|
this._a = typeof a === "number" ? new _AnimatedValue.default(a) : a;
|
|
this._b = typeof b === "number" ? new _AnimatedValue.default(b) : b;
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._a.__makeNative(platformConfig);
|
|
this._b.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getValue() {
|
|
return this._a.__getValue() + this._b.__getValue();
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
__attach() {
|
|
this._a.__addChild(this);
|
|
this._b.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._a.__removeChild(this);
|
|
this._b.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "addition",
|
|
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedAddition;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDiffClamp.js
|
|
var require_AnimatedDiffClamp = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDiffClamp.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var AnimatedDiffClamp = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedDiffClamp");
|
|
}
|
|
constructor(a, min2, max2) {
|
|
super();
|
|
this._a = a;
|
|
this._min = min2;
|
|
this._max = max2;
|
|
this._value = this._lastValue = this._a.__getValue();
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._a.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
__getValue() {
|
|
var value = this._a.__getValue();
|
|
var diff = value - this._lastValue;
|
|
this._lastValue = value;
|
|
this._value = Math.min(Math.max(this._value + diff, this._min), this._max);
|
|
return this._value;
|
|
}
|
|
__attach() {
|
|
this._a.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._a.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "diffclamp",
|
|
input: this._a.__getNativeTag(),
|
|
min: this._min,
|
|
max: this._max
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedDiffClamp;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDivision.js
|
|
var require_AnimatedDivision = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDivision.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var AnimatedDivision = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedDivision");
|
|
}
|
|
constructor(a, b) {
|
|
super();
|
|
this._warnedAboutDivideByZero = false;
|
|
if (b === 0 || b instanceof _AnimatedNode.default && b.__getValue() === 0) {
|
|
console.error("Detected potential division by zero in AnimatedDivision");
|
|
}
|
|
this._a = typeof a === "number" ? new _AnimatedValue.default(a) : a;
|
|
this._b = typeof b === "number" ? new _AnimatedValue.default(b) : b;
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._a.__makeNative(platformConfig);
|
|
this._b.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getValue() {
|
|
var a = this._a.__getValue();
|
|
var b = this._b.__getValue();
|
|
if (b === 0) {
|
|
if (!this._warnedAboutDivideByZero) {
|
|
console.error("Detected division by zero in AnimatedDivision");
|
|
this._warnedAboutDivideByZero = true;
|
|
}
|
|
return 0;
|
|
}
|
|
this._warnedAboutDivideByZero = false;
|
|
return a / b;
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
__attach() {
|
|
this._a.__addChild(this);
|
|
this._b.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._a.__removeChild(this);
|
|
this._b.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "division",
|
|
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedDivision;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedModulo.js
|
|
var require_AnimatedModulo = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedModulo.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var AnimatedModulo = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedModulo");
|
|
}
|
|
constructor(a, modulus) {
|
|
super();
|
|
this._a = a;
|
|
this._modulus = modulus;
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._a.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getValue() {
|
|
return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus;
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
__attach() {
|
|
this._a.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._a.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "modulus",
|
|
input: this._a.__getNativeTag(),
|
|
modulus: this._modulus
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedModulo;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedMultiplication.js
|
|
var require_AnimatedMultiplication = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedMultiplication.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var AnimatedMultiplication = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedMultiplication");
|
|
}
|
|
constructor(a, b) {
|
|
super();
|
|
this._a = typeof a === "number" ? new _AnimatedValue.default(a) : a;
|
|
this._b = typeof b === "number" ? new _AnimatedValue.default(b) : b;
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._a.__makeNative(platformConfig);
|
|
this._b.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getValue() {
|
|
return this._a.__getValue() * this._b.__getValue();
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
__attach() {
|
|
this._a.__addChild(this);
|
|
this._b.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._a.__removeChild(this);
|
|
this._b.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "multiplication",
|
|
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedMultiplication;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedSubtraction.js
|
|
var require_AnimatedSubtraction = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedSubtraction.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var AnimatedSubtraction = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedSubtraction");
|
|
}
|
|
constructor(a, b) {
|
|
super();
|
|
this._a = typeof a === "number" ? new _AnimatedValue.default(a) : a;
|
|
this._b = typeof b === "number" ? new _AnimatedValue.default(b) : b;
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this._a.__makeNative(platformConfig);
|
|
this._b.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getValue() {
|
|
return this._a.__getValue() - this._b.__getValue();
|
|
}
|
|
interpolate(config) {
|
|
return new _AnimatedInterpolation.default(this, config);
|
|
}
|
|
__attach() {
|
|
this._a.__addChild(this);
|
|
this._b.__addChild(this);
|
|
}
|
|
__detach() {
|
|
this._a.__removeChild(this);
|
|
this._b.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "subtraction",
|
|
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedSubtraction;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTracking.js
|
|
var require_AnimatedTracking = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTracking.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _NativeAnimatedHelper = require_NativeAnimatedHelper();
|
|
var AnimatedTracking = class extends _AnimatedNode.default {
|
|
static {
|
|
__name(this, "AnimatedTracking");
|
|
}
|
|
constructor(value, parent, animationClass, animationConfig, callback) {
|
|
super();
|
|
this._value = value;
|
|
this._parent = parent;
|
|
this._animationClass = animationClass;
|
|
this._animationConfig = animationConfig;
|
|
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(animationConfig);
|
|
this._callback = callback;
|
|
this.__attach();
|
|
}
|
|
__makeNative() {
|
|
this.__isNative = true;
|
|
this._parent.__makeNative();
|
|
super.__makeNative();
|
|
this._value.__makeNative();
|
|
}
|
|
__getValue() {
|
|
return this._parent.__getValue();
|
|
}
|
|
__attach() {
|
|
this._parent.__addChild(this);
|
|
if (this._useNativeDriver) {
|
|
this.__makeNative();
|
|
}
|
|
}
|
|
__detach() {
|
|
this._parent.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
update() {
|
|
this._value.animate(new this._animationClass((0, _objectSpread2.default)((0, _objectSpread2.default)({}, this._animationConfig), {}, {
|
|
toValue: this._animationConfig.toValue.__getValue()
|
|
})), this._callback);
|
|
}
|
|
__getNativeConfig() {
|
|
var animation = new this._animationClass((0, _objectSpread2.default)((0, _objectSpread2.default)({}, this._animationConfig), {}, {
|
|
// remove toValue from the config as it's a ref to Animated.Value
|
|
toValue: void 0
|
|
}));
|
|
var animationConfig = animation.__getNativeAnimationConfig();
|
|
return {
|
|
type: "tracking",
|
|
animationId: (0, _NativeAnimatedHelper.generateNewAnimationId)(),
|
|
animationConfig,
|
|
toValue: this._parent.__getNativeTag(),
|
|
value: this._value.__getNativeTag()
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedTracking;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValueXY.js
|
|
var require_AnimatedValueXY = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValueXY.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _uniqueId = 1;
|
|
var AnimatedValueXY = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedValueXY");
|
|
}
|
|
constructor(valueIn) {
|
|
super();
|
|
var value = valueIn || {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
if (typeof value.x === "number" && typeof value.y === "number") {
|
|
this.x = new _AnimatedValue.default(value.x);
|
|
this.y = new _AnimatedValue.default(value.y);
|
|
} else {
|
|
(0, _invariant.default)(value.x instanceof _AnimatedValue.default && value.y instanceof _AnimatedValue.default, "AnimatedValueXY must be initialized with an object of numbers or AnimatedValues.");
|
|
this.x = value.x;
|
|
this.y = value.y;
|
|
}
|
|
this._listeners = {};
|
|
}
|
|
/**
|
|
* Directly set the value. This will stop any animations running on the value
|
|
* and update all the bound properties.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#setvalue
|
|
*/
|
|
setValue(value) {
|
|
this.x.setValue(value.x);
|
|
this.y.setValue(value.y);
|
|
}
|
|
/**
|
|
* Sets an offset that is applied on top of whatever value is set, whether
|
|
* via `setValue`, an animation, or `Animated.event`. Useful for compensating
|
|
* things like the start of a pan gesture.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#setoffset
|
|
*/
|
|
setOffset(offset4) {
|
|
this.x.setOffset(offset4.x);
|
|
this.y.setOffset(offset4.y);
|
|
}
|
|
/**
|
|
* Merges the offset value into the base value and resets the offset to zero.
|
|
* The final output of the value is unchanged.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#flattenoffset
|
|
*/
|
|
flattenOffset() {
|
|
this.x.flattenOffset();
|
|
this.y.flattenOffset();
|
|
}
|
|
/**
|
|
* Sets the offset value to the base value, and resets the base value to
|
|
* zero. The final output of the value is unchanged.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#extractoffset
|
|
*/
|
|
extractOffset() {
|
|
this.x.extractOffset();
|
|
this.y.extractOffset();
|
|
}
|
|
__getValue() {
|
|
return {
|
|
x: this.x.__getValue(),
|
|
y: this.y.__getValue()
|
|
};
|
|
}
|
|
/**
|
|
* Stops any animation and resets the value to its original.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#resetanimation
|
|
*/
|
|
resetAnimation(callback) {
|
|
this.x.resetAnimation();
|
|
this.y.resetAnimation();
|
|
callback && callback(this.__getValue());
|
|
}
|
|
/**
|
|
* Stops any running animation or tracking. `callback` is invoked with the
|
|
* final value after stopping the animation, which is useful for updating
|
|
* state to match the animation position with layout.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#stopanimation
|
|
*/
|
|
stopAnimation(callback) {
|
|
this.x.stopAnimation();
|
|
this.y.stopAnimation();
|
|
callback && callback(this.__getValue());
|
|
}
|
|
/**
|
|
* Adds an asynchronous listener to the value so you can observe updates from
|
|
* animations. This is useful because there is no way to synchronously read
|
|
* the value because it might be driven natively.
|
|
*
|
|
* Returns a string that serves as an identifier for the listener.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#addlistener
|
|
*/
|
|
addListener(callback) {
|
|
var id = String(_uniqueId++);
|
|
var jointCallback = /* @__PURE__ */ __name((_ref) => {
|
|
var number = _ref.value;
|
|
callback(this.__getValue());
|
|
}, "jointCallback");
|
|
this._listeners[id] = {
|
|
x: this.x.addListener(jointCallback),
|
|
y: this.y.addListener(jointCallback)
|
|
};
|
|
return id;
|
|
}
|
|
/**
|
|
* Unregister a listener. The `id` param shall match the identifier
|
|
* previously returned by `addListener()`.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#removelistener
|
|
*/
|
|
removeListener(id) {
|
|
this.x.removeListener(this._listeners[id].x);
|
|
this.y.removeListener(this._listeners[id].y);
|
|
delete this._listeners[id];
|
|
}
|
|
/**
|
|
* Remove all registered listeners.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#removealllisteners
|
|
*/
|
|
removeAllListeners() {
|
|
this.x.removeAllListeners();
|
|
this.y.removeAllListeners();
|
|
this._listeners = {};
|
|
}
|
|
/**
|
|
* Converts `{x, y}` into `{left, top}` for use in style.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#getlayout
|
|
*/
|
|
getLayout() {
|
|
return {
|
|
left: this.x,
|
|
top: this.y
|
|
};
|
|
}
|
|
/**
|
|
* Converts `{x, y}` into a useable translation transform.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy.html#gettranslatetransform
|
|
*/
|
|
getTranslateTransform() {
|
|
return [{
|
|
translateX: this.x
|
|
}, {
|
|
translateY: this.y
|
|
}];
|
|
}
|
|
};
|
|
var _default = exports2.default = AnimatedValueXY;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/Animation.js
|
|
var require_Animation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/Animation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var startNativeAnimationNextId = 1;
|
|
var Animation = class {
|
|
static {
|
|
__name(this, "Animation");
|
|
}
|
|
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
|
|
}
|
|
stop() {
|
|
if (this.__nativeId) {
|
|
_NativeAnimatedHelper.default.API.stopAnimation(this.__nativeId);
|
|
}
|
|
}
|
|
__getNativeAnimationConfig() {
|
|
throw new Error("This animation type cannot be offloaded to native");
|
|
}
|
|
// Helper function for subclasses to make sure onEnd is only called once.
|
|
__debouncedOnEnd(result) {
|
|
var onEnd = this.__onEnd;
|
|
this.__onEnd = null;
|
|
onEnd && onEnd(result);
|
|
}
|
|
__startNativeAnimation(animatedValue) {
|
|
var startNativeAnimationWaitId = startNativeAnimationNextId + ":startAnimation";
|
|
startNativeAnimationNextId += 1;
|
|
_NativeAnimatedHelper.default.API.setWaitingForIdentifier(startNativeAnimationWaitId);
|
|
try {
|
|
var config = this.__getNativeAnimationConfig();
|
|
animatedValue.__makeNative(config.platformConfig);
|
|
this.__nativeId = _NativeAnimatedHelper.default.generateNewAnimationId();
|
|
_NativeAnimatedHelper.default.API.startAnimatingNode(
|
|
this.__nativeId,
|
|
animatedValue.__getNativeTag(),
|
|
config,
|
|
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
this.__debouncedOnEnd.bind(this)
|
|
);
|
|
} catch (e) {
|
|
throw e;
|
|
} finally {
|
|
_NativeAnimatedHelper.default.API.unsetWaitingForIdentifier(startNativeAnimationWaitId);
|
|
}
|
|
}
|
|
};
|
|
var _default = exports2.default = Animation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/DecayAnimation.js
|
|
var require_DecayAnimation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/DecayAnimation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Animation = _interopRequireDefault(require_Animation());
|
|
var _NativeAnimatedHelper = require_NativeAnimatedHelper();
|
|
var DecayAnimation = class extends _Animation.default {
|
|
static {
|
|
__name(this, "DecayAnimation");
|
|
}
|
|
constructor(config) {
|
|
var _config$deceleration, _config$isInteraction, _config$iterations;
|
|
super();
|
|
this._deceleration = (_config$deceleration = config.deceleration) !== null && _config$deceleration !== void 0 ? _config$deceleration : 0.998;
|
|
this._velocity = config.velocity;
|
|
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
|
|
this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;
|
|
this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
|
|
}
|
|
__getNativeAnimationConfig() {
|
|
return {
|
|
type: "decay",
|
|
deceleration: this._deceleration,
|
|
velocity: this._velocity,
|
|
iterations: this.__iterations
|
|
};
|
|
}
|
|
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
|
|
this.__active = true;
|
|
this._lastValue = fromValue;
|
|
this._fromValue = fromValue;
|
|
this._onUpdate = onUpdate;
|
|
this.__onEnd = onEnd;
|
|
this._startTime = Date.now();
|
|
if (this._useNativeDriver) {
|
|
this.__startNativeAnimation(animatedValue);
|
|
} else {
|
|
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
|
|
}
|
|
}
|
|
onUpdate() {
|
|
var now = Date.now();
|
|
var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));
|
|
this._onUpdate(value);
|
|
if (Math.abs(this._lastValue - value) < 0.1) {
|
|
this.__debouncedOnEnd({
|
|
finished: true
|
|
});
|
|
return;
|
|
}
|
|
this._lastValue = value;
|
|
if (this.__active) {
|
|
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
|
|
}
|
|
}
|
|
stop() {
|
|
super.stop();
|
|
this.__active = false;
|
|
global.cancelAnimationFrame(this._animationFrame);
|
|
this.__debouncedOnEnd({
|
|
finished: false
|
|
});
|
|
}
|
|
};
|
|
var _default = exports2.default = DecayAnimation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/SpringConfig.js
|
|
var require_SpringConfig = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/SpringConfig.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
function stiffnessFromOrigamiValue(oValue) {
|
|
return (oValue - 30) * 3.62 + 194;
|
|
}
|
|
__name(stiffnessFromOrigamiValue, "stiffnessFromOrigamiValue");
|
|
function dampingFromOrigamiValue(oValue) {
|
|
return (oValue - 8) * 3 + 25;
|
|
}
|
|
__name(dampingFromOrigamiValue, "dampingFromOrigamiValue");
|
|
function fromOrigamiTensionAndFriction(tension, friction) {
|
|
return {
|
|
stiffness: stiffnessFromOrigamiValue(tension),
|
|
damping: dampingFromOrigamiValue(friction)
|
|
};
|
|
}
|
|
__name(fromOrigamiTensionAndFriction, "fromOrigamiTensionAndFriction");
|
|
function fromBouncinessAndSpeed(bounciness, speed) {
|
|
function normalize(value, startValue, endValue) {
|
|
return (value - startValue) / (endValue - startValue);
|
|
}
|
|
__name(normalize, "normalize");
|
|
function projectNormal(n, start, end) {
|
|
return start + n * (end - start);
|
|
}
|
|
__name(projectNormal, "projectNormal");
|
|
function linearInterpolation(t, start, end) {
|
|
return t * end + (1 - t) * start;
|
|
}
|
|
__name(linearInterpolation, "linearInterpolation");
|
|
function quadraticOutInterpolation(t, start, end) {
|
|
return linearInterpolation(2 * t - t * t, start, end);
|
|
}
|
|
__name(quadraticOutInterpolation, "quadraticOutInterpolation");
|
|
function b3Friction1(x) {
|
|
return 7e-4 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;
|
|
}
|
|
__name(b3Friction1, "b3Friction1");
|
|
function b3Friction2(x) {
|
|
return 44e-6 * Math.pow(x, 3) - 6e-3 * Math.pow(x, 2) + 0.36 * x + 2;
|
|
}
|
|
__name(b3Friction2, "b3Friction2");
|
|
function b3Friction3(x) {
|
|
return 45e-8 * Math.pow(x, 3) - 332e-6 * Math.pow(x, 2) + 0.1078 * x + 5.84;
|
|
}
|
|
__name(b3Friction3, "b3Friction3");
|
|
function b3Nobounce(tension) {
|
|
if (tension <= 18) {
|
|
return b3Friction1(tension);
|
|
} else if (tension > 18 && tension <= 44) {
|
|
return b3Friction2(tension);
|
|
} else {
|
|
return b3Friction3(tension);
|
|
}
|
|
}
|
|
__name(b3Nobounce, "b3Nobounce");
|
|
var b = normalize(bounciness / 1.7, 0, 20);
|
|
b = projectNormal(b, 0, 0.8);
|
|
var s = normalize(speed / 1.7, 0, 20);
|
|
var bouncyTension = projectNormal(s, 0.5, 200);
|
|
var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01);
|
|
return {
|
|
stiffness: stiffnessFromOrigamiValue(bouncyTension),
|
|
damping: dampingFromOrigamiValue(bouncyFriction)
|
|
};
|
|
}
|
|
__name(fromBouncinessAndSpeed, "fromBouncinessAndSpeed");
|
|
var _default = exports2.default = {
|
|
fromOrigamiTensionAndFriction,
|
|
fromBouncinessAndSpeed
|
|
};
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedColor.js
|
|
var require_AnimatedColor = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedColor.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedWithChildren = _interopRequireDefault(require_AnimatedWithChildren());
|
|
var _normalizeColors = _interopRequireDefault(require_normalize_colors());
|
|
var _NativeAnimatedHelper = _interopRequireDefault(require_NativeAnimatedHelper());
|
|
var NativeAnimatedAPI = _NativeAnimatedHelper.default.API;
|
|
var defaultColor = {
|
|
r: 0,
|
|
g: 0,
|
|
b: 0,
|
|
a: 1
|
|
};
|
|
var _uniqueId = 1;
|
|
var processColorObject = /* @__PURE__ */ __name((color) => {
|
|
return color;
|
|
}, "processColorObject");
|
|
function processColor(color) {
|
|
if (color === void 0 || color === null) {
|
|
return null;
|
|
}
|
|
if (isRgbaValue(color)) {
|
|
return color;
|
|
}
|
|
var normalizedColor = (0, _normalizeColors.default)(
|
|
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
color
|
|
);
|
|
if (normalizedColor === void 0 || normalizedColor === null) {
|
|
return null;
|
|
}
|
|
if (typeof normalizedColor === "object") {
|
|
var processedColorObj = processColorObject(normalizedColor);
|
|
if (processedColorObj != null) {
|
|
return processedColorObj;
|
|
}
|
|
} else if (typeof normalizedColor === "number") {
|
|
var r = (normalizedColor & 4278190080) >>> 24;
|
|
var g = (normalizedColor & 16711680) >>> 16;
|
|
var b = (normalizedColor & 65280) >>> 8;
|
|
var a = (normalizedColor & 255) / 255;
|
|
return {
|
|
r,
|
|
g,
|
|
b,
|
|
a
|
|
};
|
|
}
|
|
return null;
|
|
}
|
|
__name(processColor, "processColor");
|
|
function isRgbaValue(value) {
|
|
return value && typeof value.r === "number" && typeof value.g === "number" && typeof value.b === "number" && typeof value.a === "number";
|
|
}
|
|
__name(isRgbaValue, "isRgbaValue");
|
|
function isRgbaAnimatedValue(value) {
|
|
return value && value.r instanceof _AnimatedValue.default && value.g instanceof _AnimatedValue.default && value.b instanceof _AnimatedValue.default && value.a instanceof _AnimatedValue.default;
|
|
}
|
|
__name(isRgbaAnimatedValue, "isRgbaAnimatedValue");
|
|
var AnimatedColor = class extends _AnimatedWithChildren.default {
|
|
static {
|
|
__name(this, "AnimatedColor");
|
|
}
|
|
constructor(valueIn, config) {
|
|
super();
|
|
this._listeners = {};
|
|
var value = valueIn !== null && valueIn !== void 0 ? valueIn : defaultColor;
|
|
if (isRgbaAnimatedValue(value)) {
|
|
var rgbaAnimatedValue = value;
|
|
this.r = rgbaAnimatedValue.r;
|
|
this.g = rgbaAnimatedValue.g;
|
|
this.b = rgbaAnimatedValue.b;
|
|
this.a = rgbaAnimatedValue.a;
|
|
} else {
|
|
var _processColor;
|
|
var processedColor = (
|
|
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
(_processColor = processColor(value)) !== null && _processColor !== void 0 ? _processColor : defaultColor
|
|
);
|
|
var initColor = defaultColor;
|
|
if (isRgbaValue(processedColor)) {
|
|
initColor = processedColor;
|
|
} else {
|
|
this.nativeColor = processedColor;
|
|
}
|
|
this.r = new _AnimatedValue.default(initColor.r);
|
|
this.g = new _AnimatedValue.default(initColor.g);
|
|
this.b = new _AnimatedValue.default(initColor.b);
|
|
this.a = new _AnimatedValue.default(initColor.a);
|
|
}
|
|
if (this.nativeColor || config && config.useNativeDriver) {
|
|
this.__makeNative();
|
|
}
|
|
}
|
|
/**
|
|
* Directly set the value. This will stop any animations running on the value
|
|
* and update all the bound properties.
|
|
*/
|
|
setValue(value) {
|
|
var _processColor2;
|
|
var shouldUpdateNodeConfig = false;
|
|
if (this.__isNative) {
|
|
var nativeTag = this.__getNativeTag();
|
|
NativeAnimatedAPI.setWaitingForIdentifier(nativeTag.toString());
|
|
}
|
|
var processedColor = (_processColor2 = processColor(value)) !== null && _processColor2 !== void 0 ? _processColor2 : defaultColor;
|
|
if (isRgbaValue(processedColor)) {
|
|
var rgbaValue = processedColor;
|
|
this.r.setValue(rgbaValue.r);
|
|
this.g.setValue(rgbaValue.g);
|
|
this.b.setValue(rgbaValue.b);
|
|
this.a.setValue(rgbaValue.a);
|
|
if (this.nativeColor != null) {
|
|
this.nativeColor = null;
|
|
shouldUpdateNodeConfig = true;
|
|
}
|
|
} else {
|
|
var nativeColor = processedColor;
|
|
if (this.nativeColor !== nativeColor) {
|
|
this.nativeColor = nativeColor;
|
|
shouldUpdateNodeConfig = true;
|
|
}
|
|
}
|
|
if (this.__isNative) {
|
|
var _nativeTag = this.__getNativeTag();
|
|
if (shouldUpdateNodeConfig) {
|
|
NativeAnimatedAPI.updateAnimatedNodeConfig(_nativeTag, this.__getNativeConfig());
|
|
}
|
|
NativeAnimatedAPI.unsetWaitingForIdentifier(_nativeTag.toString());
|
|
}
|
|
}
|
|
/**
|
|
* Sets an offset that is applied on top of whatever value is set, whether
|
|
* via `setValue`, an animation, or `Animated.event`. Useful for compensating
|
|
* things like the start of a pan gesture.
|
|
*/
|
|
setOffset(offset4) {
|
|
this.r.setOffset(offset4.r);
|
|
this.g.setOffset(offset4.g);
|
|
this.b.setOffset(offset4.b);
|
|
this.a.setOffset(offset4.a);
|
|
}
|
|
/**
|
|
* Merges the offset value into the base value and resets the offset to zero.
|
|
* The final output of the value is unchanged.
|
|
*/
|
|
flattenOffset() {
|
|
this.r.flattenOffset();
|
|
this.g.flattenOffset();
|
|
this.b.flattenOffset();
|
|
this.a.flattenOffset();
|
|
}
|
|
/**
|
|
* Sets the offset value to the base value, and resets the base value to
|
|
* zero. The final output of the value is unchanged.
|
|
*/
|
|
extractOffset() {
|
|
this.r.extractOffset();
|
|
this.g.extractOffset();
|
|
this.b.extractOffset();
|
|
this.a.extractOffset();
|
|
}
|
|
/**
|
|
* Adds an asynchronous listener to the value so you can observe updates from
|
|
* animations. This is useful because there is no way to synchronously read
|
|
* the value because it might be driven natively.
|
|
*
|
|
* Returns a string that serves as an identifier for the listener.
|
|
*/
|
|
addListener(callback) {
|
|
var id = String(_uniqueId++);
|
|
var jointCallback = /* @__PURE__ */ __name((_ref) => {
|
|
var number = _ref.value;
|
|
callback(this.__getValue());
|
|
}, "jointCallback");
|
|
this._listeners[id] = {
|
|
r: this.r.addListener(jointCallback),
|
|
g: this.g.addListener(jointCallback),
|
|
b: this.b.addListener(jointCallback),
|
|
a: this.a.addListener(jointCallback)
|
|
};
|
|
return id;
|
|
}
|
|
/**
|
|
* Unregister a listener. The `id` param shall match the identifier
|
|
* previously returned by `addListener()`.
|
|
*/
|
|
removeListener(id) {
|
|
this.r.removeListener(this._listeners[id].r);
|
|
this.g.removeListener(this._listeners[id].g);
|
|
this.b.removeListener(this._listeners[id].b);
|
|
this.a.removeListener(this._listeners[id].a);
|
|
delete this._listeners[id];
|
|
}
|
|
/**
|
|
* Remove all registered listeners.
|
|
*/
|
|
removeAllListeners() {
|
|
this.r.removeAllListeners();
|
|
this.g.removeAllListeners();
|
|
this.b.removeAllListeners();
|
|
this.a.removeAllListeners();
|
|
this._listeners = {};
|
|
}
|
|
/**
|
|
* Stops any running animation or tracking. `callback` is invoked with the
|
|
* final value after stopping the animation, which is useful for updating
|
|
* state to match the animation position with layout.
|
|
*/
|
|
stopAnimation(callback) {
|
|
this.r.stopAnimation();
|
|
this.g.stopAnimation();
|
|
this.b.stopAnimation();
|
|
this.a.stopAnimation();
|
|
callback && callback(this.__getValue());
|
|
}
|
|
/**
|
|
* Stops any animation and resets the value to its original.
|
|
*/
|
|
resetAnimation(callback) {
|
|
this.r.resetAnimation();
|
|
this.g.resetAnimation();
|
|
this.b.resetAnimation();
|
|
this.a.resetAnimation();
|
|
callback && callback(this.__getValue());
|
|
}
|
|
__getValue() {
|
|
if (this.nativeColor != null) {
|
|
return this.nativeColor;
|
|
} else {
|
|
return "rgba(" + this.r.__getValue() + ", " + this.g.__getValue() + ", " + this.b.__getValue() + ", " + this.a.__getValue() + ")";
|
|
}
|
|
}
|
|
__attach() {
|
|
this.r.__addChild(this);
|
|
this.g.__addChild(this);
|
|
this.b.__addChild(this);
|
|
this.a.__addChild(this);
|
|
super.__attach();
|
|
}
|
|
__detach() {
|
|
this.r.__removeChild(this);
|
|
this.g.__removeChild(this);
|
|
this.b.__removeChild(this);
|
|
this.a.__removeChild(this);
|
|
super.__detach();
|
|
}
|
|
__makeNative(platformConfig) {
|
|
this.r.__makeNative(platformConfig);
|
|
this.g.__makeNative(platformConfig);
|
|
this.b.__makeNative(platformConfig);
|
|
this.a.__makeNative(platformConfig);
|
|
super.__makeNative(platformConfig);
|
|
}
|
|
__getNativeConfig() {
|
|
return {
|
|
type: "color",
|
|
r: this.r.__getNativeTag(),
|
|
g: this.g.__getNativeTag(),
|
|
b: this.b.__getNativeTag(),
|
|
a: this.a.__getNativeTag(),
|
|
nativeColor: this.nativeColor
|
|
};
|
|
}
|
|
};
|
|
exports2.default = AnimatedColor;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/SpringAnimation.js
|
|
var require_SpringAnimation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/SpringAnimation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Animation = _interopRequireDefault(require_Animation());
|
|
var _SpringConfig = _interopRequireDefault(require_SpringConfig());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _NativeAnimatedHelper = require_NativeAnimatedHelper();
|
|
var _AnimatedColor = _interopRequireDefault(require_AnimatedColor());
|
|
var SpringAnimation = class _SpringAnimation extends _Animation.default {
|
|
static {
|
|
__name(this, "SpringAnimation");
|
|
}
|
|
constructor(config) {
|
|
var _config$overshootClam, _config$restDisplacem, _config$restSpeedThre, _config$velocity, _config$velocity2, _config$delay, _config$isInteraction, _config$iterations;
|
|
super();
|
|
this._overshootClamping = (_config$overshootClam = config.overshootClamping) !== null && _config$overshootClam !== void 0 ? _config$overshootClam : false;
|
|
this._restDisplacementThreshold = (_config$restDisplacem = config.restDisplacementThreshold) !== null && _config$restDisplacem !== void 0 ? _config$restDisplacem : 1e-3;
|
|
this._restSpeedThreshold = (_config$restSpeedThre = config.restSpeedThreshold) !== null && _config$restSpeedThre !== void 0 ? _config$restSpeedThre : 1e-3;
|
|
this._initialVelocity = (_config$velocity = config.velocity) !== null && _config$velocity !== void 0 ? _config$velocity : 0;
|
|
this._lastVelocity = (_config$velocity2 = config.velocity) !== null && _config$velocity2 !== void 0 ? _config$velocity2 : 0;
|
|
this._toValue = config.toValue;
|
|
this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;
|
|
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
|
|
this._platformConfig = config.platformConfig;
|
|
this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;
|
|
this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
|
|
if (config.stiffness !== void 0 || config.damping !== void 0 || config.mass !== void 0) {
|
|
var _config$stiffness, _config$damping, _config$mass;
|
|
(0, _invariant.default)(config.bounciness === void 0 && config.speed === void 0 && config.tension === void 0 && config.friction === void 0, "You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one");
|
|
this._stiffness = (_config$stiffness = config.stiffness) !== null && _config$stiffness !== void 0 ? _config$stiffness : 100;
|
|
this._damping = (_config$damping = config.damping) !== null && _config$damping !== void 0 ? _config$damping : 10;
|
|
this._mass = (_config$mass = config.mass) !== null && _config$mass !== void 0 ? _config$mass : 1;
|
|
} else if (config.bounciness !== void 0 || config.speed !== void 0) {
|
|
var _config$bounciness, _config$speed;
|
|
(0, _invariant.default)(config.tension === void 0 && config.friction === void 0 && config.stiffness === void 0 && config.damping === void 0 && config.mass === void 0, "You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one");
|
|
var springConfig = _SpringConfig.default.fromBouncinessAndSpeed((_config$bounciness = config.bounciness) !== null && _config$bounciness !== void 0 ? _config$bounciness : 8, (_config$speed = config.speed) !== null && _config$speed !== void 0 ? _config$speed : 12);
|
|
this._stiffness = springConfig.stiffness;
|
|
this._damping = springConfig.damping;
|
|
this._mass = 1;
|
|
} else {
|
|
var _config$tension, _config$friction;
|
|
var _springConfig = _SpringConfig.default.fromOrigamiTensionAndFriction((_config$tension = config.tension) !== null && _config$tension !== void 0 ? _config$tension : 40, (_config$friction = config.friction) !== null && _config$friction !== void 0 ? _config$friction : 7);
|
|
this._stiffness = _springConfig.stiffness;
|
|
this._damping = _springConfig.damping;
|
|
this._mass = 1;
|
|
}
|
|
(0, _invariant.default)(this._stiffness > 0, "Stiffness value must be greater than 0");
|
|
(0, _invariant.default)(this._damping > 0, "Damping value must be greater than 0");
|
|
(0, _invariant.default)(this._mass > 0, "Mass value must be greater than 0");
|
|
}
|
|
__getNativeAnimationConfig() {
|
|
var _this$_initialVelocit;
|
|
return {
|
|
type: "spring",
|
|
overshootClamping: this._overshootClamping,
|
|
restDisplacementThreshold: this._restDisplacementThreshold,
|
|
restSpeedThreshold: this._restSpeedThreshold,
|
|
stiffness: this._stiffness,
|
|
damping: this._damping,
|
|
mass: this._mass,
|
|
initialVelocity: (_this$_initialVelocit = this._initialVelocity) !== null && _this$_initialVelocit !== void 0 ? _this$_initialVelocit : this._lastVelocity,
|
|
toValue: this._toValue,
|
|
iterations: this.__iterations,
|
|
platformConfig: this._platformConfig
|
|
};
|
|
}
|
|
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
|
|
this.__active = true;
|
|
this._startPosition = fromValue;
|
|
this._lastPosition = this._startPosition;
|
|
this._onUpdate = onUpdate;
|
|
this.__onEnd = onEnd;
|
|
this._lastTime = Date.now();
|
|
this._frameTime = 0;
|
|
if (previousAnimation instanceof _SpringAnimation) {
|
|
var internalState = previousAnimation.getInternalState();
|
|
this._lastPosition = internalState.lastPosition;
|
|
this._lastVelocity = internalState.lastVelocity;
|
|
this._initialVelocity = this._lastVelocity;
|
|
this._lastTime = internalState.lastTime;
|
|
}
|
|
var start = /* @__PURE__ */ __name(() => {
|
|
if (this._useNativeDriver) {
|
|
this.__startNativeAnimation(animatedValue);
|
|
} else {
|
|
this.onUpdate();
|
|
}
|
|
}, "start");
|
|
if (this._delay) {
|
|
this._timeout = setTimeout(start, this._delay);
|
|
} else {
|
|
start();
|
|
}
|
|
}
|
|
getInternalState() {
|
|
return {
|
|
lastPosition: this._lastPosition,
|
|
lastVelocity: this._lastVelocity,
|
|
lastTime: this._lastTime
|
|
};
|
|
}
|
|
/**
|
|
* This spring model is based off of a damped harmonic oscillator
|
|
* (https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator).
|
|
*
|
|
* We use the closed form of the second order differential equation:
|
|
*
|
|
* x'' + (2ζ⍵_0)x' + ⍵^2x = 0
|
|
*
|
|
* where
|
|
* ⍵_0 = √(k / m) (undamped angular frequency of the oscillator),
|
|
* ζ = c / 2√mk (damping ratio),
|
|
* c = damping constant
|
|
* k = stiffness
|
|
* m = mass
|
|
*
|
|
* The derivation of the closed form is described in detail here:
|
|
* http://planetmath.org/sites/default/files/texpdf/39745.pdf
|
|
*
|
|
* This algorithm happens to match the algorithm used by CASpringAnimation,
|
|
* a QuartzCore (iOS) API that creates spring animations.
|
|
*/
|
|
onUpdate() {
|
|
var MAX_STEPS = 64;
|
|
var now = Date.now();
|
|
if (now > this._lastTime + MAX_STEPS) {
|
|
now = this._lastTime + MAX_STEPS;
|
|
}
|
|
var deltaTime = (now - this._lastTime) / 1e3;
|
|
this._frameTime += deltaTime;
|
|
var c = this._damping;
|
|
var m = this._mass;
|
|
var k = this._stiffness;
|
|
var v0 = -this._initialVelocity;
|
|
var zeta = c / (2 * Math.sqrt(k * m));
|
|
var omega0 = Math.sqrt(k / m);
|
|
var omega1 = omega0 * Math.sqrt(1 - zeta * zeta);
|
|
var x0 = this._toValue - this._startPosition;
|
|
var position = 0;
|
|
var velocity = 0;
|
|
var t = this._frameTime;
|
|
if (zeta < 1) {
|
|
var envelope = Math.exp(-zeta * omega0 * t);
|
|
position = this._toValue - envelope * ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t));
|
|
velocity = zeta * omega0 * envelope * (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t));
|
|
} else {
|
|
var _envelope = Math.exp(-omega0 * t);
|
|
position = this._toValue - _envelope * (x0 + (v0 + omega0 * x0) * t);
|
|
velocity = _envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0));
|
|
}
|
|
this._lastTime = now;
|
|
this._lastPosition = position;
|
|
this._lastVelocity = velocity;
|
|
this._onUpdate(position);
|
|
if (!this.__active) {
|
|
return;
|
|
}
|
|
var isOvershooting = false;
|
|
if (this._overshootClamping && this._stiffness !== 0) {
|
|
if (this._startPosition < this._toValue) {
|
|
isOvershooting = position > this._toValue;
|
|
} else {
|
|
isOvershooting = position < this._toValue;
|
|
}
|
|
}
|
|
var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold;
|
|
var isDisplacement = true;
|
|
if (this._stiffness !== 0) {
|
|
isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold;
|
|
}
|
|
if (isOvershooting || isVelocity && isDisplacement) {
|
|
if (this._stiffness !== 0) {
|
|
this._lastPosition = this._toValue;
|
|
this._lastVelocity = 0;
|
|
this._onUpdate(this._toValue);
|
|
}
|
|
this.__debouncedOnEnd({
|
|
finished: true
|
|
});
|
|
return;
|
|
}
|
|
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
|
|
}
|
|
stop() {
|
|
super.stop();
|
|
this.__active = false;
|
|
clearTimeout(this._timeout);
|
|
global.cancelAnimationFrame(this._animationFrame);
|
|
this.__debouncedOnEnd({
|
|
finished: false
|
|
});
|
|
}
|
|
};
|
|
var _default = exports2.default = SpringAnimation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/bezier.js
|
|
var require_bezier = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/bezier.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = bezier;
|
|
var NEWTON_ITERATIONS = 4;
|
|
var NEWTON_MIN_SLOPE = 1e-3;
|
|
var SUBDIVISION_PRECISION = 1e-7;
|
|
var SUBDIVISION_MAX_ITERATIONS = 10;
|
|
var kSplineTableSize = 11;
|
|
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
var float32ArraySupported = typeof Float32Array === "function";
|
|
function A(aA1, aA2) {
|
|
return 1 - 3 * aA2 + 3 * aA1;
|
|
}
|
|
__name(A, "A");
|
|
function B(aA1, aA2) {
|
|
return 3 * aA2 - 6 * aA1;
|
|
}
|
|
__name(B, "B");
|
|
function C(aA1) {
|
|
return 3 * aA1;
|
|
}
|
|
__name(C, "C");
|
|
function calcBezier(aT, aA1, aA2) {
|
|
return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
|
|
}
|
|
__name(calcBezier, "calcBezier");
|
|
function getSlope(aT, aA1, aA2) {
|
|
return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);
|
|
}
|
|
__name(getSlope, "getSlope");
|
|
function binarySubdivide(aX, _aA, _aB, mX1, mX2) {
|
|
var currentX, currentT, i = 0, aA = _aA, aB = _aB;
|
|
do {
|
|
currentT = aA + (aB - aA) / 2;
|
|
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
if (currentX > 0) {
|
|
aB = currentT;
|
|
} else {
|
|
aA = currentT;
|
|
}
|
|
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
|
return currentT;
|
|
}
|
|
__name(binarySubdivide, "binarySubdivide");
|
|
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
|
|
var aGuessT = _aGuessT;
|
|
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
|
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
if (currentSlope === 0) {
|
|
return aGuessT;
|
|
}
|
|
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
aGuessT -= currentX / currentSlope;
|
|
}
|
|
return aGuessT;
|
|
}
|
|
__name(newtonRaphsonIterate, "newtonRaphsonIterate");
|
|
function bezier(mX1, mY1, mX2, mY2) {
|
|
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
|
throw new Error("bezier x values must be in [0, 1] range");
|
|
}
|
|
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
|
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
for (var i = 0; i < kSplineTableSize; ++i) {
|
|
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
}
|
|
}
|
|
function getTForX(aX) {
|
|
var intervalStart = 0;
|
|
var currentSample = 1;
|
|
var lastSample = kSplineTableSize - 1;
|
|
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
intervalStart += kSampleStepSize;
|
|
}
|
|
--currentSample;
|
|
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
var guessForT = intervalStart + dist * kSampleStepSize;
|
|
var initialSlope = getSlope(guessForT, mX1, mX2);
|
|
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
} else if (initialSlope === 0) {
|
|
return guessForT;
|
|
} else {
|
|
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
|
}
|
|
}
|
|
__name(getTForX, "getTForX");
|
|
return /* @__PURE__ */ __name(function BezierEasing(x) {
|
|
if (mX1 === mY1 && mX2 === mY2) {
|
|
return x;
|
|
}
|
|
if (x === 0) {
|
|
return 0;
|
|
}
|
|
if (x === 1) {
|
|
return 1;
|
|
}
|
|
return calcBezier(getTForX(x), mY1, mY2);
|
|
}, "BezierEasing");
|
|
}
|
|
__name(bezier, "bezier");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/Easing.js
|
|
var require_Easing = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/Easing.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _bezier2 = _interopRequireDefault(require_bezier());
|
|
var ease;
|
|
var Easing = class _Easing {
|
|
static {
|
|
__name(this, "Easing");
|
|
}
|
|
/**
|
|
* A stepping function, returns 1 for any positive value of `n`.
|
|
*/
|
|
static step0(n) {
|
|
return n > 0 ? 1 : 0;
|
|
}
|
|
/**
|
|
* A stepping function, returns 1 if `n` is greater than or equal to 1.
|
|
*/
|
|
static step1(n) {
|
|
return n >= 1 ? 1 : 0;
|
|
}
|
|
/**
|
|
* A linear function, `f(t) = t`. Position correlates to elapsed time one to
|
|
* one.
|
|
*
|
|
* http://cubic-bezier.com/#0,0,1,1
|
|
*/
|
|
static linear(t) {
|
|
return t;
|
|
}
|
|
/**
|
|
* A simple inertial interaction, similar to an object slowly accelerating to
|
|
* speed.
|
|
*
|
|
* http://cubic-bezier.com/#.42,0,1,1
|
|
*/
|
|
static ease(t) {
|
|
if (!ease) {
|
|
ease = _Easing.bezier(0.42, 0, 1, 1);
|
|
}
|
|
return ease(t);
|
|
}
|
|
/**
|
|
* A quadratic function, `f(t) = t * t`. Position equals the square of elapsed
|
|
* time.
|
|
*
|
|
* http://easings.net/#easeInQuad
|
|
*/
|
|
static quad(t) {
|
|
return t * t;
|
|
}
|
|
/**
|
|
* A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed
|
|
* time.
|
|
*
|
|
* http://easings.net/#easeInCubic
|
|
*/
|
|
static cubic(t) {
|
|
return t * t * t;
|
|
}
|
|
/**
|
|
* A power function. Position is equal to the Nth power of elapsed time.
|
|
*
|
|
* n = 4: http://easings.net/#easeInQuart
|
|
* n = 5: http://easings.net/#easeInQuint
|
|
*/
|
|
static poly(n) {
|
|
return (t) => Math.pow(t, n);
|
|
}
|
|
/**
|
|
* A sinusoidal function.
|
|
*
|
|
* http://easings.net/#easeInSine
|
|
*/
|
|
static sin(t) {
|
|
return 1 - Math.cos(t * Math.PI / 2);
|
|
}
|
|
/**
|
|
* A circular function.
|
|
*
|
|
* http://easings.net/#easeInCirc
|
|
*/
|
|
static circle(t) {
|
|
return 1 - Math.sqrt(1 - t * t);
|
|
}
|
|
/**
|
|
* An exponential function.
|
|
*
|
|
* http://easings.net/#easeInExpo
|
|
*/
|
|
static exp(t) {
|
|
return Math.pow(2, 10 * (t - 1));
|
|
}
|
|
/**
|
|
* A simple elastic interaction, similar to a spring oscillating back and
|
|
* forth.
|
|
*
|
|
* Default bounciness is 1, which overshoots a little bit once. 0 bounciness
|
|
* doesn't overshoot at all, and bounciness of N > 1 will overshoot about N
|
|
* times.
|
|
*
|
|
* http://easings.net/#easeInElastic
|
|
*/
|
|
static elastic(bounciness) {
|
|
if (bounciness === void 0) {
|
|
bounciness = 1;
|
|
}
|
|
var p = bounciness * Math.PI;
|
|
return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);
|
|
}
|
|
/**
|
|
* Use with `Animated.parallel()` to create a simple effect where the object
|
|
* animates back slightly as the animation starts.
|
|
*
|
|
* Wolfram Plot:
|
|
*
|
|
* - http://tiny.cc/back_default (s = 1.70158, default)
|
|
*/
|
|
static back(s) {
|
|
if (s === void 0) {
|
|
s = 1.70158;
|
|
}
|
|
return (t) => t * t * ((s + 1) * t - s);
|
|
}
|
|
/**
|
|
* Provides a simple bouncing effect.
|
|
*
|
|
* http://easings.net/#easeInBounce
|
|
*/
|
|
static bounce(t) {
|
|
if (t < 1 / 2.75) {
|
|
return 7.5625 * t * t;
|
|
}
|
|
if (t < 2 / 2.75) {
|
|
var _t = t - 1.5 / 2.75;
|
|
return 7.5625 * _t * _t + 0.75;
|
|
}
|
|
if (t < 2.5 / 2.75) {
|
|
var _t2 = t - 2.25 / 2.75;
|
|
return 7.5625 * _t2 * _t2 + 0.9375;
|
|
}
|
|
var t2 = t - 2.625 / 2.75;
|
|
return 7.5625 * t2 * t2 + 0.984375;
|
|
}
|
|
/**
|
|
* Provides a cubic bezier curve, equivalent to CSS Transitions'
|
|
* `transition-timing-function`.
|
|
*
|
|
* A useful tool to visualize cubic bezier curves can be found at
|
|
* http://cubic-bezier.com/
|
|
*/
|
|
static bezier(x1, y1, x2, y2) {
|
|
return (0, _bezier2.default)(x1, y1, x2, y2);
|
|
}
|
|
/**
|
|
* Runs an easing function forwards.
|
|
*/
|
|
static in(easing) {
|
|
return easing;
|
|
}
|
|
/**
|
|
* Runs an easing function backwards.
|
|
*/
|
|
static out(easing) {
|
|
return (t) => 1 - easing(1 - t);
|
|
}
|
|
/**
|
|
* Makes any easing function symmetrical. The easing function will run
|
|
* forwards for half of the duration, then backwards for the rest of the
|
|
* duration.
|
|
*/
|
|
static inOut(easing) {
|
|
return (t) => {
|
|
if (t < 0.5) {
|
|
return easing(t * 2) / 2;
|
|
}
|
|
return 1 - easing((1 - t) * 2) / 2;
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = Easing;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Easing/index.js
|
|
var require_Easing2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Easing/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Easing = _interopRequireDefault(require_Easing());
|
|
var _default = exports2.default = _Easing.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/TimingAnimation.js
|
|
var require_TimingAnimation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/TimingAnimation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedValueXY = _interopRequireDefault(require_AnimatedValueXY());
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _Easing = _interopRequireDefault(require_Easing2());
|
|
var _Animation = _interopRequireDefault(require_Animation());
|
|
var _NativeAnimatedHelper = require_NativeAnimatedHelper();
|
|
var _AnimatedColor = _interopRequireDefault(require_AnimatedColor());
|
|
var _easeInOut;
|
|
function easeInOut() {
|
|
if (!_easeInOut) {
|
|
_easeInOut = _Easing.default.inOut(_Easing.default.ease);
|
|
}
|
|
return _easeInOut;
|
|
}
|
|
__name(easeInOut, "easeInOut");
|
|
var TimingAnimation = class extends _Animation.default {
|
|
static {
|
|
__name(this, "TimingAnimation");
|
|
}
|
|
constructor(config) {
|
|
var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;
|
|
super();
|
|
this._toValue = config.toValue;
|
|
this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();
|
|
this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;
|
|
this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;
|
|
this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
|
|
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
|
|
this._platformConfig = config.platformConfig;
|
|
this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;
|
|
}
|
|
__getNativeAnimationConfig() {
|
|
var frameDuration = 1e3 / 60;
|
|
var frames = [];
|
|
var numFrames = Math.round(this._duration / frameDuration);
|
|
for (var frame = 0; frame < numFrames; frame++) {
|
|
frames.push(this._easing(frame / numFrames));
|
|
}
|
|
frames.push(this._easing(1));
|
|
return {
|
|
type: "frames",
|
|
frames,
|
|
toValue: this._toValue,
|
|
iterations: this.__iterations,
|
|
platformConfig: this._platformConfig
|
|
};
|
|
}
|
|
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
|
|
this.__active = true;
|
|
this._fromValue = fromValue;
|
|
this._onUpdate = onUpdate;
|
|
this.__onEnd = onEnd;
|
|
var start = /* @__PURE__ */ __name(() => {
|
|
if (this._duration === 0 && !this._useNativeDriver) {
|
|
this._onUpdate(this._toValue);
|
|
this.__debouncedOnEnd({
|
|
finished: true
|
|
});
|
|
} else {
|
|
this._startTime = Date.now();
|
|
if (this._useNativeDriver) {
|
|
this.__startNativeAnimation(animatedValue);
|
|
} else {
|
|
this._animationFrame = requestAnimationFrame(
|
|
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
this.onUpdate.bind(this)
|
|
);
|
|
}
|
|
}
|
|
}, "start");
|
|
if (this._delay) {
|
|
this._timeout = setTimeout(start, this._delay);
|
|
} else {
|
|
start();
|
|
}
|
|
}
|
|
onUpdate() {
|
|
var now = Date.now();
|
|
if (now >= this._startTime + this._duration) {
|
|
if (this._duration === 0) {
|
|
this._onUpdate(this._toValue);
|
|
} else {
|
|
this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));
|
|
}
|
|
this.__debouncedOnEnd({
|
|
finished: true
|
|
});
|
|
return;
|
|
}
|
|
this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));
|
|
if (this.__active) {
|
|
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
|
|
}
|
|
}
|
|
stop() {
|
|
super.stop();
|
|
this.__active = false;
|
|
clearTimeout(this._timeout);
|
|
global.cancelAnimationFrame(this._animationFrame);
|
|
this.__debouncedOnEnd({
|
|
finished: false
|
|
});
|
|
}
|
|
};
|
|
var _default = exports2.default = TimingAnimation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedImplementation.js
|
|
var require_AnimatedImplementation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedImplementation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AnimatedEvent = require_AnimatedEvent();
|
|
var _AnimatedAddition = _interopRequireDefault(require_AnimatedAddition());
|
|
var _AnimatedDiffClamp = _interopRequireDefault(require_AnimatedDiffClamp());
|
|
var _AnimatedDivision = _interopRequireDefault(require_AnimatedDivision());
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedModulo = _interopRequireDefault(require_AnimatedModulo());
|
|
var _AnimatedMultiplication = _interopRequireDefault(require_AnimatedMultiplication());
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _AnimatedProps = _interopRequireDefault(require_AnimatedProps());
|
|
var _AnimatedSubtraction = _interopRequireDefault(require_AnimatedSubtraction());
|
|
var _AnimatedTracking = _interopRequireDefault(require_AnimatedTracking());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedValueXY = _interopRequireDefault(require_AnimatedValueXY());
|
|
var _DecayAnimation = _interopRequireDefault(require_DecayAnimation());
|
|
var _SpringAnimation = _interopRequireDefault(require_SpringAnimation());
|
|
var _TimingAnimation = _interopRequireDefault(require_TimingAnimation());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var _AnimatedColor = _interopRequireDefault(require_AnimatedColor());
|
|
var add = /* @__PURE__ */ __name(function add2(a, b) {
|
|
return new _AnimatedAddition.default(a, b);
|
|
}, "add");
|
|
var subtract = /* @__PURE__ */ __name(function subtract2(a, b) {
|
|
return new _AnimatedSubtraction.default(a, b);
|
|
}, "subtract");
|
|
var divide = /* @__PURE__ */ __name(function divide2(a, b) {
|
|
return new _AnimatedDivision.default(a, b);
|
|
}, "divide");
|
|
var multiply = /* @__PURE__ */ __name(function multiply2(a, b) {
|
|
return new _AnimatedMultiplication.default(a, b);
|
|
}, "multiply");
|
|
var modulo = /* @__PURE__ */ __name(function modulo2(a, modulus) {
|
|
return new _AnimatedModulo.default(a, modulus);
|
|
}, "modulo");
|
|
var diffClamp = /* @__PURE__ */ __name(function diffClamp2(a, min2, max2) {
|
|
return new _AnimatedDiffClamp.default(a, min2, max2);
|
|
}, "diffClamp");
|
|
var _combineCallbacks = /* @__PURE__ */ __name(function _combineCallbacks2(callback, config) {
|
|
if (callback && config.onComplete) {
|
|
return function() {
|
|
config.onComplete && config.onComplete(...arguments);
|
|
callback && callback(...arguments);
|
|
};
|
|
} else {
|
|
return callback || config.onComplete;
|
|
}
|
|
}, "_combineCallbacks");
|
|
var maybeVectorAnim = /* @__PURE__ */ __name(function maybeVectorAnim2(value, config, anim) {
|
|
if (value instanceof _AnimatedValueXY.default) {
|
|
var configX = (0, _objectSpread2.default)({}, config);
|
|
var configY = (0, _objectSpread2.default)({}, config);
|
|
for (var key in config) {
|
|
var _config$key = config[key], x = _config$key.x, y = _config$key.y;
|
|
if (x !== void 0 && y !== void 0) {
|
|
configX[key] = x;
|
|
configY[key] = y;
|
|
}
|
|
}
|
|
var aX = anim(value.x, configX);
|
|
var aY = anim(value.y, configY);
|
|
return parallel([aX, aY], {
|
|
stopTogether: false
|
|
});
|
|
} else if (value instanceof _AnimatedColor.default) {
|
|
var configR = (0, _objectSpread2.default)({}, config);
|
|
var configG = (0, _objectSpread2.default)({}, config);
|
|
var configB = (0, _objectSpread2.default)({}, config);
|
|
var configA = (0, _objectSpread2.default)({}, config);
|
|
for (var _key in config) {
|
|
var _config$_key = config[_key], r = _config$_key.r, g = _config$_key.g, b = _config$_key.b, a = _config$_key.a;
|
|
if (r !== void 0 && g !== void 0 && b !== void 0 && a !== void 0) {
|
|
configR[_key] = r;
|
|
configG[_key] = g;
|
|
configB[_key] = b;
|
|
configA[_key] = a;
|
|
}
|
|
}
|
|
var aR = anim(value.r, configR);
|
|
var aG = anim(value.g, configG);
|
|
var aB = anim(value.b, configB);
|
|
var aA = anim(value.a, configA);
|
|
return parallel([aR, aG, aB, aA], {
|
|
stopTogether: false
|
|
});
|
|
}
|
|
return null;
|
|
}, "maybeVectorAnim");
|
|
var spring = /* @__PURE__ */ __name(function spring2(value, config) {
|
|
var _start = /* @__PURE__ */ __name(function start(animatedValue, configuration, callback) {
|
|
callback = _combineCallbacks(callback, configuration);
|
|
var singleValue = animatedValue;
|
|
var singleConfig = configuration;
|
|
singleValue.stopTracking();
|
|
if (configuration.toValue instanceof _AnimatedNode.default) {
|
|
singleValue.track(new _AnimatedTracking.default(singleValue, configuration.toValue, _SpringAnimation.default, singleConfig, callback));
|
|
} else {
|
|
singleValue.animate(new _SpringAnimation.default(singleConfig), callback);
|
|
}
|
|
}, "start");
|
|
return maybeVectorAnim(value, config, spring2) || {
|
|
start: /* @__PURE__ */ __name(function start(callback) {
|
|
_start(value, config, callback);
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(function stop() {
|
|
value.stopAnimation();
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(function reset() {
|
|
value.resetAnimation();
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(function _startNativeLoop(iterations) {
|
|
var singleConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
|
iterations
|
|
});
|
|
_start(value, singleConfig);
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(function _isUsingNativeDriver() {
|
|
return config.useNativeDriver || false;
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
}, "spring");
|
|
var timing = /* @__PURE__ */ __name(function timing2(value, config) {
|
|
var _start2 = /* @__PURE__ */ __name(function start(animatedValue, configuration, callback) {
|
|
callback = _combineCallbacks(callback, configuration);
|
|
var singleValue = animatedValue;
|
|
var singleConfig = configuration;
|
|
singleValue.stopTracking();
|
|
if (configuration.toValue instanceof _AnimatedNode.default) {
|
|
singleValue.track(new _AnimatedTracking.default(singleValue, configuration.toValue, _TimingAnimation.default, singleConfig, callback));
|
|
} else {
|
|
singleValue.animate(new _TimingAnimation.default(singleConfig), callback);
|
|
}
|
|
}, "start");
|
|
return maybeVectorAnim(value, config, timing2) || {
|
|
start: /* @__PURE__ */ __name(function start(callback) {
|
|
_start2(value, config, callback);
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(function stop() {
|
|
value.stopAnimation();
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(function reset() {
|
|
value.resetAnimation();
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(function _startNativeLoop(iterations) {
|
|
var singleConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
|
iterations
|
|
});
|
|
_start2(value, singleConfig);
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(function _isUsingNativeDriver() {
|
|
return config.useNativeDriver || false;
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
}, "timing");
|
|
var decay = /* @__PURE__ */ __name(function decay2(value, config) {
|
|
var _start3 = /* @__PURE__ */ __name(function start(animatedValue, configuration, callback) {
|
|
callback = _combineCallbacks(callback, configuration);
|
|
var singleValue = animatedValue;
|
|
var singleConfig = configuration;
|
|
singleValue.stopTracking();
|
|
singleValue.animate(new _DecayAnimation.default(singleConfig), callback);
|
|
}, "start");
|
|
return maybeVectorAnim(value, config, decay2) || {
|
|
start: /* @__PURE__ */ __name(function start(callback) {
|
|
_start3(value, config, callback);
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(function stop() {
|
|
value.stopAnimation();
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(function reset() {
|
|
value.resetAnimation();
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(function _startNativeLoop(iterations) {
|
|
var singleConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
|
iterations
|
|
});
|
|
_start3(value, singleConfig);
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(function _isUsingNativeDriver() {
|
|
return config.useNativeDriver || false;
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
}, "decay");
|
|
var sequence = /* @__PURE__ */ __name(function sequence2(animations) {
|
|
var current = 0;
|
|
return {
|
|
start: /* @__PURE__ */ __name(function start(callback) {
|
|
var onComplete = /* @__PURE__ */ __name(function onComplete2(result) {
|
|
if (!result.finished) {
|
|
callback && callback(result);
|
|
return;
|
|
}
|
|
current++;
|
|
if (current === animations.length) {
|
|
current = 0;
|
|
callback && callback(result);
|
|
return;
|
|
}
|
|
animations[current].start(onComplete2);
|
|
}, "onComplete");
|
|
if (animations.length === 0) {
|
|
callback && callback({
|
|
finished: true
|
|
});
|
|
} else {
|
|
animations[current].start(onComplete);
|
|
}
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(function stop() {
|
|
if (current < animations.length) {
|
|
animations[current].stop();
|
|
}
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(function reset() {
|
|
animations.forEach((animation, idx) => {
|
|
if (idx <= current) {
|
|
animation.reset();
|
|
}
|
|
});
|
|
current = 0;
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(function _startNativeLoop() {
|
|
throw new Error("Loops run using the native driver cannot contain Animated.sequence animations");
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(function _isUsingNativeDriver() {
|
|
return false;
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
}, "sequence");
|
|
var parallel = /* @__PURE__ */ __name(function parallel2(animations, config) {
|
|
var doneCount = 0;
|
|
var hasEnded = {};
|
|
var stopTogether = !(config && config.stopTogether === false);
|
|
var result = {
|
|
start: /* @__PURE__ */ __name(function start(callback) {
|
|
if (doneCount === animations.length) {
|
|
callback && callback({
|
|
finished: true
|
|
});
|
|
return;
|
|
}
|
|
animations.forEach((animation, idx) => {
|
|
var cb = /* @__PURE__ */ __name(function cb2(endResult) {
|
|
hasEnded[idx] = true;
|
|
doneCount++;
|
|
if (doneCount === animations.length) {
|
|
doneCount = 0;
|
|
callback && callback(endResult);
|
|
return;
|
|
}
|
|
if (!endResult.finished && stopTogether) {
|
|
result.stop();
|
|
}
|
|
}, "cb");
|
|
if (!animation) {
|
|
cb({
|
|
finished: true
|
|
});
|
|
} else {
|
|
animation.start(cb);
|
|
}
|
|
});
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(function stop() {
|
|
animations.forEach((animation, idx) => {
|
|
!hasEnded[idx] && animation.stop();
|
|
hasEnded[idx] = true;
|
|
});
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(function reset() {
|
|
animations.forEach((animation, idx) => {
|
|
animation.reset();
|
|
hasEnded[idx] = false;
|
|
doneCount = 0;
|
|
});
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(function _startNativeLoop() {
|
|
throw new Error("Loops run using the native driver cannot contain Animated.parallel animations");
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(function _isUsingNativeDriver() {
|
|
return false;
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
return result;
|
|
}, "parallel");
|
|
var delay = /* @__PURE__ */ __name(function delay2(time) {
|
|
return timing(new _AnimatedValue.default(0), {
|
|
toValue: 0,
|
|
delay: time,
|
|
duration: 0,
|
|
useNativeDriver: false
|
|
});
|
|
}, "delay");
|
|
var stagger = /* @__PURE__ */ __name(function stagger2(time, animations) {
|
|
return parallel(animations.map((animation, i) => {
|
|
return sequence([delay(time * i), animation]);
|
|
}));
|
|
}, "stagger");
|
|
var loop = /* @__PURE__ */ __name(function loop2(animation, _temp) {
|
|
var _ref = _temp === void 0 ? {} : _temp, _ref$iterations = _ref.iterations, iterations = _ref$iterations === void 0 ? -1 : _ref$iterations, _ref$resetBeforeItera = _ref.resetBeforeIteration, resetBeforeIteration = _ref$resetBeforeItera === void 0 ? true : _ref$resetBeforeItera;
|
|
var isFinished = false;
|
|
var iterationsSoFar = 0;
|
|
return {
|
|
start: /* @__PURE__ */ __name(function start(callback) {
|
|
var restart = /* @__PURE__ */ __name(function restart2(result) {
|
|
if (result === void 0) {
|
|
result = {
|
|
finished: true
|
|
};
|
|
}
|
|
if (isFinished || iterationsSoFar === iterations || result.finished === false) {
|
|
callback && callback(result);
|
|
} else {
|
|
iterationsSoFar++;
|
|
resetBeforeIteration && animation.reset();
|
|
animation.start(restart2);
|
|
}
|
|
}, "restart");
|
|
if (!animation || iterations === 0) {
|
|
callback && callback({
|
|
finished: true
|
|
});
|
|
} else {
|
|
if (animation._isUsingNativeDriver()) {
|
|
animation._startNativeLoop(iterations);
|
|
} else {
|
|
restart();
|
|
}
|
|
}
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(function stop() {
|
|
isFinished = true;
|
|
animation.stop();
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(function reset() {
|
|
iterationsSoFar = 0;
|
|
isFinished = false;
|
|
animation.reset();
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(function _startNativeLoop() {
|
|
throw new Error("Loops run using the native driver cannot contain Animated.loop animations");
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(function _isUsingNativeDriver() {
|
|
return animation._isUsingNativeDriver();
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
}, "loop");
|
|
function forkEvent(event2, listener) {
|
|
if (!event2) {
|
|
return listener;
|
|
} else if (event2 instanceof _AnimatedEvent.AnimatedEvent) {
|
|
event2.__addListener(listener);
|
|
return event2;
|
|
} else {
|
|
return function() {
|
|
typeof event2 === "function" && event2(...arguments);
|
|
listener(...arguments);
|
|
};
|
|
}
|
|
}
|
|
__name(forkEvent, "forkEvent");
|
|
function unforkEvent(event2, listener) {
|
|
if (event2 && event2 instanceof _AnimatedEvent.AnimatedEvent) {
|
|
event2.__removeListener(listener);
|
|
}
|
|
}
|
|
__name(unforkEvent, "unforkEvent");
|
|
var event = /* @__PURE__ */ __name(function event2(argMapping, config) {
|
|
var animatedEvent = new _AnimatedEvent.AnimatedEvent(argMapping, config);
|
|
if (animatedEvent.__isNative) {
|
|
return animatedEvent;
|
|
} else {
|
|
return animatedEvent.__getHandler();
|
|
}
|
|
}, "event");
|
|
var _default = exports2.default = {
|
|
/**
|
|
* Standard value class for driving animations. Typically initialized with
|
|
* `new Animated.Value(0);`
|
|
*
|
|
* See https://reactnative.dev/docs/animated#value
|
|
*/
|
|
Value: _AnimatedValue.default,
|
|
/**
|
|
* 2D value class for driving 2D animations, such as pan gestures.
|
|
*
|
|
* See https://reactnative.dev/docs/animatedvaluexy
|
|
*/
|
|
ValueXY: _AnimatedValueXY.default,
|
|
/**
|
|
* Value class for driving color animations.
|
|
*/
|
|
Color: _AnimatedColor.default,
|
|
/**
|
|
* Exported to use the Interpolation type in flow.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#interpolation
|
|
*/
|
|
Interpolation: _AnimatedInterpolation.default,
|
|
/**
|
|
* Exported for ease of type checking. All animated values derive from this
|
|
* class.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#node
|
|
*/
|
|
Node: _AnimatedNode.default,
|
|
/**
|
|
* Animates a value from an initial velocity to zero based on a decay
|
|
* coefficient.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#decay
|
|
*/
|
|
decay,
|
|
/**
|
|
* Animates a value along a timed easing curve. The Easing module has tons of
|
|
* predefined curves, or you can use your own function.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#timing
|
|
*/
|
|
timing,
|
|
/**
|
|
* Animates a value according to an analytical spring model based on
|
|
* damped harmonic oscillation.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#spring
|
|
*/
|
|
spring,
|
|
/**
|
|
* Creates a new Animated value composed from two Animated values added
|
|
* together.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#add
|
|
*/
|
|
add,
|
|
/**
|
|
* Creates a new Animated value composed by subtracting the second Animated
|
|
* value from the first Animated value.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#subtract
|
|
*/
|
|
subtract,
|
|
/**
|
|
* Creates a new Animated value composed by dividing the first Animated value
|
|
* by the second Animated value.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#divide
|
|
*/
|
|
divide,
|
|
/**
|
|
* Creates a new Animated value composed from two Animated values multiplied
|
|
* together.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#multiply
|
|
*/
|
|
multiply,
|
|
/**
|
|
* Creates a new Animated value that is the (non-negative) modulo of the
|
|
* provided Animated value.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#modulo
|
|
*/
|
|
modulo,
|
|
/**
|
|
* Create a new Animated value that is limited between 2 values. It uses the
|
|
* difference between the last value so even if the value is far from the
|
|
* bounds it will start changing when the value starts getting closer again.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#diffclamp
|
|
*/
|
|
diffClamp,
|
|
/**
|
|
* Starts an animation after the given delay.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#delay
|
|
*/
|
|
delay,
|
|
/**
|
|
* Starts an array of animations in order, waiting for each to complete
|
|
* before starting the next. If the current running animation is stopped, no
|
|
* following animations will be started.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#sequence
|
|
*/
|
|
sequence,
|
|
/**
|
|
* Starts an array of animations all at the same time. By default, if one
|
|
* of the animations is stopped, they will all be stopped. You can override
|
|
* this with the `stopTogether` flag.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#parallel
|
|
*/
|
|
parallel,
|
|
/**
|
|
* Array of animations may run in parallel (overlap), but are started in
|
|
* sequence with successive delays. Nice for doing trailing effects.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#stagger
|
|
*/
|
|
stagger,
|
|
/**
|
|
* Loops a given animation continuously, so that each time it reaches the
|
|
* end, it resets and begins again from the start.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#loop
|
|
*/
|
|
loop,
|
|
/**
|
|
* Takes an array of mappings and extracts values from each arg accordingly,
|
|
* then calls `setValue` on the mapped outputs.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#event
|
|
*/
|
|
event,
|
|
/**
|
|
* Make any React component Animatable. Used to create `Animated.View`, etc.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#createanimatedcomponent
|
|
*/
|
|
createAnimatedComponent: _createAnimatedComponent.default,
|
|
/**
|
|
* Imperative API to attach an animated value to an event on a view. Prefer
|
|
* using `Animated.event` with `useNativeDrive: true` if possible.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#attachnativeevent
|
|
*/
|
|
attachNativeEvent: _AnimatedEvent.attachNativeEvent,
|
|
/**
|
|
* Advanced imperative API for snooping on animated events that are passed in
|
|
* through props. Use values directly where possible.
|
|
*
|
|
* See https://reactnative.dev/docs/animated#forkevent
|
|
*/
|
|
forkEvent,
|
|
unforkEvent,
|
|
/**
|
|
* Expose Event class, so it can be used as a type for type checkers.
|
|
*/
|
|
Event: _AnimatedEvent.AnimatedEvent
|
|
};
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedMock.js
|
|
var require_AnimatedMock = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedMock.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AnimatedEvent = require_AnimatedEvent();
|
|
var _AnimatedImplementation = _interopRequireDefault(require_AnimatedImplementation());
|
|
var _AnimatedInterpolation = _interopRequireDefault(require_AnimatedInterpolation());
|
|
var _AnimatedNode = _interopRequireDefault(require_AnimatedNode());
|
|
var _AnimatedValue = _interopRequireDefault(require_AnimatedValue());
|
|
var _AnimatedValueXY = _interopRequireDefault(require_AnimatedValueXY());
|
|
var _createAnimatedComponent = _interopRequireDefault(require_createAnimatedComponent());
|
|
var _AnimatedColor = _interopRequireDefault(require_AnimatedColor());
|
|
var inAnimationCallback = false;
|
|
function mockAnimationStart(start) {
|
|
return (callback) => {
|
|
var guardedCallback = callback == null ? callback : function() {
|
|
if (inAnimationCallback) {
|
|
console.warn("Ignoring recursive animation callback when running mock animations");
|
|
return;
|
|
}
|
|
inAnimationCallback = true;
|
|
try {
|
|
callback(...arguments);
|
|
} finally {
|
|
inAnimationCallback = false;
|
|
}
|
|
};
|
|
start(guardedCallback);
|
|
};
|
|
}
|
|
__name(mockAnimationStart, "mockAnimationStart");
|
|
var emptyAnimation = {
|
|
start: /* @__PURE__ */ __name(() => {
|
|
}, "start"),
|
|
stop: /* @__PURE__ */ __name(() => {
|
|
}, "stop"),
|
|
reset: /* @__PURE__ */ __name(() => {
|
|
}, "reset"),
|
|
_startNativeLoop: /* @__PURE__ */ __name(() => {
|
|
}, "_startNativeLoop"),
|
|
_isUsingNativeDriver: /* @__PURE__ */ __name(() => {
|
|
return false;
|
|
}, "_isUsingNativeDriver")
|
|
};
|
|
var mockCompositeAnimation = /* @__PURE__ */ __name((animations) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, emptyAnimation), {}, {
|
|
start: mockAnimationStart((callback) => {
|
|
animations.forEach((animation) => animation.start());
|
|
callback == null ? void 0 : callback({
|
|
finished: true
|
|
});
|
|
})
|
|
}), "mockCompositeAnimation");
|
|
var spring = /* @__PURE__ */ __name(function spring2(value, config) {
|
|
var anyValue = value;
|
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, emptyAnimation), {}, {
|
|
start: mockAnimationStart((callback) => {
|
|
anyValue.setValue(config.toValue);
|
|
callback == null ? void 0 : callback({
|
|
finished: true
|
|
});
|
|
})
|
|
});
|
|
}, "spring");
|
|
var timing = /* @__PURE__ */ __name(function timing2(value, config) {
|
|
var anyValue = value;
|
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, emptyAnimation), {}, {
|
|
start: mockAnimationStart((callback) => {
|
|
anyValue.setValue(config.toValue);
|
|
callback == null ? void 0 : callback({
|
|
finished: true
|
|
});
|
|
})
|
|
});
|
|
}, "timing");
|
|
var decay = /* @__PURE__ */ __name(function decay2(value, config) {
|
|
return emptyAnimation;
|
|
}, "decay");
|
|
var sequence = /* @__PURE__ */ __name(function sequence2(animations) {
|
|
return mockCompositeAnimation(animations);
|
|
}, "sequence");
|
|
var parallel = /* @__PURE__ */ __name(function parallel2(animations, config) {
|
|
return mockCompositeAnimation(animations);
|
|
}, "parallel");
|
|
var delay = /* @__PURE__ */ __name(function delay2(time) {
|
|
return emptyAnimation;
|
|
}, "delay");
|
|
var stagger = /* @__PURE__ */ __name(function stagger2(time, animations) {
|
|
return mockCompositeAnimation(animations);
|
|
}, "stagger");
|
|
var loop = /* @__PURE__ */ __name(function loop2(animation, _temp) {
|
|
var _ref = _temp === void 0 ? {} : _temp, _ref$iterations = _ref.iterations, iterations = _ref$iterations === void 0 ? -1 : _ref$iterations;
|
|
return emptyAnimation;
|
|
}, "loop");
|
|
var _default = exports2.default = {
|
|
Value: _AnimatedValue.default,
|
|
ValueXY: _AnimatedValueXY.default,
|
|
Color: _AnimatedColor.default,
|
|
Interpolation: _AnimatedInterpolation.default,
|
|
Node: _AnimatedNode.default,
|
|
decay,
|
|
timing,
|
|
spring,
|
|
add: _AnimatedImplementation.default.add,
|
|
subtract: _AnimatedImplementation.default.subtract,
|
|
divide: _AnimatedImplementation.default.divide,
|
|
multiply: _AnimatedImplementation.default.multiply,
|
|
modulo: _AnimatedImplementation.default.modulo,
|
|
diffClamp: _AnimatedImplementation.default.diffClamp,
|
|
delay,
|
|
sequence,
|
|
parallel,
|
|
stagger,
|
|
loop,
|
|
event: _AnimatedImplementation.default.event,
|
|
createAnimatedComponent: _createAnimatedComponent.default,
|
|
attachNativeEvent: _AnimatedEvent.attachNativeEvent,
|
|
forkEvent: _AnimatedImplementation.default.forkEvent,
|
|
unforkEvent: _AnimatedImplementation.default.unforkEvent,
|
|
Event: _AnimatedEvent.AnimatedEvent
|
|
};
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/Animated.js
|
|
var require_Animated = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/Animated.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var _AnimatedFlatList = _interopRequireDefault(require_AnimatedFlatList());
|
|
var _AnimatedImage = _interopRequireDefault(require_AnimatedImage());
|
|
var _AnimatedScrollView = _interopRequireDefault(require_AnimatedScrollView());
|
|
var _AnimatedSectionList = _interopRequireDefault(require_AnimatedSectionList());
|
|
var _AnimatedText = _interopRequireDefault(require_AnimatedText());
|
|
var _AnimatedView = _interopRequireDefault(require_AnimatedView());
|
|
var _AnimatedMock = _interopRequireDefault(require_AnimatedMock());
|
|
var _AnimatedImplementation = _interopRequireDefault(require_AnimatedImplementation());
|
|
var Animated = _Platform.default.isTesting ? _AnimatedMock.default : _AnimatedImplementation.default;
|
|
var _default = exports2.default = (0, _objectSpread2.default)({
|
|
FlatList: _AnimatedFlatList.default,
|
|
Image: _AnimatedImage.default,
|
|
ScrollView: _AnimatedScrollView.default,
|
|
SectionList: _AnimatedSectionList.default,
|
|
Text: _AnimatedText.default,
|
|
View: _AnimatedView.default
|
|
}, Animated);
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Animated/index.js
|
|
var require_Animated2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Animated/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Animated = _interopRequireDefault(require_Animated());
|
|
var _default = exports2.default = _Animated.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Appearance/index.js
|
|
var require_Appearance = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Appearance/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
function getQuery() {
|
|
return _canUseDom.default && window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
}
|
|
__name(getQuery, "getQuery");
|
|
var query = getQuery();
|
|
var listenerMapping = /* @__PURE__ */ new WeakMap();
|
|
var Appearance = {
|
|
getColorScheme() {
|
|
return query && query.matches ? "dark" : "light";
|
|
},
|
|
addChangeListener(listener) {
|
|
var mappedListener = listenerMapping.get(listener);
|
|
if (!mappedListener) {
|
|
mappedListener = /* @__PURE__ */ __name((_ref) => {
|
|
var matches = _ref.matches;
|
|
listener({
|
|
colorScheme: matches ? "dark" : "light"
|
|
});
|
|
}, "mappedListener");
|
|
listenerMapping.set(listener, mappedListener);
|
|
}
|
|
if (query) {
|
|
query.addListener(mappedListener);
|
|
}
|
|
function remove() {
|
|
var mappedListener2 = listenerMapping.get(listener);
|
|
if (query && mappedListener2) {
|
|
query.removeListener(mappedListener2);
|
|
}
|
|
listenerMapping.delete(listener);
|
|
}
|
|
__name(remove, "remove");
|
|
return {
|
|
remove
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = Appearance;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js
|
|
var require_AppContainer = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var RootTagContext = /* @__PURE__ */ React83.createContext(null);
|
|
var AppContainer = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var children = props.children, WrapperComponent = props.WrapperComponent;
|
|
var innerView = /* @__PURE__ */ React83.createElement(_View.default, {
|
|
children,
|
|
key: 1,
|
|
style: styles.appContainer
|
|
});
|
|
if (WrapperComponent) {
|
|
innerView = /* @__PURE__ */ React83.createElement(WrapperComponent, null, innerView);
|
|
}
|
|
return /* @__PURE__ */ React83.createElement(RootTagContext.Provider, {
|
|
value: props.rootTag
|
|
}, /* @__PURE__ */ React83.createElement(_View.default, {
|
|
ref: forwardedRef,
|
|
style: styles.appContainer
|
|
}, innerView));
|
|
});
|
|
AppContainer.displayName = "AppContainer";
|
|
var _default = exports2.default = AppContainer;
|
|
var styles = _StyleSheet.default.create({
|
|
appContainer: {
|
|
flex: 1,
|
|
pointerEvents: "box-none"
|
|
}
|
|
});
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/AppRegistry/renderApplication.js
|
|
var require_renderApplication = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/AppRegistry/renderApplication.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = renderApplication;
|
|
exports2.getApplication = getApplication;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _AppContainer = _interopRequireDefault(require_AppContainer());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _render = _interopRequireWildcard(require_render());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _react = _interopRequireDefault(require("react"));
|
|
function renderApplication(RootComponent, WrapperComponent, callback, options) {
|
|
var shouldHydrate = options.hydrate, initialProps = options.initialProps, rootTag = options.rootTag;
|
|
var renderFn = shouldHydrate ? _render.hydrate : _render.default;
|
|
(0, _invariant.default)(rootTag, "Expect to have a valid rootTag, instead got ", rootTag);
|
|
return renderFn(/* @__PURE__ */ _react.default.createElement(_AppContainer.default, {
|
|
WrapperComponent,
|
|
ref: callback,
|
|
rootTag
|
|
}, /* @__PURE__ */ _react.default.createElement(RootComponent, initialProps)), rootTag);
|
|
}
|
|
__name(renderApplication, "renderApplication");
|
|
function getApplication(RootComponent, initialProps, WrapperComponent) {
|
|
var element = /* @__PURE__ */ _react.default.createElement(_AppContainer.default, {
|
|
WrapperComponent,
|
|
rootTag: {}
|
|
}, /* @__PURE__ */ _react.default.createElement(RootComponent, initialProps));
|
|
var getStyleElement = /* @__PURE__ */ __name((props) => {
|
|
var sheet = _StyleSheet.default.getSheet();
|
|
return /* @__PURE__ */ _react.default.createElement("style", (0, _extends2.default)({}, props, {
|
|
dangerouslySetInnerHTML: {
|
|
__html: sheet.textContent
|
|
},
|
|
id: sheet.id
|
|
}));
|
|
}, "getStyleElement");
|
|
return {
|
|
element,
|
|
getStyleElement
|
|
};
|
|
}
|
|
__name(getApplication, "getApplication");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/AppRegistry/index.js
|
|
var require_AppRegistry = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/AppRegistry/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _unmountComponentAtNode = _interopRequireDefault(require_unmountComponentAtNode());
|
|
var _renderApplication = _interopRequireWildcard(require_renderApplication());
|
|
var emptyObject = {};
|
|
var runnables = {};
|
|
var componentProviderInstrumentationHook = /* @__PURE__ */ __name((component) => component(), "componentProviderInstrumentationHook");
|
|
var wrapperComponentProvider;
|
|
var AppRegistry = class _AppRegistry {
|
|
static {
|
|
__name(this, "AppRegistry");
|
|
}
|
|
static getAppKeys() {
|
|
return Object.keys(runnables);
|
|
}
|
|
static getApplication(appKey, appParameters) {
|
|
(0, _invariant.default)(runnables[appKey] && runnables[appKey].getApplication, "Application " + appKey + " has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.");
|
|
return runnables[appKey].getApplication(appParameters);
|
|
}
|
|
static registerComponent(appKey, componentProvider) {
|
|
runnables[appKey] = {
|
|
getApplication: /* @__PURE__ */ __name((appParameters) => (0, _renderApplication.getApplication)(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters)), "getApplication"),
|
|
run: /* @__PURE__ */ __name((appParameters) => (0, _renderApplication.default)(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {
|
|
hydrate: appParameters.hydrate || false,
|
|
initialProps: appParameters.initialProps || emptyObject,
|
|
mode: appParameters.mode || "concurrent",
|
|
rootTag: appParameters.rootTag
|
|
}), "run")
|
|
};
|
|
return appKey;
|
|
}
|
|
static registerConfig(config) {
|
|
config.forEach((_ref) => {
|
|
var appKey = _ref.appKey, component = _ref.component, run = _ref.run;
|
|
if (run) {
|
|
_AppRegistry.registerRunnable(appKey, run);
|
|
} else {
|
|
(0, _invariant.default)(component, "No component provider passed in");
|
|
_AppRegistry.registerComponent(appKey, component);
|
|
}
|
|
});
|
|
}
|
|
// TODO: fix style sheet creation when using this method
|
|
static registerRunnable(appKey, run) {
|
|
runnables[appKey] = {
|
|
run
|
|
};
|
|
return appKey;
|
|
}
|
|
static runApplication(appKey, appParameters) {
|
|
var isDevelopment = process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test";
|
|
if (isDevelopment) {
|
|
var params = (0, _objectSpread2.default)({}, appParameters);
|
|
params.rootTag = "#" + params.rootTag.id;
|
|
console.log('Running application "' + appKey + '" with appParams:\n', params, "\nDevelopment-level warnings: " + (isDevelopment ? "ON" : "OFF") + "." + ("\nPerformance optimizations: " + (isDevelopment ? "OFF" : "ON") + "."));
|
|
}
|
|
(0, _invariant.default)(runnables[appKey] && runnables[appKey].run, 'Application "' + appKey + '" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');
|
|
return runnables[appKey].run(appParameters);
|
|
}
|
|
static setComponentProviderInstrumentationHook(hook) {
|
|
componentProviderInstrumentationHook = hook;
|
|
}
|
|
static setWrapperComponentProvider(provider) {
|
|
wrapperComponentProvider = provider;
|
|
}
|
|
static unmountApplicationComponentAtRootTag(rootTag) {
|
|
(0, _unmountComponentAtNode.default)(rootTag);
|
|
}
|
|
};
|
|
exports2.default = AppRegistry;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/AppState/index.js
|
|
var require_AppState = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/AppState/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _EventEmitter = _interopRequireDefault(require_EventEmitter());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var isPrefixed = _canUseDom.default && !document.hasOwnProperty("hidden") && document.hasOwnProperty("webkitHidden");
|
|
var EVENT_TYPES = ["change", "memoryWarning"];
|
|
var VISIBILITY_CHANGE_EVENT = isPrefixed ? "webkitvisibilitychange" : "visibilitychange";
|
|
var VISIBILITY_STATE_PROPERTY = isPrefixed ? "webkitVisibilityState" : "visibilityState";
|
|
var AppStates = {
|
|
BACKGROUND: "background",
|
|
ACTIVE: "active"
|
|
};
|
|
var changeEmitter = null;
|
|
var AppState = class _AppState {
|
|
static {
|
|
__name(this, "AppState");
|
|
}
|
|
static get currentState() {
|
|
if (!_AppState.isAvailable) {
|
|
return AppStates.ACTIVE;
|
|
}
|
|
switch (document[VISIBILITY_STATE_PROPERTY]) {
|
|
case "hidden":
|
|
case "prerender":
|
|
case "unloaded":
|
|
return AppStates.BACKGROUND;
|
|
default:
|
|
return AppStates.ACTIVE;
|
|
}
|
|
}
|
|
static addEventListener(type, handler) {
|
|
if (_AppState.isAvailable) {
|
|
(0, _invariant.default)(EVENT_TYPES.indexOf(type) !== -1, 'Trying to subscribe to unknown event: "%s"', type);
|
|
if (type === "change") {
|
|
if (!changeEmitter) {
|
|
changeEmitter = new _EventEmitter.default();
|
|
document.addEventListener(VISIBILITY_CHANGE_EVENT, () => {
|
|
if (changeEmitter) {
|
|
changeEmitter.emit("change", _AppState.currentState);
|
|
}
|
|
}, false);
|
|
}
|
|
return changeEmitter.addListener(type, handler);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
exports2.default = AppState;
|
|
AppState.isAvailable = _canUseDom.default && !!document[VISIBILITY_STATE_PROPERTY];
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/BackHandler/index.js
|
|
var require_BackHandler = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/BackHandler/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
function emptyFunction() {
|
|
}
|
|
__name(emptyFunction, "emptyFunction");
|
|
var BackHandler = {
|
|
exitApp: emptyFunction,
|
|
addEventListener() {
|
|
console.error("BackHandler is not supported on web and should not be used.");
|
|
return {
|
|
remove: emptyFunction
|
|
};
|
|
},
|
|
removeEventListener: emptyFunction
|
|
};
|
|
var _default = exports2.default = BackHandler;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Clipboard/index.js
|
|
var require_Clipboard = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Clipboard/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var clipboardAvailable;
|
|
var Clipboard = class {
|
|
static {
|
|
__name(this, "Clipboard");
|
|
}
|
|
static isAvailable() {
|
|
if (clipboardAvailable === void 0) {
|
|
clipboardAvailable = typeof document.queryCommandSupported === "function" && document.queryCommandSupported("copy");
|
|
}
|
|
return clipboardAvailable;
|
|
}
|
|
static getString() {
|
|
return Promise.resolve("");
|
|
}
|
|
static setString(text) {
|
|
var success = false;
|
|
var body = document.body;
|
|
if (body) {
|
|
var node = document.createElement("span");
|
|
node.textContent = text;
|
|
node.style.opacity = "0";
|
|
node.style.position = "absolute";
|
|
node.style.whiteSpace = "pre-wrap";
|
|
node.style.userSelect = "auto";
|
|
body.appendChild(node);
|
|
var selection = window.getSelection();
|
|
selection.removeAllRanges();
|
|
var range = document.createRange();
|
|
range.selectNodeContents(node);
|
|
selection.addRange(range);
|
|
try {
|
|
document.execCommand("copy");
|
|
success = true;
|
|
} catch (e) {
|
|
}
|
|
selection.removeAllRanges();
|
|
body.removeChild(node);
|
|
}
|
|
return success;
|
|
}
|
|
};
|
|
exports2.default = Clipboard;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/I18nManager/index.js
|
|
var require_I18nManager = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/I18nManager/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var I18nManager = {
|
|
allowRTL() {
|
|
return;
|
|
},
|
|
forceRTL() {
|
|
return;
|
|
},
|
|
getConstants() {
|
|
return {
|
|
isRTL: false
|
|
};
|
|
}
|
|
};
|
|
var _default = exports2.default = I18nManager;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Keyboard/index.js
|
|
var require_Keyboard = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Keyboard/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _dismissKeyboard = _interopRequireDefault(require_dismissKeyboard());
|
|
var Keyboard2 = {
|
|
isVisible() {
|
|
return false;
|
|
},
|
|
addListener() {
|
|
return {
|
|
remove: /* @__PURE__ */ __name(() => {
|
|
}, "remove")
|
|
};
|
|
},
|
|
dismiss() {
|
|
(0, _dismissKeyboard.default)();
|
|
},
|
|
removeAllListeners() {
|
|
},
|
|
removeListener() {
|
|
}
|
|
};
|
|
var _default = exports2.default = Keyboard2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/LayoutAnimation/index.js
|
|
var require_LayoutAnimation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/LayoutAnimation/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var __DEV__ = process.env.NODE_ENV !== "production";
|
|
function configureNext(config, onAnimationDidEnd) {
|
|
if (!_Platform.default.isTesting) {
|
|
_UIManager.default.configureNextLayoutAnimation(
|
|
config,
|
|
onAnimationDidEnd !== null && onAnimationDidEnd !== void 0 ? onAnimationDidEnd : function() {
|
|
},
|
|
function() {
|
|
}
|
|
/* unused onError */
|
|
);
|
|
}
|
|
}
|
|
__name(configureNext, "configureNext");
|
|
function create(duration, type, property) {
|
|
return {
|
|
duration,
|
|
create: {
|
|
type,
|
|
property
|
|
},
|
|
update: {
|
|
type
|
|
},
|
|
delete: {
|
|
type,
|
|
property
|
|
}
|
|
};
|
|
}
|
|
__name(create, "create");
|
|
var Presets = {
|
|
easeInEaseOut: create(300, "easeInEaseOut", "opacity"),
|
|
linear: create(500, "linear", "opacity"),
|
|
spring: {
|
|
duration: 700,
|
|
create: {
|
|
type: "linear",
|
|
property: "opacity"
|
|
},
|
|
update: {
|
|
type: "spring",
|
|
springDamping: 0.4
|
|
},
|
|
delete: {
|
|
type: "linear",
|
|
property: "opacity"
|
|
}
|
|
}
|
|
};
|
|
var LayoutAnimation = {
|
|
/**
|
|
* Schedules an animation to happen on the next layout.
|
|
*
|
|
* @param config Specifies animation properties:
|
|
*
|
|
* - `duration` in milliseconds
|
|
* - `create`, `AnimationConfig` for animating in new views
|
|
* - `update`, `AnimationConfig` for animating views that have been updated
|
|
*
|
|
* @param onAnimationDidEnd Called when the animation finished.
|
|
* Only supported on iOS.
|
|
* @param onError Called on error. Only supported on iOS.
|
|
*/
|
|
configureNext,
|
|
/**
|
|
* Helper for creating a config for `configureNext`.
|
|
*/
|
|
create,
|
|
Types: Object.freeze({
|
|
spring: "spring",
|
|
linear: "linear",
|
|
easeInEaseOut: "easeInEaseOut",
|
|
easeIn: "easeIn",
|
|
easeOut: "easeOut",
|
|
keyboard: "keyboard"
|
|
}),
|
|
Properties: Object.freeze({
|
|
opacity: "opacity",
|
|
scaleX: "scaleX",
|
|
scaleY: "scaleY",
|
|
scaleXY: "scaleXY"
|
|
}),
|
|
checkConfig() {
|
|
console.error("LayoutAnimation.checkConfig(...) has been disabled.");
|
|
},
|
|
Presets,
|
|
easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut),
|
|
linear: configureNext.bind(null, Presets.linear),
|
|
spring: configureNext.bind(null, Presets.spring)
|
|
};
|
|
var _default = exports2.default = LayoutAnimation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/LayoutAnimation/index.js
|
|
var require_LayoutAnimation2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/LayoutAnimation/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _LayoutAnimation = _interopRequireDefault(require_LayoutAnimation());
|
|
var _default = exports2.default = _LayoutAnimation.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Linking/index.js
|
|
var require_Linking = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Linking/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var initialURL = _canUseDom.default ? window.location.href : "";
|
|
var Linking2 = class {
|
|
static {
|
|
__name(this, "Linking");
|
|
}
|
|
constructor() {
|
|
this._eventCallbacks = {};
|
|
}
|
|
/**
|
|
* An object mapping of event name
|
|
* and all the callbacks subscribing to it
|
|
*/
|
|
_dispatchEvent(event) {
|
|
for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
data[_key - 1] = arguments[_key];
|
|
}
|
|
var listeners = this._eventCallbacks[event];
|
|
if (listeners != null && Array.isArray(listeners)) {
|
|
listeners.map((listener) => {
|
|
listener(...data);
|
|
});
|
|
}
|
|
}
|
|
/**
|
|
* Adds a event listener for the specified event. The callback will be called when the
|
|
* said event is dispatched.
|
|
*/
|
|
addEventListener(eventType, callback) {
|
|
var _this = this;
|
|
if (!_this._eventCallbacks[eventType]) {
|
|
_this._eventCallbacks[eventType] = [callback];
|
|
}
|
|
_this._eventCallbacks[eventType].push(callback);
|
|
return {
|
|
remove() {
|
|
var callbacks = _this._eventCallbacks[eventType];
|
|
var filteredCallbacks = callbacks.filter((c) => c.toString() !== callback.toString());
|
|
_this._eventCallbacks[eventType] = filteredCallbacks;
|
|
}
|
|
};
|
|
}
|
|
/**
|
|
* Removes a previously added event listener for the specified event. The callback must
|
|
* be the same object as the one passed to `addEventListener`.
|
|
*/
|
|
removeEventListener(eventType, callback) {
|
|
console.error("Linking.removeEventListener('" + eventType + "', ...): Method has been deprecated. Please instead use `remove()` on the subscription returned by `Linking.addEventListener`.");
|
|
var callbacks = this._eventCallbacks[eventType];
|
|
var filteredCallbacks = callbacks.filter((c) => c.toString() !== callback.toString());
|
|
this._eventCallbacks[eventType] = filteredCallbacks;
|
|
}
|
|
canOpenURL() {
|
|
return Promise.resolve(true);
|
|
}
|
|
getInitialURL() {
|
|
return Promise.resolve(initialURL);
|
|
}
|
|
/**
|
|
* Try to open the given url in a secure fashion. The method returns a Promise object.
|
|
* If a target is passed (including undefined) that target will be used, otherwise '_blank'.
|
|
* If the url opens, the promise is resolved. If not, the promise is rejected.
|
|
* Dispatches the `onOpen` event if `url` is opened successfully.
|
|
*/
|
|
openURL(url, target) {
|
|
if (arguments.length === 1) {
|
|
target = "_blank";
|
|
}
|
|
try {
|
|
open(url, target);
|
|
this._dispatchEvent("onOpen", url);
|
|
return Promise.resolve();
|
|
} catch (e) {
|
|
return Promise.reject(e);
|
|
}
|
|
}
|
|
_validateURL(url) {
|
|
(0, _invariant.default)(typeof url === "string", "Invalid URL: should be a string. Was: " + url);
|
|
(0, _invariant.default)(url, "Invalid URL: cannot be empty");
|
|
}
|
|
};
|
|
var open = /* @__PURE__ */ __name((url, target) => {
|
|
if (_canUseDom.default) {
|
|
var urlToOpen = new URL(url, window.location).toString();
|
|
if (urlToOpen.indexOf("tel:") === 0) {
|
|
window.location = urlToOpen;
|
|
} else {
|
|
window.open(urlToOpen, target, "noopener");
|
|
}
|
|
}
|
|
}, "open");
|
|
var _default = exports2.default = new Linking2();
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/NativeEventEmitter/index.js
|
|
var require_NativeEventEmitter2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/NativeEventEmitter/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _NativeEventEmitter = _interopRequireDefault(require_NativeEventEmitter());
|
|
var _default = exports2.default = _NativeEventEmitter.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/TouchHistoryMath/index.js
|
|
var require_TouchHistoryMath = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/TouchHistoryMath/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var TouchHistoryMath = {
|
|
/**
|
|
* This code is optimized and not intended to look beautiful. This allows
|
|
* computing of touch centroids that have moved after `touchesChangedAfter`
|
|
* timeStamp. You can compute the current centroid involving all touches
|
|
* moves after `touchesChangedAfter`, or you can compute the previous
|
|
* centroid of all touches that were moved after `touchesChangedAfter`.
|
|
*
|
|
* @param {TouchHistoryMath} touchHistory Standard Responder touch track
|
|
* data.
|
|
* @param {number} touchesChangedAfter timeStamp after which moved touches
|
|
* are considered "actively moving" - not just "active".
|
|
* @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.
|
|
* @param {boolean} ofCurrent Compute current centroid for actively moving
|
|
* touches vs. previous centroid of now actively moving touches.
|
|
* @return {number} value of centroid in specified dimension.
|
|
*/
|
|
centroidDimension: /* @__PURE__ */ __name(function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {
|
|
var touchBank = touchHistory.touchBank;
|
|
var total = 0;
|
|
var count4 = 0;
|
|
var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;
|
|
if (oneTouchData !== null) {
|
|
if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
|
|
total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
|
|
count4 = 1;
|
|
}
|
|
} else {
|
|
for (var i = 0; i < touchBank.length; i++) {
|
|
var touchTrack = touchBank[i];
|
|
if (touchTrack !== null && touchTrack !== void 0 && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {
|
|
var toAdd = void 0;
|
|
if (ofCurrent && isXAxis) {
|
|
toAdd = touchTrack.currentPageX;
|
|
} else if (ofCurrent && !isXAxis) {
|
|
toAdd = touchTrack.currentPageY;
|
|
} else if (!ofCurrent && isXAxis) {
|
|
toAdd = touchTrack.previousPageX;
|
|
} else {
|
|
toAdd = touchTrack.previousPageY;
|
|
}
|
|
total += toAdd;
|
|
count4++;
|
|
}
|
|
}
|
|
}
|
|
return count4 > 0 ? total / count4 : TouchHistoryMath.noCentroid;
|
|
}, "centroidDimension"),
|
|
currentCentroidXOfTouchesChangedAfter: /* @__PURE__ */ __name(function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
|
|
return TouchHistoryMath.centroidDimension(
|
|
touchHistory,
|
|
touchesChangedAfter,
|
|
true,
|
|
// isXAxis
|
|
true
|
|
// ofCurrent
|
|
);
|
|
}, "currentCentroidXOfTouchesChangedAfter"),
|
|
currentCentroidYOfTouchesChangedAfter: /* @__PURE__ */ __name(function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
|
|
return TouchHistoryMath.centroidDimension(
|
|
touchHistory,
|
|
touchesChangedAfter,
|
|
false,
|
|
// isXAxis
|
|
true
|
|
// ofCurrent
|
|
);
|
|
}, "currentCentroidYOfTouchesChangedAfter"),
|
|
previousCentroidXOfTouchesChangedAfter: /* @__PURE__ */ __name(function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
|
|
return TouchHistoryMath.centroidDimension(
|
|
touchHistory,
|
|
touchesChangedAfter,
|
|
true,
|
|
// isXAxis
|
|
false
|
|
// ofCurrent
|
|
);
|
|
}, "previousCentroidXOfTouchesChangedAfter"),
|
|
previousCentroidYOfTouchesChangedAfter: /* @__PURE__ */ __name(function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
|
|
return TouchHistoryMath.centroidDimension(
|
|
touchHistory,
|
|
touchesChangedAfter,
|
|
false,
|
|
// isXAxis
|
|
false
|
|
// ofCurrent
|
|
);
|
|
}, "previousCentroidYOfTouchesChangedAfter"),
|
|
currentCentroidX: /* @__PURE__ */ __name(function currentCentroidX(touchHistory) {
|
|
return TouchHistoryMath.centroidDimension(
|
|
touchHistory,
|
|
0,
|
|
// touchesChangedAfter
|
|
true,
|
|
// isXAxis
|
|
true
|
|
// ofCurrent
|
|
);
|
|
}, "currentCentroidX"),
|
|
currentCentroidY: /* @__PURE__ */ __name(function currentCentroidY(touchHistory) {
|
|
return TouchHistoryMath.centroidDimension(
|
|
touchHistory,
|
|
0,
|
|
// touchesChangedAfter
|
|
false,
|
|
// isXAxis
|
|
true
|
|
// ofCurrent
|
|
);
|
|
}, "currentCentroidY"),
|
|
noCentroid: -1
|
|
};
|
|
var _default = exports2.default = TouchHistoryMath;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/PanResponder/index.js
|
|
var require_PanResponder = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/PanResponder/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _InteractionManager = _interopRequireDefault(require_InteractionManager());
|
|
var _TouchHistoryMath = _interopRequireDefault(require_TouchHistoryMath());
|
|
var currentCentroidXOfTouchesChangedAfter = _TouchHistoryMath.default.currentCentroidXOfTouchesChangedAfter;
|
|
var currentCentroidYOfTouchesChangedAfter = _TouchHistoryMath.default.currentCentroidYOfTouchesChangedAfter;
|
|
var previousCentroidXOfTouchesChangedAfter = _TouchHistoryMath.default.previousCentroidXOfTouchesChangedAfter;
|
|
var previousCentroidYOfTouchesChangedAfter = _TouchHistoryMath.default.previousCentroidYOfTouchesChangedAfter;
|
|
var currentCentroidX = _TouchHistoryMath.default.currentCentroidX;
|
|
var currentCentroidY = _TouchHistoryMath.default.currentCentroidY;
|
|
var PanResponder2 = {
|
|
/**
|
|
*
|
|
* A graphical explanation of the touch data flow:
|
|
*
|
|
* +----------------------------+ +--------------------------------+
|
|
* | ResponderTouchHistoryStore | |TouchHistoryMath |
|
|
* +----------------------------+ +----------+---------------------+
|
|
* |Global store of touchHistory| |Allocation-less math util |
|
|
* |including activeness, start | |on touch history (centroids |
|
|
* |position, prev/cur position.| |and multitouch movement etc) |
|
|
* | | | |
|
|
* +----^-----------------------+ +----^---------------------------+
|
|
* | |
|
|
* | (records relevant history |
|
|
* | of touches relevant for |
|
|
* | implementing higher level |
|
|
* | gestures) |
|
|
* | |
|
|
* +----+-----------------------+ +----|---------------------------+
|
|
* | ResponderEventPlugin | | | Your App/Component |
|
|
* +----------------------------+ +----|---------------------------+
|
|
* |Negotiates which view gets | Low level | | High level |
|
|
* |onResponderMove events. | events w/ | +-+-------+ events w/ |
|
|
* |Also records history into | touchHistory| | Pan | multitouch + |
|
|
* |ResponderTouchHistoryStore. +---------------->Responder+-----> accumulative|
|
|
* +----------------------------+ attached to | | | distance and |
|
|
* each event | +---------+ velocity. |
|
|
* | |
|
|
* | |
|
|
* +--------------------------------+
|
|
*
|
|
*
|
|
*
|
|
* Gesture that calculates cumulative movement over time in a way that just
|
|
* "does the right thing" for multiple touches. The "right thing" is very
|
|
* nuanced. When moving two touches in opposite directions, the cumulative
|
|
* distance is zero in each dimension. When two touches move in parallel five
|
|
* pixels in the same direction, the cumulative distance is five, not ten. If
|
|
* two touches start, one moves five in a direction, then stops and the other
|
|
* touch moves fives in the same direction, the cumulative distance is ten.
|
|
*
|
|
* This logic requires a kind of processing of time "clusters" of touch events
|
|
* so that two touch moves that essentially occur in parallel but move every
|
|
* other frame respectively, are considered part of the same movement.
|
|
*
|
|
* Explanation of some of the non-obvious fields:
|
|
*
|
|
* - moveX/moveY: If no move event has been observed, then `(moveX, moveY)` is
|
|
* invalid. If a move event has been observed, `(moveX, moveY)` is the
|
|
* centroid of the most recently moved "cluster" of active touches.
|
|
* (Currently all move have the same timeStamp, but later we should add some
|
|
* threshold for what is considered to be "moving"). If a palm is
|
|
* accidentally counted as a touch, but a finger is moving greatly, the palm
|
|
* will move slightly, but we only want to count the single moving touch.
|
|
* - x0/y0: Centroid location (non-cumulative) at the time of becoming
|
|
* responder.
|
|
* - dx/dy: Cumulative touch distance - not the same thing as sum of each touch
|
|
* distance. Accounts for touch moves that are clustered together in time,
|
|
* moving the same direction. Only valid when currently responder (otherwise,
|
|
* it only represents the drag distance below the threshold).
|
|
* - vx/vy: Velocity.
|
|
*/
|
|
_initializeGestureState(gestureState) {
|
|
gestureState.moveX = 0;
|
|
gestureState.moveY = 0;
|
|
gestureState.x0 = 0;
|
|
gestureState.y0 = 0;
|
|
gestureState.dx = 0;
|
|
gestureState.dy = 0;
|
|
gestureState.vx = 0;
|
|
gestureState.vy = 0;
|
|
gestureState.numberActiveTouches = 0;
|
|
gestureState._accountsForMovesUpTo = 0;
|
|
},
|
|
/**
|
|
* This is nuanced and is necessary. It is incorrect to continuously take all
|
|
* active *and* recently moved touches, find the centroid, and track how that
|
|
* result changes over time. Instead, we must take all recently moved
|
|
* touches, and calculate how the centroid has changed just for those
|
|
* recently moved touches, and append that change to an accumulator. This is
|
|
* to (at least) handle the case where the user is moving three fingers, and
|
|
* then one of the fingers stops but the other two continue.
|
|
*
|
|
* This is very different than taking all of the recently moved touches and
|
|
* storing their centroid as `dx/dy`. For correctness, we must *accumulate
|
|
* changes* in the centroid of recently moved touches.
|
|
*
|
|
* There is also some nuance with how we handle multiple moved touches in a
|
|
* single event. With the way `ReactNativeEventEmitter` dispatches touches as
|
|
* individual events, multiple touches generate two 'move' events, each of
|
|
* them triggering `onResponderMove`. But with the way `PanResponder` works,
|
|
* all of the gesture inference is performed on the first dispatch, since it
|
|
* looks at all of the touches (even the ones for which there hasn't been a
|
|
* native dispatch yet). Therefore, `PanResponder` does not call
|
|
* `onResponderMove` passed the first dispatch. This diverges from the
|
|
* typical responder callback pattern (without using `PanResponder`), but
|
|
* avoids more dispatches than necessary.
|
|
*/
|
|
_updateGestureStateOnMove(gestureState, touchHistory) {
|
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
gestureState.moveX = currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);
|
|
gestureState.moveY = currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);
|
|
var movedAfter = gestureState._accountsForMovesUpTo;
|
|
var prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);
|
|
var x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);
|
|
var prevY = previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);
|
|
var y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);
|
|
var nextDX = gestureState.dx + (x - prevX);
|
|
var nextDY = gestureState.dy + (y - prevY);
|
|
var dt = touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;
|
|
gestureState.vx = (nextDX - gestureState.dx) / dt;
|
|
gestureState.vy = (nextDY - gestureState.dy) / dt;
|
|
gestureState.dx = nextDX;
|
|
gestureState.dy = nextDY;
|
|
gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp;
|
|
},
|
|
/**
|
|
* @param {object} config Enhanced versions of all of the responder callbacks
|
|
* that provide not only the typical `ResponderSyntheticEvent`, but also the
|
|
* `PanResponder` gesture state. Simply replace the word `Responder` with
|
|
* `PanResponder` in each of the typical `onResponder*` callbacks. For
|
|
* example, the `config` object would look like:
|
|
*
|
|
* - `onMoveShouldSetPanResponder: (e, gestureState) => {...}`
|
|
* - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}`
|
|
* - `onStartShouldSetPanResponder: (e, gestureState) => {...}`
|
|
* - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}`
|
|
* - `onPanResponderReject: (e, gestureState) => {...}`
|
|
* - `onPanResponderGrant: (e, gestureState) => {...}`
|
|
* - `onPanResponderStart: (e, gestureState) => {...}`
|
|
* - `onPanResponderEnd: (e, gestureState) => {...}`
|
|
* - `onPanResponderRelease: (e, gestureState) => {...}`
|
|
* - `onPanResponderMove: (e, gestureState) => {...}`
|
|
* - `onPanResponderTerminate: (e, gestureState) => {...}`
|
|
* - `onPanResponderTerminationRequest: (e, gestureState) => {...}`
|
|
* - `onShouldBlockNativeResponder: (e, gestureState) => {...}`
|
|
*
|
|
* In general, for events that have capture equivalents, we update the
|
|
* gestureState once in the capture phase and can use it in the bubble phase
|
|
* as well.
|
|
*
|
|
* Be careful with onStartShould* callbacks. They only reflect updated
|
|
* `gestureState` for start/end events that bubble/capture to the Node.
|
|
* Once the node is the responder, you can rely on every start/end event
|
|
* being processed by the gesture and `gestureState` being updated
|
|
* accordingly. (numberActiveTouches) may not be totally accurate unless you
|
|
* are the responder.
|
|
*/
|
|
create(config) {
|
|
var interactionState = {
|
|
handle: null,
|
|
shouldCancelClick: false,
|
|
timeout: null
|
|
};
|
|
var gestureState = {
|
|
// Useful for debugging
|
|
stateID: Math.random(),
|
|
moveX: 0,
|
|
moveY: 0,
|
|
x0: 0,
|
|
y0: 0,
|
|
dx: 0,
|
|
dy: 0,
|
|
vx: 0,
|
|
vy: 0,
|
|
numberActiveTouches: 0,
|
|
_accountsForMovesUpTo: 0
|
|
};
|
|
var panHandlers = {
|
|
onStartShouldSetResponder(event) {
|
|
return config.onStartShouldSetPanResponder == null ? false : config.onStartShouldSetPanResponder(event, gestureState);
|
|
},
|
|
onMoveShouldSetResponder(event) {
|
|
return config.onMoveShouldSetPanResponder == null ? false : config.onMoveShouldSetPanResponder(event, gestureState);
|
|
},
|
|
onStartShouldSetResponderCapture(event) {
|
|
if (event.nativeEvent.touches.length === 1) {
|
|
PanResponder2._initializeGestureState(gestureState);
|
|
}
|
|
gestureState.numberActiveTouches = event.touchHistory.numberActiveTouches;
|
|
return config.onStartShouldSetPanResponderCapture != null ? config.onStartShouldSetPanResponderCapture(event, gestureState) : false;
|
|
},
|
|
onMoveShouldSetResponderCapture(event) {
|
|
var touchHistory = event.touchHistory;
|
|
if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {
|
|
return false;
|
|
}
|
|
PanResponder2._updateGestureStateOnMove(gestureState, touchHistory);
|
|
return config.onMoveShouldSetPanResponderCapture ? config.onMoveShouldSetPanResponderCapture(event, gestureState) : false;
|
|
},
|
|
onResponderGrant(event) {
|
|
if (!interactionState.handle) {
|
|
interactionState.handle = _InteractionManager.default.createInteractionHandle();
|
|
}
|
|
if (interactionState.timeout) {
|
|
clearInteractionTimeout(interactionState);
|
|
}
|
|
interactionState.shouldCancelClick = true;
|
|
gestureState.x0 = currentCentroidX(event.touchHistory);
|
|
gestureState.y0 = currentCentroidY(event.touchHistory);
|
|
gestureState.dx = 0;
|
|
gestureState.dy = 0;
|
|
if (config.onPanResponderGrant) {
|
|
config.onPanResponderGrant(event, gestureState);
|
|
}
|
|
return config.onShouldBlockNativeResponder == null ? true : config.onShouldBlockNativeResponder(event, gestureState);
|
|
},
|
|
onResponderReject(event) {
|
|
clearInteractionHandle(interactionState, config.onPanResponderReject, event, gestureState);
|
|
},
|
|
onResponderRelease(event) {
|
|
clearInteractionHandle(interactionState, config.onPanResponderRelease, event, gestureState);
|
|
setInteractionTimeout(interactionState);
|
|
PanResponder2._initializeGestureState(gestureState);
|
|
},
|
|
onResponderStart(event) {
|
|
var touchHistory = event.touchHistory;
|
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
if (config.onPanResponderStart) {
|
|
config.onPanResponderStart(event, gestureState);
|
|
}
|
|
},
|
|
onResponderMove(event) {
|
|
var touchHistory = event.touchHistory;
|
|
if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {
|
|
return;
|
|
}
|
|
PanResponder2._updateGestureStateOnMove(gestureState, touchHistory);
|
|
if (config.onPanResponderMove) {
|
|
config.onPanResponderMove(event, gestureState);
|
|
}
|
|
},
|
|
onResponderEnd(event) {
|
|
var touchHistory = event.touchHistory;
|
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
clearInteractionHandle(interactionState, config.onPanResponderEnd, event, gestureState);
|
|
},
|
|
onResponderTerminate(event) {
|
|
clearInteractionHandle(interactionState, config.onPanResponderTerminate, event, gestureState);
|
|
setInteractionTimeout(interactionState);
|
|
PanResponder2._initializeGestureState(gestureState);
|
|
},
|
|
onResponderTerminationRequest(event) {
|
|
return config.onPanResponderTerminationRequest == null ? true : config.onPanResponderTerminationRequest(event, gestureState);
|
|
},
|
|
// We do not want to trigger 'click' activated gestures or native behaviors
|
|
// on any pan target that is under a mouse cursor when it is released.
|
|
// Browsers will natively cancel 'click' events on a target if a non-mouse
|
|
// active pointer moves.
|
|
onClickCapture: /* @__PURE__ */ __name((event) => {
|
|
if (interactionState.shouldCancelClick === true) {
|
|
event.stopPropagation();
|
|
event.preventDefault();
|
|
}
|
|
}, "onClickCapture")
|
|
};
|
|
return {
|
|
panHandlers,
|
|
getInteractionHandle() {
|
|
return interactionState.handle;
|
|
}
|
|
};
|
|
}
|
|
};
|
|
function clearInteractionHandle(interactionState, callback, event, gestureState) {
|
|
if (interactionState.handle) {
|
|
_InteractionManager.default.clearInteractionHandle(interactionState.handle);
|
|
interactionState.handle = null;
|
|
}
|
|
if (callback) {
|
|
callback(event, gestureState);
|
|
}
|
|
}
|
|
__name(clearInteractionHandle, "clearInteractionHandle");
|
|
function clearInteractionTimeout(interactionState) {
|
|
clearTimeout(interactionState.timeout);
|
|
}
|
|
__name(clearInteractionTimeout, "clearInteractionTimeout");
|
|
function setInteractionTimeout(interactionState) {
|
|
interactionState.timeout = setTimeout(() => {
|
|
interactionState.shouldCancelClick = false;
|
|
}, 250);
|
|
}
|
|
__name(setInteractionTimeout, "setInteractionTimeout");
|
|
var _default = exports2.default = PanResponder2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/PanResponder/index.js
|
|
var require_PanResponder2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/PanResponder/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _PanResponder = _interopRequireDefault(require_PanResponder());
|
|
var _default = exports2.default = _PanResponder.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Share/index.js
|
|
var require_Share = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Share/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var Share = class {
|
|
static {
|
|
__name(this, "Share");
|
|
}
|
|
static share(content, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
(0, _invariant.default)(typeof content === "object" && content !== null, "Content to share must be a valid object");
|
|
(0, _invariant.default)(typeof content.url === "string" || typeof content.message === "string", "At least one of URL and message is required");
|
|
(0, _invariant.default)(typeof options === "object" && options !== null, "Options must be a valid object");
|
|
(0, _invariant.default)(!content.title || typeof content.title === "string", "Invalid title: title should be a string.");
|
|
if (window.navigator.share !== void 0) {
|
|
return window.navigator.share({
|
|
title: content.title,
|
|
text: content.message,
|
|
url: content.url
|
|
});
|
|
} else {
|
|
return Promise.reject(new Error("Share is not supported in this browser"));
|
|
}
|
|
}
|
|
/**
|
|
* The content was successfully shared.
|
|
*/
|
|
static get sharedAction() {
|
|
return "sharedAction";
|
|
}
|
|
/**
|
|
* The dialog has been dismissed.
|
|
* @platform ios
|
|
*/
|
|
static get dismissedAction() {
|
|
return "dismissedAction";
|
|
}
|
|
};
|
|
var _default = exports2.default = Share;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Vibration/index.js
|
|
var require_Vibration = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Vibration/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var vibrate = /* @__PURE__ */ __name((pattern) => {
|
|
if ("vibrate" in window.navigator) {
|
|
window.navigator.vibrate(pattern);
|
|
}
|
|
}, "vibrate");
|
|
var Vibration = {
|
|
cancel() {
|
|
vibrate(0);
|
|
},
|
|
vibrate(pattern) {
|
|
if (pattern === void 0) {
|
|
pattern = 400;
|
|
}
|
|
vibrate(pattern);
|
|
}
|
|
};
|
|
var _default = exports2.default = Vibration;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/ActivityIndicator/index.js
|
|
var require_ActivityIndicator = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/ActivityIndicator/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["animating", "color", "hidesWhenStopped", "size", "style"];
|
|
var createSvgCircle = /* @__PURE__ */ __name((style) => /* @__PURE__ */ React83.createElement("circle", {
|
|
cx: "16",
|
|
cy: "16",
|
|
fill: "none",
|
|
r: "14",
|
|
strokeWidth: "4",
|
|
style
|
|
}), "createSvgCircle");
|
|
var ActivityIndicator2 = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var _props$animating = props.animating, animating = _props$animating === void 0 ? true : _props$animating, _props$color = props.color, color = _props$color === void 0 ? "#1976D2" : _props$color, _props$hidesWhenStopp = props.hidesWhenStopped, hidesWhenStopped = _props$hidesWhenStopp === void 0 ? true : _props$hidesWhenStopp, _props$size = props.size, size4 = _props$size === void 0 ? "small" : _props$size, style = props.style, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var svg = /* @__PURE__ */ React83.createElement("svg", {
|
|
height: "100%",
|
|
viewBox: "0 0 32 32",
|
|
width: "100%"
|
|
}, createSvgCircle({
|
|
stroke: color,
|
|
opacity: 0.2
|
|
}), createSvgCircle({
|
|
stroke: color,
|
|
strokeDasharray: 80,
|
|
strokeDashoffset: 60
|
|
}));
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, other, {
|
|
"aria-valuemax": 1,
|
|
"aria-valuemin": 0,
|
|
ref: forwardedRef,
|
|
role: "progressbar",
|
|
style: [styles.container, style]
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
children: svg,
|
|
style: [typeof size4 === "number" ? {
|
|
height: size4,
|
|
width: size4
|
|
} : indicatorSizes[size4], styles.animation, !animating && styles.animationPause, !animating && hidesWhenStopped && styles.hidesWhenStopped]
|
|
}));
|
|
});
|
|
ActivityIndicator2.displayName = "ActivityIndicator";
|
|
var styles = _StyleSheet.default.create({
|
|
container: {
|
|
alignItems: "center",
|
|
justifyContent: "center"
|
|
},
|
|
hidesWhenStopped: {
|
|
visibility: "hidden"
|
|
},
|
|
animation: {
|
|
animationDuration: "0.75s",
|
|
animationKeyframes: [{
|
|
"0%": {
|
|
transform: "rotate(0deg)"
|
|
},
|
|
"100%": {
|
|
transform: "rotate(360deg)"
|
|
}
|
|
}],
|
|
animationTimingFunction: "linear",
|
|
animationIterationCount: "infinite"
|
|
},
|
|
animationPause: {
|
|
animationPlayState: "paused"
|
|
}
|
|
});
|
|
var indicatorSizes = _StyleSheet.default.create({
|
|
small: {
|
|
width: 20,
|
|
height: 20
|
|
},
|
|
large: {
|
|
width: 36,
|
|
height: 36
|
|
}
|
|
});
|
|
var _default = exports2.default = ActivityIndicator2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/usePressEvents/PressResponder.js
|
|
var require_PressResponder = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/usePressEvents/PressResponder.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var DELAY = "DELAY";
|
|
var ERROR = "ERROR";
|
|
var LONG_PRESS_DETECTED = "LONG_PRESS_DETECTED";
|
|
var NOT_RESPONDER = "NOT_RESPONDER";
|
|
var RESPONDER_ACTIVE_LONG_PRESS_START = "RESPONDER_ACTIVE_LONG_PRESS_START";
|
|
var RESPONDER_ACTIVE_PRESS_START = "RESPONDER_ACTIVE_PRESS_START";
|
|
var RESPONDER_INACTIVE_PRESS_START = "RESPONDER_INACTIVE_PRESS_START";
|
|
var RESPONDER_GRANT = "RESPONDER_GRANT";
|
|
var RESPONDER_RELEASE = "RESPONDER_RELEASE";
|
|
var RESPONDER_TERMINATED = "RESPONDER_TERMINATED";
|
|
var Transitions = Object.freeze({
|
|
NOT_RESPONDER: {
|
|
DELAY: ERROR,
|
|
RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,
|
|
RESPONDER_RELEASE: ERROR,
|
|
RESPONDER_TERMINATED: ERROR,
|
|
LONG_PRESS_DETECTED: ERROR
|
|
},
|
|
RESPONDER_INACTIVE_PRESS_START: {
|
|
DELAY: RESPONDER_ACTIVE_PRESS_START,
|
|
RESPONDER_GRANT: ERROR,
|
|
RESPONDER_RELEASE: NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: NOT_RESPONDER,
|
|
LONG_PRESS_DETECTED: ERROR
|
|
},
|
|
RESPONDER_ACTIVE_PRESS_START: {
|
|
DELAY: ERROR,
|
|
RESPONDER_GRANT: ERROR,
|
|
RESPONDER_RELEASE: NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: NOT_RESPONDER,
|
|
LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START
|
|
},
|
|
RESPONDER_ACTIVE_LONG_PRESS_START: {
|
|
DELAY: ERROR,
|
|
RESPONDER_GRANT: ERROR,
|
|
RESPONDER_RELEASE: NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: NOT_RESPONDER,
|
|
LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START
|
|
},
|
|
ERROR: {
|
|
DELAY: NOT_RESPONDER,
|
|
RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,
|
|
RESPONDER_RELEASE: NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: NOT_RESPONDER,
|
|
LONG_PRESS_DETECTED: NOT_RESPONDER
|
|
}
|
|
});
|
|
var getElementRole = /* @__PURE__ */ __name((element) => element.getAttribute("role"), "getElementRole");
|
|
var getElementType = /* @__PURE__ */ __name((element) => element.tagName.toLowerCase(), "getElementType");
|
|
var isActiveSignal = /* @__PURE__ */ __name((signal) => signal === RESPONDER_ACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_LONG_PRESS_START, "isActiveSignal");
|
|
var isButtonRole = /* @__PURE__ */ __name((element) => getElementRole(element) === "button", "isButtonRole");
|
|
var isPressStartSignal = /* @__PURE__ */ __name((signal) => signal === RESPONDER_INACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_LONG_PRESS_START, "isPressStartSignal");
|
|
var isTerminalSignal = /* @__PURE__ */ __name((signal) => signal === RESPONDER_TERMINATED || signal === RESPONDER_RELEASE, "isTerminalSignal");
|
|
var isValidKeyPress = /* @__PURE__ */ __name((event) => {
|
|
var key = event.key, target = event.target;
|
|
var isSpacebar = key === " " || key === "Spacebar";
|
|
var isButtonish = getElementType(target) === "button" || isButtonRole(target);
|
|
return key === "Enter" || isSpacebar && isButtonish;
|
|
}, "isValidKeyPress");
|
|
var DEFAULT_LONG_PRESS_DELAY_MS = 450;
|
|
var DEFAULT_PRESS_DELAY_MS = 50;
|
|
var PressResponder = class {
|
|
static {
|
|
__name(this, "PressResponder");
|
|
}
|
|
constructor(config) {
|
|
this._eventHandlers = null;
|
|
this._isPointerTouch = false;
|
|
this._longPressDelayTimeout = null;
|
|
this._longPressDispatched = false;
|
|
this._pressDelayTimeout = null;
|
|
this._pressOutDelayTimeout = null;
|
|
this._touchState = NOT_RESPONDER;
|
|
this._responderElement = null;
|
|
this.configure(config);
|
|
}
|
|
configure(config) {
|
|
this._config = config;
|
|
}
|
|
/**
|
|
* Resets any pending timers. This should be called on unmount.
|
|
*/
|
|
reset() {
|
|
this._cancelLongPressDelayTimeout();
|
|
this._cancelPressDelayTimeout();
|
|
this._cancelPressOutDelayTimeout();
|
|
}
|
|
/**
|
|
* Returns a set of props to spread into the interactive element.
|
|
*/
|
|
getEventHandlers() {
|
|
if (this._eventHandlers == null) {
|
|
this._eventHandlers = this._createEventHandlers();
|
|
}
|
|
return this._eventHandlers;
|
|
}
|
|
_createEventHandlers() {
|
|
var start = /* @__PURE__ */ __name((event, shouldDelay) => {
|
|
event.persist();
|
|
this._cancelPressOutDelayTimeout();
|
|
this._longPressDispatched = false;
|
|
this._selectionTerminated = false;
|
|
this._touchState = NOT_RESPONDER;
|
|
this._isPointerTouch = event.nativeEvent.type === "touchstart";
|
|
this._receiveSignal(RESPONDER_GRANT, event);
|
|
var delayPressStart = normalizeDelay(this._config.delayPressStart, 0, DEFAULT_PRESS_DELAY_MS);
|
|
if (shouldDelay !== false && delayPressStart > 0) {
|
|
this._pressDelayTimeout = setTimeout(() => {
|
|
this._receiveSignal(DELAY, event);
|
|
}, delayPressStart);
|
|
} else {
|
|
this._receiveSignal(DELAY, event);
|
|
}
|
|
var delayLongPress = normalizeDelay(this._config.delayLongPress, 10, DEFAULT_LONG_PRESS_DELAY_MS);
|
|
this._longPressDelayTimeout = setTimeout(() => {
|
|
this._handleLongPress(event);
|
|
}, delayLongPress + delayPressStart);
|
|
}, "start");
|
|
var end = /* @__PURE__ */ __name((event) => {
|
|
this._receiveSignal(RESPONDER_RELEASE, event);
|
|
}, "end");
|
|
var keyupHandler = /* @__PURE__ */ __name((event) => {
|
|
var onPress = this._config.onPress;
|
|
var target = event.target;
|
|
if (this._touchState !== NOT_RESPONDER && isValidKeyPress(event)) {
|
|
end(event);
|
|
document.removeEventListener("keyup", keyupHandler);
|
|
var role = target.getAttribute("role");
|
|
var elementType = getElementType(target);
|
|
var isNativeInteractiveElement = role === "link" || elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea";
|
|
var isActiveElement = this._responderElement === target;
|
|
if (onPress != null && !isNativeInteractiveElement && isActiveElement) {
|
|
onPress(event);
|
|
}
|
|
this._responderElement = null;
|
|
}
|
|
}, "keyupHandler");
|
|
return {
|
|
onStartShouldSetResponder: /* @__PURE__ */ __name((event) => {
|
|
var disabled = this._config.disabled;
|
|
if (disabled && isButtonRole(event.currentTarget)) {
|
|
event.stopPropagation();
|
|
}
|
|
if (disabled == null) {
|
|
return true;
|
|
}
|
|
return !disabled;
|
|
}, "onStartShouldSetResponder"),
|
|
onKeyDown: /* @__PURE__ */ __name((event) => {
|
|
var disabled = this._config.disabled;
|
|
var key = event.key, target = event.target;
|
|
if (!disabled && isValidKeyPress(event)) {
|
|
if (this._touchState === NOT_RESPONDER) {
|
|
start(event, false);
|
|
this._responderElement = target;
|
|
document.addEventListener("keyup", keyupHandler);
|
|
}
|
|
var isSpacebarKey = key === " " || key === "Spacebar";
|
|
var role = getElementRole(target);
|
|
var isButtonLikeRole = role === "button" || role === "menuitem";
|
|
if (isSpacebarKey && isButtonLikeRole && getElementType(target) !== "button") {
|
|
event.preventDefault();
|
|
}
|
|
event.stopPropagation();
|
|
}
|
|
}, "onKeyDown"),
|
|
onResponderGrant: /* @__PURE__ */ __name((event) => start(event), "onResponderGrant"),
|
|
onResponderMove: /* @__PURE__ */ __name((event) => {
|
|
if (this._config.onPressMove != null) {
|
|
this._config.onPressMove(event);
|
|
}
|
|
var touch = getTouchFromResponderEvent(event);
|
|
if (this._touchActivatePosition != null) {
|
|
var deltaX = this._touchActivatePosition.pageX - touch.pageX;
|
|
var deltaY = this._touchActivatePosition.pageY - touch.pageY;
|
|
if (Math.hypot(deltaX, deltaY) > 10) {
|
|
this._cancelLongPressDelayTimeout();
|
|
}
|
|
}
|
|
}, "onResponderMove"),
|
|
onResponderRelease: /* @__PURE__ */ __name((event) => end(event), "onResponderRelease"),
|
|
onResponderTerminate: /* @__PURE__ */ __name((event) => {
|
|
if (event.nativeEvent.type === "selectionchange") {
|
|
this._selectionTerminated = true;
|
|
}
|
|
this._receiveSignal(RESPONDER_TERMINATED, event);
|
|
}, "onResponderTerminate"),
|
|
onResponderTerminationRequest: /* @__PURE__ */ __name((event) => {
|
|
var _this$_config = this._config, cancelable = _this$_config.cancelable, disabled = _this$_config.disabled, onLongPress = _this$_config.onLongPress;
|
|
if (!disabled && onLongPress != null && this._isPointerTouch && event.nativeEvent.type === "contextmenu") {
|
|
return false;
|
|
}
|
|
if (cancelable == null) {
|
|
return true;
|
|
}
|
|
return cancelable;
|
|
}, "onResponderTerminationRequest"),
|
|
// NOTE: this diverges from react-native in 3 significant ways:
|
|
// * The `onPress` callback is not connected to the responder system (the native
|
|
// `click` event must be used but is dispatched in many scenarios where no pointers
|
|
// are on the screen.) Therefore, it's possible for `onPress` to be called without
|
|
// `onPress{Start,End}` being called first.
|
|
// * The `onPress` callback is only be called on the first ancestor of the native
|
|
// `click` target that is using the PressResponder.
|
|
// * The event's `nativeEvent` is a `MouseEvent` not a `TouchEvent`.
|
|
onClick: /* @__PURE__ */ __name((event) => {
|
|
var _this$_config2 = this._config, disabled = _this$_config2.disabled, onPress = _this$_config2.onPress;
|
|
if (!disabled) {
|
|
event.stopPropagation();
|
|
if (this._longPressDispatched || this._selectionTerminated) {
|
|
event.preventDefault();
|
|
} else if (onPress != null && event.altKey === false) {
|
|
onPress(event);
|
|
}
|
|
} else {
|
|
if (isButtonRole(event.currentTarget)) {
|
|
event.stopPropagation();
|
|
}
|
|
}
|
|
}, "onClick"),
|
|
// If `onLongPress` is provided and a touch pointer is being used, prevent the
|
|
// default context menu from opening.
|
|
onContextMenu: /* @__PURE__ */ __name((event) => {
|
|
var _this$_config3 = this._config, disabled = _this$_config3.disabled, onLongPress = _this$_config3.onLongPress;
|
|
if (!disabled) {
|
|
if (onLongPress != null && this._isPointerTouch && !event.defaultPrevented) {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
}
|
|
} else {
|
|
if (isButtonRole(event.currentTarget)) {
|
|
event.stopPropagation();
|
|
}
|
|
}
|
|
}, "onContextMenu")
|
|
};
|
|
}
|
|
/**
|
|
* Receives a state machine signal, performs side effects of the transition
|
|
* and stores the new state. Validates the transition as well.
|
|
*/
|
|
_receiveSignal(signal, event) {
|
|
var prevState = this._touchState;
|
|
var nextState = null;
|
|
if (Transitions[prevState] != null) {
|
|
nextState = Transitions[prevState][signal];
|
|
}
|
|
if (this._touchState === NOT_RESPONDER && signal === RESPONDER_RELEASE) {
|
|
return;
|
|
}
|
|
if (nextState == null || nextState === ERROR) {
|
|
console.error("PressResponder: Invalid signal " + signal + " for state " + prevState + " on responder");
|
|
} else if (prevState !== nextState) {
|
|
this._performTransitionSideEffects(prevState, nextState, signal, event);
|
|
this._touchState = nextState;
|
|
}
|
|
}
|
|
/**
|
|
* Performs a transition between touchable states and identify any activations
|
|
* or deactivations (and callback invocations).
|
|
*/
|
|
_performTransitionSideEffects(prevState, nextState, signal, event) {
|
|
if (isTerminalSignal(signal)) {
|
|
setTimeout(() => {
|
|
this._isPointerTouch = false;
|
|
}, 0);
|
|
this._touchActivatePosition = null;
|
|
this._cancelLongPressDelayTimeout();
|
|
}
|
|
if (isPressStartSignal(prevState) && signal === LONG_PRESS_DETECTED) {
|
|
var onLongPress = this._config.onLongPress;
|
|
if (onLongPress != null && event.nativeEvent.key == null) {
|
|
onLongPress(event);
|
|
this._longPressDispatched = true;
|
|
}
|
|
}
|
|
var isPrevActive = isActiveSignal(prevState);
|
|
var isNextActive = isActiveSignal(nextState);
|
|
if (!isPrevActive && isNextActive) {
|
|
this._activate(event);
|
|
} else if (isPrevActive && !isNextActive) {
|
|
this._deactivate(event);
|
|
}
|
|
if (isPressStartSignal(prevState) && signal === RESPONDER_RELEASE) {
|
|
var _this$_config4 = this._config, _onLongPress = _this$_config4.onLongPress, onPress = _this$_config4.onPress;
|
|
if (onPress != null) {
|
|
var isPressCanceledByLongPress = _onLongPress != null && prevState === RESPONDER_ACTIVE_LONG_PRESS_START;
|
|
if (!isPressCanceledByLongPress) {
|
|
if (!isNextActive && !isPrevActive) {
|
|
this._activate(event);
|
|
this._deactivate(event);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this._cancelPressDelayTimeout();
|
|
}
|
|
_activate(event) {
|
|
var _this$_config5 = this._config, onPressChange = _this$_config5.onPressChange, onPressStart = _this$_config5.onPressStart;
|
|
var touch = getTouchFromResponderEvent(event);
|
|
this._touchActivatePosition = {
|
|
pageX: touch.pageX,
|
|
pageY: touch.pageY
|
|
};
|
|
if (onPressStart != null) {
|
|
onPressStart(event);
|
|
}
|
|
if (onPressChange != null) {
|
|
onPressChange(true);
|
|
}
|
|
}
|
|
_deactivate(event) {
|
|
var _this$_config6 = this._config, onPressChange = _this$_config6.onPressChange, onPressEnd = _this$_config6.onPressEnd;
|
|
function end() {
|
|
if (onPressEnd != null) {
|
|
onPressEnd(event);
|
|
}
|
|
if (onPressChange != null) {
|
|
onPressChange(false);
|
|
}
|
|
}
|
|
__name(end, "end");
|
|
var delayPressEnd = normalizeDelay(this._config.delayPressEnd);
|
|
if (delayPressEnd > 0) {
|
|
this._pressOutDelayTimeout = setTimeout(() => {
|
|
end();
|
|
}, delayPressEnd);
|
|
} else {
|
|
end();
|
|
}
|
|
}
|
|
_handleLongPress(event) {
|
|
if (this._touchState === RESPONDER_ACTIVE_PRESS_START || this._touchState === RESPONDER_ACTIVE_LONG_PRESS_START) {
|
|
this._receiveSignal(LONG_PRESS_DETECTED, event);
|
|
}
|
|
}
|
|
_cancelLongPressDelayTimeout() {
|
|
if (this._longPressDelayTimeout != null) {
|
|
clearTimeout(this._longPressDelayTimeout);
|
|
this._longPressDelayTimeout = null;
|
|
}
|
|
}
|
|
_cancelPressDelayTimeout() {
|
|
if (this._pressDelayTimeout != null) {
|
|
clearTimeout(this._pressDelayTimeout);
|
|
this._pressDelayTimeout = null;
|
|
}
|
|
}
|
|
_cancelPressOutDelayTimeout() {
|
|
if (this._pressOutDelayTimeout != null) {
|
|
clearTimeout(this._pressOutDelayTimeout);
|
|
this._pressOutDelayTimeout = null;
|
|
}
|
|
}
|
|
};
|
|
exports2.default = PressResponder;
|
|
function normalizeDelay(delay, min2, fallback) {
|
|
if (min2 === void 0) {
|
|
min2 = 0;
|
|
}
|
|
if (fallback === void 0) {
|
|
fallback = 0;
|
|
}
|
|
return Math.max(min2, delay !== null && delay !== void 0 ? delay : fallback);
|
|
}
|
|
__name(normalizeDelay, "normalizeDelay");
|
|
function getTouchFromResponderEvent(event) {
|
|
var _event$nativeEvent = event.nativeEvent, changedTouches = _event$nativeEvent.changedTouches, touches = _event$nativeEvent.touches;
|
|
if (touches != null && touches.length > 0) {
|
|
return touches[0];
|
|
}
|
|
if (changedTouches != null && changedTouches.length > 0) {
|
|
return changedTouches[0];
|
|
}
|
|
return event.nativeEvent;
|
|
}
|
|
__name(getTouchFromResponderEvent, "getTouchFromResponderEvent");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/usePressEvents/index.js
|
|
var require_usePressEvents = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/usePressEvents/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = usePressEvents;
|
|
var _PressResponder = _interopRequireDefault(require_PressResponder());
|
|
var _react = require("react");
|
|
function usePressEvents(hostRef, config) {
|
|
var pressResponderRef = (0, _react.useRef)(null);
|
|
if (pressResponderRef.current == null) {
|
|
pressResponderRef.current = new _PressResponder.default(config);
|
|
}
|
|
var pressResponder = pressResponderRef.current;
|
|
(0, _react.useEffect)(() => {
|
|
pressResponder.configure(config);
|
|
}, [config, pressResponder]);
|
|
(0, _react.useEffect)(() => {
|
|
return () => {
|
|
pressResponder.reset();
|
|
};
|
|
}, [pressResponder]);
|
|
(0, _react.useDebugValue)(config);
|
|
return pressResponder.getEventHandlers();
|
|
}
|
|
__name(usePressEvents, "usePressEvents");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/TouchableOpacity/index.js
|
|
var require_TouchableOpacity = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/TouchableOpacity/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var React83 = _react;
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePressEvents = _interopRequireDefault(require_usePressEvents());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["activeOpacity", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onLongPress", "onPress", "onPressIn", "onPressOut", "rejectResponderTermination", "style"];
|
|
function TouchableOpacity(props, forwardedRef) {
|
|
var activeOpacity = props.activeOpacity, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable2 = props.focusable, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, rejectResponderTermination = props.rejectResponderTermination, style = props.style, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var hostRef = (0, _react.useRef)(null);
|
|
var setRef2 = (0, _useMergeRefs.default)(forwardedRef, hostRef);
|
|
var _useState = (0, _react.useState)("0s"), duration = _useState[0], setDuration = _useState[1];
|
|
var _useState2 = (0, _react.useState)(null), opacityOverride = _useState2[0], setOpacityOverride = _useState2[1];
|
|
var setOpacityTo = (0, _react.useCallback)((value, duration2) => {
|
|
setOpacityOverride(value);
|
|
setDuration(duration2 ? duration2 / 1e3 + "s" : "0s");
|
|
}, [setOpacityOverride, setDuration]);
|
|
var setOpacityActive = (0, _react.useCallback)((duration2) => {
|
|
setOpacityTo(activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.2, duration2);
|
|
}, [activeOpacity, setOpacityTo]);
|
|
var setOpacityInactive = (0, _react.useCallback)((duration2) => {
|
|
setOpacityTo(null, duration2);
|
|
}, [setOpacityTo]);
|
|
var pressConfig = (0, _react.useMemo)(() => ({
|
|
cancelable: !rejectResponderTermination,
|
|
disabled,
|
|
delayLongPress,
|
|
delayPressStart: delayPressIn,
|
|
delayPressEnd: delayPressOut,
|
|
onLongPress,
|
|
onPress,
|
|
onPressStart(event) {
|
|
var isGrant = event.dispatchConfig != null ? event.dispatchConfig.registrationName === "onResponderGrant" : event.type === "keydown";
|
|
setOpacityActive(isGrant ? 0 : 150);
|
|
if (onPressIn != null) {
|
|
onPressIn(event);
|
|
}
|
|
},
|
|
onPressEnd(event) {
|
|
setOpacityInactive(250);
|
|
if (onPressOut != null) {
|
|
onPressOut(event);
|
|
}
|
|
}
|
|
}), [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, setOpacityActive, setOpacityInactive]);
|
|
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, pressEventHandlers, {
|
|
accessibilityDisabled: disabled,
|
|
focusable: !disabled && focusable2 !== false,
|
|
pointerEvents: disabled ? "box-none" : void 0,
|
|
ref: setRef2,
|
|
style: [styles.root, !disabled && styles.actionable, style, opacityOverride != null && {
|
|
opacity: opacityOverride
|
|
}, {
|
|
transitionDuration: duration
|
|
}]
|
|
}));
|
|
}
|
|
__name(TouchableOpacity, "TouchableOpacity");
|
|
var styles = _StyleSheet.default.create({
|
|
root: {
|
|
transitionProperty: "opacity",
|
|
transitionDuration: "0.15s",
|
|
userSelect: "none"
|
|
},
|
|
actionable: {
|
|
cursor: "pointer",
|
|
touchAction: "manipulation"
|
|
}
|
|
});
|
|
var MemoedTouchableOpacity = /* @__PURE__ */ React83.memo(/* @__PURE__ */ React83.forwardRef(TouchableOpacity));
|
|
MemoedTouchableOpacity.displayName = "TouchableOpacity";
|
|
var _default = exports2.default = MemoedTouchableOpacity;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Button/index.js
|
|
var require_Button = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Button/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _TouchableOpacity = _interopRequireDefault(require_TouchableOpacity());
|
|
var _Text = _interopRequireDefault(require_Text());
|
|
var Button = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var accessibilityLabel = props.accessibilityLabel, color = props.color, disabled = props.disabled, onPress = props.onPress, testID = props.testID, title = props.title;
|
|
return /* @__PURE__ */ React83.createElement(_TouchableOpacity.default, {
|
|
accessibilityLabel,
|
|
accessibilityRole: "button",
|
|
disabled,
|
|
focusable: !disabled,
|
|
onPress,
|
|
ref: forwardedRef,
|
|
style: [styles.button, color && {
|
|
backgroundColor: color
|
|
}, disabled && styles.buttonDisabled],
|
|
testID
|
|
}, /* @__PURE__ */ React83.createElement(_Text.default, {
|
|
style: [styles.text, disabled && styles.textDisabled]
|
|
}, title));
|
|
});
|
|
Button.displayName = "Button";
|
|
var styles = _StyleSheet.default.create({
|
|
button: {
|
|
backgroundColor: "#2196F3",
|
|
borderRadius: 2
|
|
},
|
|
text: {
|
|
color: "#fff",
|
|
fontWeight: "500",
|
|
padding: 8,
|
|
textAlign: "center",
|
|
textTransform: "uppercase"
|
|
},
|
|
buttonDisabled: {
|
|
backgroundColor: "#dfdfdf"
|
|
},
|
|
textDisabled: {
|
|
color: "#a1a1a1"
|
|
}
|
|
});
|
|
var _default = exports2.default = Button;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/CheckBox/index.js
|
|
var require_CheckBox = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/CheckBox/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["aria-readonly", "color", "disabled", "onChange", "onValueChange", "readOnly", "style", "value"];
|
|
var CheckBox = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var ariaReadOnly = props["aria-readonly"], color = props.color, disabled = props.disabled, onChange = props.onChange, onValueChange = props.onValueChange, readOnly = props.readOnly, style = props.style, value = props.value, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
function handleChange(event) {
|
|
var value2 = event.nativeEvent.target.checked;
|
|
event.nativeEvent.value = value2;
|
|
onChange && onChange(event);
|
|
onValueChange && onValueChange(value2);
|
|
}
|
|
__name(handleChange, "handleChange");
|
|
var fakeControl = /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [
|
|
styles.fakeControl,
|
|
value && styles.fakeControlChecked,
|
|
// custom color
|
|
value && color && {
|
|
backgroundColor: color,
|
|
borderColor: color
|
|
},
|
|
disabled && styles.fakeControlDisabled,
|
|
value && disabled && styles.fakeControlCheckedAndDisabled
|
|
]
|
|
});
|
|
var nativeControl = (0, _createElement.default)("input", {
|
|
checked: value,
|
|
disabled,
|
|
onChange: handleChange,
|
|
readOnly: readOnly === true || ariaReadOnly === true || other.accessibilityReadOnly === true,
|
|
ref: forwardedRef,
|
|
style: [styles.nativeControl, styles.cursorInherit],
|
|
type: "checkbox"
|
|
});
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, other, {
|
|
"aria-disabled": disabled,
|
|
"aria-readonly": ariaReadOnly,
|
|
style: [styles.root, style, disabled && styles.cursorDefault]
|
|
}), fakeControl, nativeControl);
|
|
});
|
|
CheckBox.displayName = "CheckBox";
|
|
var styles = _StyleSheet.default.create({
|
|
root: {
|
|
cursor: "pointer",
|
|
height: 16,
|
|
userSelect: "none",
|
|
width: 16
|
|
},
|
|
cursorDefault: {
|
|
cursor: "default"
|
|
},
|
|
cursorInherit: {
|
|
cursor: "inherit"
|
|
},
|
|
fakeControl: {
|
|
alignItems: "center",
|
|
backgroundColor: "#fff",
|
|
borderColor: "#657786",
|
|
borderRadius: 2,
|
|
borderStyle: "solid",
|
|
borderWidth: 2,
|
|
height: "100%",
|
|
justifyContent: "center",
|
|
width: "100%"
|
|
},
|
|
fakeControlChecked: {
|
|
backgroundColor: "#009688",
|
|
backgroundImage: 'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K")',
|
|
backgroundRepeat: "no-repeat",
|
|
borderColor: "#009688"
|
|
},
|
|
fakeControlDisabled: {
|
|
borderColor: "#CCD6DD"
|
|
},
|
|
fakeControlCheckedAndDisabled: {
|
|
backgroundColor: "#AAB8C2",
|
|
borderColor: "#AAB8C2"
|
|
},
|
|
nativeControl: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
|
|
height: "100%",
|
|
margin: 0,
|
|
appearance: "none",
|
|
padding: 0,
|
|
width: "100%"
|
|
})
|
|
});
|
|
var _default = exports2.default = CheckBox;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/ImageBackground/index.js
|
|
var require_ImageBackground = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/ImageBackground/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var React83 = _react;
|
|
var _Image = _interopRequireDefault(require_Image());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["children", "style", "imageStyle", "imageRef"];
|
|
var emptyObject = {};
|
|
var ImageBackground = /* @__PURE__ */ (0, _react.forwardRef)((props, forwardedRef) => {
|
|
var children = props.children, _props$style = props.style, style = _props$style === void 0 ? emptyObject : _props$style, imageStyle = props.imageStyle, imageRef = props.imageRef, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var _StyleSheet$flatten = _StyleSheet.default.flatten(style), height = _StyleSheet$flatten.height, width = _StyleSheet$flatten.width;
|
|
return /* @__PURE__ */ React83.createElement(_View.default, {
|
|
ref: forwardedRef,
|
|
style
|
|
}, /* @__PURE__ */ React83.createElement(_Image.default, (0, _extends2.default)({}, rest, {
|
|
ref: imageRef,
|
|
style: [{
|
|
// Temporary Workaround:
|
|
// Current (imperfect yet) implementation of <Image> overwrites width and height styles
|
|
// (which is not quite correct), and these styles conflict with explicitly set styles
|
|
// of <ImageBackground> and with our internal layout model here.
|
|
// So, we have to proxy/reapply these styles explicitly for actual <Image> component.
|
|
// This workaround should be removed after implementing proper support of
|
|
// intrinsic content size of the <Image>.
|
|
width,
|
|
height,
|
|
zIndex: -1
|
|
}, _StyleSheet.default.absoluteFill, imageStyle]
|
|
})), children);
|
|
});
|
|
ImageBackground.displayName = "ImageBackground";
|
|
var _default = exports2.default = ImageBackground;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/KeyboardAvoidingView/index.js
|
|
var require_KeyboardAvoidingView = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/KeyboardAvoidingView/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["behavior", "contentContainerStyle", "keyboardVerticalOffset"];
|
|
var KeyboardAvoidingView = class extends React83.Component {
|
|
static {
|
|
__name(this, "KeyboardAvoidingView");
|
|
}
|
|
constructor() {
|
|
super(...arguments);
|
|
this.frame = null;
|
|
this.onLayout = (event) => {
|
|
this.frame = event.nativeEvent.layout;
|
|
};
|
|
}
|
|
relativeKeyboardHeight(keyboardFrame) {
|
|
var frame = this.frame;
|
|
if (!frame || !keyboardFrame) {
|
|
return 0;
|
|
}
|
|
var keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0);
|
|
return Math.max(frame.y + frame.height - keyboardY, 0);
|
|
}
|
|
onKeyboardChange(event) {
|
|
}
|
|
render() {
|
|
var _this$props = this.props, behavior = _this$props.behavior, contentContainerStyle = _this$props.contentContainerStyle, keyboardVerticalOffset = _this$props.keyboardVerticalOffset, rest = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({
|
|
onLayout: this.onLayout
|
|
}, rest));
|
|
}
|
|
};
|
|
var _default = exports2.default = KeyboardAvoidingView;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Modal/ModalPortal.js
|
|
var require_ModalPortal = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Modal/ModalPortal.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _reactDom = require("react-dom");
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
function ModalPortal(props) {
|
|
var children = props.children;
|
|
var elementRef = React83.useRef(null);
|
|
if (_canUseDom.default && !elementRef.current) {
|
|
var element = document.createElement("div");
|
|
if (element && document.body) {
|
|
document.body.appendChild(element);
|
|
elementRef.current = element;
|
|
}
|
|
}
|
|
React83.useEffect(() => {
|
|
if (_canUseDom.default) {
|
|
return () => {
|
|
if (document.body && elementRef.current) {
|
|
document.body.removeChild(elementRef.current);
|
|
elementRef.current = null;
|
|
}
|
|
};
|
|
}
|
|
}, []);
|
|
return elementRef.current && _canUseDom.default ? /* @__PURE__ */ (0, _reactDom.createPortal)(children, elementRef.current) : null;
|
|
}
|
|
__name(ModalPortal, "ModalPortal");
|
|
var _default = exports2.default = ModalPortal;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Modal/ModalAnimation.js
|
|
var require_ModalAnimation = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Modal/ModalAnimation.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var ANIMATION_DURATION = 250;
|
|
function getAnimationStyle(animationType, visible) {
|
|
if (animationType === "slide") {
|
|
return visible ? animatedSlideInStyles : animatedSlideOutStyles;
|
|
}
|
|
if (animationType === "fade") {
|
|
return visible ? animatedFadeInStyles : animatedFadeOutStyles;
|
|
}
|
|
return visible ? styles.container : styles.hidden;
|
|
}
|
|
__name(getAnimationStyle, "getAnimationStyle");
|
|
function ModalAnimation(props) {
|
|
var animationType = props.animationType, children = props.children, onDismiss = props.onDismiss, onShow = props.onShow, visible = props.visible;
|
|
var _React$useState = React83.useState(false), isRendering = _React$useState[0], setIsRendering = _React$useState[1];
|
|
var wasVisible = React83.useRef(false);
|
|
var wasRendering = React83.useRef(false);
|
|
var isAnimated = animationType && animationType !== "none";
|
|
var animationEndCallback = React83.useCallback((e) => {
|
|
if (e && e.currentTarget !== e.target) {
|
|
return;
|
|
}
|
|
if (visible) {
|
|
if (onShow) {
|
|
onShow();
|
|
}
|
|
} else {
|
|
setIsRendering(false);
|
|
}
|
|
}, [onShow, visible]);
|
|
React83.useEffect(() => {
|
|
if (wasRendering.current && !isRendering && onDismiss) {
|
|
onDismiss();
|
|
}
|
|
wasRendering.current = isRendering;
|
|
}, [isRendering, onDismiss]);
|
|
React83.useEffect(() => {
|
|
if (visible) {
|
|
setIsRendering(true);
|
|
}
|
|
if (visible !== wasVisible.current && !isAnimated) {
|
|
animationEndCallback();
|
|
}
|
|
wasVisible.current = visible;
|
|
}, [isAnimated, visible, animationEndCallback]);
|
|
return isRendering || visible ? (0, _createElement.default)("div", {
|
|
style: isRendering ? getAnimationStyle(animationType, visible) : styles.hidden,
|
|
onAnimationEnd: animationEndCallback,
|
|
children
|
|
}) : null;
|
|
}
|
|
__name(ModalAnimation, "ModalAnimation");
|
|
var styles = _StyleSheet.default.create({
|
|
container: {
|
|
position: "fixed",
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
zIndex: 9999
|
|
},
|
|
animatedIn: {
|
|
animationDuration: ANIMATION_DURATION + "ms",
|
|
animationTimingFunction: "cubic-bezier(0.215, 0.61, 0.355, 1)"
|
|
},
|
|
animatedOut: {
|
|
pointerEvents: "none",
|
|
animationDuration: ANIMATION_DURATION + "ms",
|
|
animationTimingFunction: "cubic-bezier(0.47, 0, 0.745, 0.715)"
|
|
},
|
|
fadeIn: {
|
|
opacity: 1,
|
|
animationKeyframes: {
|
|
"0%": {
|
|
opacity: 0
|
|
},
|
|
"100%": {
|
|
opacity: 1
|
|
}
|
|
}
|
|
},
|
|
fadeOut: {
|
|
opacity: 0,
|
|
animationKeyframes: {
|
|
"0%": {
|
|
opacity: 1
|
|
},
|
|
"100%": {
|
|
opacity: 0
|
|
}
|
|
}
|
|
},
|
|
slideIn: {
|
|
transform: "translateY(0%)",
|
|
animationKeyframes: {
|
|
"0%": {
|
|
transform: "translateY(100%)"
|
|
},
|
|
"100%": {
|
|
transform: "translateY(0%)"
|
|
}
|
|
}
|
|
},
|
|
slideOut: {
|
|
transform: "translateY(100%)",
|
|
animationKeyframes: {
|
|
"0%": {
|
|
transform: "translateY(0%)"
|
|
},
|
|
"100%": {
|
|
transform: "translateY(100%)"
|
|
}
|
|
}
|
|
},
|
|
hidden: {
|
|
opacity: 0
|
|
}
|
|
});
|
|
var animatedSlideInStyles = [styles.container, styles.animatedIn, styles.slideIn];
|
|
var animatedSlideOutStyles = [styles.container, styles.animatedOut, styles.slideOut];
|
|
var animatedFadeInStyles = [styles.container, styles.animatedIn, styles.fadeIn];
|
|
var animatedFadeOutStyles = [styles.container, styles.animatedOut, styles.fadeOut];
|
|
var _default = exports2.default = ModalAnimation;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Modal/ModalContent.js
|
|
var require_ModalContent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Modal/ModalContent.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var _excluded = ["active", "children", "onRequestClose", "transparent"];
|
|
var ModalContent = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var active = props.active, children = props.children, onRequestClose = props.onRequestClose, transparent = props.transparent, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
React83.useEffect(() => {
|
|
if (_canUseDom.default) {
|
|
var closeOnEscape = /* @__PURE__ */ __name((e) => {
|
|
if (active && e.key === "Escape") {
|
|
e.stopPropagation();
|
|
if (onRequestClose) {
|
|
onRequestClose();
|
|
}
|
|
}
|
|
}, "closeOnEscape");
|
|
document.addEventListener("keyup", closeOnEscape, false);
|
|
return () => document.removeEventListener("keyup", closeOnEscape, false);
|
|
}
|
|
}, [active, onRequestClose]);
|
|
var style = React83.useMemo(() => {
|
|
return [styles.modal, transparent ? styles.modalTransparent : styles.modalOpaque];
|
|
}, [transparent]);
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, {
|
|
"aria-modal": true,
|
|
ref: forwardedRef,
|
|
role: active ? "dialog" : null,
|
|
style
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: styles.container
|
|
}, children));
|
|
});
|
|
var styles = _StyleSheet.default.create({
|
|
modal: {
|
|
position: "fixed",
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0
|
|
},
|
|
modalTransparent: {
|
|
backgroundColor: "transparent"
|
|
},
|
|
modalOpaque: {
|
|
backgroundColor: "white"
|
|
},
|
|
container: {
|
|
top: 0,
|
|
flex: 1
|
|
}
|
|
});
|
|
var _default = exports2.default = ModalContent;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Modal/ModalFocusTrap.js
|
|
var require_ModalFocusTrap = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Modal/ModalFocusTrap.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var FocusBracket = /* @__PURE__ */ __name(() => {
|
|
return (0, _createElement.default)("div", {
|
|
role: "none",
|
|
tabIndex: 0,
|
|
style: styles.focusBracket
|
|
});
|
|
}, "FocusBracket");
|
|
function attemptFocus(element) {
|
|
if (!_canUseDom.default) {
|
|
return false;
|
|
}
|
|
try {
|
|
element.focus();
|
|
} catch (e) {
|
|
}
|
|
return document.activeElement === element;
|
|
}
|
|
__name(attemptFocus, "attemptFocus");
|
|
function focusFirstDescendant(element) {
|
|
for (var i = 0; i < element.childNodes.length; i++) {
|
|
var child = element.childNodes[i];
|
|
if (attemptFocus(child) || focusFirstDescendant(child)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(focusFirstDescendant, "focusFirstDescendant");
|
|
function focusLastDescendant(element) {
|
|
for (var i = element.childNodes.length - 1; i >= 0; i--) {
|
|
var child = element.childNodes[i];
|
|
if (attemptFocus(child) || focusLastDescendant(child)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(focusLastDescendant, "focusLastDescendant");
|
|
var ModalFocusTrap = /* @__PURE__ */ __name((_ref) => {
|
|
var active = _ref.active, children = _ref.children;
|
|
var trapElementRef = React83.useRef();
|
|
var focusRef = React83.useRef({
|
|
trapFocusInProgress: false,
|
|
lastFocusedElement: null
|
|
});
|
|
React83.useEffect(() => {
|
|
if (_canUseDom.default) {
|
|
var trapFocus = /* @__PURE__ */ __name(() => {
|
|
if (trapElementRef.current == null || focusRef.current.trapFocusInProgress || !active) {
|
|
return;
|
|
}
|
|
try {
|
|
focusRef.current.trapFocusInProgress = true;
|
|
if (document.activeElement instanceof Node && !trapElementRef.current.contains(document.activeElement)) {
|
|
var hasFocused = focusFirstDescendant(trapElementRef.current);
|
|
if (focusRef.current.lastFocusedElement === document.activeElement) {
|
|
hasFocused = focusLastDescendant(trapElementRef.current);
|
|
}
|
|
if (!hasFocused && trapElementRef.current != null && document.activeElement) {
|
|
_UIManager.default.focus(trapElementRef.current);
|
|
}
|
|
}
|
|
} finally {
|
|
focusRef.current.trapFocusInProgress = false;
|
|
}
|
|
focusRef.current.lastFocusedElement = document.activeElement;
|
|
}, "trapFocus");
|
|
trapFocus();
|
|
document.addEventListener("focus", trapFocus, true);
|
|
return () => document.removeEventListener("focus", trapFocus, true);
|
|
}
|
|
}, [active]);
|
|
React83.useEffect(function() {
|
|
if (_canUseDom.default) {
|
|
var lastFocusedElementOutsideTrap = document.activeElement;
|
|
return function() {
|
|
if (lastFocusedElementOutsideTrap && document.contains(lastFocusedElementOutsideTrap)) {
|
|
_UIManager.default.focus(lastFocusedElementOutsideTrap);
|
|
}
|
|
};
|
|
}
|
|
}, []);
|
|
return /* @__PURE__ */ React83.createElement(React83.Fragment, null, /* @__PURE__ */ React83.createElement(FocusBracket, null), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
ref: trapElementRef
|
|
}, children), /* @__PURE__ */ React83.createElement(FocusBracket, null));
|
|
}, "ModalFocusTrap");
|
|
var _default = exports2.default = ModalFocusTrap;
|
|
var styles = _StyleSheet.default.create({
|
|
focusBracket: {
|
|
outlineStyle: "none"
|
|
}
|
|
});
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Modal/index.js
|
|
var require_Modal = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Modal/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _ModalPortal = _interopRequireDefault(require_ModalPortal());
|
|
var _ModalAnimation = _interopRequireDefault(require_ModalAnimation());
|
|
var _ModalContent = _interopRequireDefault(require_ModalContent());
|
|
var _ModalFocusTrap = _interopRequireDefault(require_ModalFocusTrap());
|
|
var _excluded = ["animationType", "children", "onDismiss", "onRequestClose", "onShow", "transparent", "visible"];
|
|
var uniqueModalIdentifier = 0;
|
|
var activeModalStack = [];
|
|
var activeModalListeners = {};
|
|
function notifyActiveModalListeners() {
|
|
if (activeModalStack.length === 0) {
|
|
return;
|
|
}
|
|
var activeModalId = activeModalStack[activeModalStack.length - 1];
|
|
activeModalStack.forEach((modalId) => {
|
|
if (modalId in activeModalListeners) {
|
|
activeModalListeners[modalId](modalId === activeModalId);
|
|
}
|
|
});
|
|
}
|
|
__name(notifyActiveModalListeners, "notifyActiveModalListeners");
|
|
function removeActiveModal(modalId) {
|
|
if (modalId in activeModalListeners) {
|
|
activeModalListeners[modalId](false);
|
|
delete activeModalListeners[modalId];
|
|
}
|
|
var index5 = activeModalStack.indexOf(modalId);
|
|
if (index5 !== -1) {
|
|
activeModalStack.splice(index5, 1);
|
|
notifyActiveModalListeners();
|
|
}
|
|
}
|
|
__name(removeActiveModal, "removeActiveModal");
|
|
function addActiveModal(modalId, listener) {
|
|
removeActiveModal(modalId);
|
|
activeModalStack.push(modalId);
|
|
activeModalListeners[modalId] = listener;
|
|
notifyActiveModalListeners();
|
|
}
|
|
__name(addActiveModal, "addActiveModal");
|
|
var Modal = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var animationType = props.animationType, children = props.children, onDismiss = props.onDismiss, onRequestClose = props.onRequestClose, onShow = props.onShow, transparent = props.transparent, _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var modalId = React83.useMemo(() => uniqueModalIdentifier++, []);
|
|
var _React$useState = React83.useState(false), isActive = _React$useState[0], setIsActive = _React$useState[1];
|
|
var onDismissCallback = React83.useCallback(() => {
|
|
removeActiveModal(modalId);
|
|
if (onDismiss) {
|
|
onDismiss();
|
|
}
|
|
}, [modalId, onDismiss]);
|
|
var onShowCallback = React83.useCallback(() => {
|
|
addActiveModal(modalId, setIsActive);
|
|
if (onShow) {
|
|
onShow();
|
|
}
|
|
}, [modalId, onShow]);
|
|
React83.useEffect(() => {
|
|
return () => removeActiveModal(modalId);
|
|
}, [modalId]);
|
|
return /* @__PURE__ */ React83.createElement(_ModalPortal.default, null, /* @__PURE__ */ React83.createElement(_ModalAnimation.default, {
|
|
animationType,
|
|
onDismiss: onDismissCallback,
|
|
onShow: onShowCallback,
|
|
visible
|
|
}, /* @__PURE__ */ React83.createElement(_ModalFocusTrap.default, {
|
|
active: isActive
|
|
}, /* @__PURE__ */ React83.createElement(_ModalContent.default, (0, _extends2.default)({}, rest, {
|
|
active: isActive,
|
|
onRequestClose,
|
|
ref: forwardedRef,
|
|
transparent
|
|
}), children))));
|
|
});
|
|
var _default = exports2.default = Modal;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Picker/PickerItem.js
|
|
var require_PickerItem = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Picker/PickerItem.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = PickerItem;
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
function PickerItem(props) {
|
|
var color = props.color, label = props.label, testID = props.testID, value = props.value;
|
|
var style = {
|
|
color
|
|
};
|
|
return (0, _createElement.default)("option", {
|
|
children: label,
|
|
style,
|
|
testID,
|
|
value
|
|
});
|
|
}
|
|
__name(PickerItem, "PickerItem");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Picker/index.js
|
|
var require_Picker = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Picker/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePlatformMethods = _interopRequireDefault(require_usePlatformMethods());
|
|
var _PickerItem = _interopRequireDefault(require_PickerItem());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _excluded = ["children", "enabled", "onValueChange", "selectedValue", "style", "testID", "itemStyle", "mode", "prompt"];
|
|
var Picker = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var children = props.children, enabled = props.enabled, onValueChange = props.onValueChange, selectedValue = props.selectedValue, style = props.style, testID = props.testID, itemStyle = props.itemStyle, mode = props.mode, prompt = props.prompt, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var hostRef = React83.useRef(null);
|
|
function handleChange(e) {
|
|
var _e$target = e.target, selectedIndex = _e$target.selectedIndex, value = _e$target.value;
|
|
if (onValueChange) {
|
|
onValueChange(value, selectedIndex);
|
|
}
|
|
}
|
|
__name(handleChange, "handleChange");
|
|
var supportedProps = (0, _objectSpread2.default)({
|
|
children,
|
|
disabled: enabled === false ? true : void 0,
|
|
onChange: handleChange,
|
|
style: [styles.initial, style],
|
|
testID,
|
|
value: selectedValue
|
|
}, other);
|
|
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
|
var setRef2 = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
|
|
supportedProps.ref = setRef2;
|
|
return (0, _createElement.default)("select", supportedProps);
|
|
});
|
|
Picker.Item = _PickerItem.default;
|
|
var styles = _StyleSheet.default.create({
|
|
initial: {
|
|
fontFamily: "System",
|
|
fontSize: "inherit",
|
|
margin: 0
|
|
}
|
|
});
|
|
var _default = exports2.default = Picker;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/addEventListener/index.js
|
|
var require_addEventListener = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/addEventListener/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.addEventListener = addEventListener;
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var emptyFunction = /* @__PURE__ */ __name(() => {
|
|
}, "emptyFunction");
|
|
function supportsPassiveEvents() {
|
|
var supported = false;
|
|
if (_canUseDom.default) {
|
|
try {
|
|
var options = {};
|
|
Object.defineProperty(options, "passive", {
|
|
get() {
|
|
supported = true;
|
|
return false;
|
|
}
|
|
});
|
|
window.addEventListener("test", null, options);
|
|
window.removeEventListener("test", null, options);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
return supported;
|
|
}
|
|
__name(supportsPassiveEvents, "supportsPassiveEvents");
|
|
var canUsePassiveEvents = supportsPassiveEvents();
|
|
function getOptions(options) {
|
|
if (options == null) {
|
|
return false;
|
|
}
|
|
return canUsePassiveEvents ? options : Boolean(options.capture);
|
|
}
|
|
__name(getOptions, "getOptions");
|
|
function isPropagationStopped() {
|
|
return this.cancelBubble;
|
|
}
|
|
__name(isPropagationStopped, "isPropagationStopped");
|
|
function isDefaultPrevented() {
|
|
return this.defaultPrevented;
|
|
}
|
|
__name(isDefaultPrevented, "isDefaultPrevented");
|
|
function normalizeEvent(event) {
|
|
event.nativeEvent = event;
|
|
event.persist = emptyFunction;
|
|
event.isDefaultPrevented = isDefaultPrevented;
|
|
event.isPropagationStopped = isPropagationStopped;
|
|
return event;
|
|
}
|
|
__name(normalizeEvent, "normalizeEvent");
|
|
function addEventListener(target, type, listener, options) {
|
|
var opts = getOptions(options);
|
|
var compatListener = /* @__PURE__ */ __name((e) => listener(normalizeEvent(e)), "compatListener");
|
|
target.addEventListener(type, compatListener, opts);
|
|
return /* @__PURE__ */ __name(function removeEventListener() {
|
|
if (target != null) {
|
|
target.removeEventListener(type, compatListener, opts);
|
|
}
|
|
}, "removeEventListener");
|
|
}
|
|
__name(addEventListener, "addEventListener");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/modality/index.js
|
|
var require_modality = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/modality/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.addModalityListener = addModalityListener;
|
|
exports2.getActiveModality = getActiveModality;
|
|
exports2.getModality = getModality;
|
|
exports2.testOnly_resetActiveModality = testOnly_resetActiveModality;
|
|
var _addEventListener = require_addEventListener();
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var supportsPointerEvent = /* @__PURE__ */ __name(() => !!(typeof window !== "undefined" && window.PointerEvent != null), "supportsPointerEvent");
|
|
var activeModality = "keyboard";
|
|
var modality = "keyboard";
|
|
var previousModality;
|
|
var previousActiveModality;
|
|
var isEmulatingMouseEvents = false;
|
|
var listeners = /* @__PURE__ */ new Set();
|
|
var KEYBOARD = "keyboard";
|
|
var MOUSE = "mouse";
|
|
var TOUCH = "touch";
|
|
var BLUR = "blur";
|
|
var CONTEXTMENU = "contextmenu";
|
|
var FOCUS = "focus";
|
|
var KEYDOWN = "keydown";
|
|
var MOUSEDOWN = "mousedown";
|
|
var MOUSEMOVE = "mousemove";
|
|
var MOUSEUP = "mouseup";
|
|
var POINTERDOWN = "pointerdown";
|
|
var POINTERMOVE = "pointermove";
|
|
var SCROLL = "scroll";
|
|
var SELECTIONCHANGE = "selectionchange";
|
|
var TOUCHCANCEL = "touchcancel";
|
|
var TOUCHMOVE = "touchmove";
|
|
var TOUCHSTART = "touchstart";
|
|
var VISIBILITYCHANGE = "visibilitychange";
|
|
var bubbleOptions = {
|
|
passive: true
|
|
};
|
|
var captureOptions = {
|
|
capture: true,
|
|
passive: true
|
|
};
|
|
function restoreModality() {
|
|
if (previousModality != null || previousActiveModality != null) {
|
|
if (previousModality != null) {
|
|
modality = previousModality;
|
|
previousModality = null;
|
|
}
|
|
if (previousActiveModality != null) {
|
|
activeModality = previousActiveModality;
|
|
previousActiveModality = null;
|
|
}
|
|
callListeners();
|
|
}
|
|
}
|
|
__name(restoreModality, "restoreModality");
|
|
function onBlurWindow() {
|
|
previousModality = modality;
|
|
previousActiveModality = activeModality;
|
|
activeModality = KEYBOARD;
|
|
modality = KEYBOARD;
|
|
callListeners();
|
|
isEmulatingMouseEvents = false;
|
|
}
|
|
__name(onBlurWindow, "onBlurWindow");
|
|
function onFocusWindow() {
|
|
restoreModality();
|
|
}
|
|
__name(onFocusWindow, "onFocusWindow");
|
|
function onKeyDown(event) {
|
|
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
return;
|
|
}
|
|
if (modality !== KEYBOARD) {
|
|
modality = KEYBOARD;
|
|
activeModality = KEYBOARD;
|
|
callListeners();
|
|
}
|
|
}
|
|
__name(onKeyDown, "onKeyDown");
|
|
function onVisibilityChange() {
|
|
if (document.visibilityState !== "hidden") {
|
|
restoreModality();
|
|
}
|
|
}
|
|
__name(onVisibilityChange, "onVisibilityChange");
|
|
function onPointerish(event) {
|
|
var eventType = event.type;
|
|
if (supportsPointerEvent()) {
|
|
if (eventType === POINTERDOWN) {
|
|
if (activeModality !== event.pointerType) {
|
|
modality = event.pointerType;
|
|
activeModality = event.pointerType;
|
|
callListeners();
|
|
}
|
|
return;
|
|
}
|
|
if (eventType === POINTERMOVE) {
|
|
if (modality !== event.pointerType) {
|
|
modality = event.pointerType;
|
|
callListeners();
|
|
}
|
|
return;
|
|
}
|
|
} else {
|
|
if (!isEmulatingMouseEvents) {
|
|
if (eventType === MOUSEDOWN) {
|
|
if (activeModality !== MOUSE) {
|
|
modality = MOUSE;
|
|
activeModality = MOUSE;
|
|
callListeners();
|
|
}
|
|
}
|
|
if (eventType === MOUSEMOVE) {
|
|
if (modality !== MOUSE) {
|
|
modality = MOUSE;
|
|
callListeners();
|
|
}
|
|
}
|
|
}
|
|
if (eventType === TOUCHSTART) {
|
|
isEmulatingMouseEvents = true;
|
|
if (event.touches && event.touches.length > 1) {
|
|
isEmulatingMouseEvents = false;
|
|
}
|
|
if (activeModality !== TOUCH) {
|
|
modality = TOUCH;
|
|
activeModality = TOUCH;
|
|
callListeners();
|
|
}
|
|
return;
|
|
}
|
|
if (eventType === CONTEXTMENU || eventType === MOUSEUP || eventType === SELECTIONCHANGE || eventType === SCROLL || eventType === TOUCHCANCEL || eventType === TOUCHMOVE) {
|
|
isEmulatingMouseEvents = false;
|
|
}
|
|
}
|
|
}
|
|
__name(onPointerish, "onPointerish");
|
|
if (_canUseDom.default) {
|
|
(0, _addEventListener.addEventListener)(window, BLUR, onBlurWindow, bubbleOptions);
|
|
(0, _addEventListener.addEventListener)(window, FOCUS, onFocusWindow, bubbleOptions);
|
|
(0, _addEventListener.addEventListener)(document, KEYDOWN, onKeyDown, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, VISIBILITYCHANGE, onVisibilityChange, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, POINTERDOWN, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, POINTERMOVE, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, CONTEXTMENU, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, MOUSEDOWN, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, MOUSEMOVE, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, MOUSEUP, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, TOUCHCANCEL, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, TOUCHMOVE, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, TOUCHSTART, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, SELECTIONCHANGE, onPointerish, captureOptions);
|
|
(0, _addEventListener.addEventListener)(document, SCROLL, onPointerish, captureOptions);
|
|
}
|
|
function callListeners() {
|
|
var value = {
|
|
activeModality,
|
|
modality
|
|
};
|
|
listeners.forEach((listener) => {
|
|
listener(value);
|
|
});
|
|
}
|
|
__name(callListeners, "callListeners");
|
|
function getActiveModality() {
|
|
return activeModality;
|
|
}
|
|
__name(getActiveModality, "getActiveModality");
|
|
function getModality() {
|
|
return modality;
|
|
}
|
|
__name(getModality, "getModality");
|
|
function addModalityListener(listener) {
|
|
listeners.add(listener);
|
|
return () => {
|
|
listeners.delete(listener);
|
|
};
|
|
}
|
|
__name(addModalityListener, "addModalityListener");
|
|
function testOnly_resetActiveModality() {
|
|
isEmulatingMouseEvents = false;
|
|
activeModality = KEYBOARD;
|
|
modality = KEYBOARD;
|
|
}
|
|
__name(testOnly_resetActiveModality, "testOnly_resetActiveModality");
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useEvent/index.js
|
|
var require_useEvent = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useEvent/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useEvent12;
|
|
var _addEventListener = require_addEventListener();
|
|
var _useLayoutEffect = _interopRequireDefault(require_useLayoutEffect());
|
|
var _useStable = _interopRequireDefault(require_useStable());
|
|
function useEvent12(eventType, options) {
|
|
var targetListeners = (0, _useStable.default)(() => /* @__PURE__ */ new Map());
|
|
var addListener = (0, _useStable.default)(() => {
|
|
return (target, callback) => {
|
|
var removeTargetListener = targetListeners.get(target);
|
|
if (removeTargetListener != null) {
|
|
removeTargetListener();
|
|
}
|
|
if (callback == null) {
|
|
targetListeners.delete(target);
|
|
callback = /* @__PURE__ */ __name(() => {
|
|
}, "callback");
|
|
}
|
|
var removeEventListener = (0, _addEventListener.addEventListener)(target, eventType, callback, options);
|
|
targetListeners.set(target, removeEventListener);
|
|
return removeEventListener;
|
|
};
|
|
});
|
|
(0, _useLayoutEffect.default)(() => {
|
|
return () => {
|
|
targetListeners.forEach((removeListener) => {
|
|
removeListener();
|
|
});
|
|
targetListeners.clear();
|
|
};
|
|
}, [targetListeners]);
|
|
return addListener;
|
|
}
|
|
__name(useEvent12, "useEvent");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/useHover/index.js
|
|
var require_useHover = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/useHover/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useHover3;
|
|
var _modality = require_modality();
|
|
var _useEvent = _interopRequireDefault(require_useEvent());
|
|
var _useLayoutEffect = _interopRequireDefault(require_useLayoutEffect());
|
|
var emptyObject = {};
|
|
var opts = {
|
|
passive: true
|
|
};
|
|
var lockEventType = "react-gui:hover:lock";
|
|
var unlockEventType = "react-gui:hover:unlock";
|
|
var supportsPointerEvent = /* @__PURE__ */ __name(() => !!(typeof window !== "undefined" && window.PointerEvent != null), "supportsPointerEvent");
|
|
function dispatchCustomEvent(target, type, payload) {
|
|
var event = document.createEvent("CustomEvent");
|
|
var _ref = payload || emptyObject, _ref$bubbles = _ref.bubbles, bubbles = _ref$bubbles === void 0 ? true : _ref$bubbles, _ref$cancelable = _ref.cancelable, cancelable = _ref$cancelable === void 0 ? true : _ref$cancelable, detail = _ref.detail;
|
|
event.initCustomEvent(type, bubbles, cancelable, detail);
|
|
target.dispatchEvent(event);
|
|
}
|
|
__name(dispatchCustomEvent, "dispatchCustomEvent");
|
|
function getPointerType(event) {
|
|
var pointerType = event.pointerType;
|
|
return pointerType != null ? pointerType : (0, _modality.getModality)();
|
|
}
|
|
__name(getPointerType, "getPointerType");
|
|
function useHover3(targetRef, config) {
|
|
var contain = config.contain, disabled = config.disabled, onHoverStart = config.onHoverStart, onHoverChange = config.onHoverChange, onHoverUpdate = config.onHoverUpdate, onHoverEnd = config.onHoverEnd;
|
|
var canUsePE = supportsPointerEvent();
|
|
var addMoveListener = (0, _useEvent.default)(canUsePE ? "pointermove" : "mousemove", opts);
|
|
var addEnterListener = (0, _useEvent.default)(canUsePE ? "pointerenter" : "mouseenter", opts);
|
|
var addLeaveListener = (0, _useEvent.default)(canUsePE ? "pointerleave" : "mouseleave", opts);
|
|
var addLockListener = (0, _useEvent.default)(lockEventType, opts);
|
|
var addUnlockListener = (0, _useEvent.default)(unlockEventType, opts);
|
|
(0, _useLayoutEffect.default)(() => {
|
|
var target = targetRef.current;
|
|
if (target !== null) {
|
|
var hoverEnd = /* @__PURE__ */ __name(function hoverEnd2(e) {
|
|
if (onHoverEnd != null) {
|
|
onHoverEnd(e);
|
|
}
|
|
if (onHoverChange != null) {
|
|
onHoverChange(false);
|
|
}
|
|
addMoveListener(target, null);
|
|
addLeaveListener(target, null);
|
|
}, "hoverEnd");
|
|
var leaveListener = /* @__PURE__ */ __name(function leaveListener2(e) {
|
|
var target2 = targetRef.current;
|
|
if (target2 != null && getPointerType(e) !== "touch") {
|
|
if (contain) {
|
|
dispatchCustomEvent(target2, unlockEventType);
|
|
}
|
|
hoverEnd(e);
|
|
}
|
|
}, "leaveListener");
|
|
var moveListener = /* @__PURE__ */ __name(function moveListener2(e) {
|
|
if (getPointerType(e) !== "touch") {
|
|
if (onHoverUpdate != null) {
|
|
if (e.x == null) {
|
|
e.x = e.clientX;
|
|
}
|
|
if (e.y == null) {
|
|
e.y = e.clientY;
|
|
}
|
|
onHoverUpdate(e);
|
|
}
|
|
}
|
|
}, "moveListener");
|
|
var hoverStart = /* @__PURE__ */ __name(function hoverStart2(e) {
|
|
if (onHoverStart != null) {
|
|
onHoverStart(e);
|
|
}
|
|
if (onHoverChange != null) {
|
|
onHoverChange(true);
|
|
}
|
|
if (onHoverUpdate != null) {
|
|
addMoveListener(target, !disabled ? moveListener : null);
|
|
}
|
|
addLeaveListener(target, !disabled ? leaveListener : null);
|
|
}, "hoverStart");
|
|
var enterListener = /* @__PURE__ */ __name(function enterListener2(e) {
|
|
var target2 = targetRef.current;
|
|
if (target2 != null && getPointerType(e) !== "touch") {
|
|
if (contain) {
|
|
dispatchCustomEvent(target2, lockEventType);
|
|
}
|
|
hoverStart(e);
|
|
var lockListener = /* @__PURE__ */ __name(function lockListener2(lockEvent) {
|
|
if (lockEvent.target !== target2) {
|
|
hoverEnd(e);
|
|
}
|
|
}, "lockListener");
|
|
var unlockListener = /* @__PURE__ */ __name(function unlockListener2(lockEvent) {
|
|
if (lockEvent.target !== target2) {
|
|
hoverStart(e);
|
|
}
|
|
}, "unlockListener");
|
|
addLockListener(target2, !disabled ? lockListener : null);
|
|
addUnlockListener(target2, !disabled ? unlockListener : null);
|
|
}
|
|
}, "enterListener");
|
|
addEnterListener(target, !disabled ? enterListener : null);
|
|
}
|
|
}, [addEnterListener, addMoveListener, addLeaveListener, addLockListener, addUnlockListener, contain, disabled, onHoverStart, onHoverChange, onHoverUpdate, onHoverEnd, targetRef]);
|
|
}
|
|
__name(useHover3, "useHover");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Pressable/index.js
|
|
var require_Pressable = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Pressable/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var React83 = _react;
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _useHover = _interopRequireDefault(require_useHover());
|
|
var _usePressEvents = _interopRequireDefault(require_usePressEvents());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["children", "delayLongPress", "delayPressIn", "delayPressOut", "disabled", "onBlur", "onContextMenu", "onFocus", "onHoverIn", "onHoverOut", "onKeyDown", "onLongPress", "onPress", "onPressMove", "onPressIn", "onPressOut", "style", "tabIndex", "testOnly_hovered", "testOnly_pressed"];
|
|
function Pressable(props, forwardedRef) {
|
|
var children = props.children, delayLongPress = props.delayLongPress, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, disabled = props.disabled, onBlur = props.onBlur, onContextMenu = props.onContextMenu, onFocus = props.onFocus, onHoverIn = props.onHoverIn, onHoverOut = props.onHoverOut, onKeyDown = props.onKeyDown, onLongPress = props.onLongPress, onPress = props.onPress, onPressMove = props.onPressMove, onPressIn = props.onPressIn, onPressOut = props.onPressOut, style = props.style, tabIndex = props.tabIndex, testOnly_hovered = props.testOnly_hovered, testOnly_pressed = props.testOnly_pressed, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var _useForceableState = useForceableState(testOnly_hovered === true), hovered = _useForceableState[0], setHovered = _useForceableState[1];
|
|
var _useForceableState2 = useForceableState(false), focused = _useForceableState2[0], setFocused = _useForceableState2[1];
|
|
var _useForceableState3 = useForceableState(testOnly_pressed === true), pressed = _useForceableState3[0], setPressed = _useForceableState3[1];
|
|
var hostRef = (0, _react.useRef)(null);
|
|
var setRef2 = (0, _useMergeRefs.default)(forwardedRef, hostRef);
|
|
var pressConfig = (0, _react.useMemo)(() => ({
|
|
delayLongPress,
|
|
delayPressStart: delayPressIn,
|
|
delayPressEnd: delayPressOut,
|
|
disabled,
|
|
onLongPress,
|
|
onPress,
|
|
onPressChange: setPressed,
|
|
onPressStart: onPressIn,
|
|
onPressMove,
|
|
onPressEnd: onPressOut
|
|
}), [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressMove, onPressOut, setPressed]);
|
|
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
|
var onContextMenuPress = pressEventHandlers.onContextMenu, onKeyDownPress = pressEventHandlers.onKeyDown;
|
|
(0, _useHover.default)(hostRef, {
|
|
contain: true,
|
|
disabled,
|
|
onHoverChange: setHovered,
|
|
onHoverStart: onHoverIn,
|
|
onHoverEnd: onHoverOut
|
|
});
|
|
var interactionState = {
|
|
hovered,
|
|
focused,
|
|
pressed
|
|
};
|
|
var blurHandler = React83.useCallback((e) => {
|
|
if (e.nativeEvent.target === hostRef.current) {
|
|
setFocused(false);
|
|
if (onBlur != null) {
|
|
onBlur(e);
|
|
}
|
|
}
|
|
}, [hostRef, setFocused, onBlur]);
|
|
var focusHandler = React83.useCallback((e) => {
|
|
if (e.nativeEvent.target === hostRef.current) {
|
|
setFocused(true);
|
|
if (onFocus != null) {
|
|
onFocus(e);
|
|
}
|
|
}
|
|
}, [hostRef, setFocused, onFocus]);
|
|
var contextMenuHandler = React83.useCallback((e) => {
|
|
if (onContextMenuPress != null) {
|
|
onContextMenuPress(e);
|
|
}
|
|
if (onContextMenu != null) {
|
|
onContextMenu(e);
|
|
}
|
|
}, [onContextMenu, onContextMenuPress]);
|
|
var keyDownHandler = React83.useCallback((e) => {
|
|
if (onKeyDownPress != null) {
|
|
onKeyDownPress(e);
|
|
}
|
|
if (onKeyDown != null) {
|
|
onKeyDown(e);
|
|
}
|
|
}, [onKeyDown, onKeyDownPress]);
|
|
var _tabIndex;
|
|
if (tabIndex !== void 0) {
|
|
_tabIndex = tabIndex;
|
|
} else {
|
|
_tabIndex = disabled ? -1 : 0;
|
|
}
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, pressEventHandlers, {
|
|
"aria-disabled": disabled,
|
|
onBlur: blurHandler,
|
|
onContextMenu: contextMenuHandler,
|
|
onFocus: focusHandler,
|
|
onKeyDown: keyDownHandler,
|
|
ref: setRef2,
|
|
style: [disabled ? styles.disabled : styles.active, typeof style === "function" ? style(interactionState) : style],
|
|
tabIndex: _tabIndex
|
|
}), typeof children === "function" ? children(interactionState) : children);
|
|
}
|
|
__name(Pressable, "Pressable");
|
|
function useForceableState(forced) {
|
|
var _useState = (0, _react.useState)(false), bool = _useState[0], setBool = _useState[1];
|
|
return [bool || forced, setBool];
|
|
}
|
|
__name(useForceableState, "useForceableState");
|
|
var styles = _StyleSheet.default.create({
|
|
active: {
|
|
cursor: "pointer",
|
|
touchAction: "manipulation"
|
|
},
|
|
disabled: {
|
|
pointerEvents: "box-none"
|
|
}
|
|
});
|
|
var MemoedPressable = /* @__PURE__ */ (0, _react.memo)(/* @__PURE__ */ (0, _react.forwardRef)(Pressable));
|
|
MemoedPressable.displayName = "Pressable";
|
|
var _default = exports2.default = MemoedPressable;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/ProgressBar/index.js
|
|
var require_ProgressBar = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/ProgressBar/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["color", "indeterminate", "progress", "trackColor", "style"];
|
|
var ProgressBar = /* @__PURE__ */ React83.forwardRef((props, ref) => {
|
|
var _props$color = props.color, color = _props$color === void 0 ? "#1976D2" : _props$color, _props$indeterminate = props.indeterminate, indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate, _props$progress = props.progress, progress = _props$progress === void 0 ? 0 : _props$progress, _props$trackColor = props.trackColor, trackColor = _props$trackColor === void 0 ? "transparent" : _props$trackColor, style = props.style, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var percentageProgress = progress * 100;
|
|
var width = indeterminate ? "25%" : percentageProgress + "%";
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, other, {
|
|
"aria-valuemax": 100,
|
|
"aria-valuemin": 0,
|
|
"aria-valuenow": indeterminate ? null : percentageProgress,
|
|
ref,
|
|
role: "progressbar",
|
|
style: [styles.track, style, {
|
|
backgroundColor: trackColor
|
|
}]
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: [{
|
|
backgroundColor: color,
|
|
width
|
|
}, styles.progress, indeterminate && styles.animation]
|
|
}));
|
|
});
|
|
ProgressBar.displayName = "ProgressBar";
|
|
var styles = _StyleSheet.default.create({
|
|
track: {
|
|
forcedColorAdjust: "none",
|
|
height: 5,
|
|
overflow: "hidden",
|
|
userSelect: "none",
|
|
zIndex: 0
|
|
},
|
|
progress: {
|
|
forcedColorAdjust: "none",
|
|
height: "100%",
|
|
zIndex: -1
|
|
},
|
|
animation: {
|
|
animationDuration: "1s",
|
|
animationKeyframes: [{
|
|
"0%": {
|
|
transform: "translateX(-100%)"
|
|
},
|
|
"100%": {
|
|
transform: "translateX(400%)"
|
|
}
|
|
}],
|
|
animationTimingFunction: "linear",
|
|
animationIterationCount: "infinite"
|
|
}
|
|
});
|
|
var _default = exports2.default = ProgressBar;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/SafeAreaView/index.js
|
|
var require_SafeAreaView = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/SafeAreaView/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _canUseDom = _interopRequireDefault(require_canUseDom());
|
|
var _excluded = ["style"];
|
|
var cssFunction = (function() {
|
|
if (_canUseDom.default && window.CSS && window.CSS.supports && window.CSS.supports("top: constant(safe-area-inset-top)")) {
|
|
return "constant";
|
|
}
|
|
return "env";
|
|
})();
|
|
var SafeAreaView = /* @__PURE__ */ React83.forwardRef((props, ref) => {
|
|
var style = props.style, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, {
|
|
ref,
|
|
style: [styles.root, style]
|
|
}));
|
|
});
|
|
SafeAreaView.displayName = "SafeAreaView";
|
|
var styles = _StyleSheet.default.create({
|
|
root: {
|
|
paddingTop: cssFunction + "(safe-area-inset-top)",
|
|
paddingRight: cssFunction + "(safe-area-inset-right)",
|
|
paddingBottom: cssFunction + "(safe-area-inset-bottom)",
|
|
paddingLeft: cssFunction + "(safe-area-inset-left)"
|
|
}
|
|
});
|
|
var _default = exports2.default = SafeAreaView;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/StatusBar/index.js
|
|
var require_StatusBar = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/StatusBar/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var emptyFunction = /* @__PURE__ */ __name(() => {
|
|
}, "emptyFunction");
|
|
function StatusBar() {
|
|
return null;
|
|
}
|
|
__name(StatusBar, "StatusBar");
|
|
StatusBar.setBackgroundColor = emptyFunction;
|
|
StatusBar.setBarStyle = emptyFunction;
|
|
StatusBar.setHidden = emptyFunction;
|
|
StatusBar.setNetworkActivityIndicatorVisible = emptyFunction;
|
|
StatusBar.setTranslucent = emptyFunction;
|
|
var _default = exports2.default = StatusBar;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/multiplyStyleLengthValue/index.js
|
|
var require_multiplyStyleLengthValue = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/multiplyStyleLengthValue/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var CSS_UNIT_RE = /^[+-]?\d*(?:\.\d+)?(?:[Ee][+-]?\d+)?(%|\w*)/;
|
|
var getUnit = /* @__PURE__ */ __name((str) => str.match(CSS_UNIT_RE)[1], "getUnit");
|
|
var isNumeric = /* @__PURE__ */ __name((n) => {
|
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
}, "isNumeric");
|
|
var multiplyStyleLengthValue = /* @__PURE__ */ __name((value, multiple) => {
|
|
if (typeof value === "string") {
|
|
var number = parseFloat(value) * multiple;
|
|
var unit = getUnit(value);
|
|
return "" + number + unit;
|
|
} else if (isNumeric(value)) {
|
|
return value * multiple;
|
|
}
|
|
}, "multiplyStyleLengthValue");
|
|
var _default = exports2.default = multiplyStyleLengthValue;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Switch/index.js
|
|
var require_Switch = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Switch/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var _multiplyStyleLengthValue = _interopRequireDefault(require_multiplyStyleLengthValue());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["aria-label", "accessibilityLabel", "activeThumbColor", "activeTrackColor", "disabled", "onValueChange", "style", "thumbColor", "trackColor", "value"];
|
|
var emptyObject = {};
|
|
var thumbDefaultBoxShadow = "0px 1px 3px rgba(0,0,0,0.5)";
|
|
var thumbFocusedBoxShadow = thumbDefaultBoxShadow + ", 0 0 0 10px rgba(0,0,0,0.1)";
|
|
var defaultActiveTrackColor = "#A3D3CF";
|
|
var defaultTrackColor = "#939393";
|
|
var defaultDisabledTrackColor = "#D5D5D5";
|
|
var defaultActiveThumbColor = "#009688";
|
|
var defaultThumbColor = "#FAFAFA";
|
|
var defaultDisabledThumbColor = "#BDBDBD";
|
|
var Switch2 = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var ariaLabel = props["aria-label"], accessibilityLabel = props.accessibilityLabel, activeThumbColor = props.activeThumbColor, activeTrackColor = props.activeTrackColor, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, onValueChange = props.onValueChange, _props$style = props.style, style = _props$style === void 0 ? emptyObject : _props$style, thumbColor = props.thumbColor, trackColor = props.trackColor, _props$value = props.value, value = _props$value === void 0 ? false : _props$value, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var thumbRef = React83.useRef(null);
|
|
function handleChange(event) {
|
|
if (onValueChange != null) {
|
|
onValueChange(event.nativeEvent.target.checked);
|
|
}
|
|
}
|
|
__name(handleChange, "handleChange");
|
|
function handleFocusState(event) {
|
|
var isFocused = event.nativeEvent.type === "focus";
|
|
var boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;
|
|
if (thumbRef.current != null) {
|
|
thumbRef.current.style.boxShadow = boxShadow;
|
|
}
|
|
}
|
|
__name(handleFocusState, "handleFocusState");
|
|
var _StyleSheet$flatten = _StyleSheet.default.flatten(style), styleHeight = _StyleSheet$flatten.height, styleWidth = _StyleSheet$flatten.width;
|
|
var height = styleHeight || "20px";
|
|
var minWidth = (0, _multiplyStyleLengthValue.default)(height, 2);
|
|
var width = styleWidth > minWidth ? styleWidth : minWidth;
|
|
var trackBorderRadius = (0, _multiplyStyleLengthValue.default)(height, 0.5);
|
|
var trackCurrentColor = (function() {
|
|
if (value === true) {
|
|
if (trackColor != null && typeof trackColor === "object") {
|
|
return trackColor.true;
|
|
} else {
|
|
return activeTrackColor !== null && activeTrackColor !== void 0 ? activeTrackColor : defaultActiveTrackColor;
|
|
}
|
|
} else {
|
|
if (trackColor != null && typeof trackColor === "object") {
|
|
return trackColor.false;
|
|
} else {
|
|
return trackColor !== null && trackColor !== void 0 ? trackColor : defaultTrackColor;
|
|
}
|
|
}
|
|
})();
|
|
var thumbCurrentColor = value ? activeThumbColor !== null && activeThumbColor !== void 0 ? activeThumbColor : defaultActiveThumbColor : thumbColor !== null && thumbColor !== void 0 ? thumbColor : defaultThumbColor;
|
|
var thumbHeight = height;
|
|
var thumbWidth = thumbHeight;
|
|
var rootStyle = [styles.root, style, disabled && styles.cursorDefault, {
|
|
height,
|
|
width
|
|
}];
|
|
var disabledTrackColor = (function() {
|
|
if (value === true) {
|
|
if (typeof activeTrackColor === "string" && activeTrackColor != null || typeof trackColor === "object" && trackColor != null && trackColor.true) {
|
|
return trackCurrentColor;
|
|
} else {
|
|
return defaultDisabledTrackColor;
|
|
}
|
|
} else {
|
|
if (typeof trackColor === "string" && trackColor != null || typeof trackColor === "object" && trackColor != null && trackColor.false) {
|
|
return trackCurrentColor;
|
|
} else {
|
|
return defaultDisabledTrackColor;
|
|
}
|
|
}
|
|
})();
|
|
var disabledThumbColor = (function() {
|
|
if (value === true) {
|
|
if (activeThumbColor == null) {
|
|
return defaultDisabledThumbColor;
|
|
} else {
|
|
return thumbCurrentColor;
|
|
}
|
|
} else {
|
|
if (thumbColor == null) {
|
|
return defaultDisabledThumbColor;
|
|
} else {
|
|
return thumbCurrentColor;
|
|
}
|
|
}
|
|
})();
|
|
var trackStyle = [styles.track, {
|
|
backgroundColor: disabled ? disabledTrackColor : trackCurrentColor,
|
|
borderRadius: trackBorderRadius
|
|
}];
|
|
var thumbStyle = [styles.thumb, value && styles.thumbActive, {
|
|
backgroundColor: disabled ? disabledThumbColor : thumbCurrentColor,
|
|
height: thumbHeight,
|
|
marginStart: value ? (0, _multiplyStyleLengthValue.default)(thumbWidth, -1) : 0,
|
|
width: thumbWidth
|
|
}];
|
|
var nativeControl = (0, _createElement.default)("input", {
|
|
"aria-label": ariaLabel || accessibilityLabel,
|
|
checked: value,
|
|
disabled,
|
|
onBlur: handleFocusState,
|
|
onChange: handleChange,
|
|
onFocus: handleFocusState,
|
|
ref: forwardedRef,
|
|
style: [styles.nativeControl, styles.cursorInherit],
|
|
type: "checkbox",
|
|
role: "switch"
|
|
});
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, other, {
|
|
style: rootStyle
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
style: trackStyle
|
|
}), /* @__PURE__ */ React83.createElement(_View.default, {
|
|
ref: thumbRef,
|
|
style: thumbStyle
|
|
}), nativeControl);
|
|
});
|
|
Switch2.displayName = "Switch";
|
|
var styles = _StyleSheet.default.create({
|
|
root: {
|
|
cursor: "pointer",
|
|
userSelect: "none"
|
|
},
|
|
cursorDefault: {
|
|
cursor: "default"
|
|
},
|
|
cursorInherit: {
|
|
cursor: "inherit"
|
|
},
|
|
track: (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
forcedColorAdjust: "none"
|
|
}, _StyleSheet.default.absoluteFillObject), {}, {
|
|
height: "70%",
|
|
margin: "auto",
|
|
transitionDuration: "0.1s",
|
|
width: "100%"
|
|
}),
|
|
thumb: {
|
|
forcedColorAdjust: "none",
|
|
alignSelf: "flex-start",
|
|
borderRadius: "100%",
|
|
boxShadow: thumbDefaultBoxShadow,
|
|
start: "0%",
|
|
transform: "translateZ(0)",
|
|
transitionDuration: "0.1s"
|
|
},
|
|
thumbActive: {
|
|
insetInlineStart: "100%"
|
|
},
|
|
nativeControl: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
|
|
height: "100%",
|
|
margin: 0,
|
|
appearance: "none",
|
|
padding: 0,
|
|
width: "100%"
|
|
})
|
|
});
|
|
var _default = exports2.default = Switch2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/TextInput/index.js
|
|
var require_TextInput = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/TextInput/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
var forwardedProps = _interopRequireWildcard(require_forwardedProps());
|
|
var _pick = _interopRequireDefault(require_pick());
|
|
var _useElementLayout = _interopRequireDefault(require_useElementLayout());
|
|
var _useLayoutEffect = _interopRequireDefault(require_useLayoutEffect());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePlatformMethods = _interopRequireDefault(require_usePlatformMethods());
|
|
var _useResponderEvents = _interopRequireDefault(require_useResponderEvents());
|
|
var _useLocale = require_useLocale();
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _TextInputState = _interopRequireDefault(require_TextInputState());
|
|
var isSelectionStale = /* @__PURE__ */ __name((node, selection) => {
|
|
var selectionEnd = node.selectionEnd, selectionStart = node.selectionStart;
|
|
var start = selection.start, end = selection.end;
|
|
return start !== selectionStart || end !== selectionEnd;
|
|
}, "isSelectionStale");
|
|
var setSelection = /* @__PURE__ */ __name((node, selection) => {
|
|
if (isSelectionStale(node, selection)) {
|
|
var start = selection.start, end = selection.end;
|
|
try {
|
|
node.setSelectionRange(start, end || start);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
}, "setSelection");
|
|
var forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
|
|
autoCapitalize: true,
|
|
autoComplete: true,
|
|
autoCorrect: true,
|
|
autoFocus: true,
|
|
defaultValue: true,
|
|
disabled: true,
|
|
lang: true,
|
|
maxLength: true,
|
|
onChange: true,
|
|
onScroll: true,
|
|
placeholder: true,
|
|
pointerEvents: true,
|
|
readOnly: true,
|
|
rows: true,
|
|
spellCheck: true,
|
|
value: true,
|
|
type: true
|
|
});
|
|
var pickProps = /* @__PURE__ */ __name((props) => (0, _pick.default)(props, forwardPropsList), "pickProps");
|
|
function isEventComposing(nativeEvent) {
|
|
return nativeEvent.isComposing || nativeEvent.keyCode === 229;
|
|
}
|
|
__name(isEventComposing, "isEventComposing");
|
|
var focusTimeout = null;
|
|
var TextInput2 = /* @__PURE__ */ React83.forwardRef((props, forwardedRef) => {
|
|
var _props$autoCapitalize = props.autoCapitalize, autoCapitalize = _props$autoCapitalize === void 0 ? "sentences" : _props$autoCapitalize, autoComplete = props.autoComplete, autoCompleteType = props.autoCompleteType, _props$autoCorrect = props.autoCorrect, autoCorrect = _props$autoCorrect === void 0 ? true : _props$autoCorrect, blurOnSubmit = props.blurOnSubmit, caretHidden = props.caretHidden, clearTextOnFocus = props.clearTextOnFocus, dir = props.dir, editable = props.editable, enterKeyHint = props.enterKeyHint, inputMode = props.inputMode, keyboardType = props.keyboardType, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, numberOfLines = props.numberOfLines, onBlur = props.onBlur, onChange = props.onChange, onChangeText = props.onChangeText, onContentSizeChange = props.onContentSizeChange, onFocus = props.onFocus, onKeyPress = props.onKeyPress, onLayout = props.onLayout, onMoveShouldSetResponder = props.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture, onResponderEnd = props.onResponderEnd, onResponderGrant = props.onResponderGrant, onResponderMove = props.onResponderMove, onResponderReject = props.onResponderReject, onResponderRelease = props.onResponderRelease, onResponderStart = props.onResponderStart, onResponderTerminate = props.onResponderTerminate, onResponderTerminationRequest = props.onResponderTerminationRequest, onScrollShouldSetResponder = props.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture, onSelectionChange = props.onSelectionChange, onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = props.onStartShouldSetResponder, onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture, onSubmitEditing = props.onSubmitEditing, placeholderTextColor = props.placeholderTextColor, _props$readOnly = props.readOnly, readOnly = _props$readOnly === void 0 ? false : _props$readOnly, returnKeyType = props.returnKeyType, rows = props.rows, _props$secureTextEntr = props.secureTextEntry, secureTextEntry = _props$secureTextEntr === void 0 ? false : _props$secureTextEntr, selection = props.selection, selectTextOnFocus = props.selectTextOnFocus, showSoftInputOnFocus = props.showSoftInputOnFocus, spellCheck = props.spellCheck;
|
|
var type;
|
|
var _inputMode;
|
|
if (inputMode != null) {
|
|
_inputMode = inputMode;
|
|
if (inputMode === "email") {
|
|
type = "email";
|
|
} else if (inputMode === "tel") {
|
|
type = "tel";
|
|
} else if (inputMode === "search") {
|
|
type = "search";
|
|
} else if (inputMode === "url") {
|
|
type = "url";
|
|
} else {
|
|
type = "text";
|
|
}
|
|
} else if (keyboardType != null) {
|
|
switch (keyboardType) {
|
|
case "email-address":
|
|
type = "email";
|
|
break;
|
|
case "number-pad":
|
|
case "numeric":
|
|
_inputMode = "numeric";
|
|
break;
|
|
case "decimal-pad":
|
|
_inputMode = "decimal";
|
|
break;
|
|
case "phone-pad":
|
|
type = "tel";
|
|
break;
|
|
case "search":
|
|
case "web-search":
|
|
type = "search";
|
|
break;
|
|
case "url":
|
|
type = "url";
|
|
break;
|
|
default:
|
|
type = "text";
|
|
}
|
|
}
|
|
if (secureTextEntry) {
|
|
type = "password";
|
|
}
|
|
var dimensions = React83.useRef({
|
|
height: null,
|
|
width: null
|
|
});
|
|
var hostRef = React83.useRef(null);
|
|
var prevSelection = React83.useRef(null);
|
|
var prevSecureTextEntry = React83.useRef(false);
|
|
React83.useEffect(() => {
|
|
if (hostRef.current && prevSelection.current) {
|
|
setSelection(hostRef.current, prevSelection.current);
|
|
}
|
|
prevSecureTextEntry.current = secureTextEntry;
|
|
}, [secureTextEntry]);
|
|
var handleContentSizeChange = React83.useCallback((hostNode) => {
|
|
if (multiline && onContentSizeChange && hostNode != null) {
|
|
var newHeight = hostNode.scrollHeight;
|
|
var newWidth = hostNode.scrollWidth;
|
|
if (newHeight !== dimensions.current.height || newWidth !== dimensions.current.width) {
|
|
dimensions.current.height = newHeight;
|
|
dimensions.current.width = newWidth;
|
|
onContentSizeChange({
|
|
nativeEvent: {
|
|
contentSize: {
|
|
height: dimensions.current.height,
|
|
width: dimensions.current.width
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}, [multiline, onContentSizeChange]);
|
|
var imperativeRef = React83.useMemo(() => (hostNode) => {
|
|
if (hostNode != null) {
|
|
hostNode.clear = function() {
|
|
if (hostNode != null) {
|
|
hostNode.value = "";
|
|
}
|
|
};
|
|
hostNode.isFocused = function() {
|
|
return hostNode != null && _TextInputState.default.currentlyFocusedField() === hostNode;
|
|
};
|
|
handleContentSizeChange(hostNode);
|
|
}
|
|
}, [handleContentSizeChange]);
|
|
function handleBlur(e) {
|
|
_TextInputState.default._currentlyFocusedNode = null;
|
|
if (onBlur) {
|
|
e.nativeEvent.text = e.target.value;
|
|
onBlur(e);
|
|
}
|
|
}
|
|
__name(handleBlur, "handleBlur");
|
|
function handleChange(e) {
|
|
var hostNode = e.target;
|
|
var text = hostNode.value;
|
|
e.nativeEvent.text = text;
|
|
handleContentSizeChange(hostNode);
|
|
if (onChange) {
|
|
onChange(e);
|
|
}
|
|
if (onChangeText) {
|
|
onChangeText(text);
|
|
}
|
|
}
|
|
__name(handleChange, "handleChange");
|
|
function handleFocus(e) {
|
|
var hostNode = e.target;
|
|
if (onFocus) {
|
|
e.nativeEvent.text = hostNode.value;
|
|
onFocus(e);
|
|
}
|
|
if (hostNode != null) {
|
|
_TextInputState.default._currentlyFocusedNode = hostNode;
|
|
if (clearTextOnFocus) {
|
|
hostNode.value = "";
|
|
}
|
|
if (selectTextOnFocus) {
|
|
if (focusTimeout != null) {
|
|
clearTimeout(focusTimeout);
|
|
}
|
|
focusTimeout = setTimeout(() => {
|
|
if (hostNode != null && document.activeElement === hostNode) {
|
|
hostNode.select();
|
|
}
|
|
}, 0);
|
|
}
|
|
}
|
|
}
|
|
__name(handleFocus, "handleFocus");
|
|
function handleKeyDown(e) {
|
|
var hostNode = e.target;
|
|
e.stopPropagation();
|
|
var blurOnSubmitDefault = !multiline;
|
|
var shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit;
|
|
var nativeEvent = e.nativeEvent;
|
|
var isComposing = isEventComposing(nativeEvent);
|
|
if (onKeyPress) {
|
|
onKeyPress(e);
|
|
}
|
|
if (e.key === "Enter" && !e.shiftKey && // Do not call submit if composition is occuring.
|
|
!isComposing && !e.isDefaultPrevented()) {
|
|
if ((blurOnSubmit || !multiline) && onSubmitEditing) {
|
|
e.preventDefault();
|
|
nativeEvent.text = e.target.value;
|
|
onSubmitEditing(e);
|
|
}
|
|
if (shouldBlurOnSubmit && hostNode != null) {
|
|
setTimeout(() => hostNode.blur(), 0);
|
|
}
|
|
}
|
|
}
|
|
__name(handleKeyDown, "handleKeyDown");
|
|
function handleSelectionChange(e) {
|
|
try {
|
|
var _e$target = e.target, selectionStart = _e$target.selectionStart, selectionEnd = _e$target.selectionEnd;
|
|
var _selection = {
|
|
start: selectionStart,
|
|
end: selectionEnd
|
|
};
|
|
if (onSelectionChange) {
|
|
e.nativeEvent.selection = _selection;
|
|
e.nativeEvent.text = e.target.value;
|
|
onSelectionChange(e);
|
|
}
|
|
if (prevSecureTextEntry.current === secureTextEntry) {
|
|
prevSelection.current = _selection;
|
|
}
|
|
} catch (e2) {
|
|
}
|
|
}
|
|
__name(handleSelectionChange, "handleSelectionChange");
|
|
(0, _useLayoutEffect.default)(() => {
|
|
var node = hostRef.current;
|
|
if (node != null && selection != null) {
|
|
setSelection(node, selection);
|
|
}
|
|
if (document.activeElement === node) {
|
|
_TextInputState.default._currentlyFocusedNode = node;
|
|
}
|
|
}, [hostRef, selection]);
|
|
var component = multiline ? "textarea" : "input";
|
|
(0, _useElementLayout.default)(hostRef, onLayout);
|
|
(0, _useResponderEvents.default)(hostRef, {
|
|
onMoveShouldSetResponder,
|
|
onMoveShouldSetResponderCapture,
|
|
onResponderEnd,
|
|
onResponderGrant,
|
|
onResponderMove,
|
|
onResponderReject,
|
|
onResponderRelease,
|
|
onResponderStart,
|
|
onResponderTerminate,
|
|
onResponderTerminationRequest,
|
|
onScrollShouldSetResponder,
|
|
onScrollShouldSetResponderCapture,
|
|
onSelectionChangeShouldSetResponder,
|
|
onSelectionChangeShouldSetResponderCapture,
|
|
onStartShouldSetResponder,
|
|
onStartShouldSetResponderCapture
|
|
});
|
|
var _useLocaleContext = (0, _useLocale.useLocaleContext)(), contextDirection = _useLocaleContext.direction;
|
|
var supportedProps = pickProps(props);
|
|
supportedProps.autoCapitalize = autoCapitalize;
|
|
supportedProps.autoComplete = autoComplete || autoCompleteType || "on";
|
|
supportedProps.autoCorrect = autoCorrect ? "on" : "off";
|
|
supportedProps.dir = dir !== void 0 ? dir : "auto";
|
|
supportedProps.enterKeyHint = enterKeyHint || returnKeyType;
|
|
supportedProps.inputMode = _inputMode;
|
|
supportedProps.onBlur = handleBlur;
|
|
supportedProps.onChange = handleChange;
|
|
supportedProps.onFocus = handleFocus;
|
|
supportedProps.onKeyDown = handleKeyDown;
|
|
supportedProps.onSelect = handleSelectionChange;
|
|
supportedProps.readOnly = readOnly === true || editable === false;
|
|
supportedProps.rows = multiline ? rows != null ? rows : numberOfLines : 1;
|
|
supportedProps.spellCheck = spellCheck != null ? spellCheck : autoCorrect;
|
|
supportedProps.style = [{
|
|
"--placeholderTextColor": placeholderTextColor
|
|
}, styles.textinput$raw, styles.placeholder, props.style, caretHidden && styles.caretHidden];
|
|
supportedProps.type = multiline ? void 0 : type;
|
|
supportedProps.virtualkeyboardpolicy = showSoftInputOnFocus === false ? "manual" : "auto";
|
|
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
|
var setRef2 = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, imperativeRef, forwardedRef);
|
|
supportedProps.ref = setRef2;
|
|
var langDirection = props.lang != null ? (0, _useLocale.getLocaleDirection)(props.lang) : null;
|
|
var componentDirection = props.dir || langDirection;
|
|
var writingDirection = componentDirection || contextDirection;
|
|
var element = (0, _createElement.default)(component, supportedProps, {
|
|
writingDirection
|
|
});
|
|
return element;
|
|
});
|
|
TextInput2.displayName = "TextInput";
|
|
TextInput2.State = _TextInputState.default;
|
|
var styles = _StyleSheet.default.create({
|
|
textinput$raw: {
|
|
MozAppearance: "textfield",
|
|
WebkitAppearance: "none",
|
|
backgroundColor: "transparent",
|
|
border: "0 solid black",
|
|
borderRadius: 0,
|
|
boxSizing: "border-box",
|
|
font: "14px System",
|
|
margin: 0,
|
|
padding: 0,
|
|
resize: "none"
|
|
},
|
|
placeholder: {
|
|
placeholderTextColor: "var(--placeholderTextColor)"
|
|
},
|
|
caretHidden: {
|
|
caretColor: "transparent"
|
|
}
|
|
});
|
|
var _default = exports2.default = TextInput2;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/vendor/react-native/PooledClass/index.js
|
|
var require_PooledClass = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/vendor/react-native/PooledClass/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
var twoArgumentPooler = /* @__PURE__ */ __name(function twoArgumentPooler2(a1, a2) {
|
|
var Klass = this;
|
|
if (Klass.instancePool.length) {
|
|
var instance = Klass.instancePool.pop();
|
|
Klass.call(instance, a1, a2);
|
|
return instance;
|
|
} else {
|
|
return new Klass(a1, a2);
|
|
}
|
|
}, "twoArgumentPooler");
|
|
var standardReleaser = /* @__PURE__ */ __name(function standardReleaser2(instance) {
|
|
var Klass = this;
|
|
instance.destructor();
|
|
if (Klass.instancePool.length < Klass.poolSize) {
|
|
Klass.instancePool.push(instance);
|
|
}
|
|
}, "standardReleaser");
|
|
var DEFAULT_POOL_SIZE = 10;
|
|
var DEFAULT_POOLER = twoArgumentPooler;
|
|
var addPoolingTo = /* @__PURE__ */ __name(function addPoolingTo2(CopyConstructor, pooler) {
|
|
var NewKlass = CopyConstructor;
|
|
NewKlass.instancePool = [];
|
|
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
|
if (!NewKlass.poolSize) {
|
|
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
|
}
|
|
NewKlass.release = standardReleaser;
|
|
return NewKlass;
|
|
}, "addPoolingTo");
|
|
var PooledClass = {
|
|
addPoolingTo,
|
|
twoArgumentPooler
|
|
};
|
|
var _default = exports2.default = PooledClass;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Touchable/BoundingDimensions.js
|
|
var require_BoundingDimensions = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Touchable/BoundingDimensions.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _PooledClass = _interopRequireDefault(require_PooledClass());
|
|
var twoArgumentPooler = _PooledClass.default.twoArgumentPooler;
|
|
function BoundingDimensions(width, height) {
|
|
this.width = width;
|
|
this.height = height;
|
|
}
|
|
__name(BoundingDimensions, "BoundingDimensions");
|
|
BoundingDimensions.prototype.destructor = function() {
|
|
this.width = null;
|
|
this.height = null;
|
|
};
|
|
BoundingDimensions.getPooledFromElement = function(element) {
|
|
return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight);
|
|
};
|
|
_PooledClass.default.addPoolingTo(BoundingDimensions, twoArgumentPooler);
|
|
var _default = exports2.default = BoundingDimensions;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Touchable/Position.js
|
|
var require_Position = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Touchable/Position.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _PooledClass = _interopRequireDefault(require_PooledClass());
|
|
var twoArgumentPooler = _PooledClass.default.twoArgumentPooler;
|
|
function Position(left, top) {
|
|
this.left = left;
|
|
this.top = top;
|
|
}
|
|
__name(Position, "Position");
|
|
Position.prototype.destructor = function() {
|
|
this.left = null;
|
|
this.top = null;
|
|
};
|
|
_PooledClass.default.addPoolingTo(Position, twoArgumentPooler);
|
|
var _default = exports2.default = Position;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/Touchable/index.js
|
|
var require_Touchable = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/Touchable/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
|
var _AccessibilityUtil = _interopRequireDefault(require_AccessibilityUtil());
|
|
var _BoundingDimensions = _interopRequireDefault(require_BoundingDimensions());
|
|
var _normalizeColors = _interopRequireDefault(require_normalize_colors());
|
|
var _Position = _interopRequireDefault(require_Position());
|
|
var _react = _interopRequireDefault(require("react"));
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _warnOnce = require_warnOnce();
|
|
var extractSingleTouch = /* @__PURE__ */ __name((nativeEvent) => {
|
|
var touches = nativeEvent.touches;
|
|
var changedTouches = nativeEvent.changedTouches;
|
|
var hasTouches = touches && touches.length > 0;
|
|
var hasChangedTouches = changedTouches && changedTouches.length > 0;
|
|
return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;
|
|
}, "extractSingleTouch");
|
|
var States = {
|
|
NOT_RESPONDER: "NOT_RESPONDER",
|
|
// Not the responder
|
|
RESPONDER_INACTIVE_PRESS_IN: "RESPONDER_INACTIVE_PRESS_IN",
|
|
// Responder, inactive, in the `PressRect`
|
|
RESPONDER_INACTIVE_PRESS_OUT: "RESPONDER_INACTIVE_PRESS_OUT",
|
|
// Responder, inactive, out of `PressRect`
|
|
RESPONDER_ACTIVE_PRESS_IN: "RESPONDER_ACTIVE_PRESS_IN",
|
|
// Responder, active, in the `PressRect`
|
|
RESPONDER_ACTIVE_PRESS_OUT: "RESPONDER_ACTIVE_PRESS_OUT",
|
|
// Responder, active, out of `PressRect`
|
|
RESPONDER_ACTIVE_LONG_PRESS_IN: "RESPONDER_ACTIVE_LONG_PRESS_IN",
|
|
// Responder, active, in the `PressRect`, after long press threshold
|
|
RESPONDER_ACTIVE_LONG_PRESS_OUT: "RESPONDER_ACTIVE_LONG_PRESS_OUT",
|
|
// Responder, active, out of `PressRect`, after long press threshold
|
|
ERROR: "ERROR"
|
|
};
|
|
var baseStatesConditions = {
|
|
NOT_RESPONDER: false,
|
|
RESPONDER_INACTIVE_PRESS_IN: false,
|
|
RESPONDER_INACTIVE_PRESS_OUT: false,
|
|
RESPONDER_ACTIVE_PRESS_IN: false,
|
|
RESPONDER_ACTIVE_PRESS_OUT: false,
|
|
RESPONDER_ACTIVE_LONG_PRESS_IN: false,
|
|
RESPONDER_ACTIVE_LONG_PRESS_OUT: false,
|
|
ERROR: false
|
|
};
|
|
var IsActive = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, baseStatesConditions), {}, {
|
|
RESPONDER_ACTIVE_PRESS_OUT: true,
|
|
RESPONDER_ACTIVE_PRESS_IN: true
|
|
});
|
|
var IsPressingIn = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, baseStatesConditions), {}, {
|
|
RESPONDER_INACTIVE_PRESS_IN: true,
|
|
RESPONDER_ACTIVE_PRESS_IN: true,
|
|
RESPONDER_ACTIVE_LONG_PRESS_IN: true
|
|
});
|
|
var IsLongPressingIn = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, baseStatesConditions), {}, {
|
|
RESPONDER_ACTIVE_LONG_PRESS_IN: true
|
|
});
|
|
var Signals = {
|
|
DELAY: "DELAY",
|
|
RESPONDER_GRANT: "RESPONDER_GRANT",
|
|
RESPONDER_RELEASE: "RESPONDER_RELEASE",
|
|
RESPONDER_TERMINATED: "RESPONDER_TERMINATED",
|
|
ENTER_PRESS_RECT: "ENTER_PRESS_RECT",
|
|
LEAVE_PRESS_RECT: "LEAVE_PRESS_RECT",
|
|
LONG_PRESS_DETECTED: "LONG_PRESS_DETECTED"
|
|
};
|
|
var Transitions = {
|
|
NOT_RESPONDER: {
|
|
DELAY: States.ERROR,
|
|
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
|
|
RESPONDER_RELEASE: States.ERROR,
|
|
RESPONDER_TERMINATED: States.ERROR,
|
|
ENTER_PRESS_RECT: States.ERROR,
|
|
LEAVE_PRESS_RECT: States.ERROR,
|
|
LONG_PRESS_DETECTED: States.ERROR
|
|
},
|
|
RESPONDER_INACTIVE_PRESS_IN: {
|
|
DELAY: States.RESPONDER_ACTIVE_PRESS_IN,
|
|
RESPONDER_GRANT: States.ERROR,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
|
|
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
|
|
LONG_PRESS_DETECTED: States.ERROR
|
|
},
|
|
RESPONDER_INACTIVE_PRESS_OUT: {
|
|
DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,
|
|
RESPONDER_GRANT: States.ERROR,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
|
|
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
|
|
LONG_PRESS_DETECTED: States.ERROR
|
|
},
|
|
RESPONDER_ACTIVE_PRESS_IN: {
|
|
DELAY: States.ERROR,
|
|
RESPONDER_GRANT: States.ERROR,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
|
|
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
|
|
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
|
|
},
|
|
RESPONDER_ACTIVE_PRESS_OUT: {
|
|
DELAY: States.ERROR,
|
|
RESPONDER_GRANT: States.ERROR,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
|
|
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
|
|
LONG_PRESS_DETECTED: States.ERROR
|
|
},
|
|
RESPONDER_ACTIVE_LONG_PRESS_IN: {
|
|
DELAY: States.ERROR,
|
|
RESPONDER_GRANT: States.ERROR,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
|
|
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
|
|
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
|
|
},
|
|
RESPONDER_ACTIVE_LONG_PRESS_OUT: {
|
|
DELAY: States.ERROR,
|
|
RESPONDER_GRANT: States.ERROR,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
|
|
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
|
|
LONG_PRESS_DETECTED: States.ERROR
|
|
},
|
|
error: {
|
|
DELAY: States.NOT_RESPONDER,
|
|
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
|
|
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
|
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
|
ENTER_PRESS_RECT: States.NOT_RESPONDER,
|
|
LEAVE_PRESS_RECT: States.NOT_RESPONDER,
|
|
LONG_PRESS_DETECTED: States.NOT_RESPONDER
|
|
}
|
|
};
|
|
var HIGHLIGHT_DELAY_MS = 130;
|
|
var PRESS_EXPAND_PX = 20;
|
|
var LONG_PRESS_THRESHOLD = 500;
|
|
var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;
|
|
var LONG_PRESS_ALLOWED_MOVEMENT = 10;
|
|
var TouchableMixin = {
|
|
// HACK (part 1): basic support for touchable interactions using a keyboard
|
|
componentDidMount: /* @__PURE__ */ __name(function componentDidMount() {
|
|
(0, _warnOnce.warnOnce)("TouchableMixin", "TouchableMixin is deprecated. Please use Pressable.");
|
|
var touchableNode = this.getTouchableNode && this.getTouchableNode();
|
|
if (touchableNode && touchableNode.addEventListener) {
|
|
this._touchableBlurListener = (e) => {
|
|
if (this._isTouchableKeyboardActive) {
|
|
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
|
|
this.touchableHandleResponderTerminate({
|
|
nativeEvent: e
|
|
});
|
|
}
|
|
this._isTouchableKeyboardActive = false;
|
|
}
|
|
};
|
|
touchableNode.addEventListener("blur", this._touchableBlurListener);
|
|
}
|
|
}, "componentDidMount"),
|
|
/**
|
|
* Clear all timeouts on unmount
|
|
*/
|
|
componentWillUnmount: /* @__PURE__ */ __name(function componentWillUnmount() {
|
|
var touchableNode = this.getTouchableNode && this.getTouchableNode();
|
|
if (touchableNode && touchableNode.addEventListener) {
|
|
touchableNode.removeEventListener("blur", this._touchableBlurListener);
|
|
}
|
|
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
|
|
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
|
|
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
|
|
this.pressInLocation = null;
|
|
this.state.touchable.responderID = null;
|
|
}, "componentWillUnmount"),
|
|
/**
|
|
* It's prefer that mixins determine state in this way, having the class
|
|
* explicitly mix the state in the one and only `getInitialState` method.
|
|
*
|
|
* @return {object} State object to be placed inside of
|
|
* `this.state.touchable`.
|
|
*/
|
|
touchableGetInitialState: /* @__PURE__ */ __name(function touchableGetInitialState() {
|
|
return {
|
|
touchable: {
|
|
touchState: void 0,
|
|
responderID: null
|
|
}
|
|
};
|
|
}, "touchableGetInitialState"),
|
|
// ==== Hooks to Gesture Responder system ====
|
|
/**
|
|
* Must return true if embedded in a native platform scroll view.
|
|
*/
|
|
touchableHandleResponderTerminationRequest: /* @__PURE__ */ __name(function touchableHandleResponderTerminationRequest() {
|
|
return !this.props.rejectResponderTermination;
|
|
}, "touchableHandleResponderTerminationRequest"),
|
|
/**
|
|
* Must return true to start the process of `Touchable`.
|
|
*/
|
|
touchableHandleStartShouldSetResponder: /* @__PURE__ */ __name(function touchableHandleStartShouldSetResponder() {
|
|
return !this.props.disabled;
|
|
}, "touchableHandleStartShouldSetResponder"),
|
|
/**
|
|
* Return true to cancel press on long press.
|
|
*/
|
|
touchableLongPressCancelsPress: /* @__PURE__ */ __name(function touchableLongPressCancelsPress() {
|
|
return true;
|
|
}, "touchableLongPressCancelsPress"),
|
|
/**
|
|
* Place as callback for a DOM element's `onResponderGrant` event.
|
|
* @param {SyntheticEvent} e Synthetic event from event system.
|
|
*
|
|
*/
|
|
touchableHandleResponderGrant: /* @__PURE__ */ __name(function touchableHandleResponderGrant(e) {
|
|
var dispatchID = e.currentTarget;
|
|
e.persist();
|
|
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
|
|
this.pressOutDelayTimeout = null;
|
|
this.state.touchable.touchState = States.NOT_RESPONDER;
|
|
this.state.touchable.responderID = dispatchID;
|
|
this._receiveSignal(Signals.RESPONDER_GRANT, e);
|
|
var delayMS = this.touchableGetHighlightDelayMS !== void 0 ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;
|
|
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
|
|
if (delayMS !== 0) {
|
|
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
|
|
} else {
|
|
this._handleDelay(e);
|
|
}
|
|
var longDelayMS = this.touchableGetLongPressDelayMS !== void 0 ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;
|
|
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
|
|
this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);
|
|
}, "touchableHandleResponderGrant"),
|
|
/**
|
|
* Place as callback for a DOM element's `onResponderRelease` event.
|
|
*/
|
|
touchableHandleResponderRelease: /* @__PURE__ */ __name(function touchableHandleResponderRelease(e) {
|
|
this.pressInLocation = null;
|
|
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
|
|
}, "touchableHandleResponderRelease"),
|
|
/**
|
|
* Place as callback for a DOM element's `onResponderTerminate` event.
|
|
*/
|
|
touchableHandleResponderTerminate: /* @__PURE__ */ __name(function touchableHandleResponderTerminate(e) {
|
|
this.pressInLocation = null;
|
|
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
|
|
}, "touchableHandleResponderTerminate"),
|
|
/**
|
|
* Place as callback for a DOM element's `onResponderMove` event.
|
|
*/
|
|
touchableHandleResponderMove: /* @__PURE__ */ __name(function touchableHandleResponderMove(e) {
|
|
if (!this.state.touchable.positionOnActivate) {
|
|
return;
|
|
}
|
|
var positionOnActivate = this.state.touchable.positionOnActivate;
|
|
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
|
|
var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {
|
|
left: PRESS_EXPAND_PX,
|
|
right: PRESS_EXPAND_PX,
|
|
top: PRESS_EXPAND_PX,
|
|
bottom: PRESS_EXPAND_PX
|
|
};
|
|
var pressExpandLeft = pressRectOffset.left;
|
|
var pressExpandTop = pressRectOffset.top;
|
|
var pressExpandRight = pressRectOffset.right;
|
|
var pressExpandBottom = pressRectOffset.bottom;
|
|
var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;
|
|
if (hitSlop) {
|
|
pressExpandLeft += hitSlop.left || 0;
|
|
pressExpandTop += hitSlop.top || 0;
|
|
pressExpandRight += hitSlop.right || 0;
|
|
pressExpandBottom += hitSlop.bottom || 0;
|
|
}
|
|
var touch = extractSingleTouch(e.nativeEvent);
|
|
var pageX = touch && touch.pageX;
|
|
var pageY = touch && touch.pageY;
|
|
if (this.pressInLocation) {
|
|
var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);
|
|
if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {
|
|
this._cancelLongPressDelayTimeout();
|
|
}
|
|
}
|
|
var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;
|
|
if (isTouchWithinActive) {
|
|
var prevState = this.state.touchable.touchState;
|
|
this._receiveSignal(Signals.ENTER_PRESS_RECT, e);
|
|
var curState = this.state.touchable.touchState;
|
|
if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) {
|
|
this._cancelLongPressDelayTimeout();
|
|
}
|
|
} else {
|
|
this._cancelLongPressDelayTimeout();
|
|
this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);
|
|
}
|
|
}, "touchableHandleResponderMove"),
|
|
/**
|
|
* Invoked when the item receives focus. Mixers might override this to
|
|
* visually distinguish the `VisualRect` so that the user knows that it
|
|
* currently has the focus. Most platforms only support a single element being
|
|
* focused at a time, in which case there may have been a previously focused
|
|
* element that was blurred just prior to this. This can be overridden when
|
|
* using `Touchable.Mixin.withoutDefaultFocusAndBlur`.
|
|
*/
|
|
touchableHandleFocus: /* @__PURE__ */ __name(function touchableHandleFocus2(e) {
|
|
this.props.onFocus && this.props.onFocus(e);
|
|
}, "touchableHandleFocus"),
|
|
/**
|
|
* Invoked when the item loses focus. Mixers might override this to
|
|
* visually distinguish the `VisualRect` so that the user knows that it
|
|
* no longer has focus. Most platforms only support a single element being
|
|
* focused at a time, in which case the focus may have moved to another.
|
|
* This can be overridden when using
|
|
* `Touchable.Mixin.withoutDefaultFocusAndBlur`.
|
|
*/
|
|
touchableHandleBlur: /* @__PURE__ */ __name(function touchableHandleBlur2(e) {
|
|
this.props.onBlur && this.props.onBlur(e);
|
|
}, "touchableHandleBlur"),
|
|
// ==== Abstract Application Callbacks ====
|
|
/**
|
|
* Invoked when the item should be highlighted. Mixers should implement this
|
|
* to visually distinguish the `VisualRect` so that the user knows that
|
|
* releasing a touch will result in a "selection" (analog to click).
|
|
*
|
|
* @abstract
|
|
* touchableHandleActivePressIn: function,
|
|
*/
|
|
/**
|
|
* Invoked when the item is "active" (in that it is still eligible to become
|
|
* a "select") but the touch has left the `PressRect`. Usually the mixer will
|
|
* want to unhighlight the `VisualRect`. If the user (while pressing) moves
|
|
* back into the `PressRect` `touchableHandleActivePressIn` will be invoked
|
|
* again and the mixer should probably highlight the `VisualRect` again. This
|
|
* event will not fire on an `touchEnd/mouseUp` event, only move events while
|
|
* the user is depressing the mouse/touch.
|
|
*
|
|
* @abstract
|
|
* touchableHandleActivePressOut: function
|
|
*/
|
|
/**
|
|
* Invoked when the item is "selected" - meaning the interaction ended by
|
|
* letting up while the item was either in the state
|
|
* `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.
|
|
*
|
|
* @abstract
|
|
* touchableHandlePress: function
|
|
*/
|
|
/**
|
|
* Invoked when the item is long pressed - meaning the interaction ended by
|
|
* letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If
|
|
* `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will
|
|
* be called as it normally is. If `touchableHandleLongPress` is provided, by
|
|
* default any `touchableHandlePress` callback will not be invoked. To
|
|
* override this default behavior, override `touchableLongPressCancelsPress`
|
|
* to return false. As a result, `touchableHandlePress` will be called when
|
|
* lifting up, even if `touchableHandleLongPress` has also been called.
|
|
*
|
|
* @abstract
|
|
* touchableHandleLongPress: function
|
|
*/
|
|
/**
|
|
* Returns the number of millis to wait before triggering a highlight.
|
|
*
|
|
* @abstract
|
|
* touchableGetHighlightDelayMS: function
|
|
*/
|
|
/**
|
|
* Returns the amount to extend the `HitRect` into the `PressRect`. Positive
|
|
* numbers mean the size expands outwards.
|
|
*
|
|
* @abstract
|
|
* touchableGetPressRectOffset: function
|
|
*/
|
|
// ==== Internal Logic ====
|
|
/**
|
|
* Measures the `HitRect` node on activation. The Bounding rectangle is with
|
|
* respect to viewport - not page, so adding the `pageXOffset/pageYOffset`
|
|
* should result in points that are in the same coordinate system as an
|
|
* event's `globalX/globalY` data values.
|
|
*
|
|
* - Consider caching this for the lifetime of the component, or possibly
|
|
* being able to share this cache between any `ScrollMap` view.
|
|
*
|
|
* @sideeffects
|
|
* @private
|
|
*/
|
|
_remeasureMetricsOnActivation: /* @__PURE__ */ __name(function _remeasureMetricsOnActivation() {
|
|
var tag = this.state.touchable.responderID;
|
|
if (tag == null) {
|
|
return;
|
|
}
|
|
_UIManager.default.measure(tag, this._handleQueryLayout);
|
|
}, "_remeasureMetricsOnActivation"),
|
|
_handleQueryLayout: /* @__PURE__ */ __name(function _handleQueryLayout(l, t, w, h, globalX, globalY) {
|
|
if (!l && !t && !w && !h && !globalX && !globalY) {
|
|
return;
|
|
}
|
|
this.state.touchable.positionOnActivate && _Position.default.release(this.state.touchable.positionOnActivate);
|
|
this.state.touchable.dimensionsOnActivate && // $FlowFixMe
|
|
_BoundingDimensions.default.release(this.state.touchable.dimensionsOnActivate);
|
|
this.state.touchable.positionOnActivate = _Position.default.getPooled(globalX, globalY);
|
|
this.state.touchable.dimensionsOnActivate = _BoundingDimensions.default.getPooled(w, h);
|
|
}, "_handleQueryLayout"),
|
|
_handleDelay: /* @__PURE__ */ __name(function _handleDelay(e) {
|
|
this.touchableDelayTimeout = null;
|
|
this._receiveSignal(Signals.DELAY, e);
|
|
}, "_handleDelay"),
|
|
_handleLongDelay: /* @__PURE__ */ __name(function _handleLongDelay(e) {
|
|
this.longPressDelayTimeout = null;
|
|
var curState = this.state.touchable.touchState;
|
|
if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
|
|
console.error("Attempted to transition from state `" + curState + "` to `" + States.RESPONDER_ACTIVE_LONG_PRESS_IN + "`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled.");
|
|
} else {
|
|
this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
|
|
}
|
|
}, "_handleLongDelay"),
|
|
/**
|
|
* Receives a state machine signal, performs side effects of the transition
|
|
* and stores the new state. Validates the transition as well.
|
|
*
|
|
* @param {Signals} signal State machine signal.
|
|
* @throws Error if invalid state transition or unrecognized signal.
|
|
* @sideeffects
|
|
*/
|
|
_receiveSignal: /* @__PURE__ */ __name(function _receiveSignal(signal, e) {
|
|
var responderID = this.state.touchable.responderID;
|
|
var curState = this.state.touchable.touchState;
|
|
var nextState = Transitions[curState] && Transitions[curState][signal];
|
|
if (!responderID && signal === Signals.RESPONDER_RELEASE) {
|
|
return;
|
|
}
|
|
if (!nextState) {
|
|
throw new Error("Unrecognized signal `" + signal + "` or state `" + curState + "` for Touchable responder `" + responderID + "`");
|
|
}
|
|
if (nextState === States.ERROR) {
|
|
throw new Error("Touchable cannot transition from `" + curState + "` to `" + signal + "` for responder `" + responderID + "`");
|
|
}
|
|
if (curState !== nextState) {
|
|
this._performSideEffectsForTransition(curState, nextState, signal, e);
|
|
this.state.touchable.touchState = nextState;
|
|
}
|
|
}, "_receiveSignal"),
|
|
_cancelLongPressDelayTimeout: /* @__PURE__ */ __name(function _cancelLongPressDelayTimeout() {
|
|
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
|
|
this.longPressDelayTimeout = null;
|
|
}, "_cancelLongPressDelayTimeout"),
|
|
_isHighlight: /* @__PURE__ */ __name(function _isHighlight(state) {
|
|
return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;
|
|
}, "_isHighlight"),
|
|
_savePressInLocation: /* @__PURE__ */ __name(function _savePressInLocation(e) {
|
|
var touch = extractSingleTouch(e.nativeEvent);
|
|
var pageX = touch && touch.pageX;
|
|
var pageY = touch && touch.pageY;
|
|
var locationX = touch && touch.locationX;
|
|
var locationY = touch && touch.locationY;
|
|
this.pressInLocation = {
|
|
pageX,
|
|
pageY,
|
|
locationX,
|
|
locationY
|
|
};
|
|
}, "_savePressInLocation"),
|
|
_getDistanceBetweenPoints: /* @__PURE__ */ __name(function _getDistanceBetweenPoints(aX, aY, bX, bY) {
|
|
var deltaX = aX - bX;
|
|
var deltaY = aY - bY;
|
|
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
}, "_getDistanceBetweenPoints"),
|
|
/**
|
|
* Will perform a transition between touchable states, and identify any
|
|
* highlighting or unhighlighting that must be performed for this particular
|
|
* transition.
|
|
*
|
|
* @param {States} curState Current Touchable state.
|
|
* @param {States} nextState Next Touchable state.
|
|
* @param {Signal} signal Signal that triggered the transition.
|
|
* @param {Event} e Native event.
|
|
* @sideeffects
|
|
*/
|
|
_performSideEffectsForTransition: /* @__PURE__ */ __name(function _performSideEffectsForTransition(curState, nextState, signal, e) {
|
|
var curIsHighlight = this._isHighlight(curState);
|
|
var newIsHighlight = this._isHighlight(nextState);
|
|
var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;
|
|
if (isFinalSignal) {
|
|
this._cancelLongPressDelayTimeout();
|
|
}
|
|
var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN;
|
|
var isActiveTransition = !IsActive[curState] && IsActive[nextState];
|
|
if (isInitialTransition || isActiveTransition) {
|
|
this._remeasureMetricsOnActivation();
|
|
}
|
|
if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {
|
|
this.touchableHandleLongPress && this.touchableHandleLongPress(e);
|
|
}
|
|
if (newIsHighlight && !curIsHighlight) {
|
|
this._startHighlight(e);
|
|
} else if (!newIsHighlight && curIsHighlight) {
|
|
this._endHighlight(e);
|
|
}
|
|
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
|
|
var hasLongPressHandler = !!this.props.onLongPress;
|
|
var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && // We *are* long pressing.. // But either has no long handler
|
|
(!hasLongPressHandler || !this.touchableLongPressCancelsPress());
|
|
var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;
|
|
if (shouldInvokePress && this.touchableHandlePress) {
|
|
if (!newIsHighlight && !curIsHighlight) {
|
|
this._startHighlight(e);
|
|
this._endHighlight(e);
|
|
}
|
|
this.touchableHandlePress(e);
|
|
}
|
|
}
|
|
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
|
|
this.touchableDelayTimeout = null;
|
|
}, "_performSideEffectsForTransition"),
|
|
_playTouchSound: /* @__PURE__ */ __name(function _playTouchSound() {
|
|
_UIManager.default.playTouchSound();
|
|
}, "_playTouchSound"),
|
|
_startHighlight: /* @__PURE__ */ __name(function _startHighlight(e) {
|
|
this._savePressInLocation(e);
|
|
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
|
|
}, "_startHighlight"),
|
|
_endHighlight: /* @__PURE__ */ __name(function _endHighlight(e) {
|
|
if (this.touchableHandleActivePressOut) {
|
|
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
|
|
this.pressOutDelayTimeout = setTimeout(() => {
|
|
this.touchableHandleActivePressOut(e);
|
|
}, this.touchableGetPressOutDelayMS());
|
|
} else {
|
|
this.touchableHandleActivePressOut(e);
|
|
}
|
|
}
|
|
}, "_endHighlight"),
|
|
// HACK (part 2): basic support for touchable interactions using a keyboard (including
|
|
// delays and longPress)
|
|
touchableHandleKeyEvent: /* @__PURE__ */ __name(function touchableHandleKeyEvent(e) {
|
|
var type = e.type, key = e.key;
|
|
if (key === "Enter" || key === " ") {
|
|
if (type === "keydown") {
|
|
if (!this._isTouchableKeyboardActive) {
|
|
if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {
|
|
this.touchableHandleResponderGrant(e);
|
|
this._isTouchableKeyboardActive = true;
|
|
}
|
|
}
|
|
} else if (type === "keyup") {
|
|
if (this._isTouchableKeyboardActive) {
|
|
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
|
|
this.touchableHandleResponderRelease(e);
|
|
this._isTouchableKeyboardActive = false;
|
|
}
|
|
}
|
|
}
|
|
e.stopPropagation();
|
|
if (!(key === "Enter" && _AccessibilityUtil.default.propsToAriaRole(this.props) === "link")) {
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
}, "touchableHandleKeyEvent"),
|
|
withoutDefaultFocusAndBlur: {}
|
|
};
|
|
var touchableHandleFocus = TouchableMixin.touchableHandleFocus;
|
|
var touchableHandleBlur = TouchableMixin.touchableHandleBlur;
|
|
var TouchableMixinWithoutDefaultFocusAndBlur = (0, _objectWithoutPropertiesLoose2.default)(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]);
|
|
TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur;
|
|
var Touchable = {
|
|
Mixin: TouchableMixin,
|
|
TOUCH_TARGET_DEBUG: false,
|
|
// Highlights all touchable targets. Toggle with Inspector.
|
|
/**
|
|
* Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).
|
|
*/
|
|
renderDebugView: /* @__PURE__ */ __name((_ref) => {
|
|
var color = _ref.color, hitSlop = _ref.hitSlop;
|
|
if (!Touchable.TOUCH_TARGET_DEBUG) {
|
|
return null;
|
|
}
|
|
if (process.env.NODE_ENV !== "production") {
|
|
throw Error("Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!");
|
|
}
|
|
var debugHitSlopStyle = {};
|
|
hitSlop = hitSlop || {
|
|
top: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
right: 0
|
|
};
|
|
for (var key in hitSlop) {
|
|
debugHitSlopStyle[key] = -hitSlop[key];
|
|
}
|
|
var normalizedColor = (0, _normalizeColors.default)(color);
|
|
if (typeof normalizedColor !== "number") {
|
|
return null;
|
|
}
|
|
var hexColor = "#" + ("00000000" + normalizedColor.toString(16)).substr(-8);
|
|
return /* @__PURE__ */ _react.default.createElement(_View.default, {
|
|
pointerEvents: "none",
|
|
style: (0, _objectSpread2.default)({
|
|
position: "absolute",
|
|
borderColor: hexColor.slice(0, -2) + "55",
|
|
// More opaque
|
|
borderWidth: 1,
|
|
borderStyle: "dashed",
|
|
backgroundColor: hexColor.slice(0, -2) + "0F"
|
|
}, debugHitSlopStyle)
|
|
});
|
|
}, "renderDebugView")
|
|
};
|
|
var _default = exports2.default = Touchable;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/TouchableHighlight/index.js
|
|
var require_TouchableHighlight = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/TouchableHighlight/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var React83 = _react;
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePressEvents = _interopRequireDefault(require_usePressEvents());
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _excluded = ["activeOpacity", "children", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onHideUnderlay", "onLongPress", "onPress", "onPressIn", "onPressOut", "onShowUnderlay", "rejectResponderTermination", "style", "testOnly_pressed", "underlayColor"];
|
|
function createExtraStyles(activeOpacity, underlayColor) {
|
|
return {
|
|
child: {
|
|
opacity: activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.85
|
|
},
|
|
underlay: {
|
|
backgroundColor: underlayColor === void 0 ? "black" : underlayColor
|
|
}
|
|
};
|
|
}
|
|
__name(createExtraStyles, "createExtraStyles");
|
|
function hasPressHandler(props) {
|
|
return props.onPress != null || props.onPressIn != null || props.onPressOut != null || props.onLongPress != null;
|
|
}
|
|
__name(hasPressHandler, "hasPressHandler");
|
|
function TouchableHighlight(props, forwardedRef) {
|
|
var activeOpacity = props.activeOpacity, children = props.children, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable2 = props.focusable, onHideUnderlay = props.onHideUnderlay, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, onShowUnderlay = props.onShowUnderlay, rejectResponderTermination = props.rejectResponderTermination, style = props.style, testOnly_pressed = props.testOnly_pressed, underlayColor = props.underlayColor, rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
var hostRef = (0, _react.useRef)(null);
|
|
var setRef2 = (0, _useMergeRefs.default)(forwardedRef, hostRef);
|
|
var _useState = (0, _react.useState)(testOnly_pressed === true ? createExtraStyles(activeOpacity, underlayColor) : null), extraStyles = _useState[0], setExtraStyles = _useState[1];
|
|
var showUnderlay = (0, _react.useCallback)(() => {
|
|
if (!hasPressHandler(props)) {
|
|
return;
|
|
}
|
|
setExtraStyles(createExtraStyles(activeOpacity, underlayColor));
|
|
if (onShowUnderlay != null) {
|
|
onShowUnderlay();
|
|
}
|
|
}, [activeOpacity, onShowUnderlay, props, underlayColor]);
|
|
var hideUnderlay = (0, _react.useCallback)(() => {
|
|
if (testOnly_pressed === true) {
|
|
return;
|
|
}
|
|
if (hasPressHandler(props)) {
|
|
setExtraStyles(null);
|
|
if (onHideUnderlay != null) {
|
|
onHideUnderlay();
|
|
}
|
|
}
|
|
}, [onHideUnderlay, props, testOnly_pressed]);
|
|
var pressConfig = (0, _react.useMemo)(() => ({
|
|
cancelable: !rejectResponderTermination,
|
|
disabled,
|
|
delayLongPress,
|
|
delayPressStart: delayPressIn,
|
|
delayPressEnd: delayPressOut,
|
|
onLongPress,
|
|
onPress,
|
|
onPressStart(event) {
|
|
showUnderlay();
|
|
if (onPressIn != null) {
|
|
onPressIn(event);
|
|
}
|
|
},
|
|
onPressEnd(event) {
|
|
hideUnderlay();
|
|
if (onPressOut != null) {
|
|
onPressOut(event);
|
|
}
|
|
}
|
|
}), [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, showUnderlay, hideUnderlay]);
|
|
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
|
var child = React83.Children.only(children);
|
|
return /* @__PURE__ */ React83.createElement(_View.default, (0, _extends2.default)({}, rest, pressEventHandlers, {
|
|
accessibilityDisabled: disabled,
|
|
focusable: !disabled && focusable2 !== false,
|
|
pointerEvents: disabled ? "box-none" : void 0,
|
|
ref: setRef2,
|
|
style: [styles.root, style, !disabled && styles.actionable, extraStyles && extraStyles.underlay]
|
|
}), /* @__PURE__ */ React83.cloneElement(child, {
|
|
style: [child.props.style, extraStyles && extraStyles.child]
|
|
}));
|
|
}
|
|
__name(TouchableHighlight, "TouchableHighlight");
|
|
var styles = _StyleSheet.default.create({
|
|
root: {
|
|
userSelect: "none"
|
|
},
|
|
actionable: {
|
|
cursor: "pointer",
|
|
touchAction: "manipulation"
|
|
}
|
|
});
|
|
var MemoedTouchableHighlight = /* @__PURE__ */ React83.memo(/* @__PURE__ */ React83.forwardRef(TouchableHighlight));
|
|
MemoedTouchableHighlight.displayName = "TouchableHighlight";
|
|
var _default = exports2.default = MemoedTouchableHighlight;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/modules/UnimplementedView/index.js
|
|
var require_UnimplementedView = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/modules/UnimplementedView/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _View = _interopRequireDefault(require_View());
|
|
var _react = _interopRequireDefault(require("react"));
|
|
var _excluded = ["style"];
|
|
function UnimplementedView(_ref) {
|
|
var style = _ref.style, props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
return /* @__PURE__ */ _react.default.createElement(_View.default, (0, _extends2.default)({}, props, {
|
|
style: [unimplementedViewStyles, style]
|
|
}));
|
|
}
|
|
__name(UnimplementedView, "UnimplementedView");
|
|
var unimplementedViewStyles = process.env.NODE_ENV !== "production" ? {
|
|
alignSelf: "flex-start",
|
|
borderColor: "red",
|
|
borderWidth: 1
|
|
} : {};
|
|
var _default = exports2.default = UnimplementedView;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/TouchableNativeFeedback/index.js
|
|
var require_TouchableNativeFeedback = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/TouchableNativeFeedback/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _UnimplementedView = _interopRequireDefault(require_UnimplementedView());
|
|
var _default = exports2.default = _UnimplementedView.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/TouchableWithoutFeedback/index.js
|
|
var require_TouchableWithoutFeedback = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/TouchableWithoutFeedback/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _react = _interopRequireWildcard(require("react"));
|
|
var React83 = _react;
|
|
var _pick = _interopRequireDefault(require_pick());
|
|
var _useMergeRefs = _interopRequireDefault(require_useMergeRefs());
|
|
var _usePressEvents = _interopRequireDefault(require_usePressEvents());
|
|
var _warnOnce = require_warnOnce();
|
|
var forwardPropsList = {
|
|
accessibilityDisabled: true,
|
|
accessibilityLabel: true,
|
|
accessibilityLiveRegion: true,
|
|
accessibilityRole: true,
|
|
accessibilityState: true,
|
|
accessibilityValue: true,
|
|
children: true,
|
|
disabled: true,
|
|
focusable: true,
|
|
nativeID: true,
|
|
onBlur: true,
|
|
onFocus: true,
|
|
onLayout: true,
|
|
testID: true
|
|
};
|
|
var pickProps = /* @__PURE__ */ __name((props) => (0, _pick.default)(props, forwardPropsList), "pickProps");
|
|
function TouchableWithoutFeedback(props, forwardedRef) {
|
|
(0, _warnOnce.warnOnce)("TouchableWithoutFeedback", "TouchableWithoutFeedback is deprecated. Please use Pressable.");
|
|
var delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable2 = props.focusable, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, rejectResponderTermination = props.rejectResponderTermination;
|
|
var hostRef = (0, _react.useRef)(null);
|
|
var pressConfig = (0, _react.useMemo)(() => ({
|
|
cancelable: !rejectResponderTermination,
|
|
disabled,
|
|
delayLongPress,
|
|
delayPressStart: delayPressIn,
|
|
delayPressEnd: delayPressOut,
|
|
onLongPress,
|
|
onPress,
|
|
onPressStart: onPressIn,
|
|
onPressEnd: onPressOut
|
|
}), [disabled, delayPressIn, delayPressOut, delayLongPress, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination]);
|
|
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
|
var element = React83.Children.only(props.children);
|
|
var children = [element.props.children];
|
|
var supportedProps = pickProps(props);
|
|
supportedProps.accessibilityDisabled = disabled;
|
|
supportedProps.focusable = !disabled && focusable2 !== false;
|
|
supportedProps.ref = (0, _useMergeRefs.default)(forwardedRef, hostRef, element.ref);
|
|
var elementProps = Object.assign(supportedProps, pressEventHandlers);
|
|
return /* @__PURE__ */ React83.cloneElement(element, elementProps, ...children);
|
|
}
|
|
__name(TouchableWithoutFeedback, "TouchableWithoutFeedback");
|
|
var MemoedTouchableWithoutFeedback = /* @__PURE__ */ React83.memo(/* @__PURE__ */ React83.forwardRef(TouchableWithoutFeedback));
|
|
MemoedTouchableWithoutFeedback.displayName = "TouchableWithoutFeedback";
|
|
var _default = exports2.default = MemoedTouchableWithoutFeedback;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/VirtualizedList/index.js
|
|
var require_VirtualizedList2 = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/VirtualizedList/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _VirtualizedList = _interopRequireDefault(require_VirtualizedList());
|
|
var _default = exports2.default = _VirtualizedList.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/YellowBox/index.js
|
|
var require_YellowBox = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/YellowBox/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _react = _interopRequireDefault(require("react"));
|
|
var _UnimplementedView = _interopRequireDefault(require_UnimplementedView());
|
|
function YellowBox(props) {
|
|
return /* @__PURE__ */ _react.default.createElement(_UnimplementedView.default, props);
|
|
}
|
|
__name(YellowBox, "YellowBox");
|
|
YellowBox.ignoreWarnings = () => {
|
|
};
|
|
var _default = exports2.default = YellowBox;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/LogBox/index.js
|
|
var require_LogBox = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/LogBox/index.js"(exports2, module2) {
|
|
"use strict";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var LogBox = {
|
|
ignoreLogs() {
|
|
},
|
|
ignoreAllLogs() {
|
|
},
|
|
uninstall() {
|
|
},
|
|
install() {
|
|
}
|
|
};
|
|
var _default = exports2.default = LogBox;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/DeviceEventEmitter/index.js
|
|
var require_DeviceEventEmitter = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/DeviceEventEmitter/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _RCTDeviceEventEmitter = _interopRequireDefault(require_RCTDeviceEventEmitter());
|
|
var _default = exports2.default = _RCTDeviceEventEmitter.default;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/useColorScheme/index.js
|
|
var require_useColorScheme = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/useColorScheme/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
var _interopRequireWildcard = require_interopRequireWildcard().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useColorScheme;
|
|
var React83 = _interopRequireWildcard(require("react"));
|
|
var _Appearance = _interopRequireDefault(require_Appearance());
|
|
function useColorScheme() {
|
|
var _React$useState = React83.useState(_Appearance.default.getColorScheme()), colorScheme = _React$useState[0], setColorScheme = _React$useState[1];
|
|
React83.useEffect(() => {
|
|
function listener(appearance) {
|
|
setColorScheme(appearance.colorScheme);
|
|
}
|
|
__name(listener, "listener");
|
|
var _Appearance$addChange = _Appearance.default.addChangeListener(listener), remove = _Appearance$addChange.remove;
|
|
return remove;
|
|
});
|
|
return colorScheme;
|
|
}
|
|
__name(useColorScheme, "useColorScheme");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/useLocaleContext/index.js
|
|
var require_useLocaleContext = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/useLocaleContext/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
exports2.__esModule = true;
|
|
exports2.default = void 0;
|
|
var _useLocale = require_useLocale();
|
|
var _default = exports2.default = _useLocale.useLocaleContext;
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/exports/useWindowDimensions/index.js
|
|
var require_useWindowDimensions = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/exports/useWindowDimensions/index.js"(exports2, module2) {
|
|
"use strict";
|
|
"use client";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.default = useWindowDimensions2;
|
|
var _Dimensions = _interopRequireDefault(require_Dimensions());
|
|
var _react = require("react");
|
|
function useWindowDimensions2() {
|
|
var _useState = (0, _react.useState)(() => _Dimensions.default.get("window")), dims = _useState[0], setDims = _useState[1];
|
|
(0, _react.useEffect)(() => {
|
|
function handleChange(_ref) {
|
|
var window2 = _ref.window;
|
|
if (window2 != null) {
|
|
setDims(window2);
|
|
}
|
|
}
|
|
__name(handleChange, "handleChange");
|
|
_Dimensions.default.addEventListener("change", handleChange);
|
|
setDims(_Dimensions.default.get("window"));
|
|
return () => {
|
|
_Dimensions.default.removeEventListener("change", handleChange);
|
|
};
|
|
}, []);
|
|
return dims;
|
|
}
|
|
__name(useWindowDimensions2, "useWindowDimensions");
|
|
module2.exports = exports2.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-native-web/dist/cjs/index.js
|
|
var require_cjs = __commonJS({
|
|
"node_modules/react-native-web/dist/cjs/index.js"(exports2) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
|
exports2.__esModule = true;
|
|
exports2.useWindowDimensions = exports2.useLocaleContext = exports2.useColorScheme = exports2.unstable_createElement = exports2.unmountComponentAtNode = exports2.render = exports2.processColor = exports2.findNodeHandle = exports2.YellowBox = exports2.VirtualizedList = exports2.View = exports2.Vibration = exports2.UIManager = exports2.TouchableWithoutFeedback = exports2.TouchableOpacity = exports2.TouchableNativeFeedback = exports2.TouchableHighlight = exports2.Touchable = exports2.TextInput = exports2.Text = exports2.Switch = exports2.StyleSheet = exports2.StatusBar = exports2.Share = exports2.SectionList = exports2.ScrollView = exports2.SafeAreaView = exports2.RefreshControl = exports2.ProgressBar = exports2.Pressable = exports2.Platform = exports2.PixelRatio = exports2.Picker = exports2.PanResponder = exports2.NativeModules = exports2.NativeEventEmitter = exports2.Modal = exports2.LogBox = exports2.Linking = exports2.LayoutAnimation = exports2.KeyboardAvoidingView = exports2.Keyboard = exports2.InteractionManager = exports2.ImageBackground = exports2.Image = exports2.I18nManager = exports2.FlatList = exports2.Easing = exports2.Dimensions = exports2.DeviceEventEmitter = exports2.Clipboard = exports2.CheckBox = exports2.Button = exports2.BackHandler = exports2.Appearance = exports2.AppState = exports2.AppRegistry = exports2.Animated = exports2.Alert = exports2.ActivityIndicator = exports2.AccessibilityInfo = void 0;
|
|
var _createElement = _interopRequireDefault(require_createElement());
|
|
exports2.unstable_createElement = _createElement.default;
|
|
var _findNodeHandle = _interopRequireDefault(require_findNodeHandle());
|
|
exports2.findNodeHandle = _findNodeHandle.default;
|
|
var _processColor = _interopRequireDefault(require_processColor());
|
|
exports2.processColor = _processColor.default;
|
|
var _render = _interopRequireDefault(require_render());
|
|
exports2.render = _render.default;
|
|
var _unmountComponentAtNode = _interopRequireDefault(require_unmountComponentAtNode());
|
|
exports2.unmountComponentAtNode = _unmountComponentAtNode.default;
|
|
var _NativeModules = _interopRequireDefault(require_NativeModules());
|
|
exports2.NativeModules = _NativeModules.default;
|
|
var _AccessibilityInfo = _interopRequireDefault(require_AccessibilityInfo());
|
|
exports2.AccessibilityInfo = _AccessibilityInfo.default;
|
|
var _Alert = _interopRequireDefault(require_Alert());
|
|
exports2.Alert = _Alert.default;
|
|
var _Animated = _interopRequireDefault(require_Animated2());
|
|
exports2.Animated = _Animated.default;
|
|
var _Appearance = _interopRequireDefault(require_Appearance());
|
|
exports2.Appearance = _Appearance.default;
|
|
var _AppRegistry = _interopRequireDefault(require_AppRegistry());
|
|
exports2.AppRegistry = _AppRegistry.default;
|
|
var _AppState = _interopRequireDefault(require_AppState());
|
|
exports2.AppState = _AppState.default;
|
|
var _BackHandler = _interopRequireDefault(require_BackHandler());
|
|
exports2.BackHandler = _BackHandler.default;
|
|
var _Clipboard = _interopRequireDefault(require_Clipboard());
|
|
exports2.Clipboard = _Clipboard.default;
|
|
var _Dimensions = _interopRequireDefault(require_Dimensions());
|
|
exports2.Dimensions = _Dimensions.default;
|
|
var _Easing = _interopRequireDefault(require_Easing2());
|
|
exports2.Easing = _Easing.default;
|
|
var _I18nManager = _interopRequireDefault(require_I18nManager());
|
|
exports2.I18nManager = _I18nManager.default;
|
|
var _Keyboard = _interopRequireDefault(require_Keyboard());
|
|
exports2.Keyboard = _Keyboard.default;
|
|
var _InteractionManager = _interopRequireDefault(require_InteractionManager());
|
|
exports2.InteractionManager = _InteractionManager.default;
|
|
var _LayoutAnimation = _interopRequireDefault(require_LayoutAnimation2());
|
|
exports2.LayoutAnimation = _LayoutAnimation.default;
|
|
var _Linking = _interopRequireDefault(require_Linking());
|
|
exports2.Linking = _Linking.default;
|
|
var _NativeEventEmitter = _interopRequireDefault(require_NativeEventEmitter2());
|
|
exports2.NativeEventEmitter = _NativeEventEmitter.default;
|
|
var _PanResponder = _interopRequireDefault(require_PanResponder2());
|
|
exports2.PanResponder = _PanResponder.default;
|
|
var _PixelRatio = _interopRequireDefault(require_PixelRatio());
|
|
exports2.PixelRatio = _PixelRatio.default;
|
|
var _Platform = _interopRequireDefault(require_Platform());
|
|
exports2.Platform = _Platform.default;
|
|
var _Share = _interopRequireDefault(require_Share());
|
|
exports2.Share = _Share.default;
|
|
var _StyleSheet = _interopRequireDefault(require_StyleSheet());
|
|
exports2.StyleSheet = _StyleSheet.default;
|
|
var _UIManager = _interopRequireDefault(require_UIManager());
|
|
exports2.UIManager = _UIManager.default;
|
|
var _Vibration = _interopRequireDefault(require_Vibration());
|
|
exports2.Vibration = _Vibration.default;
|
|
var _ActivityIndicator = _interopRequireDefault(require_ActivityIndicator());
|
|
exports2.ActivityIndicator = _ActivityIndicator.default;
|
|
var _Button = _interopRequireDefault(require_Button());
|
|
exports2.Button = _Button.default;
|
|
var _CheckBox = _interopRequireDefault(require_CheckBox());
|
|
exports2.CheckBox = _CheckBox.default;
|
|
var _FlatList = _interopRequireDefault(require_FlatList2());
|
|
exports2.FlatList = _FlatList.default;
|
|
var _Image = _interopRequireDefault(require_Image());
|
|
exports2.Image = _Image.default;
|
|
var _ImageBackground = _interopRequireDefault(require_ImageBackground());
|
|
exports2.ImageBackground = _ImageBackground.default;
|
|
var _KeyboardAvoidingView = _interopRequireDefault(require_KeyboardAvoidingView());
|
|
exports2.KeyboardAvoidingView = _KeyboardAvoidingView.default;
|
|
var _Modal = _interopRequireDefault(require_Modal());
|
|
exports2.Modal = _Modal.default;
|
|
var _Picker = _interopRequireDefault(require_Picker());
|
|
exports2.Picker = _Picker.default;
|
|
var _Pressable = _interopRequireDefault(require_Pressable());
|
|
exports2.Pressable = _Pressable.default;
|
|
var _ProgressBar = _interopRequireDefault(require_ProgressBar());
|
|
exports2.ProgressBar = _ProgressBar.default;
|
|
var _RefreshControl = _interopRequireDefault(require_RefreshControl());
|
|
exports2.RefreshControl = _RefreshControl.default;
|
|
var _SafeAreaView = _interopRequireDefault(require_SafeAreaView());
|
|
exports2.SafeAreaView = _SafeAreaView.default;
|
|
var _ScrollView = _interopRequireDefault(require_ScrollView());
|
|
exports2.ScrollView = _ScrollView.default;
|
|
var _SectionList = _interopRequireDefault(require_SectionList2());
|
|
exports2.SectionList = _SectionList.default;
|
|
var _StatusBar = _interopRequireDefault(require_StatusBar());
|
|
exports2.StatusBar = _StatusBar.default;
|
|
var _Switch = _interopRequireDefault(require_Switch());
|
|
exports2.Switch = _Switch.default;
|
|
var _Text = _interopRequireDefault(require_Text());
|
|
exports2.Text = _Text.default;
|
|
var _TextInput = _interopRequireDefault(require_TextInput());
|
|
exports2.TextInput = _TextInput.default;
|
|
var _Touchable = _interopRequireDefault(require_Touchable());
|
|
exports2.Touchable = _Touchable.default;
|
|
var _TouchableHighlight = _interopRequireDefault(require_TouchableHighlight());
|
|
exports2.TouchableHighlight = _TouchableHighlight.default;
|
|
var _TouchableNativeFeedback = _interopRequireDefault(require_TouchableNativeFeedback());
|
|
exports2.TouchableNativeFeedback = _TouchableNativeFeedback.default;
|
|
var _TouchableOpacity = _interopRequireDefault(require_TouchableOpacity());
|
|
exports2.TouchableOpacity = _TouchableOpacity.default;
|
|
var _TouchableWithoutFeedback = _interopRequireDefault(require_TouchableWithoutFeedback());
|
|
exports2.TouchableWithoutFeedback = _TouchableWithoutFeedback.default;
|
|
var _View = _interopRequireDefault(require_View());
|
|
exports2.View = _View.default;
|
|
var _VirtualizedList = _interopRequireDefault(require_VirtualizedList2());
|
|
exports2.VirtualizedList = _VirtualizedList.default;
|
|
var _YellowBox = _interopRequireDefault(require_YellowBox());
|
|
exports2.YellowBox = _YellowBox.default;
|
|
var _LogBox = _interopRequireDefault(require_LogBox());
|
|
exports2.LogBox = _LogBox.default;
|
|
var _DeviceEventEmitter = _interopRequireDefault(require_DeviceEventEmitter());
|
|
exports2.DeviceEventEmitter = _DeviceEventEmitter.default;
|
|
var _useColorScheme = _interopRequireDefault(require_useColorScheme());
|
|
exports2.useColorScheme = _useColorScheme.default;
|
|
var _useLocaleContext = _interopRequireDefault(require_useLocaleContext());
|
|
exports2.useLocaleContext = _useLocaleContext.default;
|
|
var _useWindowDimensions = _interopRequireDefault(require_useWindowDimensions());
|
|
exports2.useWindowDimensions = _useWindowDimensions.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/tabbable/dist/index.js
|
|
var require_dist = __commonJS({
|
|
"node_modules/tabbable/dist/index.js"(exports2) {
|
|
"use strict";
|
|
var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"];
|
|
var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
|
|
var NoElement = typeof Element === "undefined";
|
|
var matches = NoElement ? function() {
|
|
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) {
|
|
var _element$getRootNode;
|
|
return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
|
|
} : function(element) {
|
|
return element === null || element === void 0 ? void 0 : element.ownerDocument;
|
|
};
|
|
var _isInert = /* @__PURE__ */ __name(function isInert(node, lookUp) {
|
|
var _node$getAttribute;
|
|
if (lookUp === void 0) {
|
|
lookUp = true;
|
|
}
|
|
var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, "inert");
|
|
var inert = inertAtt === "" || inertAtt === "true";
|
|
var result = inert || lookUp && node && _isInert(node.parentNode);
|
|
return result;
|
|
}, "isInert");
|
|
var isContentEditable = /* @__PURE__ */ __name(function isContentEditable2(node) {
|
|
var _node$getAttribute2;
|
|
var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, "contenteditable");
|
|
return attValue === "" || attValue === "true";
|
|
}, "isContentEditable");
|
|
var getCandidates = /* @__PURE__ */ __name(function getCandidates2(el, includeContainer, filter) {
|
|
if (_isInert(el)) {
|
|
return [];
|
|
}
|
|
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
candidates.unshift(el);
|
|
}
|
|
candidates = candidates.filter(filter);
|
|
return candidates;
|
|
}, "getCandidates");
|
|
var _getCandidatesIteratively = /* @__PURE__ */ __name(function getCandidatesIteratively(elements, includeContainer, options) {
|
|
var candidates = [];
|
|
var elementsToCheck = Array.from(elements);
|
|
while (elementsToCheck.length) {
|
|
var element = elementsToCheck.shift();
|
|
if (_isInert(element, false)) {
|
|
continue;
|
|
}
|
|
if (element.tagName === "SLOT") {
|
|
var assigned = element.assignedElements();
|
|
var content = assigned.length ? assigned : element.children;
|
|
var nestedCandidates = _getCandidatesIteratively(content, true, options);
|
|
if (options.flatten) {
|
|
candidates.push.apply(candidates, nestedCandidates);
|
|
} else {
|
|
candidates.push({
|
|
scopeParent: element,
|
|
candidates: nestedCandidates
|
|
});
|
|
}
|
|
} else {
|
|
var validCandidate = matches.call(element, candidateSelector);
|
|
if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
|
|
candidates.push(element);
|
|
}
|
|
var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
|
|
typeof options.getShadowRoot === "function" && options.getShadowRoot(element);
|
|
var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
|
|
if (shadowRoot && validShadowRoot) {
|
|
var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
if (options.flatten) {
|
|
candidates.push.apply(candidates, _nestedCandidates);
|
|
} else {
|
|
candidates.push({
|
|
scopeParent: element,
|
|
candidates: _nestedCandidates
|
|
});
|
|
}
|
|
} else {
|
|
elementsToCheck.unshift.apply(elementsToCheck, element.children);
|
|
}
|
|
}
|
|
}
|
|
return candidates;
|
|
}, "getCandidatesIteratively");
|
|
var hasTabIndex = /* @__PURE__ */ __name(function hasTabIndex2(node) {
|
|
return !isNaN(parseInt(node.getAttribute("tabindex"), 10));
|
|
}, "hasTabIndex");
|
|
var getTabIndex = /* @__PURE__ */ __name(function getTabIndex2(node) {
|
|
if (!node) {
|
|
throw new Error("No node provided");
|
|
}
|
|
if (node.tabIndex < 0) {
|
|
if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
|
|
return 0;
|
|
}
|
|
}
|
|
return node.tabIndex;
|
|
}, "getTabIndex");
|
|
var getSortOrderTabIndex = /* @__PURE__ */ __name(function getSortOrderTabIndex2(node, isScope) {
|
|
var tabIndex = getTabIndex(node);
|
|
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
|
|
return 0;
|
|
}
|
|
return tabIndex;
|
|
}, "getSortOrderTabIndex");
|
|
var sortOrderedTabbables = /* @__PURE__ */ __name(function sortOrderedTabbables2(a, b) {
|
|
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
}, "sortOrderedTabbables");
|
|
var isInput = /* @__PURE__ */ __name(function isInput2(node) {
|
|
return node.tagName === "INPUT";
|
|
}, "isInput");
|
|
var isHiddenInput = /* @__PURE__ */ __name(function isHiddenInput2(node) {
|
|
return isInput(node) && node.type === "hidden";
|
|
}, "isHiddenInput");
|
|
var isDetailsWithSummary = /* @__PURE__ */ __name(function isDetailsWithSummary2(node) {
|
|
var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
|
|
return child.tagName === "SUMMARY";
|
|
});
|
|
return r;
|
|
}, "isDetailsWithSummary");
|
|
var getCheckedRadio = /* @__PURE__ */ __name(function getCheckedRadio2(nodes, form) {
|
|
for (var i = 0; i < nodes.length; i++) {
|
|
if (nodes[i].checked && nodes[i].form === form) {
|
|
return nodes[i];
|
|
}
|
|
}
|
|
}, "getCheckedRadio");
|
|
var isTabbableRadio = /* @__PURE__ */ __name(function isTabbableRadio2(node) {
|
|
if (!node.name) {
|
|
return true;
|
|
}
|
|
var radioScope = node.form || getRootNode(node);
|
|
var queryRadios = /* @__PURE__ */ __name(function queryRadios2(name) {
|
|
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
}, "queryRadios");
|
|
var radioSet;
|
|
if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
|
|
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
} else {
|
|
try {
|
|
radioSet = queryRadios(node.name);
|
|
} catch (err) {
|
|
console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
|
|
return false;
|
|
}
|
|
}
|
|
var checked = getCheckedRadio(radioSet, node.form);
|
|
return !checked || checked === node;
|
|
}, "isTabbableRadio");
|
|
var isRadio = /* @__PURE__ */ __name(function isRadio2(node) {
|
|
return isInput(node) && node.type === "radio";
|
|
}, "isRadio");
|
|
var isNonTabbableRadio = /* @__PURE__ */ __name(function isNonTabbableRadio2(node) {
|
|
return isRadio(node) && !isTabbableRadio(node);
|
|
}, "isNonTabbableRadio");
|
|
var isNodeAttached = /* @__PURE__ */ __name(function isNodeAttached2(node) {
|
|
var _nodeRoot;
|
|
var nodeRoot = node && getRootNode(node);
|
|
var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
|
|
var attached = false;
|
|
if (nodeRoot && nodeRoot !== node) {
|
|
var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
|
|
attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
|
|
while (!attached && nodeRootHost) {
|
|
var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
|
|
nodeRoot = getRootNode(nodeRootHost);
|
|
nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
|
|
attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
|
|
}
|
|
}
|
|
return attached;
|
|
}, "isNodeAttached");
|
|
var isZeroArea = /* @__PURE__ */ __name(function isZeroArea2(node) {
|
|
var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
|
|
return width === 0 && height === 0;
|
|
}, "isZeroArea");
|
|
var isHidden2 = /* @__PURE__ */ __name(function isHidden3(node, _ref) {
|
|
var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot;
|
|
if (displayCheck === "full-native") {
|
|
if ("checkVisibility" in node) {
|
|
var visible = node.checkVisibility({
|
|
// Checking opacity might be desirable for some use cases, but natively,
|
|
// opacity zero elements _are_ focusable and tabbable.
|
|
checkOpacity: false,
|
|
opacityProperty: false,
|
|
contentVisibilityAuto: true,
|
|
visibilityProperty: true,
|
|
// This is an alias for `visibilityProperty`. Contemporary browsers
|
|
// support both. However, this alias has wider browser support (Chrome
|
|
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
|
|
// we include it anyway.
|
|
checkVisibilityCSS: true
|
|
});
|
|
return !visible;
|
|
}
|
|
}
|
|
if (getComputedStyle(node).visibility === "hidden") {
|
|
return true;
|
|
}
|
|
var isDirectSummary = matches.call(node, "details>summary:first-of-type");
|
|
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
|
|
return true;
|
|
}
|
|
if (!displayCheck || displayCheck === "full" || // full-native can run this branch when it falls through in case
|
|
// Element#checkVisibility is unsupported
|
|
displayCheck === "full-native" || displayCheck === "legacy-full") {
|
|
if (typeof getShadowRoot === "function") {
|
|
var originalNode = node;
|
|
while (node) {
|
|
var parentElement = node.parentElement;
|
|
var rootNode = getRootNode(node);
|
|
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) {
|
|
return isZeroArea(node);
|
|
} else if (node.assignedSlot) {
|
|
node = node.assignedSlot;
|
|
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
node = rootNode.host;
|
|
} else {
|
|
node = parentElement;
|
|
}
|
|
}
|
|
node = originalNode;
|
|
}
|
|
if (isNodeAttached(node)) {
|
|
return !node.getClientRects().length;
|
|
}
|
|
if (displayCheck !== "legacy-full") {
|
|
return true;
|
|
}
|
|
} else if (displayCheck === "non-zero-area") {
|
|
return isZeroArea(node);
|
|
}
|
|
return false;
|
|
}, "isHidden");
|
|
var isDisabledFromFieldset = /* @__PURE__ */ __name(function isDisabledFromFieldset2(node) {
|
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
var parentNode = node.parentElement;
|
|
while (parentNode) {
|
|
if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
|
|
for (var i = 0; i < parentNode.children.length; i++) {
|
|
var child = parentNode.children.item(i);
|
|
if (child.tagName === "LEGEND") {
|
|
return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
parentNode = parentNode.parentElement;
|
|
}
|
|
}
|
|
return false;
|
|
}, "isDisabledFromFieldset");
|
|
var isNodeMatchingSelectorFocusable = /* @__PURE__ */ __name(function isNodeMatchingSelectorFocusable2(options, node) {
|
|
if (node.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
// note related to `candidateSelectors`)
|
|
_isInert(node) || isHiddenInput(node) || isHidden2(node, options) || // For a details element with a summary, the summary element gets the focus
|
|
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}, "isNodeMatchingSelectorFocusable");
|
|
var isNodeMatchingSelectorTabbable = /* @__PURE__ */ __name(function isNodeMatchingSelectorTabbable2(options, node) {
|
|
if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}, "isNodeMatchingSelectorTabbable");
|
|
var isShadowRootTabbable = /* @__PURE__ */ __name(function isShadowRootTabbable2(shadowHostNode) {
|
|
var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10);
|
|
if (isNaN(tabIndex) || tabIndex >= 0) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}, "isShadowRootTabbable");
|
|
var _sortByOrder = /* @__PURE__ */ __name(function sortByOrder(candidates) {
|
|
var regularTabbables = [];
|
|
var orderedTabbables = [];
|
|
candidates.forEach(function(item, i) {
|
|
var isScope = !!item.scopeParent;
|
|
var element = isScope ? item.scopeParent : item;
|
|
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
var elements = isScope ? _sortByOrder(item.candidates) : element;
|
|
if (candidateTabindex === 0) {
|
|
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
} else {
|
|
orderedTabbables.push({
|
|
documentOrder: i,
|
|
tabIndex: candidateTabindex,
|
|
item,
|
|
isScope,
|
|
content: elements
|
|
});
|
|
}
|
|
});
|
|
return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) {
|
|
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
return acc;
|
|
}, []).concat(regularTabbables);
|
|
}, "sortByOrder");
|
|
var tabbable3 = /* @__PURE__ */ __name(function tabbable4(container, options) {
|
|
options = options || {};
|
|
var candidates;
|
|
if (options.getShadowRoot) {
|
|
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
flatten: false,
|
|
getShadowRoot: options.getShadowRoot,
|
|
shadowRootFilter: isShadowRootTabbable
|
|
});
|
|
} else {
|
|
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
}
|
|
return _sortByOrder(candidates);
|
|
}, "tabbable");
|
|
var focusable2 = /* @__PURE__ */ __name(function focusable3(container, options) {
|
|
options = options || {};
|
|
var candidates;
|
|
if (options.getShadowRoot) {
|
|
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
flatten: true,
|
|
getShadowRoot: options.getShadowRoot
|
|
});
|
|
} else {
|
|
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
}
|
|
return candidates;
|
|
}, "focusable");
|
|
var isTabbable2 = /* @__PURE__ */ __name(function isTabbable3(node, options) {
|
|
options = options || {};
|
|
if (!node) {
|
|
throw new Error("No node provided");
|
|
}
|
|
if (matches.call(node, candidateSelector) === false) {
|
|
return false;
|
|
}
|
|
return isNodeMatchingSelectorTabbable(options, node);
|
|
}, "isTabbable");
|
|
var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(",");
|
|
var isFocusable = /* @__PURE__ */ __name(function isFocusable2(node, options) {
|
|
options = options || {};
|
|
if (!node) {
|
|
throw new Error("No node provided");
|
|
}
|
|
if (matches.call(node, focusableCandidateSelector) === false) {
|
|
return false;
|
|
}
|
|
return isNodeMatchingSelectorFocusable(options, node);
|
|
}, "isFocusable");
|
|
exports2.focusable = focusable2;
|
|
exports2.getTabIndex = getTabIndex;
|
|
exports2.isFocusable = isFocusable;
|
|
exports2.isTabbable = isTabbable2;
|
|
exports2.tabbable = tabbable3;
|
|
}
|
|
});
|
|
|
|
// node_modules/tamagui/dist/esm/index.mjs
|
|
var esm_exports = {};
|
|
__export(esm_exports, {
|
|
ACTIONS: () => ACTIONS,
|
|
Accordion: () => Accordion,
|
|
Adapt: () => Adapt,
|
|
AdaptContents: () => AdaptContents,
|
|
AdaptContext: () => AdaptContext,
|
|
AdaptParent: () => AdaptParent,
|
|
AdaptPortalContents: () => AdaptPortalContents,
|
|
AlertDialog: () => AlertDialog,
|
|
AlertDialogAction: () => AlertDialogAction,
|
|
AlertDialogCancel: () => AlertDialogCancel,
|
|
AlertDialogContent: () => AlertDialogContent,
|
|
AlertDialogDescription: () => AlertDialogDescription,
|
|
AlertDialogOverlay: () => AlertDialogOverlay,
|
|
AlertDialogPortal: () => AlertDialogPortal,
|
|
AlertDialogTitle: () => AlertDialogTitle,
|
|
AlertDialogTrigger: () => AlertDialogTrigger,
|
|
Anchor: () => Anchor,
|
|
AnimatePresence: () => AnimatePresence,
|
|
Article: () => Article,
|
|
Aside: () => Aside,
|
|
Avatar: () => Avatar,
|
|
AvatarFallback: () => AvatarFallback,
|
|
AvatarFallbackFrame: () => AvatarFallbackFrame,
|
|
AvatarFrame: () => AvatarFrame,
|
|
AvatarImage: () => AvatarImage,
|
|
Button: () => Button2,
|
|
ButtonContext: () => ButtonContext,
|
|
ButtonFrame: () => ButtonFrame,
|
|
ButtonIcon: () => ButtonIcon,
|
|
ButtonNestingContext: () => ButtonNestingContext,
|
|
ButtonText: () => ButtonText,
|
|
Card: () => Card,
|
|
CardBackground: () => CardBackground,
|
|
CardFooter: () => CardFooter,
|
|
CardFrame: () => CardFrame,
|
|
CardHeader: () => CardHeader,
|
|
Checkbox: () => Checkbox,
|
|
CheckboxContext: () => CheckboxContext,
|
|
CheckboxFrame: () => CheckboxFrame,
|
|
CheckboxIndicatorFrame: () => CheckboxIndicatorFrame,
|
|
CheckboxStyledContext: () => CheckboxStyledContext,
|
|
Circle: () => Circle,
|
|
ClientOnly: () => import_core61.ClientOnly,
|
|
ComponentContext: () => import_core61.ComponentContext,
|
|
Configuration: () => import_core61.Configuration,
|
|
Dialog: () => Dialog,
|
|
DialogClose: () => DialogClose,
|
|
DialogContent: () => DialogContent,
|
|
DialogContext: () => DialogContext,
|
|
DialogDescription: () => DialogDescription,
|
|
DialogOverlay: () => DialogOverlay,
|
|
DialogOverlayFrame: () => DialogOverlayFrame,
|
|
DialogPortal: () => DialogPortal,
|
|
DialogPortalFrame: () => DialogPortalFrame,
|
|
DialogProvider: () => DialogProvider,
|
|
DialogTitle: () => DialogTitle,
|
|
DialogTrigger: () => DialogTrigger,
|
|
DialogWarningProvider: () => DialogWarningProvider,
|
|
EnsureFlexed: () => EnsureFlexed,
|
|
Fieldset: () => Fieldset,
|
|
FontLanguage: () => import_core61.FontLanguage,
|
|
Footer: () => Footer,
|
|
Form: () => Form2,
|
|
FormFrame: () => FormFrame,
|
|
FormProvider: () => FormProvider,
|
|
FormTrigger: () => FormTrigger,
|
|
ForwardSelectContext: () => ForwardSelectContext,
|
|
Frame: () => Frame,
|
|
Group: () => Group,
|
|
GroupContext: () => import_core61.GroupContext,
|
|
GroupFrame: () => GroupFrame,
|
|
H1: () => H1,
|
|
H2: () => H2,
|
|
H3: () => H3,
|
|
H4: () => H4,
|
|
H5: () => H5,
|
|
H6: () => H6,
|
|
Handle: () => Handle,
|
|
Header: () => Header,
|
|
Heading: () => Heading,
|
|
INITIAL_STATE: () => INITIAL_STATE,
|
|
IS_FABRIC: () => IS_FABRIC,
|
|
Image: () => Image,
|
|
Input: () => Input,
|
|
InputFrame: () => InputFrame,
|
|
Label: () => Label,
|
|
LabelFrame: () => LabelFrame,
|
|
ListItem: () => ListItem2,
|
|
ListItemFrame: () => ListItemFrame,
|
|
ListItemSubtitle: () => ListItemSubtitle,
|
|
ListItemText: () => ListItemText,
|
|
ListItemTitle: () => ListItemTitle,
|
|
Main: () => Main,
|
|
Nav: () => Nav,
|
|
Overlay: () => Overlay,
|
|
Paragraph: () => Paragraph,
|
|
ParentSheetContext: () => ParentSheetContext,
|
|
Popover: () => Popover,
|
|
PopoverAnchor: () => PopoverAnchor,
|
|
PopoverArrow: () => PopoverArrow,
|
|
PopoverClose: () => PopoverClose,
|
|
PopoverContent: () => PopoverContent,
|
|
PopoverContext: () => PopoverContext,
|
|
PopoverTrigger: () => PopoverTrigger,
|
|
Popper: () => Popper,
|
|
PopperAnchor: () => PopperAnchor,
|
|
PopperArrow: () => PopperArrow,
|
|
PopperArrowFrame: () => PopperArrowFrame,
|
|
PopperContent: () => PopperContent,
|
|
PopperContentFrame: () => PopperContentFrame,
|
|
PopperContextFast: () => PopperContextFast,
|
|
PopperContextSlow: () => PopperContextSlow,
|
|
PopperPositionContext: () => PopperPositionContext,
|
|
PopperProvider: () => PopperProvider,
|
|
PopperProviderFast: () => PopperProviderFast,
|
|
PopperProviderSlow: () => PopperProviderSlow,
|
|
Portal: () => Portal,
|
|
PortalHost: () => PortalHost,
|
|
PortalItem: () => GorhomPortalItem,
|
|
PortalProvider: () => PortalProvider,
|
|
PresenceChild: () => PresenceChild,
|
|
PresenceContext: () => PresenceContext,
|
|
Progress: () => Progress,
|
|
ProgressFrame: () => ProgressFrame,
|
|
ProgressIndicator: () => ProgressIndicator,
|
|
ProgressIndicatorFrame: () => ProgressIndicatorFrame,
|
|
ProvideAdaptContext: () => ProvideAdaptContext,
|
|
RadioGroup: () => RadioGroup,
|
|
RadioGroupFrame: () => RadioGroupFrame,
|
|
RadioGroupIndicatorFrame: () => RadioGroupIndicatorFrame,
|
|
RadioGroupItemFrame: () => RadioGroupItemFrame,
|
|
RadioGroupStyledContext: () => RadioGroupStyledContext,
|
|
Range: () => Range,
|
|
ResetPresence: () => ResetPresence,
|
|
ScrollView: () => ScrollView,
|
|
Section: () => Section,
|
|
Select: () => Select,
|
|
SelectGroupFrame: () => SelectGroupFrame,
|
|
SelectIcon: () => SelectIcon,
|
|
SelectItemParentProvider: () => SelectItemParentProvider,
|
|
SelectProvider: () => SelectProvider,
|
|
SelectSeparator: () => SelectSeparator,
|
|
Separator: () => Separator,
|
|
Sheet: () => Sheet,
|
|
SheetController: () => SheetController,
|
|
SheetControllerContext: () => SheetControllerContext,
|
|
SheetHandleFrame: () => SheetHandleFrame,
|
|
SheetInsideSheetContext: () => SheetInsideSheetContext,
|
|
SheetOverlayFrame: () => SheetOverlayFrame,
|
|
SheetScrollView: () => SheetScrollView,
|
|
SizableStack: () => SizableStack,
|
|
SizableText: () => SizableText2,
|
|
Slider: () => Slider,
|
|
SliderContext: () => SliderContext,
|
|
SliderFrame: () => SliderFrame,
|
|
SliderThumb: () => SliderThumb,
|
|
SliderThumbFrame: () => SliderThumbFrame,
|
|
SliderTrack: () => SliderTrack,
|
|
SliderTrackActive: () => SliderTrackActive,
|
|
SliderTrackActiveFrame: () => SliderTrackActiveFrame,
|
|
SliderTrackFrame: () => SliderTrackFrame,
|
|
Spacer: () => import_core61.Spacer,
|
|
Spinner: () => Spinner,
|
|
Square: () => Square,
|
|
Stack: () => import_core61.Stack,
|
|
StyleObjectIdentifier: () => StyleObjectIdentifier,
|
|
StyleObjectProperty: () => StyleObjectProperty,
|
|
StyleObjectPseudo: () => StyleObjectPseudo,
|
|
StyleObjectRules: () => StyleObjectRules,
|
|
StyleObjectValue: () => StyleObjectValue,
|
|
Switch: () => Switch,
|
|
SwitchContext: () => SwitchContext,
|
|
SwitchFrame: () => SwitchFrame,
|
|
SwitchStyledContext: () => SwitchStyledContext,
|
|
SwitchThumb: () => SwitchThumb,
|
|
Tabs: () => Tabs,
|
|
TabsProvider: () => TabsProvider,
|
|
TamaguiProvider: () => TamaguiProvider,
|
|
Text: () => Text5,
|
|
TextArea: () => TextArea,
|
|
TextAreaFrame: () => TextAreaFrame,
|
|
Theme: () => import_core61.Theme,
|
|
ThemeableStack: () => ThemeableStack,
|
|
Thumb: () => Thumb,
|
|
ToggleGroup: () => ToggleGroup,
|
|
Tooltip: () => Tooltip2,
|
|
TooltipGroup: () => TooltipGroup,
|
|
TooltipSimple: () => TooltipSimple,
|
|
Track: () => Track,
|
|
USE_NATIVE_PORTAL: () => USE_NATIVE_PORTAL,
|
|
Unspaced: () => import_core61.Unspaced,
|
|
View: () => import_core61.View,
|
|
VisuallyHidden: () => VisuallyHidden,
|
|
XGroup: () => XGroup,
|
|
XStack: () => XStack,
|
|
YGroup: () => YGroup,
|
|
YStack: () => YStack,
|
|
ZStack: () => ZStack,
|
|
addTheme: () => addTheme,
|
|
allPortalHosts: () => allPortalHosts,
|
|
clamp: () => clamp,
|
|
closeOpenTooltips: () => closeOpenTooltips,
|
|
composeEventHandlers: () => composeEventHandlers,
|
|
composeRefs: () => composeRefs,
|
|
configureInitialWindowDimensions: () => configureInitialWindowDimensions,
|
|
createAvatarScope: () => createAvatarScope,
|
|
createCheckbox: () => createCheckbox,
|
|
createComponent: () => import_core61.createComponent,
|
|
createContext: () => createContext7,
|
|
createContextScope: () => createContextScope,
|
|
createFont: () => import_core61.createFont,
|
|
createMedia: () => createMedia,
|
|
createProgressScope: () => createProgressScope,
|
|
createRadioGroup: () => createRadioGroup,
|
|
createSheet: () => createSheet,
|
|
createSheetScope: () => createSheetScope,
|
|
createShorthands: () => import_core61.createShorthands,
|
|
createStyledContext: () => import_core61.createStyledContext,
|
|
createSwitch: () => createSwitch,
|
|
createTabs: () => createTabs,
|
|
createTamagui: () => createTamagui,
|
|
createTheme: () => import_core61.createTheme,
|
|
createTokens: () => import_core61.createTokens,
|
|
createVariable: () => import_core61.createVariable,
|
|
debounce: () => debounce,
|
|
defaultStyles: () => defaultStyles,
|
|
fullscreenStyle: () => fullscreenStyle,
|
|
getCSSStylesAtomic: () => import_core61.getCSSStylesAtomic,
|
|
getConfig: () => import_core61.getConfig,
|
|
getFontSize: () => getFontSize,
|
|
getFontSizeToken: () => getFontSizeToken,
|
|
getFontSizeVariable: () => getFontSizeVariable,
|
|
getMedia: () => import_core61.getMedia,
|
|
getNativeSheet: () => getNativeSheet,
|
|
getShapeSize: () => getShapeSize,
|
|
getThemes: () => import_core61.getThemes,
|
|
getToken: () => import_core61.getToken,
|
|
getTokenValue: () => import_core61.getTokenValue,
|
|
getTokens: () => import_core61.getTokens,
|
|
getVariable: () => import_core61.getVariable,
|
|
getVariableName: () => import_core61.getVariableName,
|
|
getVariableValue: () => import_core61.getVariableValue,
|
|
insertFont: () => import_core61.insertFont,
|
|
isChrome: () => import_core61.isChrome,
|
|
isClient: () => import_core61.isClient,
|
|
isPresent: () => isPresent,
|
|
isServer: () => import_core61.isServer,
|
|
isServerSide: () => isServerSide,
|
|
isTamaguiComponent: () => import_core61.isTamaguiComponent,
|
|
isTamaguiElement: () => import_core61.isTamaguiElement,
|
|
isTouchable: () => import_core61.isTouchable,
|
|
isVariable: () => import_core61.isVariable,
|
|
isWeb: () => import_core61.isWeb,
|
|
isWebTouchable: () => import_core61.isWebTouchable,
|
|
matchMedia: () => import_core61.matchMedia,
|
|
mediaObjectToString: () => import_core61.mediaObjectToString,
|
|
mediaQueryConfig: () => import_core61.mediaQueryConfig,
|
|
mediaState: () => import_core61.mediaState,
|
|
mutateThemes: () => mutateThemes,
|
|
portalListeners: () => portalListeners,
|
|
prevent: () => prevent,
|
|
replaceTheme: () => replaceTheme,
|
|
resolveViewZIndex: () => resolveViewZIndex,
|
|
setConfig: () => import_core61.setConfig,
|
|
setOnLayoutStrategy: () => import_core61.setOnLayoutStrategy,
|
|
setRef: () => setRef,
|
|
setupDev: () => import_core61.setupDev,
|
|
setupNativeSheet: () => setupNativeSheet,
|
|
setupPopper: () => setupPopper,
|
|
setupReactNative: () => import_core61.setupReactNative,
|
|
shouldRenderNativePlatform: () => shouldRenderNativePlatform,
|
|
simpleHash: () => simpleHash,
|
|
spacedChildren: () => import_core61.spacedChildren,
|
|
stylePropsAll: () => stylePropsAll,
|
|
stylePropsText: () => stylePropsText,
|
|
stylePropsTextOnly: () => stylePropsTextOnly,
|
|
stylePropsTransform: () => stylePropsTransform,
|
|
stylePropsUnitless: () => stylePropsUnitless,
|
|
stylePropsView: () => stylePropsView,
|
|
styled: () => import_core61.styled,
|
|
themeable: () => import_core61.themeable,
|
|
themeableVariants: () => themeableVariants,
|
|
tokenCategories: () => tokenCategories,
|
|
updateTheme: () => updateTheme,
|
|
useAdaptContext: () => useAdaptContext,
|
|
useAdaptIsActive: () => useAdaptIsActive,
|
|
useButton: () => useButton,
|
|
useComposedRefs: () => useComposedRefs,
|
|
useConfiguration: () => import_core61.useConfiguration,
|
|
useControllableState: () => useControllableState,
|
|
useCurrentColor: () => useCurrentColor,
|
|
useDebounce: () => useDebounce,
|
|
useDebounceValue: () => useDebounceValue,
|
|
useDialogContext: () => useDialogContext,
|
|
useDidFinishSSR: () => import_core61.useDidFinishSSR,
|
|
useEvent: () => import_core61.useEvent,
|
|
useFloatingContext: () => useFloatingContext,
|
|
useForceUpdate: () => useForceUpdate,
|
|
useFormContext: () => useFormContext,
|
|
useGet: () => import_core61.useGet,
|
|
useGetThemedIcon: () => useGetThemedIcon,
|
|
useGroupItem: () => useGroupItem,
|
|
useInputProps: () => useInputProps,
|
|
useIsPresent: () => useIsPresent,
|
|
useIsTouchDevice: () => import_core61.useIsTouchDevice,
|
|
useIsomorphicLayoutEffect: () => import_core61.useIsomorphicLayoutEffect,
|
|
useLabelContext: () => useLabelContext,
|
|
useListItem: () => useListItem,
|
|
useMedia: () => import_core61.useMedia,
|
|
usePopoverContext: () => usePopoverContext,
|
|
usePopperContext: () => usePopperContext,
|
|
usePopperContextSlow: () => usePopperContextSlow,
|
|
usePortal: () => usePortal,
|
|
usePresence: () => usePresence,
|
|
useProps: () => import_core61.useProps,
|
|
usePropsAndStyle: () => import_core61.usePropsAndStyle,
|
|
useSelectContext: () => useSelectContext,
|
|
useSelectItemParentContext: () => useSelectItemParentContext,
|
|
useSheet: () => useSheet,
|
|
useSheetController: () => useSheetController,
|
|
useSheetOffscreenSize: () => useSheetOffscreenSize,
|
|
useSheetOpenState: () => useSheetOpenState,
|
|
useStyle: () => import_core61.useStyle,
|
|
useTabsContext: () => useTabsContext,
|
|
useTheme: () => import_core61.useTheme,
|
|
useThemeName: () => import_core61.useThemeName,
|
|
useWindowDimensions: () => useWindowDimensions,
|
|
validPseudoKeys: () => validPseudoKeys,
|
|
validStyles: () => validStyles,
|
|
variableToString: () => import_core61.variableToString,
|
|
withStaticProperties: () => import_core61.withStaticProperties,
|
|
wrapChildrenInText: () => wrapChildrenInText
|
|
});
|
|
module.exports = __toCommonJS(esm_exports);
|
|
|
|
// node_modules/@tamagui/constants/dist/esm/constants.mjs
|
|
var import_react = __toESM(require("react"), 1);
|
|
var IS_REACT_19 = typeof import_react.default.use < "u";
|
|
var isWeb = true;
|
|
var isWindowDefined = typeof window < "u";
|
|
var isServer = isWeb && !isWindowDefined;
|
|
var isClient = isWeb && isWindowDefined;
|
|
var useIsomorphicLayoutEffect = isServer ? import_react.useEffect : import_react.useLayoutEffect;
|
|
var isChrome = typeof navigator < "u" && /Chrome/.test(navigator.userAgent || "");
|
|
var isWebTouchable = isClient && ("ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
var isTouchable = !isWeb || isWebTouchable;
|
|
var isAndroid = false;
|
|
var isIos = process.env.TEST_NATIVE_PLATFORM === "ios";
|
|
var currentPlatform = "web";
|
|
|
|
// node_modules/@tamagui/use-force-update/dist/esm/index.mjs
|
|
var import_react2 = __toESM(require("react"), 1);
|
|
var isServerSide = typeof window > "u";
|
|
var idFn = /* @__PURE__ */ __name(() => {
|
|
}, "idFn");
|
|
function useForceUpdate() {
|
|
return isServerSide ? idFn : import_react2.default.useReducer((x) => Math.random(), 0)[1];
|
|
}
|
|
__name(useForceUpdate, "useForceUpdate");
|
|
|
|
// node_modules/@tamagui/animate-presence/dist/esm/AnimatePresence.mjs
|
|
var import_react5 = require("react");
|
|
|
|
// node_modules/@tamagui/animate-presence/dist/esm/LayoutGroupContext.mjs
|
|
var import_react3 = __toESM(require("react"), 1);
|
|
var LayoutGroupContext = import_react3.default.createContext({});
|
|
|
|
// node_modules/@tamagui/use-constant/dist/esm/index.mjs
|
|
var React4 = __toESM(require("react"), 1);
|
|
function useConstant(fn) {
|
|
if (typeof document > "u") return React4.useMemo(() => fn(), []);
|
|
const ref = React4.useRef(void 0);
|
|
return ref.current || (ref.current = {
|
|
v: fn()
|
|
}), ref.current.v;
|
|
}
|
|
__name(useConstant, "useConstant");
|
|
|
|
// node_modules/@tamagui/use-presence/dist/esm/PresenceContext.mjs
|
|
var React5 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
var PresenceContext = React5.createContext(null);
|
|
var ResetPresence = /* @__PURE__ */ __name((props) => {
|
|
const parent = React5.useContext(PresenceContext);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresenceContext.Provider, {
|
|
value: props.disable ? parent : null,
|
|
children: props.children
|
|
});
|
|
}, "ResetPresence");
|
|
|
|
// node_modules/@tamagui/use-presence/dist/esm/usePresence.mjs
|
|
var React6 = __toESM(require("react"), 1);
|
|
function usePresence() {
|
|
const context2 = React6.useContext(PresenceContext);
|
|
if (!context2) return [true, null, context2];
|
|
const {
|
|
id,
|
|
isPresent: isPresent2,
|
|
onExitComplete,
|
|
register
|
|
} = context2;
|
|
return React6.useEffect(() => register(id), []), !isPresent2 && onExitComplete ? [false, () => onExitComplete?.(id), context2] : [true, void 0, context2];
|
|
}
|
|
__name(usePresence, "usePresence");
|
|
function useIsPresent() {
|
|
return isPresent(React6.useContext(PresenceContext));
|
|
}
|
|
__name(useIsPresent, "useIsPresent");
|
|
function isPresent(context2) {
|
|
return context2 === null ? true : context2.isPresent;
|
|
}
|
|
__name(isPresent, "isPresent");
|
|
|
|
// node_modules/@tamagui/animate-presence/dist/esm/PresenceChild.mjs
|
|
var React7 = __toESM(require("react"), 1);
|
|
var import_react4 = require("react");
|
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
var PresenceChild = React7.memo(({
|
|
children,
|
|
initial,
|
|
isPresent: isPresent2,
|
|
onExitComplete,
|
|
exitVariant,
|
|
enterVariant,
|
|
enterExitVariant,
|
|
presenceAffectsLayout,
|
|
custom
|
|
}) => {
|
|
const presenceChildren = useConstant(newChildrenMap), id = (0, import_react4.useId)() || "", context2 = React7.useMemo(
|
|
() => ({
|
|
id,
|
|
initial,
|
|
isPresent: isPresent2,
|
|
custom,
|
|
exitVariant,
|
|
enterVariant,
|
|
enterExitVariant,
|
|
onExitComplete: /* @__PURE__ */ __name(() => {
|
|
presenceChildren.set(id, true);
|
|
for (const isComplete of presenceChildren.values()) if (!isComplete) return;
|
|
onExitComplete?.();
|
|
}, "onExitComplete"),
|
|
register: /* @__PURE__ */ __name(() => (presenceChildren.set(id, false), () => presenceChildren.delete(id)), "register")
|
|
}),
|
|
/**
|
|
* If the presence of a child affects the layout of the components around it,
|
|
* we want to make a new context value to ensure they get re-rendered
|
|
* so they can detect that layout change.
|
|
*/
|
|
// @ts-expect-error its ok
|
|
presenceAffectsLayout ? void 0 : [isPresent2, exitVariant, enterVariant]
|
|
);
|
|
return React7.useMemo(() => {
|
|
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
}, [isPresent2]), React7.useEffect(() => {
|
|
!isPresent2 && !presenceChildren.size && onExitComplete?.();
|
|
}, [isPresent2]), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PresenceContext.Provider, {
|
|
value: context2,
|
|
children
|
|
});
|
|
});
|
|
function newChildrenMap() {
|
|
return /* @__PURE__ */ new Map();
|
|
}
|
|
__name(newChildrenMap, "newChildrenMap");
|
|
|
|
// node_modules/@tamagui/animate-presence/dist/esm/AnimatePresence.mjs
|
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
var getChildKey = /* @__PURE__ */ __name((child) => child.key || "", "getChildKey");
|
|
function updateChildLookup(children, allChildren) {
|
|
children.forEach((child) => {
|
|
const key = getChildKey(child);
|
|
allChildren.set(key, child);
|
|
});
|
|
}
|
|
__name(updateChildLookup, "updateChildLookup");
|
|
function onlyElements(children) {
|
|
const filtered = [];
|
|
return import_react5.Children.forEach(children, (child) => {
|
|
(0, import_react5.isValidElement)(child) && filtered.push(child);
|
|
}), filtered;
|
|
}
|
|
__name(onlyElements, "onlyElements");
|
|
var AnimatePresence = /* @__PURE__ */ __name(({
|
|
children,
|
|
enterVariant,
|
|
exitVariant,
|
|
enterExitVariant,
|
|
initial = true,
|
|
onExitComplete,
|
|
exitBeforeEnter,
|
|
presenceAffectsLayout = true,
|
|
custom,
|
|
passThrough
|
|
}) => {
|
|
let forceRender = (0, import_react5.useContext)(LayoutGroupContext).forceRender ?? useForceUpdate();
|
|
const filteredChildren = onlyElements(children), presentChildren = (0, import_react5.useRef)(filteredChildren), allChildren = (0, import_react5.useRef)(/* @__PURE__ */ new Map()).current, exiting = (0, import_react5.useRef)(/* @__PURE__ */ new Set()).current;
|
|
updateChildLookup(filteredChildren, allChildren);
|
|
const isInitialRender = (0, import_react5.useRef)(true);
|
|
if (passThrough) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {
|
|
children
|
|
});
|
|
if (useIsomorphicLayoutEffect(() => {
|
|
isInitialRender.current = false;
|
|
}, []), isInitialRender.current) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {
|
|
children: filteredChildren.map((child) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PresenceChild, {
|
|
isPresent: true,
|
|
enterExitVariant,
|
|
exitVariant,
|
|
enterVariant,
|
|
initial: initial ? void 0 : false,
|
|
presenceAffectsLayout,
|
|
custom,
|
|
children: child
|
|
}, getChildKey(child)))
|
|
});
|
|
let childrenToRender = [...filteredChildren];
|
|
const presentKeys = presentChildren.current.map(getChildKey), targetKeys = filteredChildren.map(getChildKey), numPresent = presentKeys.length;
|
|
for (let i = 0; i < numPresent; i++) {
|
|
const key = presentKeys[i];
|
|
targetKeys.indexOf(key) === -1 ? exiting.add(key) : exiting.delete(key);
|
|
}
|
|
return exitBeforeEnter && exiting.size && (childrenToRender = []), exiting.forEach((key) => {
|
|
if (targetKeys.indexOf(key) !== -1) return;
|
|
const child = allChildren.get(key);
|
|
if (!child) return;
|
|
const insertionIndex = presentKeys.indexOf(key), exitingComponent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PresenceChild, {
|
|
isPresent: false,
|
|
onExitComplete: /* @__PURE__ */ __name(() => {
|
|
allChildren.delete(key), exiting.delete(key);
|
|
const removeIndex = presentChildren.current.findIndex((presentChild) => presentChild.key === key);
|
|
presentChildren.current.splice(removeIndex, 1), exiting.size || (presentChildren.current = filteredChildren, forceRender(), onExitComplete?.());
|
|
}, "onExitComplete"),
|
|
presenceAffectsLayout,
|
|
enterExitVariant,
|
|
enterVariant,
|
|
exitVariant,
|
|
custom,
|
|
children: child
|
|
}, getChildKey(child));
|
|
childrenToRender.splice(insertionIndex, 0, exitingComponent);
|
|
}), childrenToRender = childrenToRender.map((child) => {
|
|
const key = child.key;
|
|
return exiting.has(key) ? child : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PresenceChild, {
|
|
isPresent: true,
|
|
exitVariant,
|
|
enterVariant,
|
|
enterExitVariant,
|
|
presenceAffectsLayout,
|
|
custom,
|
|
children: child
|
|
}, getChildKey(child));
|
|
}), presentChildren.current = childrenToRender, /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {
|
|
children: exiting.size ? childrenToRender : (
|
|
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
|
|
childrenToRender.map((child) => (0, import_react5.cloneElement)(child))
|
|
)
|
|
});
|
|
}, "AnimatePresence");
|
|
AnimatePresence.displayName = "AnimatePresence";
|
|
|
|
// node_modules/@tamagui/simple-hash/dist/esm/index.mjs
|
|
var cache = /* @__PURE__ */ new Map();
|
|
var cacheSize = 0;
|
|
var simpleHash = /* @__PURE__ */ __name((strIn, hashMin = 10) => {
|
|
if (cache.has(strIn)) return cache.get(strIn);
|
|
let str = strIn;
|
|
str[0] === "v" && str.startsWith("var(") && (str = str.slice(6, str.length - 1));
|
|
let hash = 0, valids = "", added = 0;
|
|
const len = str.length;
|
|
for (let i = 0; i < len; i++) {
|
|
if (hashMin !== "strict" && added <= hashMin) {
|
|
const char = str.charCodeAt(i);
|
|
if (char === 46) {
|
|
valids += "--";
|
|
continue;
|
|
}
|
|
if (isValidCSSCharCode(char)) {
|
|
added++, valids += str[i];
|
|
continue;
|
|
}
|
|
}
|
|
hash = hashChar(hash, str[i]);
|
|
}
|
|
const res = valids + (hash ? Math.abs(hash) : "");
|
|
return cacheSize > 1e4 && (cache.clear(), cacheSize = 0), cache.set(strIn, res), cacheSize++, res;
|
|
}, "simpleHash");
|
|
var hashChar = /* @__PURE__ */ __name((hash, c) => Math.imul(31, hash) + c.charCodeAt(0) | 0, "hashChar");
|
|
function isValidCSSCharCode(code) {
|
|
return (
|
|
// A-Z
|
|
code >= 65 && code <= 90 || // a-z
|
|
code >= 97 && code <= 122 || // _
|
|
code === 95 || // -
|
|
code === 45 || // 0-9
|
|
code >= 48 && code <= 57
|
|
);
|
|
}
|
|
__name(isValidCSSCharCode, "isValidCSSCharCode");
|
|
|
|
// node_modules/@tamagui/helpers/dist/esm/clamp.mjs
|
|
function clamp(value, [min2, max2]) {
|
|
return Math.min(max2, Math.max(min2, value));
|
|
}
|
|
__name(clamp, "clamp");
|
|
|
|
// node_modules/@tamagui/helpers/dist/esm/composeEventHandlers.mjs
|
|
function composeEventHandlers(og, next, {
|
|
checkDefaultPrevented = true
|
|
} = {}) {
|
|
return !og || !next ? next || og || void 0 : (event) => {
|
|
if (og?.(event), !event || !(checkDefaultPrevented && typeof event == "object" && "defaultPrevented" in event) || // @ts-ignore
|
|
"defaultPrevented" in event && !event.defaultPrevented) return next?.(event);
|
|
};
|
|
}
|
|
__name(composeEventHandlers, "composeEventHandlers");
|
|
|
|
// node_modules/@tamagui/helpers/dist/esm/types.mjs
|
|
var StyleObjectProperty = 0;
|
|
var StyleObjectValue = 1;
|
|
var StyleObjectIdentifier = 2;
|
|
var StyleObjectPseudo = 3;
|
|
var StyleObjectRules = 4;
|
|
|
|
// node_modules/@tamagui/helpers/dist/esm/shouldRenderNativePlatform.mjs
|
|
var ALL_PLATFORMS = ["web", "android", "ios"];
|
|
function shouldRenderNativePlatform(nativeProp) {
|
|
if (!nativeProp) return null;
|
|
const userRequestedPlatforms = resolvePlatformNames(nativeProp);
|
|
for (const platform2 of ALL_PLATFORMS) if (platform2 === currentPlatform && userRequestedPlatforms.has(platform2)) return platform2;
|
|
return null;
|
|
}
|
|
__name(shouldRenderNativePlatform, "shouldRenderNativePlatform");
|
|
function resolvePlatformNames(nativeProp) {
|
|
const platforms = nativeProp === true ? ALL_PLATFORMS : nativeProp === false ? [] : Array.isArray(nativeProp) ? nativeProp : [nativeProp], set = new Set(platforms);
|
|
return set.has("mobile") && (set.add("android"), set.add("ios"), set.delete("mobile")), set;
|
|
}
|
|
__name(resolvePlatformNames, "resolvePlatformNames");
|
|
|
|
// node_modules/@tamagui/helpers/dist/esm/validStyleProps.mjs
|
|
var textColors = {
|
|
color: true,
|
|
textDecorationColor: true,
|
|
textShadowColor: true
|
|
};
|
|
var tokenCategories = {
|
|
radius: {
|
|
borderRadius: true,
|
|
borderTopLeftRadius: true,
|
|
borderTopRightRadius: true,
|
|
borderBottomLeftRadius: true,
|
|
borderBottomRightRadius: true,
|
|
// logical
|
|
borderStartStartRadius: true,
|
|
borderStartEndRadius: true,
|
|
borderEndStartRadius: true,
|
|
borderEndEndRadius: true
|
|
},
|
|
size: {
|
|
width: true,
|
|
height: true,
|
|
minWidth: true,
|
|
minHeight: true,
|
|
maxWidth: true,
|
|
maxHeight: true,
|
|
blockSize: true,
|
|
minBlockSize: true,
|
|
maxBlockSize: true,
|
|
inlineSize: true,
|
|
minInlineSize: true,
|
|
maxInlineSize: true
|
|
},
|
|
zIndex: {
|
|
zIndex: true
|
|
},
|
|
color: {
|
|
backgroundColor: true,
|
|
borderColor: true,
|
|
borderBlockStartColor: true,
|
|
borderBlockEndColor: true,
|
|
borderBlockColor: true,
|
|
borderBottomColor: true,
|
|
borderInlineColor: true,
|
|
borderInlineStartColor: true,
|
|
borderInlineEndColor: true,
|
|
borderTopColor: true,
|
|
borderLeftColor: true,
|
|
borderRightColor: true,
|
|
borderEndColor: true,
|
|
borderStartColor: true,
|
|
shadowColor: true,
|
|
...textColors,
|
|
outlineColor: true,
|
|
caretColor: true
|
|
}
|
|
};
|
|
var stylePropsUnitless = {
|
|
WebkitLineClamp: true,
|
|
animationIterationCount: true,
|
|
aspectRatio: true,
|
|
borderImageOutset: true,
|
|
borderImageSlice: true,
|
|
borderImageWidth: true,
|
|
columnCount: true,
|
|
flex: true,
|
|
flexGrow: true,
|
|
flexOrder: true,
|
|
flexPositive: true,
|
|
flexShrink: true,
|
|
flexNegative: true,
|
|
fontWeight: true,
|
|
gridRow: true,
|
|
gridRowEnd: true,
|
|
gridRowGap: true,
|
|
gridRowStart: true,
|
|
gridColumn: true,
|
|
gridColumnEnd: true,
|
|
gridColumnGap: true,
|
|
gridColumnStart: true,
|
|
gridTemplateColumns: true,
|
|
gridTemplateAreas: true,
|
|
lineClamp: true,
|
|
opacity: true,
|
|
order: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
scale: true,
|
|
scaleX: true,
|
|
scaleY: true,
|
|
scaleZ: true,
|
|
shadowOpacity: true
|
|
};
|
|
var stylePropsTransform = {
|
|
x: true,
|
|
y: true,
|
|
scale: true,
|
|
perspective: true,
|
|
scaleX: true,
|
|
scaleY: true,
|
|
skewX: true,
|
|
skewY: true,
|
|
matrix: true,
|
|
rotate: true,
|
|
rotateY: true,
|
|
rotateX: true,
|
|
rotateZ: true
|
|
};
|
|
var stylePropsView = {
|
|
backfaceVisibility: true,
|
|
borderBottomEndRadius: true,
|
|
borderBottomStartRadius: true,
|
|
borderBottomWidth: true,
|
|
borderLeftWidth: true,
|
|
borderRightWidth: true,
|
|
borderBlockWidth: true,
|
|
borderBlockEndWidth: true,
|
|
borderBlockStartWidth: true,
|
|
borderInlineWidth: true,
|
|
borderInlineEndWidth: true,
|
|
borderInlineStartWidth: true,
|
|
borderStyle: true,
|
|
borderBlockStyle: true,
|
|
borderBlockEndStyle: true,
|
|
borderBlockStartStyle: true,
|
|
borderInlineStyle: true,
|
|
borderInlineEndStyle: true,
|
|
borderInlineStartStyle: true,
|
|
borderTopEndRadius: true,
|
|
borderTopStartRadius: true,
|
|
borderTopWidth: true,
|
|
borderWidth: true,
|
|
transform: true,
|
|
transformOrigin: true,
|
|
alignContent: true,
|
|
alignItems: true,
|
|
alignSelf: true,
|
|
borderEndWidth: true,
|
|
borderStartWidth: true,
|
|
bottom: true,
|
|
display: true,
|
|
end: true,
|
|
flexBasis: true,
|
|
flexDirection: true,
|
|
flexWrap: true,
|
|
gap: true,
|
|
columnGap: true,
|
|
rowGap: true,
|
|
justifyContent: true,
|
|
left: true,
|
|
margin: true,
|
|
marginBlock: true,
|
|
marginBlockEnd: true,
|
|
marginBlockStart: true,
|
|
marginInline: true,
|
|
marginInlineStart: true,
|
|
marginInlineEnd: true,
|
|
marginBottom: true,
|
|
marginEnd: true,
|
|
marginHorizontal: true,
|
|
marginLeft: true,
|
|
marginRight: true,
|
|
marginStart: true,
|
|
marginTop: true,
|
|
marginVertical: true,
|
|
overflow: true,
|
|
padding: true,
|
|
paddingBottom: true,
|
|
paddingInline: true,
|
|
paddingBlock: true,
|
|
paddingBlockStart: true,
|
|
paddingInlineEnd: true,
|
|
paddingInlineStart: true,
|
|
paddingEnd: true,
|
|
paddingHorizontal: true,
|
|
paddingLeft: true,
|
|
paddingRight: true,
|
|
paddingStart: true,
|
|
paddingTop: true,
|
|
paddingVertical: true,
|
|
position: true,
|
|
right: true,
|
|
start: true,
|
|
top: true,
|
|
inset: true,
|
|
insetBlock: true,
|
|
insetBlockEnd: true,
|
|
insetBlockStart: true,
|
|
insetInline: true,
|
|
insetInlineEnd: true,
|
|
insetInlineStart: true,
|
|
direction: true,
|
|
shadowOffset: true,
|
|
shadowRadius: true,
|
|
...tokenCategories.color,
|
|
...tokenCategories.radius,
|
|
...tokenCategories.size,
|
|
...tokenCategories.radius,
|
|
...stylePropsTransform,
|
|
...stylePropsUnitless,
|
|
boxShadow: true,
|
|
filter: true,
|
|
// RN 0.77+ style props (set REACT_NATIVE_PRE_77=1 for older RN)
|
|
...!process.env.REACT_NATIVE_PRE_77 && {
|
|
boxSizing: true,
|
|
mixBlendMode: true,
|
|
outlineColor: true,
|
|
outlineSpread: true,
|
|
outlineStyle: true,
|
|
outlineWidth: true
|
|
},
|
|
// RN doesn't support specific border styles per-edge
|
|
transition: true,
|
|
textWrap: true,
|
|
backdropFilter: true,
|
|
WebkitBackdropFilter: true,
|
|
background: true,
|
|
backgroundAttachment: true,
|
|
backgroundBlendMode: true,
|
|
backgroundClip: true,
|
|
backgroundColor: true,
|
|
backgroundImage: true,
|
|
backgroundOrigin: true,
|
|
backgroundPosition: true,
|
|
backgroundRepeat: true,
|
|
backgroundSize: true,
|
|
borderBottomStyle: true,
|
|
borderImage: true,
|
|
borderLeftStyle: true,
|
|
borderRightStyle: true,
|
|
borderTopStyle: true,
|
|
caretColor: true,
|
|
clipPath: true,
|
|
contain: true,
|
|
containerType: true,
|
|
content: true,
|
|
cursor: true,
|
|
float: true,
|
|
mask: true,
|
|
maskBorder: true,
|
|
maskBorderMode: true,
|
|
maskBorderOutset: true,
|
|
maskBorderRepeat: true,
|
|
maskBorderSlice: true,
|
|
maskBorderSource: true,
|
|
maskBorderWidth: true,
|
|
maskClip: true,
|
|
maskComposite: true,
|
|
maskImage: true,
|
|
maskMode: true,
|
|
maskOrigin: true,
|
|
maskPosition: true,
|
|
maskRepeat: true,
|
|
maskSize: true,
|
|
maskType: true,
|
|
objectFit: true,
|
|
objectPosition: true,
|
|
outlineOffset: true,
|
|
overflowBlock: true,
|
|
overflowInline: true,
|
|
overflowX: true,
|
|
overflowY: true,
|
|
pointerEvents: true,
|
|
scrollbarWidth: true,
|
|
textEmphasis: true,
|
|
touchAction: true,
|
|
transformStyle: true,
|
|
userSelect: true,
|
|
willChange: true,
|
|
...isAndroid ? {
|
|
elevationAndroid: true
|
|
} : {}
|
|
};
|
|
var stylePropsFont = {
|
|
fontFamily: true,
|
|
fontSize: true,
|
|
fontStyle: true,
|
|
fontWeight: true,
|
|
fontVariant: true,
|
|
letterSpacing: true,
|
|
lineHeight: true,
|
|
textTransform: true
|
|
};
|
|
var stylePropsTextOnly = {
|
|
...stylePropsFont,
|
|
textAlign: true,
|
|
textDecorationLine: true,
|
|
textDecorationStyle: true,
|
|
...textColors,
|
|
textShadowOffset: true,
|
|
textShadowRadius: true,
|
|
userSelect: true,
|
|
selectable: true,
|
|
verticalAlign: true,
|
|
whiteSpace: true,
|
|
wordWrap: true,
|
|
textOverflow: true,
|
|
textDecorationDistance: true,
|
|
cursor: true,
|
|
WebkitLineClamp: true,
|
|
WebkitBoxOrient: true
|
|
};
|
|
var stylePropsText = {
|
|
...stylePropsView,
|
|
...stylePropsTextOnly
|
|
};
|
|
var stylePropsAll = stylePropsText;
|
|
var validPseudoKeys = {
|
|
enterStyle: true,
|
|
exitStyle: true,
|
|
hoverStyle: true,
|
|
pressStyle: true,
|
|
focusStyle: true,
|
|
disabledStyle: true,
|
|
focusWithinStyle: true,
|
|
focusVisibleStyle: true
|
|
};
|
|
var validStyles = stylePropsView;
|
|
|
|
// node_modules/@tamagui/helpers/dist/esm/withStaticProperties.mjs
|
|
var import_react6 = __toESM(require("react"), 1);
|
|
var Decorated = Symbol();
|
|
var withStaticProperties = /* @__PURE__ */ __name((component, staticProps) => {
|
|
const next = (() => {
|
|
if (component[Decorated]) {
|
|
const _ = import_react6.default.forwardRef((props, ref) => import_react6.default.createElement(component, {
|
|
...props,
|
|
ref
|
|
}));
|
|
for (const key in component) {
|
|
const v = component[key];
|
|
_[key] = v && typeof v == "object" ? {
|
|
...v
|
|
} : v;
|
|
}
|
|
}
|
|
return component;
|
|
})();
|
|
return Object.assign(next, staticProps), next[Decorated] = true, next;
|
|
}, "withStaticProperties");
|
|
|
|
// node_modules/@tamagui/use-event/dist/esm/useGet.mjs
|
|
var React9 = __toESM(require("react"), 1);
|
|
function useGet(currentValue, initialValue2, forwardToFunction) {
|
|
const curRef = React9.useRef(initialValue2 ?? currentValue);
|
|
return useIsomorphicLayoutEffect(() => {
|
|
curRef.current = currentValue;
|
|
}), React9.useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
|
|
}
|
|
__name(useGet, "useGet");
|
|
|
|
// node_modules/@tamagui/use-event/dist/esm/useEvent.mjs
|
|
function useEvent(callback) {
|
|
return useGet(callback, defaultValue, true);
|
|
}
|
|
__name(useEvent, "useEvent");
|
|
var defaultValue = /* @__PURE__ */ __name(() => {
|
|
throw new Error("Cannot call an event handler while rendering.");
|
|
}, "defaultValue");
|
|
|
|
// node_modules/@tamagui/use-controllable-state/dist/esm/useControllableState.mjs
|
|
var React10 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/start-transition/dist/esm/index.mjs
|
|
var import_react7 = require("react");
|
|
var startTransition = /* @__PURE__ */ __name((callback) => {
|
|
(0, import_react7.startTransition)(callback);
|
|
}, "startTransition");
|
|
|
|
// node_modules/@tamagui/use-controllable-state/dist/esm/useControllableState.mjs
|
|
var emptyCallbackFn = /* @__PURE__ */ __name((_) => _(), "emptyCallbackFn");
|
|
function useControllableState({
|
|
prop,
|
|
defaultProp,
|
|
onChange,
|
|
strategy = "prop-wins",
|
|
preventUpdate,
|
|
transition
|
|
}) {
|
|
const [state, setState] = React10.useState(prop ?? defaultProp), previous = React10.useRef(state), propWins = strategy === "prop-wins" && prop !== void 0, value = propWins ? prop : state, onChangeCb = useEvent(onChange || idFn2), transitionFn = transition ? startTransition : emptyCallbackFn;
|
|
React10.useEffect(() => {
|
|
prop !== void 0 && (previous.current = prop, transitionFn(() => {
|
|
setState(prop);
|
|
}));
|
|
}, [prop]), React10.useEffect(() => {
|
|
propWins || state !== previous.current && (previous.current = state, onChangeCb(state));
|
|
}, [onChangeCb, state, propWins]);
|
|
const setter = useEvent((next) => {
|
|
if (!preventUpdate) if (propWins) {
|
|
const nextValue = typeof next == "function" ? next(previous.current) : next;
|
|
onChangeCb(nextValue);
|
|
} else transitionFn(() => {
|
|
setState(next);
|
|
});
|
|
});
|
|
return [value, setter];
|
|
}
|
|
__name(useControllableState, "useControllableState");
|
|
var idFn2 = /* @__PURE__ */ __name(() => {
|
|
}, "idFn");
|
|
|
|
// node_modules/@tamagui/collapsible/dist/esm/Collapsible.mjs
|
|
var import_web = require("@tamagui/core");
|
|
var React11 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
var {
|
|
Provider: CollapsibleProvider,
|
|
useStyledContext: useCollapsibleContext
|
|
} = (0, import_web.createStyledContext)();
|
|
var _Collapsible = React11.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeCollapsible,
|
|
open: openProp,
|
|
defaultOpen,
|
|
disabled,
|
|
onOpenChange,
|
|
...collapsibleProps
|
|
} = props, [open = false, setOpen] = useControllableState({
|
|
prop: openProp,
|
|
defaultProp: defaultOpen,
|
|
onChange: onOpenChange
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollapsibleProvider, {
|
|
scope: __scopeCollapsible,
|
|
disabled,
|
|
contentId: React11.useId(),
|
|
open,
|
|
onOpenToggle: React11.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_web.Stack, {
|
|
"data-state": getState(open),
|
|
"data-disabled": disabled ? "" : void 0,
|
|
...collapsibleProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
var TRIGGER_NAME = "CollapsibleTrigger";
|
|
var CollapsibleTriggerFrame = (0, import_web.styled)(import_web.Stack, {
|
|
name: TRIGGER_NAME,
|
|
tag: "button"
|
|
});
|
|
var CollapsibleTrigger = CollapsibleTriggerFrame.styleable((props, forwardedRef) => {
|
|
const {
|
|
__scopeCollapsible,
|
|
children,
|
|
...triggerProps
|
|
} = props, context2 = useCollapsibleContext(__scopeCollapsible);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollapsibleTriggerFrame, {
|
|
"aria-controls": context2.contentId,
|
|
"aria-expanded": context2.open || false,
|
|
"data-state": getState(context2.open),
|
|
"data-disabled": context2.disabled ? "" : void 0,
|
|
disabled: context2.disabled,
|
|
...triggerProps,
|
|
ref: forwardedRef,
|
|
onPress: composeEventHandlers(props.onPress, context2.onOpenToggle),
|
|
children: typeof children == "function" ? children({
|
|
open: context2.open
|
|
}) : children
|
|
});
|
|
});
|
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
var CONTENT_NAME = "CollapsibleContent";
|
|
var CollapsibleContentFrame = (0, import_web.styled)(import_web.Stack, {
|
|
name: CONTENT_NAME
|
|
});
|
|
var CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
const {
|
|
forceMount,
|
|
children,
|
|
// @ts-expect-error
|
|
__scopeCollapsible,
|
|
...contentProps
|
|
} = props, context2 = useCollapsibleContext(__scopeCollapsible);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AnimatePresence, {
|
|
...contentProps,
|
|
children: forceMount || context2.open ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollapsibleContentFrame, {
|
|
ref: forwardedRef,
|
|
...contentProps,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ResetPresence, {
|
|
children
|
|
})
|
|
}) : null
|
|
});
|
|
});
|
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
function getState(open) {
|
|
return open ? "open" : "closed";
|
|
}
|
|
__name(getState, "getState");
|
|
var Collapsible = withStaticProperties(_Collapsible, {
|
|
Trigger: CollapsibleTrigger,
|
|
Content: CollapsibleContent
|
|
});
|
|
|
|
// node_modules/@tamagui/compose-refs/dist/esm/compose-refs.mjs
|
|
var React12 = __toESM(require("react"), 1);
|
|
function setRef(ref, value) {
|
|
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
}
|
|
__name(setRef, "setRef");
|
|
function composeRefs(...refs) {
|
|
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
}
|
|
__name(composeRefs, "composeRefs");
|
|
function useComposedRefs(...refs) {
|
|
return React12.useCallback(composeRefs(...refs), refs);
|
|
}
|
|
__name(useComposedRefs, "useComposedRefs");
|
|
|
|
// node_modules/@tamagui/collection/dist/esm/Collection.mjs
|
|
var import_core = require("@tamagui/core");
|
|
var import_react8 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
function createCollection(name) {
|
|
const {
|
|
Provider: CollectionProviderImpl,
|
|
useStyledContext: useCollectionContext
|
|
} = (0, import_core.createStyledContext)({
|
|
collectionRef: {
|
|
current: void 0
|
|
},
|
|
itemMap: /* @__PURE__ */ new Map()
|
|
}, "Toast"), CollectionProvider = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
scope,
|
|
children
|
|
} = props, ref = import_react8.default.useRef(void 0), itemMap = import_react8.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionProviderImpl, {
|
|
scope,
|
|
itemMap,
|
|
collectionRef: ref,
|
|
children
|
|
});
|
|
}, "CollectionProvider");
|
|
CollectionProvider.displayName = "CollectionProvider";
|
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = import_react8.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
scope,
|
|
children
|
|
} = props, context2 = useCollectionContext(scope), composedRefs = useComposedRefs(forwardedRef, context2.collectionRef);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core.Slot, {
|
|
ref: composedRefs,
|
|
children
|
|
});
|
|
});
|
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-collection-item", CollectionItemSlot = import_react8.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
scope,
|
|
children,
|
|
...itemData
|
|
} = props, ref = import_react8.default.useRef(void 0), composedRefs = useComposedRefs(forwardedRef, ref), context2 = useCollectionContext(scope);
|
|
return import_react8.default.useEffect(() => (context2.itemMap.set(ref, {
|
|
ref,
|
|
...itemData
|
|
}), () => void context2.itemMap.delete(ref))), /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core.Slot, {
|
|
[ITEM_DATA_ATTR]: "",
|
|
ref: composedRefs,
|
|
children
|
|
});
|
|
});
|
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
function useCollection3(scope) {
|
|
const context2 = useCollectionContext(scope);
|
|
return import_react8.default.useCallback(() => {
|
|
if (!isWeb) return [];
|
|
const collectionNode = context2.collectionRef.current;
|
|
if (!collectionNode) return [];
|
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
return Array.from(context2.itemMap.values()).sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
}, [context2.collectionRef, context2.itemMap]);
|
|
}
|
|
__name(useCollection3, "useCollection");
|
|
return [{
|
|
Provider: CollectionProvider,
|
|
Slot: CollectionSlot,
|
|
ItemSlot: CollectionItemSlot
|
|
}, useCollection3];
|
|
}
|
|
__name(createCollection, "createCollection");
|
|
|
|
// node_modules/@tamagui/accordion/dist/esm/Accordion.mjs
|
|
var import_core6 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/Stacks.mjs
|
|
var import_core3 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/getElevation.mjs
|
|
var import_core2 = require("@tamagui/core");
|
|
var getElevation = /* @__PURE__ */ __name((size4, extras) => {
|
|
if (!size4) return;
|
|
const {
|
|
tokens
|
|
} = extras, token = tokens.size[size4], sizeNum = (0, import_core2.isVariable)(token) ? +token.val : size4;
|
|
return getSizedElevation(sizeNum, extras);
|
|
}, "getElevation");
|
|
var getSizedElevation = /* @__PURE__ */ __name((val, {
|
|
theme,
|
|
tokens
|
|
}) => {
|
|
let num = 0;
|
|
if (val === true) {
|
|
const val2 = (0, import_core2.getVariableValue)(tokens.size.true);
|
|
typeof val2 == "number" ? num = val2 : num = 10;
|
|
} else num = +val;
|
|
if (num === 0) return;
|
|
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
return {
|
|
shadowColor: theme.shadowColor,
|
|
shadowRadius,
|
|
shadowOffset: {
|
|
height,
|
|
width: 0
|
|
},
|
|
...import_core2.isAndroid ? {
|
|
elevationAndroid: 2 * height
|
|
} : {}
|
|
};
|
|
}, "getSizedElevation");
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/Stacks.mjs
|
|
var fullscreenStyle = {
|
|
position: "absolute",
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
bottom: 0
|
|
};
|
|
var getInset = /* @__PURE__ */ __name((val) => val && typeof val == "object" ? val : {
|
|
top: val,
|
|
left: val,
|
|
bottom: val,
|
|
right: val
|
|
}, "getInset");
|
|
var variants = {
|
|
fullscreen: {
|
|
true: fullscreenStyle
|
|
},
|
|
elevation: {
|
|
"...size": getElevation,
|
|
":number": getElevation
|
|
},
|
|
inset: getInset
|
|
};
|
|
var YStack = (0, import_core3.styled)(import_core3.View, {
|
|
flexDirection: "column",
|
|
variants
|
|
});
|
|
YStack.displayName = "YStack";
|
|
var XStack = (0, import_core3.styled)(import_core3.View, {
|
|
flexDirection: "row",
|
|
variants
|
|
});
|
|
XStack.displayName = "XStack";
|
|
var ZStack = (0, import_core3.styled)(YStack, {
|
|
position: "relative"
|
|
}, {
|
|
neverFlatten: true,
|
|
isZStack: true
|
|
});
|
|
ZStack.displayName = "ZStack";
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/SizableStack.mjs
|
|
var import_core4 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/get-token/dist/esm/index.mjs
|
|
var import_web2 = require("@tamagui/core");
|
|
var defaultOptions = {
|
|
shift: 0,
|
|
bounds: [0]
|
|
};
|
|
var getSize = /* @__PURE__ */ __name((size4, options) => getTokenRelative("size", size4, options), "getSize");
|
|
var getSpace = /* @__PURE__ */ __name((space, options) => getTokenRelative("space", space, options), "getSpace");
|
|
var cacheVariables = {};
|
|
var cacheWholeVariables = {};
|
|
var cacheKeys = {};
|
|
var cacheWholeKeys = {};
|
|
var stepTokenUpOrDown = /* @__PURE__ */ __name((type, current, options = defaultOptions) => {
|
|
const tokens = (0, import_web2.getTokens)({
|
|
prefixed: true
|
|
})[type];
|
|
if (!(type in cacheVariables)) {
|
|
cacheKeys[type] = [], cacheVariables[type] = [], cacheWholeKeys[type] = [], cacheWholeVariables[type] = [];
|
|
const sorted = Object.keys(tokens).map((k) => tokens[k]).sort((a, b) => a.val - b.val);
|
|
for (const token of sorted) cacheKeys[type].push(token.key), cacheVariables[type].push(token);
|
|
const sortedExcludingHalfSteps = sorted.filter((x) => !x.key.endsWith(".5"));
|
|
for (const token of sortedExcludingHalfSteps) cacheWholeKeys[type].push(token.key), cacheWholeVariables[type].push(token);
|
|
}
|
|
const isString = typeof current == "string", tokensOrdered = (options.excludeHalfSteps ? isString ? cacheWholeKeys : cacheWholeVariables : isString ? cacheKeys : cacheVariables)[type], min2 = options.bounds?.[0] ?? 0, max2 = options.bounds?.[1] ?? tokensOrdered.length - 1, currentIndex = tokensOrdered.indexOf(current);
|
|
let shift4 = options.shift || 0;
|
|
shift4 && (current === "$true" || (0, import_web2.isVariable)(current) && current.name === "true") && (shift4 += shift4 > 0 ? 1 : -1);
|
|
const index5 = Math.min(max2, Math.max(min2, currentIndex + shift4)), found = tokensOrdered[index5];
|
|
return (typeof found == "string" ? tokens[found] : found) || tokens.$true;
|
|
}, "stepTokenUpOrDown");
|
|
var getTokenRelative = stepTokenUpOrDown;
|
|
|
|
// node_modules/@tamagui/get-button-sized/dist/esm/index.mjs
|
|
var getButtonSized = /* @__PURE__ */ __name((val, {
|
|
tokens,
|
|
props
|
|
}) => {
|
|
if (!val || props.circular) return;
|
|
if (typeof val == "number") return {
|
|
paddingHorizontal: val * 0.25,
|
|
height: val,
|
|
borderRadius: props.circular ? 1e5 : val * 0.2
|
|
};
|
|
const xSize = getSpace(val), radiusToken = tokens.radius[val] ?? tokens.radius.$true;
|
|
return {
|
|
paddingHorizontal: xSize,
|
|
height: val,
|
|
borderRadius: props.circular ? 1e5 : radiusToken
|
|
};
|
|
}, "getButtonSized");
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/variants.mjs
|
|
var elevate = {
|
|
true: /* @__PURE__ */ __name((_, extras) => getElevation(extras.props.size, extras), "true")
|
|
};
|
|
var bordered = /* @__PURE__ */ __name((val, {
|
|
props
|
|
}) => ({
|
|
// TODO size it with size in '...size'
|
|
borderWidth: typeof val == "number" ? val : 1,
|
|
borderColor: "$borderColor",
|
|
...props.hoverTheme && {
|
|
hoverStyle: {
|
|
borderColor: "$borderColorHover"
|
|
}
|
|
},
|
|
...props.pressTheme && {
|
|
pressStyle: {
|
|
borderColor: "$borderColorPress"
|
|
}
|
|
},
|
|
...props.focusTheme && {
|
|
focusStyle: {
|
|
borderColor: "$borderColorFocus"
|
|
}
|
|
}
|
|
}), "bordered");
|
|
var padded = {
|
|
true: /* @__PURE__ */ __name((_, extras) => {
|
|
const {
|
|
tokens,
|
|
props
|
|
} = extras;
|
|
return {
|
|
padding: tokens.space[props.size] || tokens.space.$true
|
|
};
|
|
}, "true")
|
|
};
|
|
var radiused = {
|
|
true: /* @__PURE__ */ __name((_, extras) => {
|
|
const {
|
|
tokens,
|
|
props
|
|
} = extras;
|
|
return {
|
|
borderRadius: tokens.radius[props.size] || tokens.radius.$true
|
|
};
|
|
}, "true")
|
|
};
|
|
var circularStyle = {
|
|
borderRadius: 1e5,
|
|
padding: 0
|
|
};
|
|
var circular = {
|
|
true: /* @__PURE__ */ __name((_, {
|
|
props,
|
|
tokens
|
|
}) => {
|
|
if (!("size" in props)) return circularStyle;
|
|
const size4 = typeof props.size == "number" ? props.size : tokens.size[props.size];
|
|
return {
|
|
...circularStyle,
|
|
width: size4,
|
|
height: size4,
|
|
maxWidth: size4,
|
|
maxHeight: size4,
|
|
minWidth: size4,
|
|
minHeight: size4
|
|
};
|
|
}, "true")
|
|
};
|
|
var hoverTheme = {
|
|
true: {
|
|
hoverStyle: {
|
|
backgroundColor: "$backgroundHover",
|
|
borderColor: "$borderColorHover"
|
|
}
|
|
},
|
|
false: {}
|
|
};
|
|
var pressTheme = {
|
|
true: {
|
|
cursor: "pointer",
|
|
pressStyle: {
|
|
backgroundColor: "$backgroundPress",
|
|
borderColor: "$borderColorPress"
|
|
}
|
|
},
|
|
false: {}
|
|
};
|
|
var focusTheme = {
|
|
true: {
|
|
focusStyle: {
|
|
backgroundColor: "$backgroundFocus",
|
|
borderColor: "$borderColorFocus"
|
|
}
|
|
},
|
|
false: {}
|
|
};
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/SizableStack.mjs
|
|
var SizableStack = (0, import_core4.styled)(XStack, {
|
|
name: "SizableStack",
|
|
variants: {
|
|
unstyled: {
|
|
true: {
|
|
hoverTheme: false,
|
|
pressTheme: false,
|
|
focusTheme: false,
|
|
elevate: false,
|
|
bordered: false
|
|
}
|
|
},
|
|
hoverTheme,
|
|
pressTheme,
|
|
focusTheme,
|
|
circular,
|
|
elevate,
|
|
bordered,
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, extras) => getButtonSized(val, extras), "...size")
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/ThemeableStack.mjs
|
|
var import_core5 = require("@tamagui/core");
|
|
var chromelessStyle = {
|
|
backgroundColor: "transparent",
|
|
borderColor: "transparent",
|
|
shadowColor: "transparent",
|
|
hoverStyle: {
|
|
borderColor: "transparent"
|
|
}
|
|
};
|
|
var themeableVariants = {
|
|
backgrounded: {
|
|
true: {
|
|
backgroundColor: "$background"
|
|
}
|
|
},
|
|
radiused,
|
|
hoverTheme,
|
|
pressTheme,
|
|
focusTheme,
|
|
circular,
|
|
padded,
|
|
elevate,
|
|
bordered,
|
|
transparent: {
|
|
true: {
|
|
backgroundColor: "transparent"
|
|
}
|
|
},
|
|
chromeless: {
|
|
true: chromelessStyle,
|
|
all: {
|
|
...chromelessStyle,
|
|
hoverStyle: chromelessStyle,
|
|
pressStyle: chromelessStyle,
|
|
focusStyle: chromelessStyle
|
|
}
|
|
}
|
|
};
|
|
var ThemeableStack = (0, import_core5.styled)(YStack, {
|
|
variants: themeableVariants
|
|
});
|
|
|
|
// node_modules/@tamagui/stacks/dist/esm/NestingContext.mjs
|
|
var import_react9 = __toESM(require("react"), 1);
|
|
var ButtonNestingContext = import_react9.default.createContext(false);
|
|
|
|
// node_modules/@tamagui/get-font-sized/dist/esm/index.mjs
|
|
var import_web3 = require("@tamagui/core");
|
|
var getFontSized = /* @__PURE__ */ __name((sizeTokenIn = "$true", {
|
|
font,
|
|
fontFamily,
|
|
props
|
|
}) => {
|
|
if (!font) return {
|
|
fontSize: sizeTokenIn
|
|
};
|
|
const sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, style = {}, fontSize = font.size[sizeToken], lineHeight = font.lineHeight?.[sizeToken], fontWeight = font.weight?.[sizeToken], letterSpacing = font.letterSpacing?.[sizeToken], textTransform = font.transform?.[sizeToken], fontStyle = props.fontStyle ?? font.style?.[sizeToken], color = props.color ?? font.color?.[sizeToken];
|
|
return fontStyle && (style.fontStyle = fontStyle), textTransform && (style.textTransform = textTransform), fontFamily && (style.fontFamily = fontFamily), fontWeight && (style.fontWeight = fontWeight), letterSpacing && (style.letterSpacing = letterSpacing), fontSize && (style.fontSize = fontSize), lineHeight && (style.lineHeight = lineHeight), color && (style.color = color), process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), isClient && console.info({
|
|
style,
|
|
props,
|
|
font
|
|
}), console.groupEnd()), style;
|
|
}, "getFontSized");
|
|
var SizableText = (0, import_web3.styled)(import_web3.Text, {
|
|
name: "SizableText",
|
|
fontFamily: "$body",
|
|
variants: {
|
|
size: {
|
|
"...fontSize": getFontSized
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
size: "$true"
|
|
}
|
|
});
|
|
var cache2 = /* @__PURE__ */ new WeakMap();
|
|
function getDefaultSizeToken(font) {
|
|
if (typeof font == "object" && cache2.has(font)) return cache2.get(font);
|
|
const sizeTokens = "$true" in font.size ? font.size : (0, import_web3.getTokens)().size, sizeDefault = sizeTokens.$true, sizeDefaultSpecific = sizeDefault ? Object.keys(sizeTokens).find((x) => x !== "$true" && sizeTokens[x].val === sizeDefault.val) : null;
|
|
return !sizeDefault || !sizeDefaultSpecific ? (process.env.NODE_ENV === "development" && console.warn(`No default size is set in your tokens for the "true" key, fonts will be inconsistent.
|
|
|
|
Fix this by having consistent tokens across fonts and sizes and setting a true key for your size tokens, or
|
|
set true keys for all your font tokens: "size", "lineHeight", "fontStyle", etc.`), Object.keys(font.size)[3]) : (cache2.set(font, sizeDefaultSpecific), sizeDefaultSpecific);
|
|
}
|
|
__name(getDefaultSizeToken, "getDefaultSizeToken");
|
|
|
|
// node_modules/@tamagui/text/dist/esm/SizableText.mjs
|
|
var import_web4 = require("@tamagui/core");
|
|
var SizableText2 = (0, import_web4.styled)(import_web4.Text, {
|
|
name: "SizableText",
|
|
fontFamily: "$body",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
color: "$color"
|
|
}
|
|
},
|
|
size: getFontSized
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
SizableText2.staticConfig.variants.fontFamily = {
|
|
"...": /* @__PURE__ */ __name((_val, extras) => {
|
|
const sizeProp = extras.props.size, fontSizeProp = extras.props.fontSize, size4 = sizeProp === "$true" && fontSizeProp ? fontSizeProp : extras.props.size || "$true";
|
|
return getFontSized(size4, extras);
|
|
}, "...")
|
|
};
|
|
|
|
// node_modules/@tamagui/text/dist/esm/Paragraph.mjs
|
|
var import_web5 = require("@tamagui/core");
|
|
var Paragraph = (0, import_web5.styled)(SizableText2, {
|
|
name: "Paragraph",
|
|
tag: "p",
|
|
userSelect: "auto",
|
|
color: "$color",
|
|
size: "$true",
|
|
whiteSpace: "normal"
|
|
});
|
|
|
|
// node_modules/@tamagui/text/dist/esm/Headings.mjs
|
|
var import_web6 = require("@tamagui/core");
|
|
var Heading = (0, import_web6.styled)(Paragraph, {
|
|
tag: "span",
|
|
name: "Heading",
|
|
accessibilityRole: "header",
|
|
fontFamily: "$heading",
|
|
size: "$8",
|
|
margin: 0
|
|
});
|
|
var H1 = (0, import_web6.styled)(Heading, {
|
|
name: "H1",
|
|
tag: "h1",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$10"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var H2 = (0, import_web6.styled)(Heading, {
|
|
name: "H2",
|
|
tag: "h2",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$9"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var H3 = (0, import_web6.styled)(Heading, {
|
|
name: "H3",
|
|
tag: "h3",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$8"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var H4 = (0, import_web6.styled)(Heading, {
|
|
name: "H4",
|
|
tag: "h4",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$7"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var H5 = (0, import_web6.styled)(Heading, {
|
|
name: "H5",
|
|
tag: "h5",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$6"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var H6 = (0, import_web6.styled)(Heading, {
|
|
name: "H6",
|
|
tag: "h6",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$5"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/text/dist/esm/wrapChildrenInText.mjs
|
|
var import_react10 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
function wrapChildrenInText(TextComponent, propsIn, extraProps) {
|
|
const {
|
|
children,
|
|
textProps,
|
|
size: size4,
|
|
noTextWrap,
|
|
color,
|
|
fontFamily,
|
|
fontSize,
|
|
fontWeight,
|
|
letterSpacing,
|
|
textAlign,
|
|
fontStyle,
|
|
maxFontSizeMultiplier
|
|
} = propsIn;
|
|
if (noTextWrap || !children) return [children];
|
|
const props = {
|
|
...extraProps
|
|
};
|
|
return color && (props.color = color), fontFamily && (props.fontFamily = fontFamily), fontSize && (props.fontSize = fontSize), fontWeight && (props.fontWeight = fontWeight), letterSpacing && (props.letterSpacing = letterSpacing), textAlign && (props.textAlign = textAlign), size4 && (props.size = size4), fontStyle && (props.fontStyle = fontStyle), maxFontSizeMultiplier && (props.maxFontSizeMultiplier = maxFontSizeMultiplier), import_react10.default.Children.toArray(children).map((child, index5) => typeof child == "string" ? (
|
|
// so "data-disable-theme" is a hack to fix themeInverse, don't ask me why
|
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TextComponent, {
|
|
...props,
|
|
...textProps,
|
|
children: child
|
|
}, index5)
|
|
) : child);
|
|
}
|
|
__name(wrapChildrenInText, "wrapChildrenInText");
|
|
|
|
// node_modules/@tamagui/use-direction/dist/esm/useDirection.mjs
|
|
var React16 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
var DirectionContext = React16.createContext(void 0);
|
|
function useDirection(localDir) {
|
|
const globalDir = React16.useContext(DirectionContext);
|
|
return localDir || globalDir || "ltr";
|
|
}
|
|
__name(useDirection, "useDirection");
|
|
|
|
// node_modules/@tamagui/accordion/dist/esm/Accordion.mjs
|
|
var React17 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
var ACCORDION_NAME = "Accordion";
|
|
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
var [Collection, useCollection] = createCollection(ACCORDION_NAME);
|
|
var ACCORDION_CONTEXT = "Accordion";
|
|
var AccordionComponent = React17.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
type,
|
|
...accordionProps
|
|
} = props, singleProps = accordionProps, multipleProps = accordionProps;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Collection.Provider, {
|
|
scope: props.__scopeAccordion || ACCORDION_CONTEXT,
|
|
children: type === "multiple" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionImplMultiple, {
|
|
...multipleProps,
|
|
ref: forwardedRef
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionImplSingle, {
|
|
...singleProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
AccordionComponent.displayName = ACCORDION_NAME;
|
|
AccordionComponent.propTypes = {
|
|
type(props) {
|
|
const value = props.value || props.defaultValue;
|
|
return props.type && !["single", "multiple"].includes(props.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : props.type === "multiple" && typeof value == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : props.type === "single" && Array.isArray(value) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null;
|
|
}
|
|
};
|
|
var {
|
|
Provider: AccordionValueProvider,
|
|
useStyledContext: useAccordionValueContext
|
|
} = (0, import_core6.createStyledContext)();
|
|
var {
|
|
Provider: AccordionCollapsibleProvider,
|
|
useStyledContext: useAccordionCollapsibleContext
|
|
} = (0, import_core6.createStyledContext)();
|
|
var AccordionImplSingle = React17.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
value: valueProp,
|
|
defaultValue: defaultValue2,
|
|
control,
|
|
onValueChange = /* @__PURE__ */ __name(() => {
|
|
}, "onValueChange"),
|
|
collapsible = false,
|
|
...accordionSingleProps
|
|
} = props, [value, setValue] = useControllableState({
|
|
prop: valueProp,
|
|
defaultProp: defaultValue2 || "",
|
|
onChange: onValueChange
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionValueProvider, {
|
|
scope: props.__scopeAccordion,
|
|
value: value ? [value] : [],
|
|
onItemOpen: setValue,
|
|
onItemClose: React17.useCallback(() => collapsible && setValue(""), [setValue, collapsible]),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionCollapsibleProvider, {
|
|
scope: props.__scopeAccordion,
|
|
collapsible,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionImpl, {
|
|
...accordionSingleProps,
|
|
ref: forwardedRef
|
|
})
|
|
})
|
|
});
|
|
});
|
|
var AccordionImplMultiple = React17.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
value: valueProp,
|
|
defaultValue: defaultValue2,
|
|
onValueChange = /* @__PURE__ */ __name(() => {
|
|
}, "onValueChange"),
|
|
...accordionMultipleProps
|
|
} = props, [value, setValue] = useControllableState({
|
|
prop: valueProp,
|
|
defaultProp: defaultValue2 || [],
|
|
onChange: onValueChange
|
|
}), handleItemOpen = React17.useCallback((itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]), [setValue]), handleItemClose = React17.useCallback((itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)), [setValue]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionValueProvider, {
|
|
scope: props.__scopeAccordion,
|
|
value: value || [],
|
|
onItemOpen: handleItemOpen,
|
|
onItemClose: handleItemClose,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionCollapsibleProvider, {
|
|
scope: props.__scopeAccordion,
|
|
collapsible: true,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionImpl, {
|
|
...accordionMultipleProps,
|
|
ref: forwardedRef
|
|
})
|
|
})
|
|
});
|
|
});
|
|
var {
|
|
Provider: AccordionImplProvider,
|
|
useStyledContext: useAccordionContext
|
|
} = (0, import_core6.createStyledContext)();
|
|
var AccordionImpl = React17.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeAccordion,
|
|
disabled,
|
|
dir,
|
|
orientation = "vertical",
|
|
...accordionProps
|
|
} = props, accordionRef = React17.useRef(null), composedRef = useComposedRefs(accordionRef, forwardedRef), getItems = useCollection(__scopeAccordion || ACCORDION_CONTEXT), isDirectionLTR = useDirection(dir) === "ltr", handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {
|
|
if (!ACCORDION_KEYS.includes(event.key)) return;
|
|
const target = event.target, triggerCollection = getItems().filter((item) => !item.ref.current?.disabled), triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target), triggerCount = triggerCollection.length;
|
|
if (triggerIndex === -1) return;
|
|
event.preventDefault();
|
|
let nextIndex = triggerIndex;
|
|
const homeIndex = 0, endIndex = triggerCount - 1, moveNext = /* @__PURE__ */ __name(() => {
|
|
nextIndex = triggerIndex + 1, nextIndex > endIndex && (nextIndex = homeIndex);
|
|
}, "moveNext"), movePrev = /* @__PURE__ */ __name(() => {
|
|
nextIndex = triggerIndex - 1, nextIndex < homeIndex && (nextIndex = endIndex);
|
|
}, "movePrev");
|
|
switch (event.key) {
|
|
case "Home":
|
|
nextIndex = homeIndex;
|
|
break;
|
|
case "End":
|
|
nextIndex = endIndex;
|
|
break;
|
|
case "ArrowRight":
|
|
orientation === "horizontal" && (isDirectionLTR ? moveNext() : movePrev());
|
|
break;
|
|
case "ArrowDown":
|
|
orientation === "vertical" && moveNext();
|
|
break;
|
|
case "ArrowLeft":
|
|
orientation === "horizontal" && (isDirectionLTR ? movePrev() : moveNext());
|
|
break;
|
|
case "ArrowUp":
|
|
orientation === "vertical" && movePrev();
|
|
break;
|
|
}
|
|
const clampedIndex = nextIndex % triggerCount;
|
|
triggerCollection[clampedIndex].ref.current?.focus();
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionImplProvider, {
|
|
scope: __scopeAccordion,
|
|
disabled,
|
|
direction: dir,
|
|
orientation,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Collection.Slot, {
|
|
scope: __scopeAccordion || ACCORDION_CONTEXT,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(YStack, {
|
|
"data-orientation": orientation,
|
|
ref: composedRef,
|
|
...accordionProps,
|
|
...isWeb && {
|
|
onKeyDown: handleKeyDown
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
var ITEM_NAME = "AccordionItem";
|
|
var {
|
|
Provider: AccordionItemProvider,
|
|
useStyledContext: useAccordionItemContext
|
|
} = (0, import_core6.createStyledContext)();
|
|
var AccordionItem = React17.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeAccordion,
|
|
value,
|
|
...accordionItemProps
|
|
} = props, accordionContext = useAccordionContext(__scopeAccordion), valueContext = useAccordionValueContext(__scopeAccordion), triggerId = React17.useId(), open = value && valueContext.value.includes(value) || false, disabled = accordionContext.disabled || props.disabled;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionItemProvider, {
|
|
scope: __scopeAccordion,
|
|
open,
|
|
disabled,
|
|
triggerId,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Collapsible, {
|
|
"data-orientation": accordionContext.orientation,
|
|
"data-state": open ? "open" : "closed",
|
|
__scopeCollapsible: __scopeAccordion || ACCORDION_CONTEXT,
|
|
...accordionItemProps,
|
|
ref: forwardedRef,
|
|
disabled,
|
|
open,
|
|
onOpenChange: /* @__PURE__ */ __name((open2) => {
|
|
open2 ? valueContext.onItemOpen(value) : valueContext.onItemClose(value);
|
|
}, "onOpenChange")
|
|
})
|
|
});
|
|
});
|
|
AccordionItem.displayName = ITEM_NAME;
|
|
var HEADER_NAME = "AccordionHeader";
|
|
var AccordionHeader = React17.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeAccordion,
|
|
...headerProps
|
|
} = props, accordionContext = useAccordionContext(__scopeAccordion), itemContext = useAccordionItemContext(__scopeAccordion);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(H1, {
|
|
"data-orientation": accordionContext.orientation,
|
|
"data-state": getState2(itemContext.open),
|
|
"data-disabled": itemContext.disabled ? "" : void 0,
|
|
...headerProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
AccordionHeader.displayName = HEADER_NAME;
|
|
var AccordionTriggerFrame = (0, import_core6.styled)(Collapsible.Trigger, {
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
cursor: "pointer",
|
|
backgroundColor: "$background",
|
|
borderColor: "$borderColor",
|
|
borderWidth: 1,
|
|
padding: "$true",
|
|
hoverStyle: {
|
|
backgroundColor: "$backgroundHover"
|
|
},
|
|
focusStyle: {
|
|
backgroundColor: "$backgroundFocus"
|
|
},
|
|
pressStyle: {
|
|
backgroundColor: "$backgroundPress"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var AccordionTrigger = AccordionTriggerFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
__scopeAccordion,
|
|
...triggerProps
|
|
} = props, accordionContext = useAccordionContext(__scopeAccordion), itemContext = useAccordionItemContext(__scopeAccordion), collapsibleContext = useAccordionCollapsibleContext(__scopeAccordion);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Collection.ItemSlot, {
|
|
scope: __scopeAccordion || ACCORDION_CONTEXT,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionTriggerFrame, {
|
|
__scopeCollapsible: __scopeAccordion || ACCORDION_CONTEXT,
|
|
"aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
|
|
"data-orientation": accordionContext.orientation,
|
|
id: itemContext.triggerId,
|
|
...triggerProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
var AccordionContentFrame = (0, import_core6.styled)(Collapsible.Content, {
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
padding: "$true",
|
|
backgroundColor: "$background"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var AccordionContent = AccordionContentFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
__scopeAccordion,
|
|
...contentProps
|
|
} = props, accordionContext = useAccordionContext(__scopeAccordion), itemContext = useAccordionItemContext(__scopeAccordion);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AccordionContentFrame, {
|
|
role: "region",
|
|
"aria-labelledby": itemContext.triggerId,
|
|
"data-orientation": accordionContext.orientation,
|
|
__scopeCollapsible: __scopeAccordion || ACCORDION_CONTEXT,
|
|
...contentProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var HeightAnimator = import_core6.View.styleable((props, ref) => {
|
|
const itemContext = useAccordionItemContext(), {
|
|
children,
|
|
...rest
|
|
} = props, [height, setHeight] = React17.useState(0);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core6.View, {
|
|
ref,
|
|
height: itemContext.open ? height : 0,
|
|
...rest,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core6.View, {
|
|
position: "absolute",
|
|
width: "100%",
|
|
onLayout: /* @__PURE__ */ __name(({
|
|
nativeEvent
|
|
}) => {
|
|
nativeEvent.layout.height && setHeight(nativeEvent.layout.height);
|
|
}, "onLayout"),
|
|
children
|
|
})
|
|
});
|
|
});
|
|
function getState2(open) {
|
|
return open ? "open" : "closed";
|
|
}
|
|
__name(getState2, "getState");
|
|
var Accordion = withStaticProperties(AccordionComponent, {
|
|
Trigger: AccordionTrigger,
|
|
Header: AccordionHeader,
|
|
Content: AccordionContent,
|
|
Item: AccordionItem,
|
|
HeightAnimator
|
|
});
|
|
|
|
// node_modules/@tamagui/adapt/dist/esm/Adapt.mjs
|
|
var import_core7 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/polyfill-dev/index.js
|
|
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
globalThis["__DEV__"] = process.env.NODE_ENV === "development";
|
|
}
|
|
|
|
// node_modules/@tamagui/z-index-stack/dist/esm/useStackedZIndex.mjs
|
|
var import_react12 = require("react");
|
|
|
|
// node_modules/@tamagui/z-index-stack/dist/esm/context.mjs
|
|
var import_react11 = require("react");
|
|
var ZIndexStackContext = (0, import_react11.createContext)(1);
|
|
var ZIndexHardcodedContext = (0, import_react11.createContext)(void 0);
|
|
|
|
// node_modules/@tamagui/z-index-stack/dist/esm/useStackedZIndex.mjs
|
|
var ZIndicesByContext = {};
|
|
var CurrentPortalZIndices = {};
|
|
var useStackedZIndex = /* @__PURE__ */ __name((props) => {
|
|
if (process.env.TAMAGUI_STACK_Z_INDEX_GLOBAL) {
|
|
const {
|
|
stackZIndex,
|
|
zIndex: zIndexProp
|
|
} = props, id = (0, import_react12.useId)(), zIndex = (0, import_react12.useMemo)(() => {
|
|
if (stackZIndex && stackZIndex !== "global" && zIndexProp === void 0) {
|
|
const highest = Object.values(CurrentPortalZIndices).reduce((acc, cur) => Math.max(acc, cur), 0);
|
|
return Math.max(stackZIndex === true ? 1 : stackZIndex, highest + 1);
|
|
}
|
|
return zIndexProp ?? 1e3;
|
|
}, [stackZIndex]);
|
|
return (0, import_react12.useEffect)(() => {
|
|
if (typeof stackZIndex == "number") return CurrentPortalZIndices[id] = stackZIndex, () => {
|
|
delete CurrentPortalZIndices[id];
|
|
};
|
|
}, [stackZIndex]), zIndex;
|
|
} else {
|
|
const {
|
|
stackZIndex,
|
|
zIndex: zIndexProp
|
|
} = props, id = (0, import_react12.useId)(), stackingContextLevel = (0, import_react12.useContext)(ZIndexStackContext), stackLayer = stackZIndex === "global" ? 0 : stackingContextLevel, hardcoded = (0, import_react12.useContext)(ZIndexHardcodedContext);
|
|
ZIndicesByContext[stackLayer] ||= {};
|
|
const stackContext = ZIndicesByContext[stackLayer], zIndex = (0, import_react12.useMemo)(() => {
|
|
if (typeof zIndexProp == "number") return zIndexProp;
|
|
if (stackZIndex) {
|
|
if (hardcoded) return hardcoded + 1;
|
|
const highest = Object.values(stackContext).reduce((acc, cur) => Math.max(acc, cur), 0), found = stackLayer * 5e3 + highest + 1;
|
|
return typeof stackZIndex == "number" ? stackZIndex + found : found;
|
|
}
|
|
return 1;
|
|
}, [stackLayer, zIndexProp, stackZIndex]);
|
|
return (0, import_react12.useEffect)(() => {
|
|
if (stackZIndex) return stackContext[id] = zIndex, () => {
|
|
delete stackContext[id];
|
|
};
|
|
}, [zIndex]), zIndex;
|
|
}
|
|
}, "useStackedZIndex");
|
|
|
|
// node_modules/@tamagui/z-index-stack/dist/esm/StackZIndex.mjs
|
|
var import_react13 = require("react");
|
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
var StackZIndexContext = /* @__PURE__ */ __name(({
|
|
children,
|
|
zIndex
|
|
}) => {
|
|
const existing = (0, import_react13.useContext)(ZIndexStackContext);
|
|
let content = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ZIndexStackContext.Provider, {
|
|
value: existing + 1,
|
|
children
|
|
});
|
|
return typeof zIndex < "u" && (content = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ZIndexHardcodedContext.Provider, {
|
|
value: zIndex,
|
|
children: content
|
|
})), content;
|
|
}, "StackZIndexContext");
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/Portal.mjs
|
|
var React18 = __toESM(require("react"), 1);
|
|
var import_react_dom = require("react-dom");
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/helpers.mjs
|
|
var import_web7 = require("@tamagui/core");
|
|
var getStackedZIndexProps = /* @__PURE__ */ __name((propsIn) => ({
|
|
stackZIndex: propsIn.stackZIndex,
|
|
zIndex: resolveViewZIndex(propsIn.zIndex)
|
|
}), "getStackedZIndexProps");
|
|
var resolveViewZIndex = /* @__PURE__ */ __name((zIndex) => typeof zIndex > "u" || zIndex === "unset" ? void 0 : typeof zIndex == "number" ? zIndex : (0, import_web7.getTokenValue)(zIndex, "zIndex"), "resolveViewZIndex");
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/Portal.mjs
|
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
var Portal = React18.memo((propsIn) => {
|
|
if (isServer) return null;
|
|
const body = globalThis.document?.body;
|
|
if (!body) return propsIn.children;
|
|
const {
|
|
children,
|
|
passThrough
|
|
} = propsIn, zIndex = useStackedZIndex(getStackedZIndexProps(propsIn));
|
|
return passThrough ? children : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", {
|
|
style: {
|
|
zIndex,
|
|
position: "fixed",
|
|
inset: 0,
|
|
contain: "strict",
|
|
pointerEvents: "none"
|
|
},
|
|
children
|
|
}), body);
|
|
});
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/GorhomPortal.mjs
|
|
var import_react14 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/constants.mjs
|
|
var IS_FABRIC = typeof global < "u" && !!(global._IS_FABRIC ?? global.nativeFabricUIManager);
|
|
var USE_NATIVE_PORTAL = process.env.TAMAGUI_USE_NATIVE_PORTAL && process.env.TAMAGUI_USE_NATIVE_PORTAL !== "false" ? true : !isAndroid && !IS_FABRIC;
|
|
var allPortalHosts = /* @__PURE__ */ new Map();
|
|
var portalListeners = {};
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/GorhomPortal.mjs
|
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
var ACTIONS = /* @__PURE__ */ ((ACTIONS2) => (ACTIONS2[ACTIONS2.REGISTER_HOST = 0] = "REGISTER_HOST", ACTIONS2[ACTIONS2.DEREGISTER_HOST = 1] = "DEREGISTER_HOST", ACTIONS2[ACTIONS2.ADD_UPDATE_PORTAL = 2] = "ADD_UPDATE_PORTAL", ACTIONS2[ACTIONS2.REMOVE_PORTAL = 3] = "REMOVE_PORTAL", ACTIONS2))(ACTIONS || {});
|
|
var INITIAL_STATE = {};
|
|
var registerHost = /* @__PURE__ */ __name((state, hostName) => (hostName in state || (state[hostName] = []), state), "registerHost");
|
|
var deregisterHost = /* @__PURE__ */ __name((state, hostName) => (delete state[hostName], state), "deregisterHost");
|
|
var addUpdatePortal = /* @__PURE__ */ __name((state, hostName, portalName, node) => {
|
|
hostName in state || (state = registerHost(state, hostName));
|
|
const index5 = state[hostName].findIndex((item) => item.name === portalName);
|
|
return index5 !== -1 ? state[hostName][index5].node = node : state[hostName].push({
|
|
name: portalName,
|
|
node
|
|
}), state;
|
|
}, "addUpdatePortal");
|
|
var removePortal = /* @__PURE__ */ __name((state, hostName, portalName) => {
|
|
if (!(hostName in state)) return console.info(`Failed to remove portal '${portalName}', '${hostName}' was not registered!`), state;
|
|
const index5 = state[hostName].findIndex((item) => item.name === portalName);
|
|
return index5 !== -1 && state[hostName].splice(index5, 1), state;
|
|
}, "removePortal");
|
|
var reducer = /* @__PURE__ */ __name((state, action) => {
|
|
const {
|
|
type
|
|
} = action;
|
|
switch (type) {
|
|
case 0:
|
|
return registerHost({
|
|
...state
|
|
}, action.hostName);
|
|
case 1:
|
|
return deregisterHost({
|
|
...state
|
|
}, action.hostName);
|
|
case 2:
|
|
return addUpdatePortal({
|
|
...state
|
|
}, action.hostName, action.portalName, action.node);
|
|
case 3:
|
|
return removePortal({
|
|
...state
|
|
}, action.hostName, action.portalName);
|
|
default:
|
|
return state;
|
|
}
|
|
}, "reducer");
|
|
var PortalStateContext = (0, import_react14.createContext)(null);
|
|
var PortalDispatchContext = (0, import_react14.createContext)(null);
|
|
var usePortalState = /* @__PURE__ */ __name((hostName) => {
|
|
const state = (0, import_react14.useContext)(PortalStateContext);
|
|
if (state === null) throw new Error("'PortalStateContext' cannot be null, please add 'PortalProvider' to the root component.");
|
|
return state[hostName] || [];
|
|
}, "usePortalState");
|
|
var usePortal = /* @__PURE__ */ __name((hostName = "root") => {
|
|
const dispatch = (0, import_react14.useContext)(PortalDispatchContext);
|
|
if (dispatch === null) throw new Error("'PortalDispatchContext' cannot be null, please add 'PortalProvider' to the root component.");
|
|
const registerHost2 = (0, import_react14.useCallback)(() => {
|
|
dispatch({
|
|
type: 0,
|
|
hostName
|
|
});
|
|
}, []), deregisterHost2 = (0, import_react14.useCallback)(() => {
|
|
dispatch({
|
|
type: 1,
|
|
hostName
|
|
});
|
|
}, []), addUpdatePortal2 = (0, import_react14.useCallback)((name, node) => {
|
|
dispatch({
|
|
type: 2,
|
|
hostName,
|
|
portalName: name,
|
|
node
|
|
});
|
|
}, []), removePortal2 = (0, import_react14.useCallback)((name) => {
|
|
dispatch({
|
|
type: 3,
|
|
hostName,
|
|
portalName: name
|
|
});
|
|
}, []);
|
|
return {
|
|
registerHost: registerHost2,
|
|
deregisterHost: deregisterHost2,
|
|
addPortal: addUpdatePortal2,
|
|
updatePortal: addUpdatePortal2,
|
|
removePortal: removePortal2
|
|
};
|
|
}, "usePortal");
|
|
var PortalProviderComponent = /* @__PURE__ */ __name(({
|
|
rootHostName = "root",
|
|
shouldAddRootHost = true,
|
|
children
|
|
}) => {
|
|
const [state, dispatch] = (0, import_react14.useReducer)(reducer, INITIAL_STATE), transitionDispatch = (0, import_react14.useMemo)(() => (value) => {
|
|
startTransition(() => {
|
|
dispatch(value);
|
|
});
|
|
}, [dispatch]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PortalDispatchContext.Provider, {
|
|
value: transitionDispatch,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(PortalStateContext.Provider, {
|
|
value: state,
|
|
children: [children, shouldAddRootHost && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PortalHost, {
|
|
name: rootHostName
|
|
})]
|
|
})
|
|
});
|
|
}, "PortalProviderComponent");
|
|
var PortalProvider = (0, import_react14.memo)(PortalProviderComponent);
|
|
PortalProvider.displayName = "PortalProvider";
|
|
var defaultRenderer = /* @__PURE__ */ __name((children) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, {
|
|
children
|
|
}), "defaultRenderer");
|
|
var PortalHost = (0, import_react14.memo)(function(props) {
|
|
return isWeb ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PortalHostWeb, {
|
|
...props
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PortalHostNonNative, {
|
|
...props
|
|
});
|
|
});
|
|
function PortalHostWeb(props) {
|
|
return useIsomorphicLayoutEffect(() => () => {
|
|
allPortalHosts.delete(props.name);
|
|
}, [props.name]), /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {
|
|
style: {
|
|
display: "contents"
|
|
},
|
|
ref: /* @__PURE__ */ __name((node) => {
|
|
node && (allPortalHosts.set(props.name, node), portalListeners[props.name]?.forEach((x) => x(node)));
|
|
}, "ref")
|
|
});
|
|
}
|
|
__name(PortalHostWeb, "PortalHostWeb");
|
|
function PortalHostNonNative(props) {
|
|
const {
|
|
name,
|
|
forwardProps,
|
|
render = defaultRenderer
|
|
} = props, state = usePortalState(name), {
|
|
registerHost: registerHost2,
|
|
deregisterHost: deregisterHost2
|
|
} = usePortal(props.name);
|
|
return useIsomorphicLayoutEffect(() => {
|
|
if (!(typeof window > "u")) return registerHost2(), () => {
|
|
deregisterHost2();
|
|
};
|
|
}, []), render(forwardProps ? state.map((item) => {
|
|
let next = item.node;
|
|
const {
|
|
children,
|
|
...restForwardProps
|
|
} = forwardProps;
|
|
return forwardProps ? import_react14.default.Children.map(next, (child) => import_react14.default.isValidElement(child) ? import_react14.default.cloneElement(child, {
|
|
key: child.key,
|
|
...restForwardProps
|
|
}) : child) : next;
|
|
}) : state.map((item) => item.node));
|
|
}
|
|
__name(PortalHostNonNative, "PortalHostNonNative");
|
|
|
|
// node_modules/@tamagui/portal/dist/esm/GorhomPortalItem.mjs
|
|
var import_react15 = require("react");
|
|
var import_react_dom2 = require("react-dom");
|
|
var GorhomPortalItem = /* @__PURE__ */ __name((props) => {
|
|
!props.hostName && !props.passThrough && console.warn("No hostName");
|
|
const cur = allPortalHosts.get(props.hostName || ""), [node, setNode] = (0, import_react15.useState)(cur);
|
|
if (useIsomorphicLayoutEffect(() => {
|
|
if (!props.hostName) return;
|
|
const listener = /* @__PURE__ */ __name((newNode) => {
|
|
setNode(newNode);
|
|
}, "listener");
|
|
return portalListeners[props.hostName] ||= /* @__PURE__ */ new Set(), portalListeners[props.hostName].add(listener), () => {
|
|
portalListeners[props.hostName]?.delete(listener);
|
|
};
|
|
}, [props.hostName]), useIsomorphicLayoutEffect(() => {
|
|
cur && cur !== node && setNode(cur);
|
|
}, [cur, node]), props.passThrough) return props.children;
|
|
const actualNode = node?.isConnected ? node : null;
|
|
return actualNode ? (0, import_react_dom2.createPortal)(props.children, actualNode) : null;
|
|
}, "GorhomPortalItem");
|
|
|
|
// node_modules/@tamagui/adapt/dist/esm/Adapt.mjs
|
|
var import_react16 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
var AdaptContext = (0, import_core7.createStyledContext)({
|
|
Contents: null,
|
|
scopeName: "",
|
|
portalName: "",
|
|
platform: null,
|
|
setPlatform: /* @__PURE__ */ __name((x) => {
|
|
}, "setPlatform"),
|
|
when: null,
|
|
setChildren: null,
|
|
setWhen: /* @__PURE__ */ __name(() => {
|
|
}, "setWhen")
|
|
});
|
|
var LastAdaptContextScope = (0, import_react16.createContext)("");
|
|
var ProvideAdaptContext = /* @__PURE__ */ __name(({
|
|
children,
|
|
...context2
|
|
}) => {
|
|
const scope = context2.scopeName || "", lastScope = (0, import_react16.useContext)(LastAdaptContextScope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LastAdaptContextScope.Provider, {
|
|
value: lastScope || context2.lastScope || "",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AdaptContext.Provider, {
|
|
scope,
|
|
lastScope: lastScope || context2.lastScope,
|
|
...context2,
|
|
children
|
|
})
|
|
});
|
|
}, "ProvideAdaptContext");
|
|
var useAdaptContext = /* @__PURE__ */ __name((scope) => {
|
|
const lastScope = (0, import_react16.useContext)(LastAdaptContextScope), adaptScope = scope ?? lastScope;
|
|
return AdaptContext.useStyledContext(adaptScope);
|
|
}, "useAdaptContext");
|
|
var AdaptPortals = /* @__PURE__ */ new Map();
|
|
var AdaptParent = /* @__PURE__ */ __name(({
|
|
children,
|
|
Contents,
|
|
scope,
|
|
portal
|
|
}) => {
|
|
const id = (0, import_react16.useId)(), portalName = `AdaptPortal${scope}${id}`, FinalContents = (0, import_react16.useMemo)(() => {
|
|
if (Contents) return Contents;
|
|
if (AdaptPortals.has(portalName)) return AdaptPortals.get(portalName);
|
|
const element = /* @__PURE__ */ __name(() => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PortalHost, {
|
|
name: portalName,
|
|
forwardProps: typeof portal == "boolean" ? void 0 : portal?.forwardProps
|
|
}, id), "element");
|
|
return AdaptPortals.set(portalName, element), element;
|
|
}, [portalName, Contents]);
|
|
useIsomorphicLayoutEffect(() => (AdaptPortals.set(portalName, FinalContents), () => {
|
|
AdaptPortals.delete(portalName);
|
|
}), [portalName]);
|
|
const [when, setWhen] = import_react16.default.useState(null), [platform2, setPlatform] = import_react16.default.useState(null), [children2, setChildren] = import_react16.default.useState(null);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LastAdaptContextScope.Provider, {
|
|
value: scope,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProvideAdaptContext, {
|
|
Contents: FinalContents,
|
|
when,
|
|
platform: platform2,
|
|
setPlatform,
|
|
setWhen,
|
|
setChildren,
|
|
portalName,
|
|
scopeName: scope,
|
|
children
|
|
})
|
|
});
|
|
}, "AdaptParent");
|
|
var AdaptContents = /* @__PURE__ */ __name(({
|
|
scope,
|
|
...rest
|
|
}) => {
|
|
const context2 = useAdaptContext(scope);
|
|
if (!context2?.Contents) throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
|
|
return import_react16.default.createElement(context2.Contents, {
|
|
...rest,
|
|
key: "stable"
|
|
});
|
|
}, "AdaptContents");
|
|
AdaptContents.shouldForwardSpace = true;
|
|
var Adapt = withStaticProperties(function(props) {
|
|
const {
|
|
platform: platform2,
|
|
when,
|
|
children,
|
|
scope
|
|
} = props, context2 = useAdaptContext(scope), enabled = useAdaptIsActiveGiven(props);
|
|
useIsomorphicLayoutEffect(() => {
|
|
context2?.setWhen?.(when || enabled), context2?.setPlatform?.(platform2 || null);
|
|
}, [when, platform2, enabled, context2.setWhen, context2.setPlatform]), useIsomorphicLayoutEffect(() => () => {
|
|
context2?.setWhen?.(null), context2?.setPlatform?.(null);
|
|
}, []);
|
|
let output;
|
|
if (typeof children == "function") {
|
|
const Component = context2?.Contents;
|
|
output = children(Component ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Component, {}) : null);
|
|
} else output = children;
|
|
return useIsomorphicLayoutEffect(() => {
|
|
typeof children == "function" && output !== void 0 && context2?.setChildren(output);
|
|
}, [output]), /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StackZIndexContext, {
|
|
children: enabled ? output : null
|
|
});
|
|
}, {
|
|
Contents: AdaptContents
|
|
});
|
|
var AdaptPortalContents = /* @__PURE__ */ __name((props) => {
|
|
const isActive = useAdaptIsActive(props.scope), {
|
|
portalName
|
|
} = useAdaptContext(props.scope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GorhomPortalItem, {
|
|
passThrough: !isActive,
|
|
hostName: portalName,
|
|
children: props.children
|
|
});
|
|
}, "AdaptPortalContents");
|
|
var useAdaptIsActiveGiven = /* @__PURE__ */ __name(({
|
|
when,
|
|
platform: platform2
|
|
}) => {
|
|
const media = (0, import_core7.useMedia)();
|
|
if (when == null && platform2 == null) return false;
|
|
if (when === true) return true;
|
|
let enabled = false;
|
|
return platform2 === "touch" ? enabled = isTouchable : platform2 === "native" ? enabled = !isWeb : platform2 === "web" ? enabled = isWeb : platform2 === "ios" ? enabled = isIos : platform2 === "android" && (enabled = isAndroid), platform2 && enabled == false ? false : (when && typeof when == "string" && (enabled = media[when]), enabled);
|
|
}, "useAdaptIsActiveGiven");
|
|
var useAdaptIsActive = /* @__PURE__ */ __name((scope) => {
|
|
const props = useAdaptContext(scope);
|
|
return useAdaptIsActiveGiven(props);
|
|
}, "useAdaptIsActive");
|
|
|
|
// node_modules/@tamagui/alert-dialog/dist/esm/AlertDialog.mjs
|
|
var import_core15 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/dialog/dist/esm/Dialog.mjs
|
|
var import_core14 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/create-context/dist/esm/create-context.mjs
|
|
var React21 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
function createContext7(rootComponentName, defaultContext) {
|
|
const Context = React21.createContext(defaultContext);
|
|
function Provider(props) {
|
|
const {
|
|
children,
|
|
...context2
|
|
} = props, value = React21.useMemo(() => context2, Object.values(context2));
|
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Context.Provider, {
|
|
value,
|
|
children
|
|
});
|
|
}
|
|
__name(Provider, "Provider");
|
|
function useContext22(consumerName) {
|
|
const context2 = React21.useContext(Context);
|
|
if (context2) return context2;
|
|
if (defaultContext !== void 0) return defaultContext;
|
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
}
|
|
__name(useContext22, "useContext");
|
|
return [Provider, useContext22];
|
|
}
|
|
__name(createContext7, "createContext");
|
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
let defaultContexts = [];
|
|
function createContext22(rootComponentName, defaultContext) {
|
|
const BaseContext = React21.createContext(defaultContext), index5 = defaultContexts.length;
|
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
function Provider(props) {
|
|
const {
|
|
scope,
|
|
children,
|
|
...context2
|
|
} = props, Context = scope?.[scopeName]?.[index5] || BaseContext, value = React21.useMemo(() => context2, Object.values(context2));
|
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Context.Provider, {
|
|
value,
|
|
children
|
|
});
|
|
}
|
|
__name(Provider, "Provider");
|
|
function useContext22(consumerName, scope, options) {
|
|
const Context = scope?.[scopeName]?.[index5] || BaseContext, context2 = React21.useContext(Context);
|
|
if (context2) return context2;
|
|
if (defaultContext !== void 0) return defaultContext;
|
|
const missingContextMessage = `\`${consumerName}\` must be used within \`${rootComponentName}\``;
|
|
if (options?.fallback) return options?.warn !== false && console.warn(missingContextMessage), options.fallback;
|
|
throw new Error(missingContextMessage);
|
|
}
|
|
__name(useContext22, "useContext");
|
|
return [Provider, useContext22];
|
|
}
|
|
__name(createContext22, "createContext2");
|
|
const createScope = /* @__PURE__ */ __name(() => {
|
|
const scopeContexts = defaultContexts.map((defaultContext) => React21.createContext(defaultContext));
|
|
return function(scope) {
|
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
return React21.useMemo(() => ({
|
|
[`__scope${scopeName}`]: {
|
|
...scope,
|
|
[scopeName]: contexts
|
|
}
|
|
}), [scope, contexts]);
|
|
};
|
|
}, "createScope");
|
|
return createScope.scopeName = scopeName, [createContext22, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
}
|
|
__name(createContextScope, "createContextScope");
|
|
function composeContextScopes(...scopes) {
|
|
const baseScope = scopes[0];
|
|
if (scopes.length === 1) return baseScope;
|
|
const createScope = /* @__PURE__ */ __name(() => {
|
|
const scopeHooks = scopes.map((createScope2) => ({
|
|
useScope: createScope2(),
|
|
scopeName: createScope2.scopeName
|
|
}));
|
|
return function(overrideScopes) {
|
|
const nextScopes = scopeHooks.reduce((nextScopes2, {
|
|
useScope,
|
|
scopeName
|
|
}) => {
|
|
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
return {
|
|
...nextScopes2,
|
|
...currentScope
|
|
};
|
|
}, {});
|
|
return React21.useMemo(() => ({
|
|
[`__scope${baseScope.scopeName}`]: nextScopes
|
|
}), [nextScopes]);
|
|
};
|
|
}, "createScope");
|
|
return createScope.scopeName = baseScope.scopeName, createScope;
|
|
}
|
|
__name(composeContextScopes, "composeContextScopes");
|
|
|
|
// node_modules/@tamagui/use-callback-ref/dist/esm/index.mjs
|
|
var React22 = __toESM(require("react"), 1);
|
|
function useCallbackRef(callback) {
|
|
const callbackRef = React22.useRef(callback);
|
|
return React22.useEffect(() => {
|
|
callbackRef.current = callback;
|
|
}), React22.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
}
|
|
__name(useCallbackRef, "useCallbackRef");
|
|
|
|
// node_modules/@tamagui/use-escape-keydown/dist/esm/index.mjs
|
|
var import_react17 = __toESM(require("react"), 1);
|
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
import_react17.default.useEffect(() => {
|
|
const handleKeyDown = /* @__PURE__ */ __name((event) => {
|
|
event.key === "Escape" && onEscapeKeyDown(event);
|
|
}, "handleKeyDown");
|
|
return ownerDocument.addEventListener("keydown", handleKeyDown), () => {
|
|
ownerDocument.removeEventListener("keydown", handleKeyDown);
|
|
};
|
|
}, [onEscapeKeyDown, ownerDocument]);
|
|
}
|
|
__name(useEscapeKeydown, "useEscapeKeydown");
|
|
|
|
// node_modules/@tamagui/dismissable/dist/esm/Dismissable.mjs
|
|
var React24 = __toESM(require("react"), 1);
|
|
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
function dispatchDiscreteCustomEvent(target, event) {
|
|
target && ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
}
|
|
__name(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
|
|
var DISMISSABLE_LAYER_NAME = "Dismissable";
|
|
var CONTEXT_UPDATE = "dismissable.update";
|
|
var POINTER_DOWN_OUTSIDE = "dismissable.pointerDownOutside";
|
|
var FOCUS_OUTSIDE = "dismissable.focusOutside";
|
|
var originalBodyPointerEvents;
|
|
var DismissableContext = React24.createContext({
|
|
layers: /* @__PURE__ */ new Set(),
|
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
branches: /* @__PURE__ */ new Set()
|
|
});
|
|
var Dismissable = React24.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
disableOutsidePointerEvents = false,
|
|
forceUnmount,
|
|
onEscapeKeyDown,
|
|
onPointerDownOutside,
|
|
onFocusOutside,
|
|
onInteractOutside,
|
|
onDismiss,
|
|
...layerProps
|
|
} = props, context2 = React24.useContext(DismissableContext), [node, setNode] = React24.useState(null), [, force] = React24.useState({}), composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2)), layers = Array.from(context2.layers), [highestLayerWithOutsidePointerEventsDisabled] = [...context2.layersWithOutsidePointerEventsDisabled].slice(-1), highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled), index5 = node ? layers.indexOf(node) : -1, isBodyPointerEventsDisabled = context2.layersWithOutsidePointerEventsDisabled.size > 0, isPointerEventsEnabled = index5 >= highestLayerWithOutsidePointerEventsDisabledIndex, pointerDownOutside = usePointerDownOutside((event) => {
|
|
const target = event.target, isPointerDownOnBranch = [...context2.branches].some((branch) => branch.contains(target));
|
|
!isPointerEventsEnabled || isPointerDownOnBranch || (onPointerDownOutside?.(event), onInteractOutside?.(event), event.defaultPrevented || onDismiss?.());
|
|
}), focusOutside = useFocusOutside((event) => {
|
|
const target = event.target;
|
|
[...context2.branches].some((branch) => branch.contains(target)) || (onFocusOutside?.(event), onInteractOutside?.(event), event.defaultPrevented || onDismiss?.());
|
|
});
|
|
return useEscapeKeydown((event) => {
|
|
index5 === context2.layers.size - 1 && (onEscapeKeyDown?.(event), !event.defaultPrevented && onDismiss && (event.preventDefault(), onDismiss()));
|
|
}), React24.useEffect(() => {
|
|
if (node) return disableOutsidePointerEvents && (context2.layersWithOutsidePointerEventsDisabled.size === 0 && (originalBodyPointerEvents = document.body.style.pointerEvents, document.body.style.pointerEvents = "none"), context2.layersWithOutsidePointerEventsDisabled.add(node)), context2.layers.add(node), dispatchUpdate(), () => {
|
|
disableOutsidePointerEvents && context2.layersWithOutsidePointerEventsDisabled.size === 1 && (document.body.style.pointerEvents = originalBodyPointerEvents);
|
|
};
|
|
}, [node, disableOutsidePointerEvents, context2]), React24.useEffect(() => {
|
|
if (!forceUnmount) return () => {
|
|
node && (context2.layers.delete(node), context2.layersWithOutsidePointerEventsDisabled.delete(node), dispatchUpdate());
|
|
};
|
|
}, [node, context2, forceUnmount]), React24.useEffect(() => {
|
|
const handleUpdate = /* @__PURE__ */ __name(() => {
|
|
force({});
|
|
}, "handleUpdate");
|
|
return document.addEventListener(CONTEXT_UPDATE, handleUpdate), () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
}, []), /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", {
|
|
...layerProps,
|
|
ref: composedRefs,
|
|
style: {
|
|
display: "contents",
|
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
// @ts-ignore
|
|
...props.style
|
|
},
|
|
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
});
|
|
});
|
|
Dismissable.displayName = DISMISSABLE_LAYER_NAME;
|
|
var BRANCH_NAME = "DismissableBranch";
|
|
var DismissableBranch = React24.forwardRef((props, forwardedRef) => {
|
|
const context2 = React24.useContext(DismissableContext), ref = React24.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref);
|
|
return React24.useEffect(() => {
|
|
const node = ref.current;
|
|
if (node) return context2.branches.add(node), () => {
|
|
context2.branches.delete(node);
|
|
};
|
|
}, [context2.branches]), /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", {
|
|
style: {
|
|
display: "contents"
|
|
},
|
|
...props,
|
|
ref: composedRefs
|
|
});
|
|
});
|
|
DismissableBranch.displayName = BRANCH_NAME;
|
|
function usePointerDownOutside(onPointerDownOutside) {
|
|
const handlePointerDownOutside = useEvent(onPointerDownOutside), isPointerInsideReactTreeRef = React24.useRef(false), handleClickRef = React24.useRef(() => {
|
|
});
|
|
return React24.useEffect(() => {
|
|
const handlePointerDown = /* @__PURE__ */ __name((event) => {
|
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
let handleAndDispatchPointerDownOutsideEvent = /* @__PURE__ */ __name(function() {
|
|
handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
discrete: true
|
|
});
|
|
}, "handleAndDispatchPointerDownOutsideEvent");
|
|
const eventDetail = {
|
|
originalEvent: event
|
|
};
|
|
event.pointerType === "touch" ? (document.removeEventListener("click", handleClickRef.current), handleClickRef.current = handleAndDispatchPointerDownOutsideEvent, document.addEventListener("click", handleClickRef.current, {
|
|
once: true
|
|
})) : handleAndDispatchPointerDownOutsideEvent();
|
|
}
|
|
isPointerInsideReactTreeRef.current = false;
|
|
}, "handlePointerDown"), timerId = setTimeout(() => {
|
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
}, 0);
|
|
return () => {
|
|
window.clearTimeout(timerId), document.removeEventListener("pointerdown", handlePointerDown), document.removeEventListener("click", handleClickRef.current);
|
|
};
|
|
}, [handlePointerDownOutside]), {
|
|
// ensures we check React component tree (not just DOM tree)
|
|
onPointerDownCapture: /* @__PURE__ */ __name(() => {
|
|
isPointerInsideReactTreeRef.current = true;
|
|
}, "onPointerDownCapture")
|
|
};
|
|
}
|
|
__name(usePointerDownOutside, "usePointerDownOutside");
|
|
function useFocusOutside(onFocusOutside) {
|
|
const handleFocusOutside = useEvent(onFocusOutside), isFocusInsideReactTreeRef = React24.useRef(false);
|
|
return React24.useEffect(() => {
|
|
const handleFocus = /* @__PURE__ */ __name((event) => {
|
|
event.target && !isFocusInsideReactTreeRef.current && handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, {
|
|
originalEvent: event
|
|
}, {
|
|
discrete: false
|
|
});
|
|
}, "handleFocus");
|
|
return document.addEventListener("focusin", handleFocus), () => document.removeEventListener("focusin", handleFocus);
|
|
}, [handleFocusOutside]), {
|
|
onFocusCapture: /* @__PURE__ */ __name(() => {
|
|
isFocusInsideReactTreeRef.current = true;
|
|
}, "onFocusCapture"),
|
|
onBlurCapture: /* @__PURE__ */ __name(() => {
|
|
isFocusInsideReactTreeRef.current = false;
|
|
}, "onBlurCapture")
|
|
};
|
|
}
|
|
__name(useFocusOutside, "useFocusOutside");
|
|
function dispatchUpdate() {
|
|
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
document.dispatchEvent(event);
|
|
}
|
|
__name(dispatchUpdate, "dispatchUpdate");
|
|
function handleAndDispatchCustomEvent(name, handler, detail, {
|
|
discrete
|
|
}) {
|
|
const target = detail.originalEvent.target, event = new CustomEvent(name, {
|
|
bubbles: false,
|
|
cancelable: true,
|
|
detail
|
|
});
|
|
handler && target.addEventListener(name, handler, {
|
|
once: true
|
|
}), discrete ? dispatchDiscreteCustomEvent(target, event) : target.dispatchEvent(event);
|
|
}
|
|
__name(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
|
|
|
|
// node_modules/@tamagui/use-async/dist/esm/useAsyncEffect.mjs
|
|
var import_react18 = require("react");
|
|
|
|
// node_modules/@tamagui/use-async/dist/esm/errors.mjs
|
|
var AbortError = class extends Error {
|
|
static {
|
|
__name(this, "AbortError");
|
|
}
|
|
constructor(message = "") {
|
|
super(message), this.name = "AbortError";
|
|
}
|
|
};
|
|
|
|
// node_modules/@tamagui/use-async/dist/esm/useAsyncEffect.mjs
|
|
var DEBUG_LEVEL = 0;
|
|
function useAsyncEffect(cb, deps = []) {
|
|
useAsyncEffectOfType(import_react18.useEffect, cb, deps);
|
|
}
|
|
__name(useAsyncEffect, "useAsyncEffect");
|
|
function useAsyncEffectOfType(type, cb, deps = []) {
|
|
type(() => {
|
|
const controller = new AbortController(), signal = controller.signal;
|
|
try {
|
|
const value = cb(signal, ...deps);
|
|
Promise.resolve(value).then(async (res) => {
|
|
if (res && typeof res == "function") {
|
|
if (signal.aborted) return res();
|
|
signal.addEventListener("abort", res);
|
|
}
|
|
}).catch(handleError);
|
|
} catch (error4) {
|
|
handleError(error4);
|
|
}
|
|
function handleError(error4) {
|
|
if (error4 instanceof AbortError) return DEBUG_LEVEL > 2 && console.info(`\u{1F41B} useAsyncEffect aborted: ${error4.message}`), null;
|
|
if (typeof error4 == "object" && error4.name === "AbortError") return null;
|
|
throw error4;
|
|
}
|
|
__name(handleError, "handleError");
|
|
return () => {
|
|
signal.aborted || controller.abort();
|
|
};
|
|
}, deps);
|
|
}
|
|
__name(useAsyncEffectOfType, "useAsyncEffectOfType");
|
|
|
|
// node_modules/@tamagui/use-async/dist/esm/sleep.mjs
|
|
var sleep = /* @__PURE__ */ __name(async (ms, signal) => {
|
|
if (await new Promise((res) => setTimeout(res, ms)), signal?.aborted) throw new AbortError();
|
|
}, "sleep");
|
|
|
|
// node_modules/@tamagui/use-async/dist/esm/idle.mjs
|
|
var idleCb = typeof requestIdleCallback > "u" ? (cb) => setTimeout(cb, 1) : requestIdleCallback;
|
|
var idleAsync = /* @__PURE__ */ __name(() => new Promise((res) => {
|
|
idleCb(res);
|
|
}), "idleAsync");
|
|
var idle = /* @__PURE__ */ __name(async (signal, options) => {
|
|
const {
|
|
max: max2,
|
|
min: min2,
|
|
fully
|
|
} = options || {}, idleFn = fully ? fullyIdle : idleAsync;
|
|
if (max2 && min2 && min2 < max2 ? await Promise.race([Promise.all([idleFn(), sleep(min2)]), sleep(max2)]) : max2 ? await Promise.race([idleFn(), sleep(max2)]) : min2 ? await Promise.all([idleFn(), sleep(min2)]) : await idleFn(), signal?.aborted) throw new AbortError();
|
|
}, "idle");
|
|
var fullyIdle = /* @__PURE__ */ __name(async (signal) => {
|
|
for (; ; ) {
|
|
const startTime = Date.now();
|
|
if (await idle(signal), Date.now() - startTime < 15) break;
|
|
if (signal?.aborted) throw new AbortError();
|
|
}
|
|
}, "fullyIdle");
|
|
|
|
// node_modules/@tamagui/focus-scope/dist/esm/FocusScope.mjs
|
|
var React26 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/focus-scope/dist/esm/FocusScopeController.mjs
|
|
var React25 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
var FOCUS_SCOPE_CONTROLLER_NAME = "FocusScopeController";
|
|
var [createFocusScopeControllerContext, createFocusScopeControllerScope] = createContextScope(FOCUS_SCOPE_CONTROLLER_NAME);
|
|
var [FocusScopeControllerProvider, useFocusScopeControllerContext] = createFocusScopeControllerContext(FOCUS_SCOPE_CONTROLLER_NAME);
|
|
function FocusScopeController(props) {
|
|
const {
|
|
__scopeFocusScope,
|
|
children,
|
|
enabled,
|
|
loop,
|
|
trapped,
|
|
onMountAutoFocus,
|
|
onUnmountAutoFocus,
|
|
forceUnmount,
|
|
focusOnIdle
|
|
} = props, stableOnMountAutoFocus = useEvent(onMountAutoFocus), stableOnUnmountAutoFocus = useEvent(onUnmountAutoFocus), contextValue = React25.useMemo(() => ({
|
|
enabled,
|
|
loop,
|
|
trapped,
|
|
onMountAutoFocus: stableOnMountAutoFocus,
|
|
onUnmountAutoFocus: stableOnUnmountAutoFocus,
|
|
forceUnmount,
|
|
focusOnIdle
|
|
}), [enabled, loop, trapped, stableOnMountAutoFocus, stableOnUnmountAutoFocus, forceUnmount, focusOnIdle]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FocusScopeControllerProvider, {
|
|
scope: __scopeFocusScope,
|
|
...contextValue,
|
|
children
|
|
});
|
|
}
|
|
__name(FocusScopeController, "FocusScopeController");
|
|
var FocusScopeControllerComponent = FocusScopeController;
|
|
|
|
// node_modules/@tamagui/focus-scope/dist/esm/FocusScope.mjs
|
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
var EVENT_OPTIONS = {
|
|
bubbles: false,
|
|
cancelable: true
|
|
};
|
|
var FocusScope = React26.forwardRef(function({
|
|
__scopeFocusScope,
|
|
...props
|
|
}, forwardedRef) {
|
|
const context2 = useFocusScopeControllerContext("FocusScope", __scopeFocusScope, {
|
|
warn: false,
|
|
fallback: {}
|
|
}), mergedProps = {
|
|
...props,
|
|
enabled: context2.enabled ?? props.enabled,
|
|
loop: context2.loop ?? props.loop,
|
|
trapped: context2.trapped ?? props.trapped,
|
|
onMountAutoFocus: context2.onMountAutoFocus ?? props.onMountAutoFocus,
|
|
onUnmountAutoFocus: context2.onUnmountAutoFocus ?? props.onUnmountAutoFocus,
|
|
forceUnmount: context2.forceUnmount ?? props.forceUnmount,
|
|
focusOnIdle: context2.focusOnIdle ?? props.focusOnIdle
|
|
}, childProps = useFocusScope(mergedProps, forwardedRef);
|
|
return typeof mergedProps.children == "function" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, {
|
|
children: mergedProps.children(childProps)
|
|
}) : React26.cloneElement(React26.Children.only(mergedProps.children), childProps);
|
|
});
|
|
function useFocusScope(props, forwardedRef) {
|
|
const {
|
|
loop = false,
|
|
enabled = true,
|
|
trapped = false,
|
|
onMountAutoFocus: onMountAutoFocusProp,
|
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
forceUnmount,
|
|
focusOnIdle = true,
|
|
children,
|
|
...scopeProps
|
|
} = props, [container, setContainer] = React26.useState(null), onMountAutoFocus = useEvent(onMountAutoFocusProp), onUnmountAutoFocus = useEvent(onUnmountAutoFocusProp), lastFocusedElementRef = React26.useRef(null), setContainerTransition = React26.useCallback((node) => {
|
|
startTransition(() => {
|
|
setContainer(node);
|
|
});
|
|
}, [setContainer]), composedRefs = useComposedRefs(forwardedRef, setContainerTransition), focusScope = React26.useRef({
|
|
paused: false,
|
|
pause() {
|
|
this.paused = true;
|
|
},
|
|
resume() {
|
|
this.paused = false;
|
|
}
|
|
}).current;
|
|
React26.useEffect(() => {
|
|
if (!enabled || !trapped) return;
|
|
const controller = new AbortController();
|
|
function handleFocusIn(event) {
|
|
if (focusScope.paused || !container) return;
|
|
const target = event.target;
|
|
container.contains(target) ? (target?.addEventListener("blur", handleBlur, {
|
|
signal: controller.signal
|
|
}), lastFocusedElementRef.current = target) : focus(lastFocusedElementRef.current, {
|
|
select: true
|
|
});
|
|
}
|
|
__name(handleFocusIn, "handleFocusIn");
|
|
function handleFocusOut(event) {
|
|
controller.abort(), !(focusScope.paused || !container) && (container.contains(event.relatedTarget) || focus(lastFocusedElementRef.current, {
|
|
select: true
|
|
}));
|
|
}
|
|
__name(handleFocusOut, "handleFocusOut");
|
|
function handleBlur() {
|
|
lastFocusedElementRef.current = container;
|
|
}
|
|
__name(handleBlur, "handleBlur");
|
|
return document.addEventListener("focusin", handleFocusIn), document.addEventListener("focusout", handleFocusOut), () => {
|
|
controller.abort(), document.removeEventListener("focusin", handleFocusIn), document.removeEventListener("focusout", handleFocusOut);
|
|
};
|
|
}, [trapped, forceUnmount, container, focusScope.paused]), useAsyncEffect(async (signal) => {
|
|
if (!enabled || !container || forceUnmount) return;
|
|
focusScopesStack.add(focusScope);
|
|
const previouslyFocusedElement = document.activeElement;
|
|
if (!container.contains(previouslyFocusedElement)) {
|
|
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
if (container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus), container.dispatchEvent(mountEvent), !mountEvent.defaultPrevented) {
|
|
focusOnIdle && await idle(signal, typeof focusOnIdle == "object" ? focusOnIdle : {
|
|
// we can't wait too long or else user can take an action and then we focus
|
|
max: 200,
|
|
min: typeof focusOnIdle == "number" ? focusOnIdle : 16
|
|
});
|
|
const allCandidates = getTabbableCandidates(container), visibleCandidates = removeLinks(allCandidates).filter((candidate) => !isHidden(candidate, {
|
|
upTo: container
|
|
}));
|
|
focusFirst(visibleCandidates, {
|
|
select: true
|
|
}), visibleCandidates.length > 0 ? lastFocusedElementRef.current = visibleCandidates[0] : lastFocusedElementRef.current = container, document.activeElement === previouslyFocusedElement && visibleCandidates.length === 0 && focus(container);
|
|
}
|
|
}
|
|
return () => {
|
|
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus), container.dispatchEvent(unmountEvent), unmountEvent.defaultPrevented || focus(previouslyFocusedElement ?? document.body, {
|
|
select: true
|
|
}), container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus), focusScopesStack.remove(focusScope);
|
|
};
|
|
}, [enabled, container, forceUnmount, onMountAutoFocus, onUnmountAutoFocus, focusScope, focusOnIdle]);
|
|
const handleKeyDown = React26.useCallback((event) => {
|
|
if (!trapped || !loop || focusScope.paused || !enabled || !container) return;
|
|
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey, focusedElement = document.activeElement;
|
|
if (isTabKey && focusedElement) {
|
|
const [first, last] = getTabbableEdges(container);
|
|
first && last ? !event.shiftKey && focusedElement === last ? (event.preventDefault(), loop && focus(first, {
|
|
select: true
|
|
})) : event.shiftKey && focusedElement === first && (event.preventDefault(), loop && focus(last, {
|
|
select: true
|
|
})) : focusedElement === container && event.preventDefault();
|
|
}
|
|
}, [loop, trapped, focusScope.paused, enabled, container]);
|
|
React26.useEffect(() => {
|
|
if (!container || !trapped || !loop || !enabled) return;
|
|
const handleKeyDownCapture = /* @__PURE__ */ __name((event) => {
|
|
event.key === "Tab" && handleKeyDown(event);
|
|
}, "handleKeyDownCapture");
|
|
return container.addEventListener("keydown", handleKeyDownCapture, true), () => {
|
|
container.removeEventListener("keydown", handleKeyDownCapture, true);
|
|
};
|
|
}, [container, trapped, loop, enabled, handleKeyDown]);
|
|
const existingOnKeyDown = scopeProps.onKeyDown, composedOnKeyDown = React26.useCallback((event) => {
|
|
existingOnKeyDown?.(event);
|
|
}, [existingOnKeyDown]);
|
|
return {
|
|
...scopeProps,
|
|
ref: composedRefs,
|
|
onKeyDown: composedOnKeyDown
|
|
};
|
|
}
|
|
__name(useFocusScope, "useFocusScope");
|
|
function focusFirst(candidates, {
|
|
select = false
|
|
} = {}) {
|
|
const previouslyFocusedElement = document.activeElement;
|
|
for (const candidate of candidates) if (focus(candidate, {
|
|
select
|
|
}), document.activeElement !== previouslyFocusedElement) return;
|
|
}
|
|
__name(focusFirst, "focusFirst");
|
|
function getTabbableEdges(container) {
|
|
const candidates = getTabbableCandidates(container), first = findVisible(candidates, container), last = findVisible(candidates.reverse(), container);
|
|
return [first, last];
|
|
}
|
|
__name(getTabbableEdges, "getTabbableEdges");
|
|
function getTabbableCandidates(container) {
|
|
const nodes = [], walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
acceptNode: /* @__PURE__ */ __name((node) => {
|
|
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
return node.disabled || node.hidden || isHiddenInput ? NodeFilter.FILTER_SKIP : node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
}, "acceptNode")
|
|
});
|
|
for (; walker.nextNode(); ) nodes.push(walker.currentNode);
|
|
return nodes;
|
|
}
|
|
__name(getTabbableCandidates, "getTabbableCandidates");
|
|
function findVisible(elements, container) {
|
|
for (const element of elements) if (!isHidden(element, {
|
|
upTo: container
|
|
})) return element;
|
|
}
|
|
__name(findVisible, "findVisible");
|
|
function isHidden(node, {
|
|
upTo
|
|
}) {
|
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
for (; node; ) {
|
|
if (upTo !== void 0 && node === upTo) return false;
|
|
if (getComputedStyle(node).display === "none") return true;
|
|
node = node.parentElement;
|
|
}
|
|
return false;
|
|
}
|
|
__name(isHidden, "isHidden");
|
|
function isSelectableInput(element) {
|
|
return element instanceof HTMLInputElement && "select" in element;
|
|
}
|
|
__name(isSelectableInput, "isSelectableInput");
|
|
function focus(element, {
|
|
select = false
|
|
} = {}) {
|
|
if (element?.focus) {
|
|
const previouslyFocusedElement = document.activeElement;
|
|
try {
|
|
element.focus({
|
|
preventScroll: true
|
|
}), element !== previouslyFocusedElement && isSelectableInput(element) && select && element.select();
|
|
} catch {
|
|
}
|
|
}
|
|
}
|
|
__name(focus, "focus");
|
|
var focusScopesStack = createFocusScopesStack();
|
|
function createFocusScopesStack() {
|
|
let stack = [];
|
|
return {
|
|
add(focusScope) {
|
|
const activeFocusScope = stack[0];
|
|
focusScope !== activeFocusScope && activeFocusScope?.pause(), stack = arrayRemove(stack, focusScope), stack.unshift(focusScope);
|
|
},
|
|
remove(focusScope) {
|
|
stack = arrayRemove(stack, focusScope), stack[0]?.resume();
|
|
}
|
|
};
|
|
}
|
|
__name(createFocusScopesStack, "createFocusScopesStack");
|
|
function arrayRemove(array, item) {
|
|
const updatedArray = [...array], index5 = updatedArray.indexOf(item);
|
|
return index5 !== -1 && updatedArray.splice(index5, 1), updatedArray;
|
|
}
|
|
__name(arrayRemove, "arrayRemove");
|
|
function removeLinks(items) {
|
|
return items.filter((item) => item.tagName !== "A");
|
|
}
|
|
__name(removeLinks, "removeLinks");
|
|
|
|
// node_modules/@tamagui/remove-scroll/dist/esm/useDisableScroll.mjs
|
|
var import_react19 = require("react");
|
|
var canUseDOM = /* @__PURE__ */ __name(() => typeof window < "u" && !!window.document && !!window.document.createElement, "canUseDOM");
|
|
var refCount = 0;
|
|
var previousBodyStyle = null;
|
|
var useDisableBodyScroll = /* @__PURE__ */ __name((enabled) => {
|
|
(0, import_react19.useEffect)(() => {
|
|
if (!enabled || !canUseDOM()) return;
|
|
const bodyEl = document.documentElement;
|
|
return ++refCount === 1 && (previousBodyStyle = {
|
|
scrollbarGutter: bodyEl.style.scrollbarGutter,
|
|
overflow: bodyEl.style.overflow
|
|
}, bodyEl.style.scrollbarGutter = "stable", bodyEl.style.overflow = "hidden"), () => {
|
|
--refCount === 0 && previousBodyStyle && (Object.assign(bodyEl.style, previousBodyStyle), previousBodyStyle = null);
|
|
};
|
|
}, [enabled]);
|
|
}, "useDisableBodyScroll");
|
|
|
|
// node_modules/@tamagui/remove-scroll/dist/esm/RemoveScroll.mjs
|
|
var RemoveScroll = /* @__PURE__ */ __name((props) => (useDisableBodyScroll(!!props.enabled), props.children), "RemoveScroll");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/Sheet.mjs
|
|
var import_core12 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/constants.mjs
|
|
var SHEET_NAME = "Sheet";
|
|
var SHEET_HANDLE_NAME = "SheetHandle";
|
|
var SHEET_OVERLAY_NAME = "SheetOverlay";
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/createSheet.mjs
|
|
var import_core11 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/use-did-finish-ssr/dist/esm/index.mjs
|
|
var React27 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/use-did-finish-ssr/dist/esm/ClientOnly.mjs
|
|
var import_react20 = require("react");
|
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
var ClientOnlyContext = (0, import_react20.createContext)(false);
|
|
|
|
// node_modules/@tamagui/use-did-finish-ssr/dist/esm/index.mjs
|
|
function useDidFinishSSR() {
|
|
return React27.useContext(ClientOnlyContext) ? true : React27.useSyncExternalStore(subscribe, () => true, () => false);
|
|
}
|
|
__name(useDidFinishSSR, "useDidFinishSSR");
|
|
var subscribe = /* @__PURE__ */ __name(() => () => {
|
|
}, "subscribe");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/createSheet.mjs
|
|
var import_react26 = require("react");
|
|
var import_react_native_web3 = __toESM(require_cjs(), 1);
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/SheetContext.mjs
|
|
var [createSheetContext, createSheetScope] = createContextScope(SHEET_NAME);
|
|
var [SheetProvider, useSheetContext] = createSheetContext(SHEET_NAME, {});
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/SheetImplementationCustom.mjs
|
|
var import_core9 = require("@tamagui/core");
|
|
var import_react24 = __toESM(require("react"), 1);
|
|
var import_react_native_web = __toESM(require_cjs(), 1);
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/contexts.mjs
|
|
var import_react21 = __toESM(require("react"), 1);
|
|
var ParentSheetContext = import_react21.default.createContext({
|
|
zIndex: 1e5
|
|
});
|
|
var SheetInsideSheetContext = import_react21.default.createContext(null);
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/helpers.mjs
|
|
function resisted(y, minY, maxOverflow = 25) {
|
|
if (y >= minY) return y;
|
|
const pastBoundary = minY - y, resistedDistance = Math.sqrt(pastBoundary) * 2;
|
|
return minY - resistedDistance;
|
|
}
|
|
__name(resisted, "resisted");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/useSheetController.mjs
|
|
var import_react22 = __toESM(require("react"), 1);
|
|
var useSheetController = /* @__PURE__ */ __name(() => {
|
|
const controller = import_react22.default.useContext(SheetControllerContext), isHidden2 = controller?.hidden, isShowingNonSheet = isHidden2 && controller?.open;
|
|
return {
|
|
controller,
|
|
isHidden: isHidden2,
|
|
isShowingNonSheet,
|
|
disableDrag: controller?.disableDrag
|
|
};
|
|
}, "useSheetController");
|
|
var SheetControllerContext = import_react22.default.createContext(null);
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/useSheetOpenState.mjs
|
|
var useSheetOpenState = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
isHidden: isHidden2,
|
|
controller
|
|
} = useSheetController(), onOpenChangeInternal = /* @__PURE__ */ __name((val) => {
|
|
controller?.onOpenChange?.(val), props.onOpenChange?.(val);
|
|
}, "onOpenChangeInternal"), propVal = props.preferAdaptParentOpenState ? controller?.open ?? props.open : props.open ?? controller?.open, [open, setOpen] = useControllableState({
|
|
prop: propVal,
|
|
defaultProp: props.defaultOpen ?? false,
|
|
onChange: onOpenChangeInternal,
|
|
strategy: "most-recent-wins"
|
|
});
|
|
return {
|
|
open,
|
|
setOpen,
|
|
isHidden: isHidden2,
|
|
controller
|
|
};
|
|
}, "useSheetOpenState");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/useSheetProviderProps.mjs
|
|
var import_react23 = __toESM(require("react"), 1);
|
|
var import_core8 = require("@tamagui/core");
|
|
function useSheetProviderProps(props, state, options = {}) {
|
|
const handleRef = import_react23.default.useRef(null), contentRef = import_react23.default.useRef(null), [frameSize, setFrameSize] = import_react23.default.useState(0), [maxContentSize, setMaxContentSize] = import_react23.default.useState(0), snapPointsMode = props.snapPointsMode ?? "percent", snapPointsProp = props.snapPoints ?? (snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"]), hasFit = snapPointsProp[0] === "fit", snapPoints = import_react23.default.useMemo(() => props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp, [JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]), [position_, setPositionImmediate] = useControllableState({
|
|
prop: props.position,
|
|
defaultProp: props.defaultPosition || (state.open ? 0 : -1),
|
|
onChange: props.onPositionChange,
|
|
strategy: "most-recent-wins"
|
|
}), position = state.open === false ? -1 : position_, {
|
|
open
|
|
} = state, setPosition = import_react23.default.useCallback((next) => {
|
|
props.dismissOnSnapToBottom && next === snapPoints.length - 1 ? state.setOpen(false) : setPositionImmediate(next);
|
|
}, [props.dismissOnSnapToBottom, snapPoints.length, setPositionImmediate, state.setOpen]);
|
|
process.env.NODE_ENV === "development" && (snapPointsMode === "mixed" && snapPoints.some((p) => {
|
|
if (typeof p == "string") {
|
|
if (p === "fit") return false;
|
|
if (p.endsWith("%")) {
|
|
const n = Number(p.slice(0, -1));
|
|
return n < 0 || n > 100;
|
|
}
|
|
return true;
|
|
}
|
|
return typeof p != "number" || p < 0;
|
|
}) && console.warn('\u26A0\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or "fit" when snapPointsMode is mixed'), snapPointsMode === "mixed" && snapPoints.indexOf("fit") > 0 && console.warn('\u26A0\uFE0F Invalid snapPoint given, "fit" must be the first/largest snap point when snapPointsMode is mixed'), snapPointsMode === "fit" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== "fit") && console.warn("\u26A0\uFE0F Invalid snapPoint given, there are no snap points when snapPointsMode is fit"), snapPointsMode === "constant" && snapPoints.some((p) => typeof p != "number" || p < 0) && console.warn("\u26A0\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant"), snapPointsMode === "percent" && snapPoints.some((p) => typeof p != "number" || p < 0 || p > 100) && console.warn("\u26A0\uFE0F Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent")), open && props.dismissOnSnapToBottom && position === snapPoints.length - 1 && setPositionImmediate(0);
|
|
const shouldSetPositionOpen = open && position < 0;
|
|
import_react23.default.useEffect(() => {
|
|
shouldSetPositionOpen && setPosition(0);
|
|
}, [setPosition, shouldSetPositionOpen]);
|
|
const {
|
|
animationDriver
|
|
} = (0, import_core8.useConfiguration)();
|
|
if (!animationDriver) throw new Error(process.env.NODE_ENV === "production" ? "\u274C 008" : "Must set animations in tamagui.config.ts");
|
|
const scrollBridge = useConstant(() => {
|
|
const parentDragListeners = /* @__PURE__ */ new Set(), bridge = {
|
|
hasScrollableContent: false,
|
|
enabled: false,
|
|
y: 0,
|
|
paneY: 0,
|
|
paneMinY: 0,
|
|
scrollStartY: -1,
|
|
drag: /* @__PURE__ */ __name(() => {
|
|
}, "drag"),
|
|
release: /* @__PURE__ */ __name(() => {
|
|
}, "release"),
|
|
scrollLock: false,
|
|
isParentDragging: false,
|
|
onParentDragging: /* @__PURE__ */ __name((cb) => (parentDragListeners.add(cb), () => {
|
|
parentDragListeners.delete(cb);
|
|
}), "onParentDragging"),
|
|
setParentDragging: /* @__PURE__ */ __name((val) => {
|
|
val !== bridge.isParentDragging && (bridge.isParentDragging = val, parentDragListeners.forEach((cb) => cb(val)));
|
|
}, "setParentDragging")
|
|
};
|
|
return bridge;
|
|
}), removeScrollEnabled = props.forceRemoveScrollEnabled ?? (open && props.modal), maxSnapPoint = snapPoints[0];
|
|
return {
|
|
screenSize: snapPointsMode === "percent" ? frameSize / ((typeof maxSnapPoint == "number" ? maxSnapPoint : 100) / 100) : maxContentSize,
|
|
maxSnapPoint,
|
|
removeScrollEnabled,
|
|
scrollBridge,
|
|
modal: !!props.modal,
|
|
open: state.open,
|
|
setOpen: state.setOpen,
|
|
hidden: !!state.isHidden,
|
|
contentRef,
|
|
handleRef,
|
|
frameSize,
|
|
setFrameSize,
|
|
dismissOnOverlayPress: props.dismissOnOverlayPress ?? true,
|
|
dismissOnSnapToBottom: props.dismissOnSnapToBottom ?? false,
|
|
onOverlayComponent: options.onOverlayComponent,
|
|
scope: props.__scopeSheet,
|
|
hasFit,
|
|
position,
|
|
snapPoints,
|
|
snapPointsMode,
|
|
setMaxContentSize,
|
|
setPosition,
|
|
setPositionImmediate,
|
|
onlyShowFrame: false
|
|
};
|
|
}
|
|
__name(useSheetProviderProps, "useSheetProviderProps");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/SheetImplementationCustom.mjs
|
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
var hiddenSize = 10000.1;
|
|
var sheetHiddenStyleSheet = null;
|
|
var relativeDimensionTo = isWeb ? "window" : "screen";
|
|
var SheetImplementationCustom = import_react24.default.forwardRef(function(props, forwardedRef) {
|
|
const parentSheet = import_react24.default.useContext(ParentSheetContext), {
|
|
animation,
|
|
animationConfig: animationConfigProp,
|
|
modal = false,
|
|
zIndex = parentSheet.zIndex + 1,
|
|
moveOnKeyboardChange = false,
|
|
unmountChildrenWhenHidden = false,
|
|
portalProps,
|
|
containerComponent: ContainerComponent = import_react24.default.Fragment
|
|
} = props, state = useSheetOpenState(props), [overlayComponent, setOverlayComponent] = import_react24.default.useState(null), providerProps = useSheetProviderProps(props, state, {
|
|
onOverlayComponent: setOverlayComponent
|
|
}), {
|
|
frameSize,
|
|
setFrameSize,
|
|
snapPoints,
|
|
snapPointsMode,
|
|
hasFit,
|
|
position,
|
|
setPosition,
|
|
scrollBridge,
|
|
screenSize,
|
|
setMaxContentSize,
|
|
maxSnapPoint
|
|
} = providerProps, {
|
|
open,
|
|
controller,
|
|
isHidden: isHidden2
|
|
} = state, sheetRef = import_react24.default.useRef(void 0), ref = useComposedRefs(forwardedRef, sheetRef, providerProps.contentRef), {
|
|
animationDriver
|
|
} = (0, import_core9.useConfiguration)();
|
|
if (!animationDriver) throw new Error("Sheet reqiures an animation driver to be set");
|
|
const animationConfig = (() => {
|
|
if (animationDriver.supportsCSS) return {};
|
|
const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
|
|
return animationConfigProp ?? (animationProp ? {
|
|
...animationDriver.animations[animationProp],
|
|
...animationPropConfig
|
|
} : null);
|
|
})(), [isShowingInnerSheet, setIsShowingInnerSheet] = import_react24.default.useState(false), shouldHideParentSheet = !isWeb && modal && isShowingInnerSheet && // if not using weird portal limitation we dont need to hide parent sheet
|
|
USE_NATIVE_PORTAL, sheetInsideSheet = import_react24.default.useContext(SheetInsideSheetContext), onInnerSheet = import_react24.default.useCallback((hasChild) => {
|
|
setIsShowingInnerSheet(hasChild);
|
|
}, []), stableFrameSize = import_react24.default.useRef(frameSize);
|
|
import_react24.default.useEffect(() => {
|
|
open && frameSize && (stableFrameSize.current = frameSize);
|
|
}, [open, frameSize]);
|
|
const positions = import_react24.default.useMemo(() => snapPoints.map((point) => (
|
|
// FIX: Use stable frameSize when closing to prevent position jumps
|
|
getYPositions(snapPointsMode, point, screenSize, open ? frameSize : stableFrameSize.current)
|
|
)), [screenSize, frameSize, snapPoints, snapPointsMode, open]), {
|
|
useAnimatedNumber,
|
|
useAnimatedNumberStyle,
|
|
useAnimatedNumberReaction
|
|
} = animationDriver, AnimatedView = animationDriver.View ?? import_core9.Stack;
|
|
useIsomorphicLayoutEffect(() => {
|
|
if (sheetInsideSheet && open) return sheetInsideSheet(true), () => {
|
|
sheetInsideSheet(false);
|
|
};
|
|
}, [sheetInsideSheet, open]);
|
|
const nextParentContext = import_react24.default.useMemo(() => ({
|
|
zIndex
|
|
}), [zIndex]), startPosition = (0, import_core9.useDidFinishSSR)() && screenSize ? screenSize : hiddenSize, animatedNumber = useAnimatedNumber(startPosition), at = import_react24.default.useRef(startPosition), hasntMeasured = at.current === hiddenSize, [disableAnimation, setDisableAnimation] = (0, import_react24.useState)(hasntMeasured), hasScrollView = import_react24.default.useRef(false);
|
|
useAnimatedNumberReaction({
|
|
value: animatedNumber,
|
|
hostRef: sheetRef
|
|
}, import_react24.default.useCallback((value) => {
|
|
at.current = value, scrollBridge.paneY = value;
|
|
}, [animationDriver]));
|
|
function stopSpring() {
|
|
animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
|
|
}
|
|
__name(stopSpring, "stopSpring");
|
|
const animateTo = (0, import_core9.useEvent)((position2) => {
|
|
if (frameSize === 0) return;
|
|
let toValue = isHidden2 || position2 === -1 ? screenSize : positions[position2];
|
|
at.current !== toValue && (at.current = toValue, stopSpring(), animatedNumber.setValue(toValue, {
|
|
type: "spring",
|
|
...animationConfig
|
|
}));
|
|
});
|
|
useIsomorphicLayoutEffect(() => {
|
|
if (hasntMeasured && screenSize && frameSize) {
|
|
at.current = screenSize, animatedNumber.setValue(screenSize, {
|
|
type: "timing",
|
|
duration: 0
|
|
}, () => {
|
|
setTimeout(() => {
|
|
setDisableAnimation(false);
|
|
}, 10);
|
|
});
|
|
return;
|
|
}
|
|
disableAnimation || !frameSize || !screenSize || isHidden2 || hasntMeasured && !open || (animateTo(position), position === -1 && (scrollBridge.scrollLock = false, scrollBridge.scrollStartY = -1));
|
|
}, [hasntMeasured, disableAnimation, isHidden2, frameSize, screenSize, open, position]);
|
|
const disableDrag = props.disableDrag ?? controller?.disableDrag, themeName = (0, import_core9.useThemeName)(), [isDragging, setIsDragging] = import_react24.default.useState(false), panResponder = import_react24.default.useMemo(() => {
|
|
if (disableDrag || !frameSize || isShowingInnerSheet) return;
|
|
const minY = positions[0];
|
|
scrollBridge.paneMinY = minY;
|
|
let startY = at.current;
|
|
function setPanning(val) {
|
|
setIsDragging(val), isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
|
|
}
|
|
__name(setPanning, "setPanning");
|
|
const release = /* @__PURE__ */ __name(({
|
|
vy,
|
|
dragAt
|
|
}) => {
|
|
if (scrollBridge.setParentDragging(false), scrollBridge.scrollLock) return;
|
|
isExternalDrag = false, previouslyScrolling = false, setPanning(false);
|
|
const end = dragAt + startY + frameSize * vy * 0.2;
|
|
let closestPoint = 0, dist = Number.POSITIVE_INFINITY;
|
|
for (let i = 0; i < positions.length; i++) {
|
|
const position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
curDist < dist && (dist = curDist, closestPoint = i);
|
|
}
|
|
setPosition(closestPoint), animateTo(closestPoint);
|
|
}, "release"), finish = /* @__PURE__ */ __name((_e, state2) => {
|
|
release({
|
|
vy: state2.vy,
|
|
dragAt: state2.dy
|
|
});
|
|
}, "finish");
|
|
let previouslyScrolling = false;
|
|
const onMoveShouldSet = /* @__PURE__ */ __name((e, {
|
|
dy
|
|
}) => {
|
|
function getShouldSet() {
|
|
if (e.target === providerProps.handleRef.current) return true;
|
|
if (scrollBridge.hasScrollableContent === true) {
|
|
if (scrollBridge.scrollLock) return false;
|
|
const isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
if (isScrolled) return previouslyScrolling = true, false;
|
|
if (isNearTop && hasScrollView.current && isDraggingUp) return false;
|
|
}
|
|
return Math.abs(dy) > 10;
|
|
}
|
|
__name(getShouldSet, "getShouldSet");
|
|
const granted = getShouldSet();
|
|
return granted && scrollBridge.setParentDragging(true), granted;
|
|
}, "onMoveShouldSet"), grant = /* @__PURE__ */ __name(() => {
|
|
setPanning(true), stopSpring(), startY = at.current;
|
|
}, "grant");
|
|
let isExternalDrag = false;
|
|
return scrollBridge.drag = (dy) => {
|
|
isExternalDrag || (isExternalDrag = true, grant());
|
|
const to = dy + startY;
|
|
animatedNumber.setValue(resisted(to, minY), {
|
|
type: "direct"
|
|
});
|
|
}, scrollBridge.release = release, import_react_native_web.PanResponder.create({
|
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
onPanResponderGrant: grant,
|
|
onPanResponderMove: /* @__PURE__ */ __name((_e, {
|
|
dy
|
|
}) => {
|
|
const toFull = dy + startY, to = resisted(toFull, minY);
|
|
to <= minY ? scrollBridge.setParentDragging(false) : scrollBridge.setParentDragging(true), animatedNumber.setValue(to, {
|
|
type: "direct"
|
|
});
|
|
}, "onPanResponderMove"),
|
|
onPanResponderEnd: finish,
|
|
onPanResponderTerminate: finish,
|
|
onPanResponderRelease: finish
|
|
});
|
|
}, [disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]), handleAnimationViewLayout = import_react24.default.useCallback((e) => {
|
|
if (!open && stableFrameSize.current !== 0) return;
|
|
const next = Math.min(e.nativeEvent?.layout.height, import_react_native_web.Dimensions.get(relativeDimensionTo).height);
|
|
next && setFrameSize(next);
|
|
}, [open]), handleMaxContentViewLayout = import_react24.default.useCallback((e) => {
|
|
const next = Math.min(e.nativeEvent?.layout.height, import_react_native_web.Dimensions.get(relativeDimensionTo).height);
|
|
next && setMaxContentSize(next);
|
|
}, []), animatedStyle = useAnimatedNumberStyle(animatedNumber, (val) => {
|
|
"worklet";
|
|
return {
|
|
transform: [{
|
|
translateY: frameSize === 0 ? hiddenSize : val
|
|
}]
|
|
};
|
|
}), sizeBeforeKeyboard = import_react24.default.useRef(null);
|
|
import_react24.default.useEffect(() => {
|
|
if (isWeb || !moveOnKeyboardChange) return;
|
|
const keyboardShowListener = import_react_native_web.Keyboard.addListener(currentPlatform === "ios" ? "keyboardWillShow" : "keyboardDidShow", (e) => {
|
|
sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = isHidden2 || position === -1 ? screenSize : positions[position], animatedNumber.setValue(Math.max(sizeBeforeKeyboard.current - e.endCoordinates.height, 0), {
|
|
type: "timing",
|
|
duration: 250
|
|
}));
|
|
}), keyboardDidHideListener = import_react_native_web.Keyboard.addListener("keyboardDidHide", () => {
|
|
sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current, {
|
|
type: "timing",
|
|
duration: 250
|
|
}), sizeBeforeKeyboard.current = null);
|
|
});
|
|
return () => {
|
|
keyboardDidHideListener.remove(), keyboardShowListener.remove();
|
|
};
|
|
}, [moveOnKeyboardChange, positions, position, isHidden2]);
|
|
const [opacity, setOpacity] = import_react24.default.useState(open ? 1 : 0);
|
|
open && opacity === 0 && setOpacity(1), import_react24.default.useEffect(() => {
|
|
if (!open) {
|
|
const tm = setTimeout(() => {
|
|
setOpacity(0);
|
|
}, 400);
|
|
return () => {
|
|
clearTimeout(tm);
|
|
};
|
|
}
|
|
}, [open]);
|
|
const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${isWeb ? "dvh" : "%"}` : maxSnapPoint, setHasScrollView = import_react24.default.useCallback((val) => {
|
|
hasScrollView.current = val;
|
|
}, []);
|
|
let contents = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core9.LayoutMeasurementController, {
|
|
disable: !open,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ParentSheetContext.Provider, {
|
|
value: nextParentContext,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SheetProvider, {
|
|
...providerProps,
|
|
setHasScrollView,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AnimatePresence, {
|
|
custom: {
|
|
open
|
|
},
|
|
children: shouldHideParentSheet || !open ? null : overlayComponent
|
|
}), snapPointsMode !== "percent" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native_web.View, {
|
|
style: {
|
|
opacity: 0,
|
|
position: "absolute",
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
pointerEvents: "none"
|
|
},
|
|
onLayout: handleMaxContentViewLayout
|
|
}), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AnimatedView, {
|
|
ref,
|
|
...panResponder?.panHandlers,
|
|
onLayout: handleAnimationViewLayout,
|
|
animation: isDragging || disableAnimation ? null : animation,
|
|
disableClassName: true,
|
|
style: [{
|
|
position: "absolute",
|
|
zIndex,
|
|
width: "100%",
|
|
height: forcedContentHeight,
|
|
minHeight: forcedContentHeight,
|
|
opacity: shouldHideParentSheet ? 0 : opacity,
|
|
...(shouldHideParentSheet || !open) && {
|
|
pointerEvents: "none"
|
|
}
|
|
}, animatedStyle],
|
|
children: props.children
|
|
})]
|
|
})
|
|
})
|
|
});
|
|
const shouldMountChildren = unmountChildrenWhenHidden ? !!opacity : true;
|
|
if (modal) {
|
|
const modalContents = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Portal, {
|
|
stackZIndex: zIndex,
|
|
...portalProps,
|
|
children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContainerComponent, {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core9.Theme, {
|
|
contain: true,
|
|
forceClassName: true,
|
|
name: themeName,
|
|
children: contents
|
|
})
|
|
})
|
|
});
|
|
return isWeb ? modalContents : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SheetInsideSheetContext.Provider, {
|
|
value: onInnerSheet,
|
|
children: modalContents
|
|
});
|
|
}
|
|
return contents;
|
|
});
|
|
function getYPositions(mode, point, screenSize, frameSize) {
|
|
if (!screenSize || !frameSize) return 0;
|
|
if (mode === "mixed") {
|
|
if (typeof point == "number") return screenSize - Math.min(screenSize, Math.max(0, point));
|
|
if (point === "fit") return screenSize - Math.min(screenSize, frameSize);
|
|
if (point.endsWith("%")) {
|
|
const pct2 = Math.min(100, Math.max(0, Number(point.slice(0, -1)))) / 100;
|
|
return Number.isNaN(pct2) ? (console.warn("Invalid snapPoint percentage string"), 0) : Math.round(screenSize - pct2 * screenSize);
|
|
}
|
|
return console.warn("Invalid snapPoint unknown value"), 0;
|
|
}
|
|
if (mode === "fit") return point === 0 ? screenSize : screenSize - Math.min(screenSize, frameSize);
|
|
if (mode === "constant" && typeof point == "number") return screenSize - Math.min(screenSize, Math.max(0, point));
|
|
const pct = Math.min(100, Math.max(0, Number(point))) / 100;
|
|
return Number.isNaN(pct) ? (console.warn("Invalid snapPoint percentage"), 0) : Math.round(screenSize - pct * screenSize);
|
|
}
|
|
__name(getYPositions, "getYPositions");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/SheetScrollView.mjs
|
|
var import_core10 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/scroll-view/dist/esm/ScrollView.mjs
|
|
var import_web8 = require("@tamagui/core");
|
|
var import_react_native_web2 = __toESM(require_cjs(), 1);
|
|
var ScrollView = (0, import_web8.styled)(import_react_native_web2.ScrollView, {
|
|
name: "ScrollView",
|
|
scrollEnabled: true,
|
|
variants: {
|
|
fullscreen: {
|
|
true: fullscreenStyle
|
|
}
|
|
}
|
|
}, {
|
|
accept: {
|
|
contentContainerStyle: "style"
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/SheetScrollView.mjs
|
|
var import_react25 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
var SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
|
|
var SheetScrollView = import_react25.default.forwardRef(({
|
|
__scopeSheet,
|
|
children,
|
|
onScroll,
|
|
scrollEnabled: scrollEnabledProp,
|
|
...props
|
|
}, ref) => {
|
|
const context2 = useSheetContext(SHEET_SCROLL_VIEW_NAME, __scopeSheet), {
|
|
scrollBridge,
|
|
setHasScrollView
|
|
} = context2, [scrollEnabled, setScrollEnabled_] = useControllableState({
|
|
prop: scrollEnabledProp,
|
|
defaultProp: true
|
|
}), scrollRef = import_react25.default.useRef(null), setScrollEnabled = /* @__PURE__ */ __name((next) => {
|
|
scrollRef.current?.setNativeProps?.({
|
|
scrollEnabled: next
|
|
}), setScrollEnabled_(next);
|
|
}, "setScrollEnabled"), state = import_react25.default.useRef({
|
|
lastPageY: 0,
|
|
dragAt: 0,
|
|
dys: [],
|
|
// store a few recent dys to get velocity on release
|
|
isScrolling: false,
|
|
isDraggingScrollArea: false
|
|
});
|
|
(0, import_react25.useEffect)(() => (setHasScrollView(true), () => {
|
|
setHasScrollView(false);
|
|
}), []);
|
|
const release = /* @__PURE__ */ __name(() => {
|
|
if (!state.current.isDraggingScrollArea) return;
|
|
state.current.isDraggingScrollArea = false, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = false, state.current.isScrolling = false, setScrollEnabled(true);
|
|
let vy = 0;
|
|
if (state.current.dys.length) {
|
|
const recentDys = state.current.dys.slice(-10);
|
|
vy = (recentDys.length ? recentDys.reduce((a, b) => a + b, 0) : 0) / recentDys.length * 0.04;
|
|
}
|
|
state.current.dys = [], scrollBridge.release({
|
|
dragAt: state.current.dragAt,
|
|
vy
|
|
});
|
|
}, "release"), scrollable = scrollEnabled;
|
|
(0, import_react25.useEffect)(() => {
|
|
if (!import_core10.isClient || !scrollRef.current) return;
|
|
const controller = new AbortController(), node = scrollRef.current?.getScrollableNode();
|
|
if (!node) return;
|
|
node.addEventListener("touchmove", (e) => {
|
|
scrollBridge.isParentDragging && node.scrollTo({
|
|
top: scrollBridge.y,
|
|
behavior: "instant"
|
|
});
|
|
}, {
|
|
signal: controller.signal,
|
|
passive: false
|
|
});
|
|
const disposeBridgeListen = scrollBridge.onParentDragging((val) => {
|
|
});
|
|
return () => {
|
|
disposeBridgeListen(), controller.abort();
|
|
};
|
|
}, [scrollRef]);
|
|
const [hasScrollableContent, setHasScrollableContent] = (0, import_react25.useState)(true), parentHeight = (0, import_react25.useRef)(0), contentHeight = (0, import_react25.useRef)(0), setIsScrollable = /* @__PURE__ */ __name(() => {
|
|
parentHeight.current && contentHeight.current && setHasScrollableContent(contentHeight.current > parentHeight.current);
|
|
}, "setIsScrollable");
|
|
return (0, import_react25.useEffect)(() => {
|
|
scrollBridge.hasScrollableContent = hasScrollableContent;
|
|
}, [hasScrollableContent]), /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(ScrollView, {
|
|
onLayout: /* @__PURE__ */ __name((e) => {
|
|
parentHeight.current = Math.ceil(e.nativeEvent.layout.height), setIsScrollable();
|
|
}, "onLayout"),
|
|
ref: composeRefs(scrollRef, ref),
|
|
flex: 1,
|
|
scrollEventThrottle: 8,
|
|
onResponderRelease: release,
|
|
className: "_ovs-contain",
|
|
scrollEnabled: scrollable,
|
|
onScroll: /* @__PURE__ */ __name((e) => {
|
|
const {
|
|
y
|
|
} = e.nativeEvent.contentOffset;
|
|
scrollBridge.y = y, import_core10.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll?.(e);
|
|
}, "onScroll"),
|
|
onStartShouldSetResponder: /* @__PURE__ */ __name(() => (scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = true, scrollable), "onStartShouldSetResponder"),
|
|
onMoveShouldSetResponder: /* @__PURE__ */ __name((e) => scrollable, "onMoveShouldSetResponder"),
|
|
contentContainerStyle: {
|
|
minHeight: "100%"
|
|
},
|
|
onResponderMove: /* @__PURE__ */ __name((e) => {
|
|
if (import_core10.isWeb) {
|
|
const {
|
|
pageY
|
|
} = e.nativeEvent;
|
|
state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
const dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
|
|
state.current.lastPageY = pageY;
|
|
const isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY;
|
|
if (hasScrollableContent && (dy === 0 || isDraggingUp) && isPaneAtTop && !state.current.isScrolling) {
|
|
state.current.isScrolling = true, scrollBridge.scrollLock = true, setScrollEnabled(true);
|
|
return;
|
|
}
|
|
if (!(!state.current.isScrolling && dy > 0 && scrollBridge.y === 0) && scrollBridge.y >= 0) return;
|
|
setScrollEnabled(false), scrollBridge.drag(dragAt), state.current.dragAt = dragAt, state.current.dys.push(dy), state.current.dys.length > 100 && (state.current.dys = state.current.dys.slice(-10));
|
|
}
|
|
}, "onResponderMove"),
|
|
...props,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core10.View, {
|
|
position: "absolute",
|
|
inset: 0,
|
|
pointerEvents: "none",
|
|
zIndex: -1,
|
|
onLayout: /* @__PURE__ */ __name((e) => {
|
|
contentHeight.current = Math.floor(e.nativeEvent.layout.height), setIsScrollable();
|
|
}, "onLayout")
|
|
}), children]
|
|
});
|
|
});
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/useSheetOffscreenSize.mjs
|
|
var useSheetOffscreenSize = /* @__PURE__ */ __name(({
|
|
snapPoints,
|
|
position,
|
|
screenSize,
|
|
frameSize,
|
|
snapPointsMode
|
|
}) => {
|
|
if (snapPointsMode === "fit") return 0;
|
|
if (snapPointsMode === "constant") {
|
|
const maxSize2 = Number(snapPoints[0]), currentSize2 = Number(snapPoints[position] ?? 0);
|
|
return maxSize2 - currentSize2;
|
|
}
|
|
if (snapPointsMode === "percent") {
|
|
const maxPercentOpened = Number(snapPoints[0]) / 100, percentOpened = Number(snapPoints[position] ?? 0) / 100;
|
|
return (maxPercentOpened - percentOpened) * screenSize;
|
|
}
|
|
const maxSnapPoint = snapPoints[0];
|
|
if (maxSnapPoint === "fit") return 0;
|
|
const maxSize = typeof maxSnapPoint == "string" ? Number(maxSnapPoint.slice(0, -1)) / 100 * screenSize : maxSnapPoint, currentSnapPoint = snapPoints[position] ?? 0, currentSize = typeof currentSnapPoint == "string" ? Number(currentSnapPoint.slice(0, -1)) / 100 * screenSize : currentSnapPoint, offscreenSize = maxSize - currentSize;
|
|
return Number.isNaN(offscreenSize) ? 0 : offscreenSize;
|
|
}, "useSheetOffscreenSize");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/createSheet.mjs
|
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
function createSheet({
|
|
Handle: Handle2,
|
|
Frame: Frame2,
|
|
Overlay: Overlay2
|
|
}) {
|
|
const SheetHandle = Handle2.styleable(({
|
|
__scopeSheet,
|
|
...props
|
|
}, forwardedRef) => {
|
|
const context2 = useSheetContext(SHEET_HANDLE_NAME, __scopeSheet), composedRef = useComposedRefs(context2.handleRef, forwardedRef);
|
|
return context2.onlyShowFrame ? null : (
|
|
// @ts-ignore
|
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Handle2, {
|
|
ref: composedRef,
|
|
onPress: /* @__PURE__ */ __name(() => {
|
|
const max2 = context2.snapPoints.length + (context2.dismissOnSnapToBottom ? -1 : 0), nextPos = (context2.position + 1) % max2;
|
|
context2.setPosition(nextPos);
|
|
}, "onPress"),
|
|
open: context2.open,
|
|
...props
|
|
})
|
|
);
|
|
}), SheetOverlay = Overlay2.extractable((0, import_react26.memo)((propsIn) => {
|
|
const {
|
|
__scopeSheet,
|
|
...props
|
|
} = propsIn, context2 = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet), element = (0, import_react26.useMemo)(() => (
|
|
// @ts-ignore
|
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Overlay2, {
|
|
...props,
|
|
onPress: composeEventHandlers(props.onPress, context2.dismissOnOverlayPress ? () => {
|
|
context2.setOpen(false);
|
|
} : void 0)
|
|
})
|
|
), [props.onPress, props.opacity, context2.dismissOnOverlayPress]);
|
|
return useIsomorphicLayoutEffect(() => {
|
|
context2.onOverlayComponent?.(element);
|
|
}, [element]), context2.onlyShowFrame, null;
|
|
})), SheetFrame = Frame2.extractable((0, import_react26.forwardRef)(({
|
|
__scopeSheet,
|
|
adjustPaddingForOffscreenContent,
|
|
disableHideBottomOverflow,
|
|
children,
|
|
...props
|
|
}, forwardedRef) => {
|
|
const context2 = useSheetContext(SHEET_NAME, __scopeSheet), {
|
|
hasFit,
|
|
removeScrollEnabled = true,
|
|
frameSize,
|
|
contentRef,
|
|
open
|
|
} = context2, composedContentRef = useComposedRefs(forwardedRef, contentRef), offscreenSize = useSheetOffscreenSize(context2), stableFrameSize = (0, import_react26.useRef)(frameSize);
|
|
(0, import_react26.useEffect)(() => {
|
|
open && frameSize && (stableFrameSize.current = frameSize);
|
|
}, [open, frameSize]);
|
|
const sheetContents = (0, import_react26.useMemo)(() => {
|
|
const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
|
|
return (
|
|
// @ts-expect-error
|
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Frame2, {
|
|
ref: composedContentRef,
|
|
flex: hasFit && open ? 0 : 1,
|
|
height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
|
|
pointerEvents: open ? "auto" : "none",
|
|
...props,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StackZIndexContext, {
|
|
zIndex: resolveViewZIndex(props.zIndex),
|
|
children
|
|
}), adjustPaddingForOffscreenContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core11.Stack, {
|
|
"data-sheet-offscreen-pad": true,
|
|
height: offscreenSize,
|
|
width: "100%"
|
|
})]
|
|
})
|
|
);
|
|
}, [open, props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RemoveScroll, {
|
|
enabled: removeScrollEnabled && context2.open,
|
|
children: sheetContents
|
|
}), !disableHideBottomOverflow && // @ts-ignore
|
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Frame2, {
|
|
...props,
|
|
"data-testid": "ensure-sheet-cover-not-overlapping",
|
|
componentName: "SheetCover",
|
|
children: null,
|
|
position: "absolute",
|
|
bottom: "-100%",
|
|
zIndex: -1,
|
|
height: context2.frameSize,
|
|
left: 0,
|
|
right: 0,
|
|
borderWidth: 0,
|
|
borderRadius: 0,
|
|
shadowOpacity: 0
|
|
})]
|
|
});
|
|
})), Sheet2 = (0, import_react26.forwardRef)(function(props, ref) {
|
|
const hydrated = useDidFinishSSR(), {
|
|
isShowingNonSheet
|
|
} = useSheetController();
|
|
let SheetImplementation = SheetImplementationCustom;
|
|
return props.native && import_react_native_web3.Platform.OS, isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SheetImplementation, {
|
|
ref,
|
|
...props
|
|
});
|
|
}), components = {
|
|
Frame: SheetFrame,
|
|
Overlay: SheetOverlay,
|
|
Handle: SheetHandle,
|
|
ScrollView: SheetScrollView
|
|
}, Controlled = withStaticProperties(Sheet2, components);
|
|
return withStaticProperties(Sheet2, {
|
|
...components,
|
|
Controlled
|
|
});
|
|
}
|
|
__name(createSheet, "createSheet");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/Sheet.mjs
|
|
var Handle = (0, import_core12.styled)(XStack, {
|
|
name: SHEET_HANDLE_NAME,
|
|
variants: {
|
|
open: {
|
|
true: {
|
|
opacity: 1,
|
|
pointerEvents: "auto"
|
|
},
|
|
false: {
|
|
opacity: 0,
|
|
pointerEvents: "none"
|
|
}
|
|
},
|
|
unstyled: {
|
|
false: {
|
|
height: 10,
|
|
borderRadius: 100,
|
|
backgroundColor: "$background",
|
|
zIndex: 10,
|
|
marginHorizontal: "35%",
|
|
marginBottom: "$2",
|
|
opacity: 0.5,
|
|
hoverStyle: {
|
|
opacity: 0.7
|
|
}
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var Overlay = (0, import_core12.styled)(ThemeableStack, {
|
|
name: SHEET_OVERLAY_NAME,
|
|
variants: {
|
|
open: {
|
|
true: {
|
|
pointerEvents: "auto"
|
|
},
|
|
false: {
|
|
pointerEvents: "none"
|
|
}
|
|
},
|
|
unstyled: {
|
|
false: {
|
|
fullscreen: true,
|
|
position: "absolute",
|
|
backgrounded: true,
|
|
zIndex: 99999,
|
|
pointerEvents: "auto"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var Frame = (0, import_core12.styled)(YStack, {
|
|
name: SHEET_NAME,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
flex: 1,
|
|
backgroundColor: "$background",
|
|
borderTopLeftRadius: "$true",
|
|
borderTopRightRadius: "$true",
|
|
width: "100%",
|
|
maxHeight: "100%",
|
|
overflow: "hidden"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var Sheet = createSheet({
|
|
Frame,
|
|
Handle,
|
|
Overlay
|
|
});
|
|
var SheetOverlayFrame = Overlay;
|
|
var SheetHandleFrame = Handle;
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/useSheet.mjs
|
|
var useSheet = /* @__PURE__ */ __name(() => useSheetContext("", void 0), "useSheet");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/SheetController.mjs
|
|
var import_react27 = __toESM(require("react"), 1);
|
|
var import_core13 = require("@tamagui/core");
|
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
var SheetController = /* @__PURE__ */ __name(({
|
|
children,
|
|
onOpenChange: onOpenChangeProp,
|
|
open,
|
|
hidden,
|
|
disableDrag
|
|
}) => {
|
|
const onOpenChange = (0, import_core13.useEvent)(onOpenChangeProp), id = (0, import_react27.useId)(), memoValue = import_react27.default.useMemo(() => ({
|
|
id,
|
|
open,
|
|
hidden,
|
|
disableDrag,
|
|
onOpenChange
|
|
}), [id, onOpenChange, open, hidden, disableDrag]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SheetControllerContext.Provider, {
|
|
value: memoValue,
|
|
children
|
|
});
|
|
}, "SheetController");
|
|
|
|
// node_modules/@tamagui/sheet/dist/esm/nativeSheet.mjs
|
|
var import_react28 = require("react");
|
|
var import_react_native_web4 = __toESM(require_cjs(), 1);
|
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
var nativeSheets = {
|
|
ios: null
|
|
};
|
|
function getNativeSheet(platform2) {
|
|
return nativeSheets[platform2];
|
|
}
|
|
__name(getNativeSheet, "getNativeSheet");
|
|
function setupNativeSheet(platform2, RNIOSModal) {
|
|
const {
|
|
ModalSheetView,
|
|
ModalSheetViewMainContent
|
|
} = RNIOSModal;
|
|
platform2 === "ios" && (nativeSheets[platform2] = (props) => {
|
|
const state = useSheetOpenState(props), providerProps = useSheetProviderProps(props, state), {
|
|
open,
|
|
setOpen
|
|
} = state, ref = (0, import_react28.useRef)(void 0);
|
|
(0, import_react28.useEffect)(() => {
|
|
open ? ref.current?.presentModal() : ref.current?.dismissModal();
|
|
}, [open]);
|
|
function setOpenInternal(next) {
|
|
props.onOpenChange?.(open), setOpen(next);
|
|
}
|
|
__name(setOpenInternal, "setOpenInternal");
|
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SheetProvider, {
|
|
setHasScrollView: emptyFn,
|
|
...providerProps,
|
|
onlyShowFrame: true,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ModalSheetView, {
|
|
ref,
|
|
onModalDidDismiss: /* @__PURE__ */ __name(() => setOpenInternal(false), "onModalDidDismiss"),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ModalSheetViewMainContent, {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native_web4.View, {
|
|
style: {
|
|
flex: 1
|
|
},
|
|
children: props.children
|
|
})
|
|
})
|
|
}), /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(YStack, {
|
|
position: "absolute",
|
|
opacity: 0,
|
|
pointerEvents: "none",
|
|
width: 0,
|
|
height: 0,
|
|
children: props.children
|
|
})]
|
|
})
|
|
});
|
|
});
|
|
}
|
|
__name(setupNativeSheet, "setupNativeSheet");
|
|
var emptyFn = /* @__PURE__ */ __name(() => {
|
|
}, "emptyFn");
|
|
|
|
// node_modules/@tamagui/dialog/dist/esm/Dialog.mjs
|
|
var React34 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
var DialogContext = (0, import_core14.createStyledContext)(
|
|
// since we always provide this we can avoid setting here
|
|
{},
|
|
"Dialog__"
|
|
);
|
|
var {
|
|
useStyledContext: useDialogContext,
|
|
Provider: DialogProvider
|
|
} = DialogContext;
|
|
var DialogTriggerFrame = (0, import_core14.styled)(import_core14.View, {
|
|
name: "DialogTrigger"
|
|
});
|
|
var DialogTrigger = DialogTriggerFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...triggerProps
|
|
} = props, isInsideButton = React34.useContext(ButtonNestingContext), context2 = useDialogContext(scope), composedTriggerRef = useComposedRefs(forwardedRef, context2.triggerRef);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ButtonNestingContext.Provider, {
|
|
value: true,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogTriggerFrame, {
|
|
tag: isInsideButton ? "span" : "button",
|
|
"aria-haspopup": "dialog",
|
|
"aria-expanded": context2.open,
|
|
"aria-controls": context2.contentId,
|
|
"data-state": getState3(context2.open),
|
|
...triggerProps,
|
|
ref: composedTriggerRef,
|
|
onPress: composeEventHandlers(props.onPress, context2.onOpenToggle)
|
|
})
|
|
});
|
|
});
|
|
var DialogPortalFrame = (0, import_core14.styled)(YStack, {
|
|
pointerEvents: "none",
|
|
tag: "dialog",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
fullscreen: true,
|
|
"$platform-web": {
|
|
// undo dialog styles
|
|
borderWidth: 0,
|
|
backgroundColor: "transparent",
|
|
color: "inherit",
|
|
maxInlineSize: "none",
|
|
margin: 0,
|
|
width: "auto",
|
|
height: "auto",
|
|
// ensure always in frame and right height
|
|
maxHeight: "100vh",
|
|
position: "fixed",
|
|
// ensure dialog inherits stacking context from portal wrapper
|
|
zIndex: 1
|
|
}
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var needsRepropagation = isAndroid || isIos && !USE_NATIVE_PORTAL;
|
|
var DialogPortalItem = /* @__PURE__ */ __name(({
|
|
context: context2,
|
|
children
|
|
}) => {
|
|
const themeName = (0, import_core14.useThemeName)(), isAdapted = useAdaptIsActive(context2.adaptScope), adaptContext = useAdaptContext(context2.adaptScope);
|
|
let content = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core14.Theme, {
|
|
name: themeName,
|
|
children
|
|
});
|
|
return needsRepropagation && (content = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ProvideAdaptContext, {
|
|
...adaptContext,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogProvider, {
|
|
...context2,
|
|
children: content
|
|
})
|
|
})), isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AdaptPortalContents, {
|
|
scope: context2.adaptScope,
|
|
children: content
|
|
}) : context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GorhomPortalItem, {
|
|
hostName: context2.modal ? "root" : context2.adaptScope,
|
|
children: content
|
|
}) : content;
|
|
}, "DialogPortalItem");
|
|
var DialogPortal = React34.forwardRef((props, forwardRef26) => {
|
|
const {
|
|
scope,
|
|
forceMount,
|
|
children,
|
|
...frameProps
|
|
} = props, dialogRef = React34.useRef(null), ref = composeRefs(dialogRef, forwardRef26), context2 = useDialogContext(scope), isMountedOrOpen = forceMount || context2.open, [isFullyHidden, setIsFullyHidden] = React34.useState(!isMountedOrOpen), isAdapted = useAdaptIsActive(context2.adaptScope), isVisible = isMountedOrOpen ? true : !isFullyHidden;
|
|
isMountedOrOpen && isFullyHidden && setIsFullyHidden(false), isWeb && useIsomorphicLayoutEffect(() => {
|
|
const node = dialogRef.current;
|
|
node instanceof HTMLDialogElement && (isVisible ? node.show?.() : node.close?.());
|
|
}, [isVisible]);
|
|
const handleExitComplete = React34.useCallback(() => {
|
|
setIsFullyHidden(true);
|
|
}, []), zIndex = (0, import_core14.getExpandedShorthand)("zIndex", props), contents = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StackZIndexContext, {
|
|
zIndex: resolveViewZIndex(zIndex),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AnimatePresence, {
|
|
passThrough: isAdapted,
|
|
onExitComplete: handleExitComplete,
|
|
children: isMountedOrOpen || isAdapted ? children : null
|
|
})
|
|
}), framedContents = (
|
|
// NOTE: we remove the inner frame, but not the portal itself
|
|
// saw a bug when we removed and re-added portals that caused stale inner contents of the portal
|
|
// seems like a React bug itself but leaving this for now as it fixes
|
|
isFullyHidden && !isAdapted ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core14.LayoutMeasurementController, {
|
|
disable: !isMountedOrOpen,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPortalFrame, {
|
|
ref,
|
|
...isWeb && isMountedOrOpen && {
|
|
"aria-modal": true
|
|
},
|
|
pointerEvents: isMountedOrOpen ? "auto" : "none",
|
|
...frameProps,
|
|
className: "_no_backdrop " + (frameProps.className || ""),
|
|
children: contents
|
|
})
|
|
})
|
|
);
|
|
return isWeb ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Portal, {
|
|
zIndex,
|
|
stackZIndex: 1e3,
|
|
passThrough: isAdapted,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PassthroughTheme, {
|
|
passThrough: isAdapted,
|
|
children: framedContents
|
|
})
|
|
}) : isAdapted ? framedContents : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPortalItem, {
|
|
context: context2,
|
|
children: framedContents
|
|
});
|
|
});
|
|
var PassthroughTheme = /* @__PURE__ */ __name(({
|
|
children,
|
|
passThrough
|
|
}) => {
|
|
const themeName = (0, import_core14.useThemeName)();
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core14.Theme, {
|
|
passThrough,
|
|
name: themeName,
|
|
forceClassName: true,
|
|
children
|
|
});
|
|
}, "PassthroughTheme");
|
|
var OVERLAY_NAME = "DialogOverlay";
|
|
var DialogOverlayFrame = (0, import_core14.styled)(Overlay, {
|
|
name: OVERLAY_NAME
|
|
});
|
|
var DialogOverlay = DialogOverlayFrame.styleable(function({
|
|
scope,
|
|
...props
|
|
}, forwardedRef) {
|
|
const context2 = useDialogContext(scope), {
|
|
forceMount = context2.forceMount,
|
|
...overlayProps
|
|
} = props, isAdapted = useAdaptIsActive(context2.adaptScope);
|
|
return !forceMount && (!context2.modal || isAdapted) ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogOverlayFrame, {
|
|
"data-state": getState3(context2.open),
|
|
pointerEvents: context2.open ? "auto" : "none",
|
|
...overlayProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var CONTENT_NAME2 = "DialogContent";
|
|
var DialogContentFrame = (0, import_core14.styled)(ThemeableStack, {
|
|
name: CONTENT_NAME2,
|
|
variants: {
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, extras) => ({}), "...size")
|
|
},
|
|
unstyled: {
|
|
false: {
|
|
position: "relative",
|
|
backgrounded: true,
|
|
padded: true,
|
|
radiused: true,
|
|
elevate: true,
|
|
zIndex: 1e5
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
size: "$true",
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var DialogContent = DialogContentFrame.styleable(function({
|
|
scope,
|
|
...props
|
|
}, forwardedRef) {
|
|
const context2 = useDialogContext(scope), {
|
|
forceMount = context2.forceMount,
|
|
...contentProps
|
|
} = props, contents = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, {
|
|
children: context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogContentModal, {
|
|
context: context2,
|
|
...contentProps,
|
|
ref: forwardedRef
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogContentNonModal, {
|
|
context: context2,
|
|
...contentProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
return !isWeb || context2.disableRemoveScroll ? contents : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(RemoveScroll, {
|
|
enabled: context2.open,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
"data-remove-scroll-container": true,
|
|
className: "_dsp_contents",
|
|
children: contents
|
|
})
|
|
});
|
|
});
|
|
var DialogContentModal = React34.forwardRef(({
|
|
children,
|
|
context: context2,
|
|
...props
|
|
}, forwardedRef) => {
|
|
const contentRef = React34.useRef(null), composedRefs = useComposedRefs(forwardedRef, context2.contentRef, contentRef);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogContentImpl, {
|
|
...props,
|
|
context: context2,
|
|
ref: composedRefs,
|
|
trapFocus: context2.open,
|
|
disableOutsidePointerEvents: true,
|
|
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
event.preventDefault(), context2.triggerRef.current?.focus();
|
|
}),
|
|
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
const originalEvent = event.detail.originalEvent, ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
(originalEvent.button === 2 || ctrlLeftClick) && event.preventDefault();
|
|
}),
|
|
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault()),
|
|
...!props.unstyled && {
|
|
outlineStyle: "none"
|
|
},
|
|
children
|
|
});
|
|
});
|
|
var DialogContentNonModal = React34.forwardRef((props, forwardedRef) => {
|
|
const hasInteractedOutsideRef = React34.useRef(false);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogContentImpl, {
|
|
...props,
|
|
ref: forwardedRef,
|
|
trapFocus: false,
|
|
disableOutsidePointerEvents: false,
|
|
onCloseAutoFocus: /* @__PURE__ */ __name((event) => {
|
|
props.onCloseAutoFocus?.(event), event.defaultPrevented || (hasInteractedOutsideRef.current || props.context.triggerRef.current?.focus(), event.preventDefault()), hasInteractedOutsideRef.current = false;
|
|
}, "onCloseAutoFocus"),
|
|
onInteractOutside: /* @__PURE__ */ __name((event) => {
|
|
props.onInteractOutside?.(event), event.defaultPrevented || (hasInteractedOutsideRef.current = true);
|
|
const target = event.target, trigger = props.context.triggerRef.current;
|
|
if (!(trigger instanceof HTMLElement)) return;
|
|
trigger.contains(target) && event.preventDefault();
|
|
}, "onInteractOutside")
|
|
});
|
|
});
|
|
var DialogContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
trapFocus,
|
|
onOpenAutoFocus,
|
|
onCloseAutoFocus,
|
|
disableOutsidePointerEvents,
|
|
onEscapeKeyDown,
|
|
onPointerDownOutside,
|
|
onFocusOutside,
|
|
onInteractOutside,
|
|
context: context2,
|
|
...contentProps
|
|
} = props, contentRef = React34.useRef(
|
|
// TODO react 19 type workaround
|
|
void 0
|
|
), composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
if (useAdaptIsActive(context2.adaptScope)) return !isWeb && !context2.open ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPortalItem, {
|
|
context: context2,
|
|
children: contentProps.children
|
|
});
|
|
const contents = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogContentFrame, {
|
|
ref: composedRefs,
|
|
id: context2.contentId,
|
|
"aria-describedby": context2.descriptionId,
|
|
"aria-labelledby": context2.titleId,
|
|
"data-state": getState3(context2.open),
|
|
...contentProps
|
|
});
|
|
return isWeb ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Dismissable, {
|
|
disableOutsidePointerEvents: context2.open && disableOutsidePointerEvents,
|
|
forceUnmount: !context2.open,
|
|
onEscapeKeyDown,
|
|
onPointerDownOutside,
|
|
onFocusOutside,
|
|
onInteractOutside,
|
|
onDismiss: /* @__PURE__ */ __name(() => context2?.onOpenChange?.(false), "onDismiss"),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FocusScope, {
|
|
loop: true,
|
|
enabled: context2.open,
|
|
trapped: trapFocus,
|
|
onMountAutoFocus: onOpenAutoFocus,
|
|
forceUnmount: !context2.open,
|
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
children: contents
|
|
})
|
|
}), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TitleWarning, {
|
|
titleId: context2.titleId
|
|
}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DescriptionWarning, {
|
|
contentRef,
|
|
descriptionId: context2.descriptionId
|
|
})]
|
|
})]
|
|
}) : contents;
|
|
});
|
|
var DialogTitleFrame = (0, import_core14.styled)(H2, {
|
|
name: "DialogTitle"
|
|
});
|
|
var DialogTitle = DialogTitleFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...titleProps
|
|
} = props, context2 = useDialogContext(scope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogTitleFrame, {
|
|
id: context2.titleId,
|
|
...titleProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var DialogDescriptionFrame = (0, import_core14.styled)(Paragraph, {
|
|
name: "DialogDescription"
|
|
});
|
|
var DialogDescription = DialogDescriptionFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...descriptionProps
|
|
} = props, context2 = useDialogContext(scope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogDescriptionFrame, {
|
|
id: context2.descriptionId,
|
|
...descriptionProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var CLOSE_NAME = "DialogClose";
|
|
var DialogCloseFrame = (0, import_core14.styled)(import_core14.View, {
|
|
name: CLOSE_NAME,
|
|
tag: "button"
|
|
});
|
|
var DialogClose = DialogCloseFrame.styleable((props, forwardedRef) => {
|
|
const {
|
|
scope,
|
|
displayWhenAdapted,
|
|
...closeProps
|
|
} = props, context2 = useDialogContext(scope), isAdapted = useAdaptIsActive(context2.adaptScope), isInsideButton = React34.useContext(ButtonNestingContext);
|
|
return isAdapted && !displayWhenAdapted ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogCloseFrame, {
|
|
accessibilityLabel: "Dialog Close",
|
|
tag: isInsideButton ? "span" : "button",
|
|
...closeProps,
|
|
ref: forwardedRef,
|
|
onPress: composeEventHandlers(props.onPress, () => {
|
|
context2.onOpenChange(false);
|
|
})
|
|
});
|
|
});
|
|
function getState3(open) {
|
|
return open ? "open" : "closed";
|
|
}
|
|
__name(getState3, "getState");
|
|
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
var [DialogWarningProvider, useWarningContext] = createContext7(TITLE_WARNING_NAME, {
|
|
contentName: CONTENT_NAME2,
|
|
titleName: "DialogTitle",
|
|
docsSlug: "dialog"
|
|
});
|
|
var TitleWarning = /* @__PURE__ */ __name(({
|
|
titleId
|
|
}) => {
|
|
if (process.env.NODE_ENV === "development") {
|
|
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME), MESSAGE = `\`${titleWarningContext.contentName}\` wants a \`${titleWarningContext.titleName}\` to be accessible. If you want to hide the \`${titleWarningContext.titleName}\`, wrap it with <VisuallyHidden />.`;
|
|
React34.useEffect(() => {
|
|
isWeb && titleId && (document.getElementById(titleId) || console.warn(MESSAGE));
|
|
}, [MESSAGE, titleId]);
|
|
}
|
|
return null;
|
|
}, "TitleWarning");
|
|
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
var DescriptionWarning = /* @__PURE__ */ __name(({
|
|
contentRef,
|
|
descriptionId
|
|
}) => {
|
|
if (process.env.NODE_ENV === "development") {
|
|
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
|
|
React34.useEffect(() => {
|
|
if (!isWeb) return;
|
|
const contentNode = contentRef.current;
|
|
if (!(contentNode instanceof HTMLElement)) return;
|
|
const describedById = contentNode.getAttribute("aria-describedby");
|
|
descriptionId && describedById && (document.getElementById(descriptionId) || console.warn(MESSAGE));
|
|
}, [MESSAGE, contentRef, descriptionId]);
|
|
}
|
|
return null;
|
|
}, "DescriptionWarning");
|
|
var Dialog = withStaticProperties(React34.forwardRef(function(props, ref) {
|
|
const {
|
|
scope = "",
|
|
children,
|
|
open: openProp,
|
|
defaultOpen = false,
|
|
onOpenChange,
|
|
modal = true,
|
|
disableRemoveScroll = false
|
|
} = props, baseId = React34.useId(), dialogId = `Dialog-${scope}-${baseId}`, contentId = `${dialogId}-content`, titleId = `${dialogId}-title`, descriptionId = `${dialogId}-description`, triggerRef = React34.useRef(null), contentRef = React34.useRef(null), [open, setOpen] = useControllableState({
|
|
prop: openProp,
|
|
defaultProp: defaultOpen,
|
|
onChange: onOpenChange
|
|
}), onOpenToggle = React34.useCallback(() => {
|
|
setOpen((prevOpen) => !prevOpen);
|
|
}, [setOpen]), adaptScope = `DialogAdapt${scope}`, context2 = {
|
|
dialogScope: scope,
|
|
adaptScope,
|
|
triggerRef,
|
|
contentRef,
|
|
contentId,
|
|
titleId,
|
|
descriptionId,
|
|
open,
|
|
onOpenChange: setOpen,
|
|
onOpenToggle,
|
|
modal,
|
|
disableRemoveScroll
|
|
};
|
|
return React34.useImperativeHandle(ref, () => ({
|
|
open: setOpen
|
|
}), [setOpen]), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AdaptParent, {
|
|
scope: adaptScope,
|
|
portal: {
|
|
forwardProps: props
|
|
},
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogProvider, {
|
|
scope,
|
|
...context2,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogSheetController, {
|
|
onOpenChange: setOpen,
|
|
scope,
|
|
children
|
|
})
|
|
})
|
|
});
|
|
}), {
|
|
Trigger: DialogTrigger,
|
|
Portal: DialogPortal,
|
|
Overlay: DialogOverlay,
|
|
Content: DialogContent,
|
|
Title: DialogTitle,
|
|
Description: DialogDescription,
|
|
Close: DialogClose,
|
|
Sheet: Sheet.Controlled,
|
|
FocusScope: FocusScopeControllerComponent,
|
|
Adapt
|
|
});
|
|
var DialogSheetController = /* @__PURE__ */ __name((props) => {
|
|
const context2 = useDialogContext(props.scope), isAdapted = useAdaptIsActive(context2.adaptScope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SheetController, {
|
|
onOpenChange: /* @__PURE__ */ __name((val) => {
|
|
isAdapted && props.onOpenChange?.(val);
|
|
}, "onOpenChange"),
|
|
open: context2.open,
|
|
hidden: !isAdapted,
|
|
children: props.children
|
|
});
|
|
}, "DialogSheetController");
|
|
|
|
// node_modules/@tamagui/alert-dialog/dist/esm/AlertDialog.mjs
|
|
var React35 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
var getAlertDialogScope = /* @__PURE__ */ __name((scope) => scope, "getAlertDialogScope");
|
|
var ROOT_NAME = "AlertDialog";
|
|
var TRIGGER_NAME2 = "AlertDialogTrigger";
|
|
var NativeAlertDialogTriggerFrame = (0, import_core15.styled)(import_core15.View, {
|
|
name: TRIGGER_NAME2
|
|
});
|
|
var AlertDialogTrigger = NativeAlertDialogTriggerFrame.styleable(function(props, forwardedRef) {
|
|
if (props.__native) {
|
|
const {
|
|
__native,
|
|
onPress,
|
|
__onPress,
|
|
...rest
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(NativeAlertDialogTriggerFrame, {
|
|
...rest,
|
|
onPress: composeEventHandlers(onPress, __onPress)
|
|
});
|
|
}
|
|
const {
|
|
scope,
|
|
...triggerProps
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTrigger, {
|
|
scope: getAlertDialogScope(scope),
|
|
...triggerProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var AlertDialogPortal = /* @__PURE__ */ __name(function(props) {
|
|
const {
|
|
scope,
|
|
...portalProps
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogPortal, {
|
|
scope: getAlertDialogScope(scope),
|
|
...portalProps
|
|
});
|
|
}, "AlertDialogPortal");
|
|
var OVERLAY_NAME2 = "AlertDialogOverlay";
|
|
var AlertDialogOverlayFrame = (0, import_core15.styled)(DialogOverlayFrame, {
|
|
name: OVERLAY_NAME2
|
|
});
|
|
var AlertDialogOverlay = AlertDialogOverlayFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...overlayProps
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, {
|
|
scope: getAlertDialogScope(scope),
|
|
...overlayProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var CONTENT_NAME3 = "AlertDialogContent";
|
|
var {
|
|
Provider: AlertDialogContextProvider,
|
|
useStyledContext: useAlertDialogContentContext
|
|
} = (0, import_core15.createStyledContext)({}, "AlertDialogContext");
|
|
var AlertDialogContent = React35.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
children,
|
|
...contentProps
|
|
} = props, dialogScope = getAlertDialogScope(scope), contentRef = React35.useRef(null), composedRefs = useComposedRefs(forwardedRef, contentRef), cancelRef = React35.useRef(null);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogWarningProvider, {
|
|
contentName: CONTENT_NAME3,
|
|
titleName: TITLE_NAME,
|
|
docsSlug: "alert-dialog",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AlertDialogContextProvider, {
|
|
scope,
|
|
cancelRef,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, {
|
|
role: "alertdialog",
|
|
"aria-modal": true,
|
|
scope: dialogScope,
|
|
...contentProps,
|
|
ref: composedRefs,
|
|
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
|
|
event.preventDefault(), isWeb && cancelRef.current?.focus({
|
|
preventScroll: true
|
|
});
|
|
}),
|
|
onPointerDownOutside: /* @__PURE__ */ __name((event) => event.preventDefault(), "onPointerDownOutside"),
|
|
onInteractOutside: /* @__PURE__ */ __name((event) => event.preventDefault(), "onInteractOutside"),
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core15.Slottable, {
|
|
children
|
|
}), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DescriptionWarning2, {
|
|
contentRef
|
|
})]
|
|
})
|
|
})
|
|
});
|
|
});
|
|
var TITLE_NAME = "AlertDialogTitle";
|
|
var AlertDialogTitleFrame = (0, import_core15.styled)(import_core15.View, {
|
|
name: TITLE_NAME
|
|
});
|
|
var AlertDialogTitle = AlertDialogTitleFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...titleProps
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, {
|
|
scope: getAlertDialogScope(scope),
|
|
...titleProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var DESCRIPTION_NAME = "AlertDialogDescription";
|
|
var AlertDialogDescriptionFrame = (0, import_core15.styled)(import_core15.View, {
|
|
name: DESCRIPTION_NAME
|
|
});
|
|
var AlertDialogDescription = AlertDialogDescriptionFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...descriptionProps
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogDescription, {
|
|
scope: getAlertDialogScope(scope),
|
|
...descriptionProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var ACTION_NAME = "AlertDialogAction";
|
|
var AlertDialogActionFrame = (0, import_core15.styled)(import_core15.View, {
|
|
name: ACTION_NAME
|
|
});
|
|
var AlertDialogAction = AlertDialogActionFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...actionProps
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogClose, {
|
|
scope: getAlertDialogScope(scope),
|
|
...actionProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var CANCEL_NAME = "AlertDialogCancel";
|
|
var AlertDialogCancelFrame = (0, import_core15.styled)(import_core15.View, {
|
|
name: CANCEL_NAME
|
|
});
|
|
var AlertDialogCancel = AlertDialogCancelFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...cancelProps
|
|
} = props, {
|
|
cancelRef
|
|
} = useAlertDialogContentContext(scope), ref = useComposedRefs(forwardedRef, cancelRef);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogClose, {
|
|
scope: getAlertDialogScope(scope),
|
|
...cancelProps,
|
|
ref
|
|
});
|
|
});
|
|
var DescriptionWarning2 = /* @__PURE__ */ __name(({
|
|
contentRef
|
|
}) => (process.env.NODE_ENV === "development" && React35.useEffect(() => {
|
|
if (!isWeb) return;
|
|
document.getElementById(
|
|
// @ts-ignore
|
|
contentRef.current?.getAttribute("aria-describedby")
|
|
) || console.warn(`\`${CONTENT_NAME3}\` requires a description for the component to be accessible for screen reader users.
|
|
|
|
You can add a description to the \`${CONTENT_NAME3}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
|
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME3}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
|
|
For more information, see https://tamagui.dev/docs/components/alert-dialog`);
|
|
}, [contentRef]), null), "DescriptionWarning");
|
|
var AlertDialogInner = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
scope,
|
|
native,
|
|
...alertDialogProps
|
|
} = props, dialogScope = getAlertDialogScope(scope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, {
|
|
scope: dialogScope,
|
|
...alertDialogProps,
|
|
modal: true
|
|
});
|
|
}, "AlertDialogInner");
|
|
var AlertDialog = withStaticProperties(AlertDialogInner, {
|
|
Trigger: AlertDialogTrigger,
|
|
Portal: AlertDialogPortal,
|
|
Overlay: AlertDialogOverlay,
|
|
Content: AlertDialogContent,
|
|
Action: AlertDialogAction,
|
|
Cancel: AlertDialogCancel,
|
|
Title: AlertDialogTitle,
|
|
Description: AlertDialogDescription
|
|
});
|
|
AlertDialog.displayName = ROOT_NAME;
|
|
|
|
// node_modules/@tamagui/avatar/dist/esm/Avatar.mjs
|
|
var import_core17 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/image/dist/esm/Image.mjs
|
|
var import_react29 = __toESM(require("react"), 1);
|
|
var import_core16 = require("@tamagui/core");
|
|
var import_react_native_web5 = __toESM(require_cjs(), 1);
|
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
var StyledImage = (0, import_core16.styled)(import_react_native_web5.Image, {
|
|
name: "Image"
|
|
});
|
|
var hasWarned = false;
|
|
var Image = StyledImage.styleable((inProps, ref) => {
|
|
const [props, style] = (0, import_core16.usePropsAndStyle)(inProps), {
|
|
src,
|
|
source,
|
|
objectFit,
|
|
...rest
|
|
} = props;
|
|
process.env.NODE_ENV === "development" && typeof src == "string" && (typeof props.width == "string" && props.width[0] !== "$" || typeof props.height == "string" && props.height[0] !== "$") && (hasWarned || (hasWarned = true, console.warn('React Native expects a numerical width/height. If you want to use a percent you must define the "source" prop with width, height, and uri.')));
|
|
let finalSource = typeof src == "string" ? {
|
|
uri: src,
|
|
...isWeb && {
|
|
width: props.width || style?.width,
|
|
height: props.height || style?.height
|
|
}
|
|
} : source ?? src;
|
|
return finalSource && typeof finalSource == "object" && (process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && import_react29.default.useEffect(() => {
|
|
async function run() {
|
|
if (typeof src == "string") try {
|
|
await fetch(src).then((res) => res.text());
|
|
} catch {
|
|
console.error(`Error loading image: ${src}`, {
|
|
props
|
|
});
|
|
}
|
|
}
|
|
__name(run, "run");
|
|
run();
|
|
}, [src]), finalSource.default && (finalSource = finalSource.default)), /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native_web5.Image, {
|
|
resizeMode: objectFit,
|
|
ref,
|
|
source: finalSource,
|
|
style,
|
|
...rest
|
|
});
|
|
});
|
|
Image.getSize = import_react_native_web5.Image.getSize;
|
|
Image.getSizeWithHeaders = import_react_native_web5.Image.getSizeWithHeaders;
|
|
Image.prefetch = import_react_native_web5.Image.prefetch;
|
|
Image.prefetchWithMetadata = import_react_native_web5.Image.prefetchWithMetadata;
|
|
Image.abortPrefetch = import_react_native_web5.Image.abortPrefetch;
|
|
Image.queryCache = import_react_native_web5.Image.queryCache;
|
|
|
|
// node_modules/@tamagui/shapes/dist/esm/Square.mjs
|
|
var import_web9 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/shapes/dist/esm/getShapeSize.mjs
|
|
var getShapeSize = /* @__PURE__ */ __name((size4, {
|
|
tokens
|
|
}) => {
|
|
const width = tokens.size[size4] ?? size4, height = tokens.size[size4] ?? size4;
|
|
return {
|
|
width,
|
|
height,
|
|
minWidth: width,
|
|
maxWidth: width,
|
|
maxHeight: height,
|
|
minHeight: height
|
|
};
|
|
}, "getShapeSize");
|
|
|
|
// node_modules/@tamagui/shapes/dist/esm/Square.mjs
|
|
var Square = (0, import_web9.styled)(ThemeableStack, {
|
|
name: "Square",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
variants: {
|
|
size: {
|
|
"...size": getShapeSize,
|
|
":number": getShapeSize
|
|
}
|
|
}
|
|
}, {
|
|
memo: true
|
|
});
|
|
|
|
// node_modules/@tamagui/shapes/dist/esm/Circle.mjs
|
|
var import_web10 = require("@tamagui/core");
|
|
var Circle = (0, import_web10.styled)(Square, {
|
|
name: "Circle",
|
|
circular: true
|
|
});
|
|
|
|
// node_modules/@tamagui/avatar/dist/esm/Avatar.mjs
|
|
var React37 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
var AVATAR_NAME = "Avatar";
|
|
var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
|
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
var IMAGE_NAME = "AvatarImage";
|
|
var AvatarImage = React37.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeAvatar,
|
|
src,
|
|
onLoadingStatusChange = /* @__PURE__ */ __name(() => {
|
|
}, "onLoadingStatusChange"),
|
|
...imageProps
|
|
} = props, context2 = useAvatarContext(IMAGE_NAME, __scopeAvatar), [status, setStatus] = React37.useState("idle"), shapeSize = (0, import_core17.getVariableValue)(getShapeSize(
|
|
context2.size,
|
|
// @ts-expect-error
|
|
{
|
|
tokens: (0, import_core17.getTokens)()
|
|
}
|
|
)?.width);
|
|
return React37.useEffect(() => {
|
|
setStatus(src ? "idle" : "error");
|
|
}, [JSON.stringify(src)]), React37.useEffect(() => {
|
|
onLoadingStatusChange(status), context2.onImageLoadingStatusChange(status);
|
|
}, [status]), src ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(YStack, {
|
|
fullscreen: true,
|
|
zIndex: 1,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Image, {
|
|
fullscreen: true,
|
|
...typeof shapeSize == "number" && !Number.isNaN(shapeSize) && {
|
|
width: shapeSize,
|
|
height: shapeSize
|
|
},
|
|
...imageProps,
|
|
ref: forwardedRef,
|
|
src,
|
|
onError: /* @__PURE__ */ __name(() => {
|
|
setStatus("error");
|
|
}, "onError"),
|
|
onLoad: /* @__PURE__ */ __name(() => {
|
|
setStatus("loaded");
|
|
}, "onLoad")
|
|
})
|
|
}) : null;
|
|
});
|
|
AvatarImage.displayName = IMAGE_NAME;
|
|
var FALLBACK_NAME = "AvatarFallback";
|
|
var AvatarFallbackFrame = (0, import_core17.styled)(YStack, {
|
|
name: FALLBACK_NAME,
|
|
position: "absolute",
|
|
fullscreen: true,
|
|
zIndex: 0
|
|
});
|
|
var AvatarFallback = AvatarFallbackFrame.extractable(React37.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeAvatar,
|
|
delayMs,
|
|
...fallbackProps
|
|
} = props, context2 = useAvatarContext(FALLBACK_NAME, __scopeAvatar), [canRender, setCanRender] = React37.useState(delayMs === void 0);
|
|
return React37.useEffect(() => {
|
|
if (delayMs !== void 0) {
|
|
const timerId = setTimeout(() => setCanRender(true), delayMs);
|
|
return () => clearTimeout(timerId);
|
|
}
|
|
}, [delayMs]), canRender && context2.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AvatarFallbackFrame, {
|
|
...fallbackProps,
|
|
ref: forwardedRef
|
|
}) : null;
|
|
}));
|
|
AvatarFallback.displayName = FALLBACK_NAME;
|
|
var AvatarFrame = (0, import_core17.styled)(Square, {
|
|
name: AVATAR_NAME,
|
|
position: "relative",
|
|
overflow: "hidden"
|
|
});
|
|
var Avatar = withStaticProperties(React37.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeAvatar,
|
|
size: size4 = "$true",
|
|
...avatarProps
|
|
} = props, [imageLoadingStatus, setImageLoadingStatus] = React37.useState("idle");
|
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AvatarProvider, {
|
|
size: size4,
|
|
scope: __scopeAvatar,
|
|
imageLoadingStatus,
|
|
onImageLoadingStatusChange: setImageLoadingStatus,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AvatarFrame, {
|
|
size: size4,
|
|
...avatarProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
}), {
|
|
Image: AvatarImage,
|
|
Fallback: AvatarFallback
|
|
});
|
|
Avatar.displayName = AVATAR_NAME;
|
|
|
|
// node_modules/@tamagui/font-size/dist/esm/getFontSize.mjs
|
|
var import_core18 = require("@tamagui/core");
|
|
var getFontSize = /* @__PURE__ */ __name((inSize, opts) => {
|
|
const res = getFontSizeVariable(inSize, opts);
|
|
return (0, import_core18.isVariable)(res) ? +res.val : res ? +res : 16;
|
|
}, "getFontSize");
|
|
var getFontSizeVariable = /* @__PURE__ */ __name((inSize, opts) => {
|
|
const token = getFontSizeToken(inSize, opts);
|
|
if (!token) return inSize;
|
|
const conf = (0, import_core18.getConfig)();
|
|
return conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size[token];
|
|
}, "getFontSizeVariable");
|
|
var getFontSizeToken = /* @__PURE__ */ __name((inSize, opts) => {
|
|
if (typeof inSize == "number") return null;
|
|
const relativeSize = opts?.relativeSize || 0, conf = (0, import_core18.getConfig)(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size || // fallback to size tokens
|
|
conf.tokensParsed.size, size4 = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize);
|
|
let foundIndex = sizeTokens.indexOf(size4);
|
|
foundIndex === -1 && size4.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size4.replace(".5", ""))), process.env.NODE_ENV === "development" && foundIndex === -1 && console.warn("No font size found", size4, opts, "in size tokens", sizeTokens);
|
|
const tokenIndex = Math.min(Math.max(0, foundIndex + relativeSize), sizeTokens.length - 1);
|
|
return sizeTokens[tokenIndex] ?? size4;
|
|
}, "getFontSizeToken");
|
|
|
|
// node_modules/@tamagui/helpers-tamagui/dist/esm/prevent.mjs
|
|
var prevent = /* @__PURE__ */ __name((e) => [e.preventDefault(), e.stopPropagation()], "prevent");
|
|
|
|
// node_modules/@tamagui/helpers-tamagui/dist/esm/useCurrentColor.mjs
|
|
var import_web11 = require("@tamagui/core");
|
|
var useCurrentColor = /* @__PURE__ */ __name((colorProp) => {
|
|
const theme = (0, import_web11.useTheme)();
|
|
return colorProp ? (0, import_web11.getVariable)(colorProp) : theme[colorProp]?.get() || theme.color?.get();
|
|
}, "useCurrentColor");
|
|
|
|
// node_modules/@tamagui/helpers-tamagui/dist/esm/useGetThemedIcon.mjs
|
|
var import_react30 = __toESM(require("react"), 1);
|
|
var useGetThemedIcon = /* @__PURE__ */ __name((props) => {
|
|
const color = useCurrentColor(props.color);
|
|
return (el) => el && (import_react30.default.isValidElement(el) ? import_react30.default.cloneElement(el, {
|
|
...props,
|
|
color,
|
|
// @ts-expect-error
|
|
...el.props
|
|
}) : import_react30.default.createElement(el, props));
|
|
}, "useGetThemedIcon");
|
|
|
|
// node_modules/@tamagui/button/dist/esm/Button.mjs
|
|
var import_web12 = require("@tamagui/core");
|
|
var import_react31 = require("react");
|
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
var ButtonContext = (0, import_web12.createStyledContext)({
|
|
// keeping these here means they work with styled() passing down color to text
|
|
color: void 0,
|
|
ellipse: void 0,
|
|
fontFamily: void 0,
|
|
fontSize: void 0,
|
|
fontStyle: void 0,
|
|
fontWeight: void 0,
|
|
letterSpacing: void 0,
|
|
maxFontSizeMultiplier: void 0,
|
|
size: void 0,
|
|
textAlign: void 0,
|
|
variant: void 0
|
|
});
|
|
var BUTTON_NAME = "Button";
|
|
var ButtonFrame = (0, import_web12.styled)(ThemeableStack, {
|
|
name: BUTTON_NAME,
|
|
tag: "button",
|
|
context: ButtonContext,
|
|
role: "button",
|
|
focusable: true,
|
|
// forces runtime pressStyle so it passes through context text colors
|
|
disableClassName: true,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
flexWrap: "nowrap",
|
|
flexDirection: "row",
|
|
cursor: "pointer",
|
|
hoverTheme: true,
|
|
pressTheme: true,
|
|
backgrounded: true,
|
|
borderWidth: 1,
|
|
borderColor: "transparent",
|
|
focusVisibleStyle: {
|
|
outlineColor: "$outlineColor",
|
|
outlineStyle: "solid",
|
|
outlineWidth: 2
|
|
}
|
|
}
|
|
},
|
|
variant: {
|
|
outlined: {
|
|
backgroundColor: "transparent",
|
|
borderWidth: 2,
|
|
borderColor: "$borderColor",
|
|
hoverStyle: {
|
|
backgroundColor: "transparent",
|
|
borderColor: "$borderColorHover"
|
|
},
|
|
pressStyle: {
|
|
backgroundColor: "transparent",
|
|
borderColor: "$borderColorPress"
|
|
},
|
|
focusVisibleStyle: {
|
|
backgroundColor: "transparent",
|
|
borderColor: "$borderColorFocus"
|
|
}
|
|
}
|
|
},
|
|
size: {
|
|
"...size": getButtonSized,
|
|
":number": getButtonSized
|
|
},
|
|
disabled: {
|
|
true: {
|
|
pointerEvents: "none"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ButtonText = (0, import_web12.styled)(SizableText2, {
|
|
name: "Button",
|
|
context: ButtonContext,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
userSelect: "none",
|
|
cursor: "pointer",
|
|
// flexGrow 1 leads to inconsistent native style where text pushes to start of view
|
|
flexGrow: 0,
|
|
flexShrink: 1,
|
|
ellipse: true,
|
|
color: "$color"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ButtonIcon = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
children,
|
|
scaleIcon = 1
|
|
} = props, {
|
|
size: size4,
|
|
color
|
|
} = (0, import_react31.useContext)(ButtonContext), iconSize = (typeof size4 == "number" ? size4 * 0.5 : getFontSize(size4)) * scaleIcon;
|
|
return useGetThemedIcon({
|
|
size: iconSize,
|
|
color
|
|
})(children);
|
|
}, "ButtonIcon");
|
|
var ButtonComponent = ButtonFrame.styleable(function(props, ref) {
|
|
const {
|
|
props: buttonProps
|
|
} = useButton(props);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ButtonFrame, {
|
|
"data-disable-theme": true,
|
|
...buttonProps,
|
|
ref
|
|
});
|
|
});
|
|
var Button2 = withStaticProperties(ButtonComponent, {
|
|
Text: ButtonText,
|
|
Icon: ButtonIcon
|
|
});
|
|
function useButton({
|
|
textProps,
|
|
...propsIn
|
|
}, {
|
|
Text: Text6 = Button2.Text
|
|
} = {
|
|
Text: Button2.Text
|
|
}) {
|
|
const isNested = (0, import_react31.useContext)(ButtonNestingContext), propsActive = (0, import_web12.useProps)(propsIn, {
|
|
noNormalize: true,
|
|
noExpand: true
|
|
}), {
|
|
icon,
|
|
iconAfter,
|
|
space,
|
|
spaceFlex,
|
|
scaleIcon = 1,
|
|
scaleSpace = 0.66,
|
|
separator,
|
|
noTextWrap,
|
|
fontFamily,
|
|
fontSize,
|
|
fontWeight,
|
|
fontStyle,
|
|
letterSpacing,
|
|
tag,
|
|
ellipse,
|
|
maxFontSizeMultiplier,
|
|
...restProps
|
|
} = propsActive, size4 = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size4 == "number" ? size4 * 0.5 : getFontSize(size4, {
|
|
font: fontFamily?.[0] === "$" ? fontFamily : void 0
|
|
})) * scaleIcon, getThemedIcon = useGetThemedIcon({
|
|
size: iconSize,
|
|
color
|
|
}), [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon), spaceSize = space ?? (0, import_web12.getVariableValue)(iconSize) * scaleSpace, contents = noTextWrap ? [propsIn.children] : wrapChildrenInText(Text6, {
|
|
children: propsIn.children,
|
|
color,
|
|
fontFamily,
|
|
fontSize,
|
|
textProps,
|
|
fontWeight,
|
|
fontStyle,
|
|
letterSpacing,
|
|
ellipse,
|
|
maxFontSizeMultiplier
|
|
}, Text6 === ButtonText && propsActive.unstyled !== true ? {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1",
|
|
size: size4
|
|
} : void 0), inner2 = (0, import_web12.spacedChildren)({
|
|
// a bit arbitrary but scaling to font size is necessary so long as button does
|
|
space: spaceSize === false ? 0 : spaceSize == true ? "$true" : spaceSize,
|
|
spaceFlex,
|
|
ensureKeys: true,
|
|
separator,
|
|
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
// for keys to stay the same we keep indices as similar a possible
|
|
// so even if icons are undefined we still pass them
|
|
children: [themedIcon, ...contents, themedIconAfter]
|
|
}), props = {
|
|
size: size4,
|
|
...propsIn.disabled && {
|
|
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
focusable: void 0,
|
|
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
focusVisibleStyle: {
|
|
borderColor: "$background"
|
|
}
|
|
},
|
|
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
tag: tag ?? (isNested ? "span" : (
|
|
// defaults to <a /> when accessibilityRole = link
|
|
// see https://github.com/tamagui/tamagui/issues/505
|
|
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"
|
|
)),
|
|
...restProps,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ButtonNestingContext.Provider, {
|
|
value: true,
|
|
children: inner2
|
|
}),
|
|
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
disableClassName: true
|
|
};
|
|
return {
|
|
spaceSize,
|
|
isNested,
|
|
props
|
|
};
|
|
}
|
|
__name(useButton, "useButton");
|
|
|
|
// node_modules/@tamagui/card/dist/esm/Card.mjs
|
|
var import_web13 = require("@tamagui/core");
|
|
var CardContext = (0, import_web13.createStyledContext)({
|
|
size: "$true"
|
|
});
|
|
var CardFrame = (0, import_web13.styled)(ThemeableStack, {
|
|
name: "Card",
|
|
context: CardContext,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
backgroundColor: "$background",
|
|
position: "relative"
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, {
|
|
tokens
|
|
}) => ({
|
|
borderRadius: tokens.radius[val] ?? val
|
|
}), "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var CardHeader = (0, import_web13.styled)(ThemeableStack, {
|
|
name: "CardHeader",
|
|
context: CardContext,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
zIndex: 10,
|
|
backgroundColor: "transparent",
|
|
marginBottom: "auto"
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, {
|
|
tokens
|
|
}) => ({
|
|
padding: tokens.space[val] ?? val
|
|
}), "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var CardFooter = (0, import_web13.styled)(CardHeader, {
|
|
name: "CardFooter",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
zIndex: 5,
|
|
flexDirection: "row",
|
|
marginTop: "auto",
|
|
marginBottom: 0
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var CardBackground = (0, import_web13.styled)(ThemeableStack, {
|
|
name: "CardBackground",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
zIndex: 0,
|
|
fullscreen: true,
|
|
overflow: "hidden",
|
|
pointerEvents: "none",
|
|
padding: 0
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var Card = (0, import_web13.withStaticProperties)(CardFrame, {
|
|
Header: CardHeader,
|
|
Footer: CardFooter,
|
|
Background: CardBackground
|
|
});
|
|
|
|
// node_modules/@tamagui/checkbox/dist/esm/Checkbox.mjs
|
|
var import_core20 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/checkbox/dist/esm/CheckboxStyledContext.mjs
|
|
var import_core19 = require("@tamagui/core");
|
|
var CheckboxStyledContext = (0, import_core19.createStyledContext)({
|
|
size: "$true",
|
|
scaleIcon: 1
|
|
});
|
|
|
|
// node_modules/@tamagui/checkbox/dist/esm/Checkbox.mjs
|
|
var INDICATOR_NAME = "CheckboxIndicator";
|
|
var CheckboxIndicatorFrame = (0, import_core20.styled)(ThemeableStack, {
|
|
// use Checkbox for easier themes
|
|
name: INDICATOR_NAME,
|
|
context: CheckboxStyledContext,
|
|
variants: {
|
|
unstyled: {
|
|
false: {}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var CHECKBOX_NAME = "Checkbox";
|
|
var CheckboxFrame = (0, import_core20.styled)(ThemeableStack, {
|
|
name: CHECKBOX_NAME,
|
|
tag: "button",
|
|
context: CheckboxStyledContext,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
backgroundColor: "$background",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
pressTheme: true,
|
|
focusable: true,
|
|
borderWidth: 1,
|
|
borderColor: "$borderColor",
|
|
hoverStyle: {
|
|
borderColor: "$borderColorHover"
|
|
},
|
|
focusStyle: {
|
|
borderColor: "$borderColorFocus"
|
|
},
|
|
focusVisibleStyle: {
|
|
outlineStyle: "solid",
|
|
outlineWidth: 2,
|
|
outlineColor: "$outlineColor"
|
|
}
|
|
}
|
|
},
|
|
disabled: {
|
|
true: {
|
|
pointerEvents: "none",
|
|
userSelect: "none",
|
|
cursor: "not-allowed",
|
|
hoverStyle: {
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background"
|
|
},
|
|
pressStyle: {
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background"
|
|
},
|
|
focusStyle: {
|
|
outlineWidth: 0
|
|
}
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val) => ({
|
|
borderRadius: (0, import_core20.getVariableValue)(getSize(val)) / 8
|
|
}), "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/checkbox/dist/esm/createCheckbox.mjs
|
|
var import_react34 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/focusable/dist/esm/registerFocusable.mjs
|
|
var registerFocusable = /* @__PURE__ */ __name((id, input) => () => {
|
|
}, "registerFocusable");
|
|
var focusFocusable = /* @__PURE__ */ __name((id) => {
|
|
}, "focusFocusable");
|
|
|
|
// node_modules/@tamagui/focusable/dist/esm/focusableInputHOC.mjs
|
|
var import_web14 = require("@tamagui/core");
|
|
var import_react32 = __toESM(require("react"), 1);
|
|
function useFocusable({
|
|
isInput,
|
|
props,
|
|
ref
|
|
}) {
|
|
const {
|
|
id,
|
|
onChangeText,
|
|
value,
|
|
defaultValue: defaultValue2
|
|
} = props, inputValue = import_react32.default.useRef(value || defaultValue2 || ""), unregisterFocusable = import_react32.default.useRef(void 0), focusAndSelect = import_react32.default.useCallback((input) => {
|
|
input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
|
|
}, []), registerFocusableHandler = import_react32.default.useCallback((input) => {
|
|
!id || !input || (unregisterFocusable.current?.(), unregisterFocusable.current = registerFocusable(id, {
|
|
focus: input.focus,
|
|
...isInput && {
|
|
focusAndSelect: /* @__PURE__ */ __name(() => focusAndSelect(input), "focusAndSelect")
|
|
}
|
|
}));
|
|
}, [id, isInput, focusAndSelect]), inputRef = import_react32.default.useCallback((input) => {
|
|
input && registerFocusableHandler(input);
|
|
}, [registerFocusableHandler]), handleChangeText = (0, import_web14.useEvent)((value2) => {
|
|
inputValue.current = value2, onChangeText?.(value2);
|
|
});
|
|
return import_react32.default.useEffect(() => () => {
|
|
unregisterFocusable.current?.();
|
|
}, []), {
|
|
ref: import_react32.default.useMemo(() => composeRefs(ref, inputRef), [ref, inputRef]),
|
|
onChangeText: handleChangeText
|
|
};
|
|
}
|
|
__name(useFocusable, "useFocusable");
|
|
|
|
// node_modules/@tamagui/label/dist/esm/Label.mjs
|
|
var import_web15 = require("@tamagui/core");
|
|
var React40 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
var NAME = "Label";
|
|
var [LabelProvider, useLabelContextImpl] = createContext7(NAME, {
|
|
id: void 0,
|
|
controlRef: {
|
|
current: null
|
|
}
|
|
});
|
|
var LabelFrame = (0, import_web15.styled)(SizableText2, {
|
|
name: "Label",
|
|
tag: "label",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
color: "$color",
|
|
backgroundColor: "transparent",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
userSelect: "none",
|
|
cursor: "default",
|
|
pressStyle: {
|
|
color: "$colorPress"
|
|
}
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, extras) => {
|
|
const buttonHeight = getButtonSized(val, extras)?.height;
|
|
return {
|
|
...getFontSized(val, extras),
|
|
lineHeight: buttonHeight ? extras.tokens.size[buttonHeight] : void 0
|
|
};
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var LabelComponent = React40.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
htmlFor,
|
|
id: idProp,
|
|
...labelProps
|
|
} = props, controlRef = React40.useRef(null), ref = React40.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), backupId = React40.useId(), id = idProp ?? backupId;
|
|
return isWeb && React40.useEffect(() => {
|
|
if (htmlFor) {
|
|
const element = document.getElementById(htmlFor);
|
|
if (ref.current && element) {
|
|
const getAriaLabel = /* @__PURE__ */ __name(() => element.getAttribute("aria-labelledby"), "getAriaLabel"), ariaLabelledBy = [id, getAriaLabel()].filter(Boolean).join(" ");
|
|
return element.setAttribute("aria-labelledby", ariaLabelledBy), controlRef.current = element, () => {
|
|
if (!id) return;
|
|
const ariaLabelledBy2 = getAriaLabel()?.replace(id, "");
|
|
ariaLabelledBy2 === "" ? element.removeAttribute("aria-labelledby") : ariaLabelledBy2 && element.setAttribute("aria-labelledby", ariaLabelledBy2);
|
|
};
|
|
}
|
|
}
|
|
}, [id, htmlFor]), /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelProvider, {
|
|
id,
|
|
controlRef,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelFrame, {
|
|
id,
|
|
htmlFor,
|
|
...labelProps,
|
|
ref: composedRefs,
|
|
onMouseDown: /* @__PURE__ */ __name((event) => {
|
|
props.onMouseDown?.(event), !event.defaultPrevented && event.detail > 1 && event.preventDefault();
|
|
}, "onMouseDown"),
|
|
onPress: /* @__PURE__ */ __name((event) => {
|
|
if (props.onPress?.(event), isWeb) {
|
|
if (htmlFor || !controlRef.current || event.defaultPrevented) return;
|
|
const isClickingControl = controlRef.current.contains(event.target), isUserClick = event.isTrusted === true;
|
|
!isClickingControl && isUserClick && (controlRef.current.click(), controlRef.current.focus());
|
|
} else props.htmlFor && focusFocusable(props.htmlFor);
|
|
}, "onPress")
|
|
})
|
|
});
|
|
});
|
|
LabelComponent.displayName = NAME;
|
|
var Label = LabelFrame.extractable((0, import_web15.themeable)(LabelComponent));
|
|
var useLabelContext = /* @__PURE__ */ __name((element) => {
|
|
const context2 = useLabelContextImpl("LabelConsumer"), {
|
|
controlRef
|
|
} = context2;
|
|
return React40.useEffect(() => {
|
|
element && (controlRef.current = element);
|
|
}, [element, controlRef]), context2.id;
|
|
}, "useLabelContext");
|
|
|
|
// node_modules/@tamagui/checkbox-headless/dist/esm/useCheckbox.mjs
|
|
var import_react33 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/use-previous/dist/esm/index.mjs
|
|
var React41 = __toESM(require("react"), 1);
|
|
function usePrevious(value) {
|
|
const ref = React41.useRef({
|
|
value,
|
|
previous: value
|
|
});
|
|
return React41.useMemo(() => (ref.current.value !== value && (ref.current.previous = ref.current.value, ref.current.value = value), ref.current.previous), [value]);
|
|
}
|
|
__name(usePrevious, "usePrevious");
|
|
|
|
// node_modules/@tamagui/checkbox-headless/dist/esm/BubbleInput.mjs
|
|
var React42 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/checkbox-headless/dist/esm/utils.mjs
|
|
function isIndeterminate(checked) {
|
|
return checked === "indeterminate";
|
|
}
|
|
__name(isIndeterminate, "isIndeterminate");
|
|
function getState4(checked) {
|
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
}
|
|
__name(getState4, "getState");
|
|
|
|
// node_modules/@tamagui/checkbox-headless/dist/esm/BubbleInput.mjs
|
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
var BubbleInput = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
checked,
|
|
bubbles = true,
|
|
control,
|
|
isHidden: isHidden2,
|
|
...inputProps
|
|
} = props, ref = React42.useRef(null), prevChecked = usePrevious(checked);
|
|
return React42.useEffect(() => {
|
|
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(inputProto, "checked").set;
|
|
if (prevChecked !== checked && setChecked) {
|
|
const event = new Event("click", {
|
|
bubbles
|
|
});
|
|
input.indeterminate = isIndeterminate(checked), setChecked.call(input, isIndeterminate(checked) ? false : checked), input.dispatchEvent(event);
|
|
}
|
|
}, [prevChecked, checked, bubbles]), /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", {
|
|
type: "checkbox",
|
|
defaultChecked: isIndeterminate(checked) ? false : checked,
|
|
...inputProps,
|
|
tabIndex: -1,
|
|
ref,
|
|
"aria-hidden": isHidden2,
|
|
style: {
|
|
...isHidden2 ? {
|
|
// ...controlSize,
|
|
position: "absolute",
|
|
pointerEvents: "none",
|
|
opacity: 0,
|
|
margin: 0
|
|
} : {
|
|
appearance: "auto",
|
|
accentColor: "var(--color6)"
|
|
},
|
|
...props.style
|
|
}
|
|
});
|
|
}, "BubbleInput");
|
|
|
|
// node_modules/@tamagui/checkbox-headless/dist/esm/useCheckbox.mjs
|
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
function useCheckbox(props, [checked, setChecked], ref) {
|
|
const {
|
|
labelledBy: ariaLabelledby,
|
|
name,
|
|
required,
|
|
disabled,
|
|
value = "on",
|
|
onCheckedChange,
|
|
...checkboxProps
|
|
} = props, [button, setButton] = import_react33.default.useState(null), composedRefs = useComposedRefs(ref, setButton), hasConsumerStoppedPropagationRef = import_react33.default.useRef(false), isFormControl = isWeb ? button ? !!button.closest("form") : true : false, labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId, parentKeyDown = props.onKeyDown, handleKeyDown = (0, import_react33.useMemo)(() => composeEventHandlers(parentKeyDown, (event) => {
|
|
event.key === "Enter" && event.preventDefault();
|
|
}), [parentKeyDown]), handlePress = (0, import_react33.useMemo)(() => composeEventHandlers(props.onPress, (event) => {
|
|
setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked), isFormControl && "isPropagationStopped" in event && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
}), [isFormControl]);
|
|
return {
|
|
bubbleInput: isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BubbleInput, {
|
|
isHidden: true,
|
|
control: button,
|
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
name,
|
|
value,
|
|
checked,
|
|
required,
|
|
disabled
|
|
}) : null,
|
|
checkboxRef: composedRefs,
|
|
checkboxProps: {
|
|
role: "checkbox",
|
|
"aria-labelledby": labelledBy,
|
|
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
...checkboxProps,
|
|
...isWeb && {
|
|
type: "button",
|
|
value,
|
|
"data-state": getState4(checked),
|
|
"data-disabled": disabled ? "" : void 0,
|
|
disabled,
|
|
onKeyDown: disabled ? void 0 : handleKeyDown
|
|
},
|
|
onPress: disabled ? void 0 : handlePress
|
|
}
|
|
};
|
|
}
|
|
__name(useCheckbox, "useCheckbox");
|
|
|
|
// node_modules/@tamagui/checkbox/dist/esm/createCheckbox.mjs
|
|
var import_core21 = require("@tamagui/core");
|
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
var CheckboxContext = import_react34.default.createContext({
|
|
checked: false,
|
|
disabled: false
|
|
});
|
|
var ensureContext = /* @__PURE__ */ __name((x) => {
|
|
x.context || (x.context = CheckboxContext);
|
|
}, "ensureContext");
|
|
function createCheckbox(createProps) {
|
|
const {
|
|
disableActiveTheme,
|
|
Frame: Frame2 = CheckboxFrame,
|
|
Indicator = CheckboxIndicatorFrame
|
|
} = createProps;
|
|
ensureContext(Frame2), ensureContext(Indicator);
|
|
const FrameComponent = Frame2.styleable(function(_props, forwardedRef) {
|
|
const {
|
|
scaleSize = 0.45,
|
|
sizeAdjust = 0,
|
|
scaleIcon,
|
|
checked: checkedProp,
|
|
defaultChecked,
|
|
onCheckedChange,
|
|
native,
|
|
unstyled = false,
|
|
...props
|
|
} = _props, propsActive = (0, import_core21.useProps)(props), styledContext = import_react34.default.useContext(CheckboxStyledContext);
|
|
let adjustedSize = 0, size4 = 0;
|
|
unstyled || (adjustedSize = (0, import_core21.getVariableValue)(getSize(propsActive.size ?? styledContext?.size ?? "$true", {
|
|
shift: sizeAdjust
|
|
})), size4 = scaleSize ? Math.round(adjustedSize * scaleSize) : adjustedSize);
|
|
const [checked = false, setChecked] = useControllableState({
|
|
prop: checkedProp,
|
|
defaultProp: defaultChecked,
|
|
onChange: onCheckedChange
|
|
}), {
|
|
checkboxProps,
|
|
checkboxRef,
|
|
bubbleInput
|
|
} = useCheckbox(
|
|
// @ts-ignore
|
|
propsActive,
|
|
[checked, setChecked],
|
|
forwardedRef
|
|
);
|
|
if ((0, import_core21.shouldRenderNativePlatform)(native) === "web") return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", {
|
|
type: "checkbox",
|
|
defaultChecked: isIndeterminate(checked) ? false : checked,
|
|
tabIndex: -1,
|
|
ref: checkboxRef,
|
|
disabled: checkboxProps.disabled,
|
|
style: {
|
|
appearance: "auto",
|
|
accentColor: "var(--color6)",
|
|
...checkboxProps.style
|
|
// TODO: any
|
|
}
|
|
});
|
|
const memoizedContext = (0, import_react34.useMemo)(() => ({
|
|
checked,
|
|
disabled: checkboxProps.disabled
|
|
}), [checked, checkboxProps.disabled]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckboxContext.Provider, {
|
|
value: memoizedContext,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(CheckboxStyledContext.Provider, {
|
|
size: propsActive.size ?? styledContext?.size ?? "$true",
|
|
scaleIcon: scaleIcon ?? styledContext?.scaleIcon ?? 1,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Frame2, {
|
|
...!unstyled && {
|
|
width: size4,
|
|
height: size4
|
|
},
|
|
tag: "button",
|
|
ref: checkboxRef,
|
|
unstyled,
|
|
...unstyled === false && {
|
|
size: size4,
|
|
theme: checked ? "active" : null
|
|
},
|
|
checked,
|
|
disabled: checkboxProps.disabled,
|
|
...checkboxProps,
|
|
style: checkboxProps.style,
|
|
children: propsActive.children
|
|
}), bubbleInput]
|
|
})
|
|
});
|
|
}), IndicatorComponent = Indicator.styleable((props, forwardedRef) => {
|
|
const {
|
|
// __scopeCheckbox,
|
|
children: childrenProp,
|
|
forceMount,
|
|
disablePassStyles,
|
|
unstyled = false,
|
|
...indicatorProps
|
|
} = props, styledContext = import_react34.default.useContext(CheckboxStyledContext);
|
|
let children = childrenProp;
|
|
if (!unstyled) {
|
|
const iconSize = (typeof styledContext.size == "number" ? styledContext.size * 0.65 : getFontSize(styledContext.size)) * styledContext.scaleIcon, theme = (0, import_core21.useTheme)(), getThemedIcon = useGetThemedIcon({
|
|
size: iconSize,
|
|
color: theme.color
|
|
});
|
|
children = import_react34.default.Children.toArray(childrenProp).map((child) => disablePassStyles || !import_react34.default.isValidElement(child) ? child : getThemedIcon(child));
|
|
}
|
|
const context2 = import_react34.default.useContext(CheckboxContext);
|
|
return forceMount || isIndeterminate(context2.checked) || context2.checked === true ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Indicator, {
|
|
pointerEvents: "none",
|
|
...indicatorProps,
|
|
ref: forwardedRef,
|
|
children
|
|
}) : null;
|
|
});
|
|
return (0, import_core21.withStaticProperties)(FrameComponent, {
|
|
Indicator: IndicatorComponent
|
|
});
|
|
}
|
|
__name(createCheckbox, "createCheckbox");
|
|
|
|
// node_modules/@tamagui/checkbox/dist/esm/index.mjs
|
|
var Checkbox = createCheckbox({
|
|
Frame: CheckboxFrame,
|
|
Indicator: CheckboxIndicatorFrame
|
|
});
|
|
|
|
// node_modules/@tamagui/form/dist/esm/Form.mjs
|
|
var import_core22 = require("@tamagui/core");
|
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
var FORM_NAME = "Form";
|
|
var FormFrame = (0, import_core22.styled)(import_core22.Stack, {
|
|
name: FORM_NAME,
|
|
tag: "form"
|
|
});
|
|
var [createFormContext] = createContextScope(FORM_NAME);
|
|
var [FormProvider, useFormContext] = createFormContext(FORM_NAME);
|
|
var TRIGGER_NAME3 = "FormTrigger";
|
|
var FormTriggerFrame = (0, import_core22.styled)(import_core22.View, {
|
|
name: TRIGGER_NAME3
|
|
});
|
|
var FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
|
|
const {
|
|
__scopeForm,
|
|
children,
|
|
onPress,
|
|
...triggerProps
|
|
} = props, context2 = useFormContext(TRIGGER_NAME3, __scopeForm);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FormTriggerFrame, {
|
|
tag: "button",
|
|
...triggerProps,
|
|
ref: forwardedRef,
|
|
onPress: composeEventHandlers(onPress, context2.onSubmit),
|
|
children
|
|
});
|
|
});
|
|
var FormComponent = FormFrame.extractable(function({
|
|
onSubmit,
|
|
...props
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FormProvider, {
|
|
scope: props.__scopeForm,
|
|
onSubmit,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FormFrame, {
|
|
...props,
|
|
onSubmit: /* @__PURE__ */ __name((e) => e.preventDefault(), "onSubmit")
|
|
})
|
|
});
|
|
});
|
|
var Form2 = withStaticProperties(FormComponent, {
|
|
Trigger: FormTrigger
|
|
});
|
|
|
|
// node_modules/@tamagui/group/dist/esm/Group.mjs
|
|
var import_core23 = require("@tamagui/core");
|
|
var import_react35 = __toESM(require("react"), 1);
|
|
var import_react_native_web6 = __toESM(require_cjs(), 1);
|
|
|
|
// node_modules/@tamagui/group/dist/esm/useIndexedChildren.mjs
|
|
var React45 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
var MaxIndexContext = React45.createContext([]);
|
|
var IndexContext = React45.createContext(null);
|
|
function useIndex() {
|
|
const maxIndexPath = React45.useContext(MaxIndexContext), indexPathString = React45.useContext(IndexContext);
|
|
return React45.useMemo(() => {
|
|
if (indexPathString === null) return null;
|
|
const indexPath = parseIndexPath(indexPathString), maxIndex = maxIndexPath[maxIndexPath.length - 1], index5 = indexPath[indexPath.length - 1];
|
|
return {
|
|
maxIndex,
|
|
maxIndexPath,
|
|
index: index5,
|
|
indexPath,
|
|
indexPathString,
|
|
isFirst: index5 === 0,
|
|
isLast: index5 === maxIndex,
|
|
isEven: index5 % 2 === 0,
|
|
isOdd: Math.abs(index5 % 2) === 1
|
|
};
|
|
}, [maxIndexPath, indexPathString]);
|
|
}
|
|
__name(useIndex, "useIndex");
|
|
function useIndexedChildren(children) {
|
|
const parentMaxIndexPath = React45.useContext(MaxIndexContext), indexPathString = React45.useContext(IndexContext), childrenCount = React45.Children.count(children), maxIndexPath = React45.useMemo(() => parentMaxIndexPath.concat(childrenCount - 1), [childrenCount]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MaxIndexContext.Provider, {
|
|
value: maxIndexPath,
|
|
children: React45.Children.map(children, (child, index5) => React45.isValidElement(child) ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(IndexContext.Provider, {
|
|
value: indexPathString ? `${indexPathString}.${index5.toString()}` : index5.toString(),
|
|
children: child
|
|
}, child.key) : child)
|
|
});
|
|
}
|
|
__name(useIndexedChildren, "useIndexedChildren");
|
|
function parseIndexPath(indexPathString) {
|
|
return indexPathString.split(".").map((index5) => Number.parseInt(index5, 10));
|
|
}
|
|
__name(parseIndexPath, "parseIndexPath");
|
|
|
|
// node_modules/@tamagui/group/dist/esm/Group.mjs
|
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
var GROUP_NAME = "Group";
|
|
var [createGroupContext, createGroupScope] = createContextScope(GROUP_NAME);
|
|
var [GroupProvider, useGroupContext] = createGroupContext(GROUP_NAME);
|
|
var GroupFrame = (0, import_core23.styled)(ThemeableStack, {
|
|
name: "GroupFrame",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true"
|
|
}
|
|
},
|
|
size: /* @__PURE__ */ __name((val, {
|
|
tokens
|
|
}) => ({
|
|
borderRadius: tokens.radius[val] ?? val ?? tokens.radius.$true
|
|
}), "size")
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
function createGroup(verticalDefault) {
|
|
return withStaticProperties(GroupFrame.styleable((props, ref) => {
|
|
const activeProps = (0, import_core23.useProps)(props), {
|
|
__scopeGroup,
|
|
children: childrenProp,
|
|
space,
|
|
size: size4 = "$true",
|
|
spaceDirection,
|
|
separator,
|
|
scrollable,
|
|
axis = verticalDefault ? "vertical" : "horizontal",
|
|
orientation = axis,
|
|
disabled: disabledProp,
|
|
disablePassBorderRadius: disablePassBorderRadiusProp,
|
|
borderRadius,
|
|
forceUseItem,
|
|
...restProps
|
|
} = activeProps, vertical = orientation === "vertical", [itemChildrenCount, setItemChildrenCount] = useControllableState({
|
|
defaultProp: forceUseItem ? 1 : 0
|
|
}), isUsingItems = itemChildrenCount > 0, radius = borderRadius ?? (size4 ? (0, import_core23.getVariableValue)((0, import_core23.getTokens)().radius[size4]) - 1 : void 0), disablePassBorderRadius = disablePassBorderRadiusProp ?? !(radius !== void 0), childrenArray = import_react35.default.Children.toArray(childrenProp), children = isUsingItems ? import_react35.default.Children.toArray(childrenProp).filter(import_react35.default.isValidElement) : childrenArray.map((child, i) => {
|
|
if (!import_react35.default.isValidElement(child) || child.type === import_react35.default.Fragment) return child;
|
|
const disabled = child.props.disabled ?? disabledProp, isFirst = i === 0, isLast = i === childrenArray.length - 1, radiusStyles = disablePassBorderRadius === true ? null : getBorderRadius({
|
|
isFirst,
|
|
isLast,
|
|
radius,
|
|
vertical,
|
|
disable: disablePassBorderRadius
|
|
}), props2 = {
|
|
disabled,
|
|
...radiusStyles
|
|
};
|
|
return cloneElementWithPropOrder(child, props2);
|
|
}), indexedChildren = useIndexedChildren((0, import_core23.spacedChildren)({
|
|
direction: spaceDirection,
|
|
separator,
|
|
space,
|
|
children
|
|
})), onItemMount = import_react35.default.useCallback(() => setItemChildrenCount((prev) => prev + 1), []), onItemUnmount = import_react35.default.useCallback(() => setItemChildrenCount((prev) => prev - 1), []);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GroupProvider, {
|
|
disablePassBorderRadius,
|
|
vertical: orientation === "vertical",
|
|
radius,
|
|
disabled: disabledProp,
|
|
onItemMount,
|
|
onItemUnmount,
|
|
scope: __scopeGroup,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GroupFrame, {
|
|
ref,
|
|
size: size4,
|
|
flexDirection: orientation === "horizontal" ? "row" : "column",
|
|
borderRadius,
|
|
...restProps,
|
|
children: wrapScroll({
|
|
...activeProps,
|
|
orientation
|
|
}, indexedChildren)
|
|
})
|
|
});
|
|
}), {
|
|
Item: GroupItem
|
|
});
|
|
}
|
|
__name(createGroup, "createGroup");
|
|
var GroupItem = import_react35.default.forwardRef((props, _ref) => {
|
|
const {
|
|
__scopeGroup,
|
|
children,
|
|
forcePlacement
|
|
} = props, groupItemProps = useGroupItem({
|
|
disabled: import_react35.default.isValidElement(children) ? children.props.disabled : false
|
|
}, forcePlacement, __scopeGroup);
|
|
return !import_react35.default.isValidElement(children) || children.type === import_react35.default.Fragment ? children : import_react35.default.cloneElement(children, groupItemProps);
|
|
});
|
|
var useGroupItem = /* @__PURE__ */ __name((childrenProps, forcePlacement, __scopeGroup) => {
|
|
const treeIndex = useIndex(), context2 = useGroupContext("GroupItem", __scopeGroup);
|
|
if (import_react35.default.useEffect(() => (context2.onItemMount(), () => {
|
|
context2.onItemUnmount();
|
|
}), []), !treeIndex) throw Error("<Group.Item/> should only be used within a <Group/>");
|
|
const isFirst = forcePlacement === "first" || forcePlacement !== "last" && treeIndex.index === 0, isLast = forcePlacement === "last" || forcePlacement !== "first" && treeIndex.index === treeIndex.maxIndex;
|
|
let propsToPass = {
|
|
disabled: childrenProps.disabled ?? context2.disabled
|
|
};
|
|
if (context2.disablePassBorderRadius !== true) {
|
|
const borderRadius = getBorderRadius({
|
|
radius: context2.radius,
|
|
isFirst,
|
|
isLast,
|
|
vertical: context2.vertical,
|
|
disable: context2.disablePassBorderRadius
|
|
});
|
|
return {
|
|
...propsToPass,
|
|
...borderRadius
|
|
};
|
|
}
|
|
return propsToPass;
|
|
}, "useGroupItem");
|
|
var Group = createGroup(true);
|
|
var YGroup = Group;
|
|
var XGroup = createGroup(false);
|
|
var wrapScroll = /* @__PURE__ */ __name(({
|
|
scrollable,
|
|
orientation,
|
|
showScrollIndicator = false
|
|
}, children) => scrollable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_native_web6.ScrollView, {
|
|
...orientation === "vertical" && {
|
|
showsVerticalScrollIndicator: showScrollIndicator
|
|
},
|
|
...orientation === "horizontal" && {
|
|
horizontal: true,
|
|
showsHorizontalScrollIndicator: showScrollIndicator
|
|
},
|
|
children
|
|
}) : children, "wrapScroll");
|
|
var getBorderRadius = /* @__PURE__ */ __name(({
|
|
isFirst,
|
|
isLast,
|
|
radius,
|
|
vertical,
|
|
disable
|
|
}) => ({
|
|
borderTopLeftRadius: isFirst && disable !== "top" && disable !== "start" ? radius : 0,
|
|
borderTopRightRadius: disable !== "top" && disable !== "end" && (vertical && isFirst || !vertical && isLast) ? radius : 0,
|
|
borderBottomLeftRadius: disable !== "bottom" && disable !== "start" && (vertical && isLast || !vertical && isFirst) ? radius : 0,
|
|
borderBottomRightRadius: isLast && disable !== "bottom" && disable !== "end" ? radius : 0
|
|
}), "getBorderRadius");
|
|
var cloneElementWithPropOrder = /* @__PURE__ */ __name((child, props) => import_react35.default.cloneElement({
|
|
...child,
|
|
props: null
|
|
}, {
|
|
...child.props,
|
|
...props
|
|
}), "cloneElementWithPropOrder");
|
|
|
|
// node_modules/@tamagui/react-native-media-driver/dist/esm/createMedia.mjs
|
|
var import_web16 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/react-native-media-driver/dist/esm/matchMedia.mjs
|
|
var matchMedia = globalThis.matchMedia;
|
|
|
|
// node_modules/@tamagui/react-native-media-driver/dist/esm/createMedia.mjs
|
|
function createMedia(media) {
|
|
return (0, import_web16.setupMatchMedia)(matchMedia), media;
|
|
}
|
|
__name(createMedia, "createMedia");
|
|
|
|
// node_modules/@tamagui/elements/dist/esm/index.mjs
|
|
var import_core24 = require("@tamagui/core");
|
|
var Section = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Section",
|
|
tag: "section",
|
|
flexDirection: "column",
|
|
accessibilityRole: "summary"
|
|
});
|
|
var Article = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Article",
|
|
tag: "article",
|
|
flexDirection: "column"
|
|
});
|
|
var Main = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Main",
|
|
tag: "main",
|
|
flexDirection: "column"
|
|
});
|
|
var Header = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Header",
|
|
tag: "header",
|
|
accessibilityRole: "header",
|
|
flexDirection: "column"
|
|
});
|
|
var Aside = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Aside",
|
|
tag: "aside",
|
|
flexDirection: "column"
|
|
// accessibilityRole: 'complementary',
|
|
});
|
|
var Footer = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Footer",
|
|
tag: "footer",
|
|
flexDirection: "column"
|
|
// accessibilityRole: 'contentinfo',
|
|
});
|
|
var Nav = (0, import_core24.styled)(import_core24.View, {
|
|
name: "Nav",
|
|
tag: "nav",
|
|
flexDirection: "column"
|
|
// accessibilityRole: 'navigation',
|
|
});
|
|
|
|
// node_modules/@tamagui/list-item/dist/esm/ListItem.mjs
|
|
var import_web17 = require("@tamagui/core");
|
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
var NAME2 = "ListItem";
|
|
var ListItemFrame = (0, import_web17.styled)(ThemeableStack, {
|
|
name: NAME2,
|
|
tag: "li",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
alignItems: "center",
|
|
justifyContent: "space-between",
|
|
flexWrap: "nowrap",
|
|
width: "100%",
|
|
borderColor: "$borderColor",
|
|
maxWidth: "100%",
|
|
overflow: "hidden",
|
|
flexDirection: "row",
|
|
backgroundColor: "$background",
|
|
cursor: "default"
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, {
|
|
tokens
|
|
}) => ({
|
|
minHeight: tokens.size[val],
|
|
paddingHorizontal: tokens.space[val],
|
|
paddingVertical: getSpace(tokens.space[val], {
|
|
shift: -4
|
|
})
|
|
}), "...size")
|
|
},
|
|
active: {
|
|
true: {
|
|
hoverStyle: {
|
|
backgroundColor: "$background"
|
|
}
|
|
}
|
|
},
|
|
disabled: {
|
|
true: {
|
|
opacity: 0.5,
|
|
// TODO breaking types
|
|
pointerEvents: "none"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ListItemText = (0, import_web17.styled)(SizableText2, {
|
|
name: "ListItemText",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
color: "$color",
|
|
size: "$true",
|
|
flexGrow: 1,
|
|
flexShrink: 1,
|
|
ellipse: true,
|
|
cursor: "inherit"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ListItemSubtitle = (0, import_web17.styled)(ListItemText, {
|
|
name: "ListItemSubtitle",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
opacity: 0.6,
|
|
maxWidth: "100%",
|
|
color: "$color"
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, extras) => {
|
|
const oneSmaller = getSize(val, {
|
|
shift: -1,
|
|
excludeHalfSteps: true
|
|
});
|
|
return getFontSized(oneSmaller.key, extras);
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ListItemTitle = (0, import_web17.styled)(ListItemText, {
|
|
name: "ListItemTitle"
|
|
});
|
|
var useListItem = /* @__PURE__ */ __name((propsIn, {
|
|
Text: Text6 = ListItemText,
|
|
Subtitle = ListItemSubtitle,
|
|
Title = ListItemTitle
|
|
} = {
|
|
Text: ListItemText,
|
|
Subtitle: ListItemSubtitle,
|
|
Title: ListItemTitle
|
|
}) => {
|
|
const props = (0, import_web17.useProps)(propsIn, {
|
|
resolveValues: "none"
|
|
}), {
|
|
children,
|
|
icon,
|
|
iconAfter,
|
|
noTextWrap,
|
|
theme: themeName,
|
|
space,
|
|
spaceFlex,
|
|
scaleIcon = 1,
|
|
scaleSpace = 1,
|
|
unstyled = false,
|
|
subTitle,
|
|
title,
|
|
// text props
|
|
color,
|
|
fontWeight,
|
|
fontSize,
|
|
fontFamily,
|
|
letterSpacing,
|
|
textAlign,
|
|
ellipse,
|
|
...rest
|
|
} = props, textProps = {
|
|
color,
|
|
fontWeight,
|
|
fontSize,
|
|
fontFamily,
|
|
letterSpacing,
|
|
textAlign,
|
|
ellipse,
|
|
children
|
|
}, size4 = props.size || "$true", iconSize = getFontSize(size4) * scaleIcon, getThemedIcon = useGetThemedIcon({
|
|
size: iconSize,
|
|
color
|
|
}), [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon), sizeToken = (0, import_web17.getTokens)().space[props.space] ?? iconSize, spaceSize = (0, import_web17.getVariableValue)(sizeToken) * scaleSpace, contents = wrapChildrenInText(Text6, textProps);
|
|
return {
|
|
props: {
|
|
...rest,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, {
|
|
children: [themedIcon ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, {
|
|
children: [themedIcon, /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_web17.Spacer, {
|
|
size: spaceSize
|
|
})]
|
|
}) : null, title || subTitle ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(YStack, {
|
|
flex: 1,
|
|
children: [noTextWrap === "all" ? title : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Title, {
|
|
size: size4,
|
|
children: title
|
|
}), subTitle ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, {
|
|
children: typeof subTitle == "string" && noTextWrap !== "all" ? (
|
|
// TODO can use theme but we need to standardize to alt themes
|
|
// or standardize on subtle colors in themes
|
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Subtitle, {
|
|
unstyled,
|
|
size: size4,
|
|
children: subTitle
|
|
})
|
|
) : subTitle
|
|
}) : null, contents]
|
|
}) : contents, themedIconAfter ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_web17.Spacer, {
|
|
size: spaceSize
|
|
}), themedIconAfter]
|
|
}) : null]
|
|
})
|
|
}
|
|
};
|
|
}, "useListItem");
|
|
var ListItemComponent = ListItemFrame.styleable(function(props, ref) {
|
|
const {
|
|
props: listItemProps
|
|
} = useListItem(props);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ListItemFrame, {
|
|
ref,
|
|
...listItemProps
|
|
});
|
|
});
|
|
var ListItem2 = withStaticProperties(ListItemComponent, {
|
|
Text: ListItemText,
|
|
Subtitle: ListItemSubtitle,
|
|
Title: ListItemTitle
|
|
});
|
|
|
|
// node_modules/@tamagui/animate/dist/esm/Animate.mjs
|
|
var import_react36 = require("react");
|
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
function Animate({
|
|
children,
|
|
lazyMount,
|
|
type,
|
|
present,
|
|
passThrough,
|
|
...props
|
|
}) {
|
|
const [lazyMounted, setLazyMounted] = (0, import_react36.useState)(lazyMount ? false : present);
|
|
(0, import_react36.useEffect)(() => {
|
|
passThrough || lazyMount && present && (0, import_react36.startTransition)(() => {
|
|
setLazyMounted(present);
|
|
});
|
|
}, [lazyMount, present]);
|
|
const mounted = present ? lazyMount ? lazyMounted : present : false;
|
|
return type === "presence" ? props.keepChildrenMounted ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PresenceChild, {
|
|
isPresent: true,
|
|
...!passThrough && {
|
|
initial: props.initial ? void 0 : false,
|
|
onExitComplete: props.onExitComplete,
|
|
enterVariant: props.enterVariant,
|
|
exitVariant: props.exitVariant,
|
|
enterExitVariant: props.enterExitVariant,
|
|
// BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
|
|
// but since we always re-render this component on open changes this should be fine to leave off?
|
|
presenceAffectsLayout: false,
|
|
isPresent: present,
|
|
custom: props.custom
|
|
},
|
|
children
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AnimatePresence, {
|
|
passThrough,
|
|
...props,
|
|
children: mounted || passThrough ? children : null
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, {
|
|
children
|
|
});
|
|
}
|
|
__name(Animate, "Animate");
|
|
|
|
// node_modules/@tamagui/popover/dist/esm/Popover.mjs
|
|
var import_core27 = require("@tamagui/core");
|
|
|
|
// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
var min = Math.min;
|
|
var max = Math.max;
|
|
var round = Math.round;
|
|
var floor = Math.floor;
|
|
var createCoords = /* @__PURE__ */ __name((v) => ({
|
|
x: v,
|
|
y: v
|
|
}), "createCoords");
|
|
var oppositeSideMap = {
|
|
left: "right",
|
|
right: "left",
|
|
bottom: "top",
|
|
top: "bottom"
|
|
};
|
|
var oppositeAlignmentMap = {
|
|
start: "end",
|
|
end: "start"
|
|
};
|
|
function clamp2(start, value, end) {
|
|
return max(start, min(value, end));
|
|
}
|
|
__name(clamp2, "clamp");
|
|
function evaluate(value, param) {
|
|
return typeof value === "function" ? value(param) : value;
|
|
}
|
|
__name(evaluate, "evaluate");
|
|
function getSide(placement) {
|
|
return placement.split("-")[0];
|
|
}
|
|
__name(getSide, "getSide");
|
|
function getAlignment(placement) {
|
|
return placement.split("-")[1];
|
|
}
|
|
__name(getAlignment, "getAlignment");
|
|
function getOppositeAxis(axis) {
|
|
return axis === "x" ? "y" : "x";
|
|
}
|
|
__name(getOppositeAxis, "getOppositeAxis");
|
|
function getAxisLength(axis) {
|
|
return axis === "y" ? "height" : "width";
|
|
}
|
|
__name(getAxisLength, "getAxisLength");
|
|
var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
function getSideAxis(placement) {
|
|
return yAxisSides.has(getSide(placement)) ? "y" : "x";
|
|
}
|
|
__name(getSideAxis, "getSideAxis");
|
|
function getAlignmentAxis(placement) {
|
|
return getOppositeAxis(getSideAxis(placement));
|
|
}
|
|
__name(getAlignmentAxis, "getAlignmentAxis");
|
|
function getAlignmentSides(placement, rects, rtl) {
|
|
if (rtl === void 0) {
|
|
rtl = false;
|
|
}
|
|
const alignment = getAlignment(placement);
|
|
const alignmentAxis = getAlignmentAxis(placement);
|
|
const length = getAxisLength(alignmentAxis);
|
|
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
if (rects.reference[length] > rects.floating[length]) {
|
|
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
}
|
|
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
}
|
|
__name(getAlignmentSides, "getAlignmentSides");
|
|
function getExpandedPlacements(placement) {
|
|
const oppositePlacement = getOppositePlacement(placement);
|
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
}
|
|
__name(getExpandedPlacements, "getExpandedPlacements");
|
|
function getOppositeAlignmentPlacement(placement) {
|
|
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
}
|
|
__name(getOppositeAlignmentPlacement, "getOppositeAlignmentPlacement");
|
|
var lrPlacement = ["left", "right"];
|
|
var rlPlacement = ["right", "left"];
|
|
var tbPlacement = ["top", "bottom"];
|
|
var btPlacement = ["bottom", "top"];
|
|
function getSideList(side, isStart, rtl) {
|
|
switch (side) {
|
|
case "top":
|
|
case "bottom":
|
|
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
return isStart ? lrPlacement : rlPlacement;
|
|
case "left":
|
|
case "right":
|
|
return isStart ? tbPlacement : btPlacement;
|
|
default:
|
|
return [];
|
|
}
|
|
}
|
|
__name(getSideList, "getSideList");
|
|
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
const alignment = getAlignment(placement);
|
|
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
if (alignment) {
|
|
list = list.map((side) => side + "-" + alignment);
|
|
if (flipAlignment) {
|
|
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
}
|
|
}
|
|
return list;
|
|
}
|
|
__name(getOppositeAxisPlacements, "getOppositeAxisPlacements");
|
|
function getOppositePlacement(placement) {
|
|
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
}
|
|
__name(getOppositePlacement, "getOppositePlacement");
|
|
function expandPaddingObject(padding) {
|
|
return {
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
...padding
|
|
};
|
|
}
|
|
__name(expandPaddingObject, "expandPaddingObject");
|
|
function getPaddingObject(padding) {
|
|
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
top: padding,
|
|
right: padding,
|
|
bottom: padding,
|
|
left: padding
|
|
};
|
|
}
|
|
__name(getPaddingObject, "getPaddingObject");
|
|
function rectToClientRect(rect) {
|
|
const {
|
|
x,
|
|
y,
|
|
width,
|
|
height
|
|
} = rect;
|
|
return {
|
|
width,
|
|
height,
|
|
top: y,
|
|
left: x,
|
|
right: x + width,
|
|
bottom: y + height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
__name(rectToClientRect, "rectToClientRect");
|
|
|
|
// node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
let {
|
|
reference,
|
|
floating
|
|
} = _ref;
|
|
const sideAxis = getSideAxis(placement);
|
|
const alignmentAxis = getAlignmentAxis(placement);
|
|
const alignLength = getAxisLength(alignmentAxis);
|
|
const side = getSide(placement);
|
|
const isVertical = sideAxis === "y";
|
|
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
let coords;
|
|
switch (side) {
|
|
case "top":
|
|
coords = {
|
|
x: commonX,
|
|
y: reference.y - floating.height
|
|
};
|
|
break;
|
|
case "bottom":
|
|
coords = {
|
|
x: commonX,
|
|
y: reference.y + reference.height
|
|
};
|
|
break;
|
|
case "right":
|
|
coords = {
|
|
x: reference.x + reference.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
case "left":
|
|
coords = {
|
|
x: reference.x - floating.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
default:
|
|
coords = {
|
|
x: reference.x,
|
|
y: reference.y
|
|
};
|
|
}
|
|
switch (getAlignment(placement)) {
|
|
case "start":
|
|
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
break;
|
|
case "end":
|
|
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
break;
|
|
}
|
|
return coords;
|
|
}
|
|
__name(computeCoordsFromPlacement, "computeCoordsFromPlacement");
|
|
var computePosition = /* @__PURE__ */ __name(async (reference, floating, config) => {
|
|
const {
|
|
placement = "bottom",
|
|
strategy = "absolute",
|
|
middleware = [],
|
|
platform: platform2
|
|
} = config;
|
|
const validMiddleware = middleware.filter(Boolean);
|
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
let rects = await platform2.getElementRects({
|
|
reference,
|
|
floating,
|
|
strategy
|
|
});
|
|
let {
|
|
x,
|
|
y
|
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
let statefulPlacement = placement;
|
|
let middlewareData = {};
|
|
let resetCount = 0;
|
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
const {
|
|
name,
|
|
fn
|
|
} = validMiddleware[i];
|
|
const {
|
|
x: nextX,
|
|
y: nextY,
|
|
data,
|
|
reset
|
|
} = await fn({
|
|
x,
|
|
y,
|
|
initialPlacement: placement,
|
|
placement: statefulPlacement,
|
|
strategy,
|
|
middlewareData,
|
|
rects,
|
|
platform: platform2,
|
|
elements: {
|
|
reference,
|
|
floating
|
|
}
|
|
});
|
|
x = nextX != null ? nextX : x;
|
|
y = nextY != null ? nextY : y;
|
|
middlewareData = {
|
|
...middlewareData,
|
|
[name]: {
|
|
...middlewareData[name],
|
|
...data
|
|
}
|
|
};
|
|
if (reset && resetCount <= 50) {
|
|
resetCount++;
|
|
if (typeof reset === "object") {
|
|
if (reset.placement) {
|
|
statefulPlacement = reset.placement;
|
|
}
|
|
if (reset.rects) {
|
|
rects = reset.rects === true ? await platform2.getElementRects({
|
|
reference,
|
|
floating,
|
|
strategy
|
|
}) : reset.rects;
|
|
}
|
|
({
|
|
x,
|
|
y
|
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
}
|
|
i = -1;
|
|
}
|
|
}
|
|
return {
|
|
x,
|
|
y,
|
|
placement: statefulPlacement,
|
|
strategy,
|
|
middlewareData
|
|
};
|
|
}, "computePosition");
|
|
async function detectOverflow(state, options) {
|
|
var _await$platform$isEle;
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
x,
|
|
y,
|
|
platform: platform2,
|
|
rects,
|
|
elements,
|
|
strategy
|
|
} = state;
|
|
const {
|
|
boundary = "clippingAncestors",
|
|
rootBoundary = "viewport",
|
|
elementContext = "floating",
|
|
altBoundary = false,
|
|
padding = 0
|
|
} = evaluate(options, state);
|
|
const paddingObject = getPaddingObject(padding);
|
|
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
|
|
boundary,
|
|
rootBoundary,
|
|
strategy
|
|
}));
|
|
const rect = elementContext === "floating" ? {
|
|
x,
|
|
y,
|
|
width: rects.floating.width,
|
|
height: rects.floating.height
|
|
} : rects.reference;
|
|
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
x: 1,
|
|
y: 1
|
|
} : {
|
|
x: 1,
|
|
y: 1
|
|
};
|
|
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
elements,
|
|
rect,
|
|
offsetParent,
|
|
strategy
|
|
}) : rect);
|
|
return {
|
|
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
};
|
|
}
|
|
__name(detectOverflow, "detectOverflow");
|
|
var arrow = /* @__PURE__ */ __name((options) => ({
|
|
name: "arrow",
|
|
options,
|
|
async fn(state) {
|
|
const {
|
|
x,
|
|
y,
|
|
placement,
|
|
rects,
|
|
platform: platform2,
|
|
elements,
|
|
middlewareData
|
|
} = state;
|
|
const {
|
|
element,
|
|
padding = 0
|
|
} = evaluate(options, state) || {};
|
|
if (element == null) {
|
|
return {};
|
|
}
|
|
const paddingObject = getPaddingObject(padding);
|
|
const coords = {
|
|
x,
|
|
y
|
|
};
|
|
const axis = getAlignmentAxis(placement);
|
|
const length = getAxisLength(axis);
|
|
const arrowDimensions = await platform2.getDimensions(element);
|
|
const isYAxis = axis === "y";
|
|
const minProp = isYAxis ? "top" : "left";
|
|
const maxProp = isYAxis ? "bottom" : "right";
|
|
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
const startDiff = coords[axis] - rects.reference[axis];
|
|
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
|
|
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
}
|
|
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
const min$1 = minPadding;
|
|
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
const offset4 = clamp2(min$1, center, max2);
|
|
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
return {
|
|
[axis]: coords[axis] + alignmentOffset,
|
|
data: {
|
|
[axis]: offset4,
|
|
centerOffset: center - offset4 - alignmentOffset,
|
|
...shouldAddOffset && {
|
|
alignmentOffset
|
|
}
|
|
},
|
|
reset: shouldAddOffset
|
|
};
|
|
}
|
|
}), "arrow");
|
|
var flip = /* @__PURE__ */ __name(function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: "flip",
|
|
options,
|
|
async fn(state) {
|
|
var _middlewareData$arrow, _middlewareData$flip;
|
|
const {
|
|
placement,
|
|
middlewareData,
|
|
rects,
|
|
initialPlacement,
|
|
platform: platform2,
|
|
elements
|
|
} = state;
|
|
const {
|
|
mainAxis: checkMainAxis = true,
|
|
crossAxis: checkCrossAxis = true,
|
|
fallbackPlacements: specifiedFallbackPlacements,
|
|
fallbackStrategy = "bestFit",
|
|
fallbackAxisSideDirection = "none",
|
|
flipAlignment = true,
|
|
...detectOverflowOptions
|
|
} = evaluate(options, state);
|
|
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
return {};
|
|
}
|
|
const side = getSide(placement);
|
|
const initialSideAxis = getSideAxis(initialPlacement);
|
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
}
|
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const overflows = [];
|
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
if (checkMainAxis) {
|
|
overflows.push(overflow[side]);
|
|
}
|
|
if (checkCrossAxis) {
|
|
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
}
|
|
overflowsData = [...overflowsData, {
|
|
placement,
|
|
overflows
|
|
}];
|
|
if (!overflows.every((side2) => side2 <= 0)) {
|
|
var _middlewareData$flip2, _overflowsData$filter;
|
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
const nextPlacement = placements2[nextIndex];
|
|
if (nextPlacement) {
|
|
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
// overflows the main axis.
|
|
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
return {
|
|
data: {
|
|
index: nextIndex,
|
|
overflows: overflowsData
|
|
},
|
|
reset: {
|
|
placement: nextPlacement
|
|
}
|
|
};
|
|
}
|
|
}
|
|
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
if (!resetPlacement) {
|
|
switch (fallbackStrategy) {
|
|
case "bestFit": {
|
|
var _overflowsData$filter2;
|
|
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
|
|
if (hasFallbackAxisSideDirection) {
|
|
const currentSideAxis = getSideAxis(d.placement);
|
|
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
// reading directions favoring greater width.
|
|
currentSideAxis === "y";
|
|
}
|
|
return true;
|
|
}).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
if (placement2) {
|
|
resetPlacement = placement2;
|
|
}
|
|
break;
|
|
}
|
|
case "initialPlacement":
|
|
resetPlacement = initialPlacement;
|
|
break;
|
|
}
|
|
}
|
|
if (placement !== resetPlacement) {
|
|
return {
|
|
reset: {
|
|
placement: resetPlacement
|
|
}
|
|
};
|
|
}
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
}, "flip");
|
|
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
async function convertValueToCoords(state, options) {
|
|
const {
|
|
placement,
|
|
platform: platform2,
|
|
elements
|
|
} = state;
|
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
const side = getSide(placement);
|
|
const alignment = getAlignment(placement);
|
|
const isVertical = getSideAxis(placement) === "y";
|
|
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
const rawValue = evaluate(options, state);
|
|
let {
|
|
mainAxis,
|
|
crossAxis,
|
|
alignmentAxis
|
|
} = typeof rawValue === "number" ? {
|
|
mainAxis: rawValue,
|
|
crossAxis: 0,
|
|
alignmentAxis: null
|
|
} : {
|
|
mainAxis: rawValue.mainAxis || 0,
|
|
crossAxis: rawValue.crossAxis || 0,
|
|
alignmentAxis: rawValue.alignmentAxis
|
|
};
|
|
if (alignment && typeof alignmentAxis === "number") {
|
|
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
}
|
|
return isVertical ? {
|
|
x: crossAxis * crossAxisMulti,
|
|
y: mainAxis * mainAxisMulti
|
|
} : {
|
|
x: mainAxis * mainAxisMulti,
|
|
y: crossAxis * crossAxisMulti
|
|
};
|
|
}
|
|
__name(convertValueToCoords, "convertValueToCoords");
|
|
var offset = /* @__PURE__ */ __name(function(options) {
|
|
if (options === void 0) {
|
|
options = 0;
|
|
}
|
|
return {
|
|
name: "offset",
|
|
options,
|
|
async fn(state) {
|
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
const {
|
|
x,
|
|
y,
|
|
placement,
|
|
middlewareData
|
|
} = state;
|
|
const diffCoords = await convertValueToCoords(state, options);
|
|
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
return {};
|
|
}
|
|
return {
|
|
x: x + diffCoords.x,
|
|
y: y + diffCoords.y,
|
|
data: {
|
|
...diffCoords,
|
|
placement
|
|
}
|
|
};
|
|
}
|
|
};
|
|
}, "offset");
|
|
var shift = /* @__PURE__ */ __name(function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: "shift",
|
|
options,
|
|
async fn(state) {
|
|
const {
|
|
x,
|
|
y,
|
|
placement
|
|
} = state;
|
|
const {
|
|
mainAxis: checkMainAxis = true,
|
|
crossAxis: checkCrossAxis = false,
|
|
limiter = {
|
|
fn: /* @__PURE__ */ __name((_ref) => {
|
|
let {
|
|
x: x2,
|
|
y: y2
|
|
} = _ref;
|
|
return {
|
|
x: x2,
|
|
y: y2
|
|
};
|
|
}, "fn")
|
|
},
|
|
...detectOverflowOptions
|
|
} = evaluate(options, state);
|
|
const coords = {
|
|
x,
|
|
y
|
|
};
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const crossAxis = getSideAxis(getSide(placement));
|
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
let mainAxisCoord = coords[mainAxis];
|
|
let crossAxisCoord = coords[crossAxis];
|
|
if (checkMainAxis) {
|
|
const minSide = mainAxis === "y" ? "top" : "left";
|
|
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
const min2 = mainAxisCoord + overflow[minSide];
|
|
const max2 = mainAxisCoord - overflow[maxSide];
|
|
mainAxisCoord = clamp2(min2, mainAxisCoord, max2);
|
|
}
|
|
if (checkCrossAxis) {
|
|
const minSide = crossAxis === "y" ? "top" : "left";
|
|
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
const min2 = crossAxisCoord + overflow[minSide];
|
|
const max2 = crossAxisCoord - overflow[maxSide];
|
|
crossAxisCoord = clamp2(min2, crossAxisCoord, max2);
|
|
}
|
|
const limitedCoords = limiter.fn({
|
|
...state,
|
|
[mainAxis]: mainAxisCoord,
|
|
[crossAxis]: crossAxisCoord
|
|
});
|
|
return {
|
|
...limitedCoords,
|
|
data: {
|
|
x: limitedCoords.x - x,
|
|
y: limitedCoords.y - y,
|
|
enabled: {
|
|
[mainAxis]: checkMainAxis,
|
|
[crossAxis]: checkCrossAxis
|
|
}
|
|
}
|
|
};
|
|
}
|
|
};
|
|
}, "shift");
|
|
var size = /* @__PURE__ */ __name(function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: "size",
|
|
options,
|
|
async fn(state) {
|
|
var _state$middlewareData, _state$middlewareData2;
|
|
const {
|
|
placement,
|
|
rects,
|
|
platform: platform2,
|
|
elements
|
|
} = state;
|
|
const {
|
|
apply = /* @__PURE__ */ __name(() => {
|
|
}, "apply"),
|
|
...detectOverflowOptions
|
|
} = evaluate(options, state);
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const side = getSide(placement);
|
|
const alignment = getAlignment(placement);
|
|
const isYAxis = getSideAxis(placement) === "y";
|
|
const {
|
|
width,
|
|
height
|
|
} = rects.floating;
|
|
let heightSide;
|
|
let widthSide;
|
|
if (side === "top" || side === "bottom") {
|
|
heightSide = side;
|
|
widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
} else {
|
|
widthSide = side;
|
|
heightSide = alignment === "end" ? "top" : "bottom";
|
|
}
|
|
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
const noShift = !state.middlewareData.shift;
|
|
let availableHeight = overflowAvailableHeight;
|
|
let availableWidth = overflowAvailableWidth;
|
|
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
availableWidth = maximumClippingWidth;
|
|
}
|
|
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
availableHeight = maximumClippingHeight;
|
|
}
|
|
if (noShift && !alignment) {
|
|
const xMin = max(overflow.left, 0);
|
|
const xMax = max(overflow.right, 0);
|
|
const yMin = max(overflow.top, 0);
|
|
const yMax = max(overflow.bottom, 0);
|
|
if (isYAxis) {
|
|
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
} else {
|
|
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
}
|
|
}
|
|
await apply({
|
|
...state,
|
|
availableWidth,
|
|
availableHeight
|
|
});
|
|
const nextDimensions = await platform2.getDimensions(elements.floating);
|
|
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
return {
|
|
reset: {
|
|
rects: true
|
|
}
|
|
};
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
}, "size");
|
|
|
|
// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
function hasWindow() {
|
|
return typeof window !== "undefined";
|
|
}
|
|
__name(hasWindow, "hasWindow");
|
|
function getNodeName(node) {
|
|
if (isNode(node)) {
|
|
return (node.nodeName || "").toLowerCase();
|
|
}
|
|
return "#document";
|
|
}
|
|
__name(getNodeName, "getNodeName");
|
|
function getWindow(node) {
|
|
var _node$ownerDocument;
|
|
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
}
|
|
__name(getWindow, "getWindow");
|
|
function getDocumentElement(node) {
|
|
var _ref;
|
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
}
|
|
__name(getDocumentElement, "getDocumentElement");
|
|
function isNode(value) {
|
|
if (!hasWindow()) {
|
|
return false;
|
|
}
|
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
}
|
|
__name(isNode, "isNode");
|
|
function isElement(value) {
|
|
if (!hasWindow()) {
|
|
return false;
|
|
}
|
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
}
|
|
__name(isElement, "isElement");
|
|
function isHTMLElement(value) {
|
|
if (!hasWindow()) {
|
|
return false;
|
|
}
|
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
}
|
|
__name(isHTMLElement, "isHTMLElement");
|
|
function isShadowRoot(value) {
|
|
if (!hasWindow() || typeof ShadowRoot === "undefined") {
|
|
return false;
|
|
}
|
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
}
|
|
__name(isShadowRoot, "isShadowRoot");
|
|
var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
function isOverflowElement(element) {
|
|
const {
|
|
overflow,
|
|
overflowX,
|
|
overflowY,
|
|
display
|
|
} = getComputedStyle2(element);
|
|
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
}
|
|
__name(isOverflowElement, "isOverflowElement");
|
|
var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
function isTableElement(element) {
|
|
return tableElements.has(getNodeName(element));
|
|
}
|
|
__name(isTableElement, "isTableElement");
|
|
var topLayerSelectors = [":popover-open", ":modal"];
|
|
function isTopLayer(element) {
|
|
return topLayerSelectors.some((selector) => {
|
|
try {
|
|
return element.matches(selector);
|
|
} catch (_e) {
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
__name(isTopLayer, "isTopLayer");
|
|
var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
|
|
var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
|
|
var containValues = ["paint", "layout", "strict", "content"];
|
|
function isContainingBlock(elementOrCss) {
|
|
const webkit = isWebKit();
|
|
const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
|
|
return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
|
|
}
|
|
__name(isContainingBlock, "isContainingBlock");
|
|
function getContainingBlock(element) {
|
|
let currentNode = getParentNode(element);
|
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
if (isContainingBlock(currentNode)) {
|
|
return currentNode;
|
|
} else if (isTopLayer(currentNode)) {
|
|
return null;
|
|
}
|
|
currentNode = getParentNode(currentNode);
|
|
}
|
|
return null;
|
|
}
|
|
__name(getContainingBlock, "getContainingBlock");
|
|
function isWebKit() {
|
|
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
}
|
|
__name(isWebKit, "isWebKit");
|
|
var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
function isLastTraversableNode(node) {
|
|
return lastTraversableNodeNames.has(getNodeName(node));
|
|
}
|
|
__name(isLastTraversableNode, "isLastTraversableNode");
|
|
function getComputedStyle2(element) {
|
|
return getWindow(element).getComputedStyle(element);
|
|
}
|
|
__name(getComputedStyle2, "getComputedStyle");
|
|
function getNodeScroll(element) {
|
|
if (isElement(element)) {
|
|
return {
|
|
scrollLeft: element.scrollLeft,
|
|
scrollTop: element.scrollTop
|
|
};
|
|
}
|
|
return {
|
|
scrollLeft: element.scrollX,
|
|
scrollTop: element.scrollY
|
|
};
|
|
}
|
|
__name(getNodeScroll, "getNodeScroll");
|
|
function getParentNode(node) {
|
|
if (getNodeName(node) === "html") {
|
|
return node;
|
|
}
|
|
const result = (
|
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
node.assignedSlot || // DOM Element detected.
|
|
node.parentNode || // ShadowRoot detected.
|
|
isShadowRoot(node) && node.host || // Fallback.
|
|
getDocumentElement(node)
|
|
);
|
|
return isShadowRoot(result) ? result.host : result;
|
|
}
|
|
__name(getParentNode, "getParentNode");
|
|
function getNearestOverflowAncestor(node) {
|
|
const parentNode = getParentNode(node);
|
|
if (isLastTraversableNode(parentNode)) {
|
|
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
}
|
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
return parentNode;
|
|
}
|
|
return getNearestOverflowAncestor(parentNode);
|
|
}
|
|
__name(getNearestOverflowAncestor, "getNearestOverflowAncestor");
|
|
function getOverflowAncestors(node, list, traverseIframes) {
|
|
var _node$ownerDocument2;
|
|
if (list === void 0) {
|
|
list = [];
|
|
}
|
|
if (traverseIframes === void 0) {
|
|
traverseIframes = true;
|
|
}
|
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
const win = getWindow(scrollableAncestor);
|
|
if (isBody) {
|
|
const frameElement = getFrameElement(win);
|
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
}
|
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
}
|
|
__name(getOverflowAncestors, "getOverflowAncestors");
|
|
function getFrameElement(win) {
|
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
}
|
|
__name(getFrameElement, "getFrameElement");
|
|
|
|
// node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
function getCssDimensions(element) {
|
|
const css = getComputedStyle2(element);
|
|
let width = parseFloat(css.width) || 0;
|
|
let height = parseFloat(css.height) || 0;
|
|
const hasOffset = isHTMLElement(element);
|
|
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
if (shouldFallback) {
|
|
width = offsetWidth;
|
|
height = offsetHeight;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
$: shouldFallback
|
|
};
|
|
}
|
|
__name(getCssDimensions, "getCssDimensions");
|
|
function unwrapElement(element) {
|
|
return !isElement(element) ? element.contextElement : element;
|
|
}
|
|
__name(unwrapElement, "unwrapElement");
|
|
function getScale(element) {
|
|
const domElement = unwrapElement(element);
|
|
if (!isHTMLElement(domElement)) {
|
|
return createCoords(1);
|
|
}
|
|
const rect = domElement.getBoundingClientRect();
|
|
const {
|
|
width,
|
|
height,
|
|
$
|
|
} = getCssDimensions(domElement);
|
|
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
if (!x || !Number.isFinite(x)) {
|
|
x = 1;
|
|
}
|
|
if (!y || !Number.isFinite(y)) {
|
|
y = 1;
|
|
}
|
|
return {
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
__name(getScale, "getScale");
|
|
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
function getVisualOffsets(element) {
|
|
const win = getWindow(element);
|
|
if (!isWebKit() || !win.visualViewport) {
|
|
return noOffsets;
|
|
}
|
|
return {
|
|
x: win.visualViewport.offsetLeft,
|
|
y: win.visualViewport.offsetTop
|
|
};
|
|
}
|
|
__name(getVisualOffsets, "getVisualOffsets");
|
|
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
if (isFixed === void 0) {
|
|
isFixed = false;
|
|
}
|
|
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
return false;
|
|
}
|
|
return isFixed;
|
|
}
|
|
__name(shouldAddVisualOffsets, "shouldAddVisualOffsets");
|
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
if (includeScale === void 0) {
|
|
includeScale = false;
|
|
}
|
|
if (isFixedStrategy === void 0) {
|
|
isFixedStrategy = false;
|
|
}
|
|
const clientRect = element.getBoundingClientRect();
|
|
const domElement = unwrapElement(element);
|
|
let scale = createCoords(1);
|
|
if (includeScale) {
|
|
if (offsetParent) {
|
|
if (isElement(offsetParent)) {
|
|
scale = getScale(offsetParent);
|
|
}
|
|
} else {
|
|
scale = getScale(element);
|
|
}
|
|
}
|
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
let width = clientRect.width / scale.x;
|
|
let height = clientRect.height / scale.y;
|
|
if (domElement) {
|
|
const win = getWindow(domElement);
|
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
let currentWin = win;
|
|
let currentIFrame = getFrameElement(currentWin);
|
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
const iframeScale = getScale(currentIFrame);
|
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
const css = getComputedStyle2(currentIFrame);
|
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
x *= iframeScale.x;
|
|
y *= iframeScale.y;
|
|
width *= iframeScale.x;
|
|
height *= iframeScale.y;
|
|
x += left;
|
|
y += top;
|
|
currentWin = getWindow(currentIFrame);
|
|
currentIFrame = getFrameElement(currentWin);
|
|
}
|
|
}
|
|
return rectToClientRect({
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
});
|
|
}
|
|
__name(getBoundingClientRect, "getBoundingClientRect");
|
|
function getWindowScrollBarX(element, rect) {
|
|
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
if (!rect) {
|
|
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
}
|
|
return rect.left + leftScroll;
|
|
}
|
|
__name(getWindowScrollBarX, "getWindowScrollBarX");
|
|
function getHTMLOffset(documentElement, scroll) {
|
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
const y = htmlRect.top + scroll.scrollTop;
|
|
return {
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
__name(getHTMLOffset, "getHTMLOffset");
|
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
let {
|
|
elements,
|
|
rect,
|
|
offsetParent,
|
|
strategy
|
|
} = _ref;
|
|
const isFixed = strategy === "fixed";
|
|
const documentElement = getDocumentElement(offsetParent);
|
|
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
return rect;
|
|
}
|
|
let scroll = {
|
|
scrollLeft: 0,
|
|
scrollTop: 0
|
|
};
|
|
let scale = createCoords(1);
|
|
const offsets = createCoords(0);
|
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
scroll = getNodeScroll(offsetParent);
|
|
}
|
|
if (isHTMLElement(offsetParent)) {
|
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
scale = getScale(offsetParent);
|
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
}
|
|
}
|
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
return {
|
|
width: rect.width * scale.x,
|
|
height: rect.height * scale.y,
|
|
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
};
|
|
}
|
|
__name(convertOffsetParentRelativeRectToViewportRelativeRect, "convertOffsetParentRelativeRectToViewportRelativeRect");
|
|
function getClientRects(element) {
|
|
return Array.from(element.getClientRects());
|
|
}
|
|
__name(getClientRects, "getClientRects");
|
|
function getDocumentRect(element) {
|
|
const html = getDocumentElement(element);
|
|
const scroll = getNodeScroll(element);
|
|
const body = element.ownerDocument.body;
|
|
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
const y = -scroll.scrollTop;
|
|
if (getComputedStyle2(body).direction === "rtl") {
|
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
__name(getDocumentRect, "getDocumentRect");
|
|
var SCROLLBAR_MAX = 25;
|
|
function getViewportRect(element, strategy) {
|
|
const win = getWindow(element);
|
|
const html = getDocumentElement(element);
|
|
const visualViewport = win.visualViewport;
|
|
let width = html.clientWidth;
|
|
let height = html.clientHeight;
|
|
let x = 0;
|
|
let y = 0;
|
|
if (visualViewport) {
|
|
width = visualViewport.width;
|
|
height = visualViewport.height;
|
|
const visualViewportBased = isWebKit();
|
|
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
x = visualViewport.offsetLeft;
|
|
y = visualViewport.offsetTop;
|
|
}
|
|
}
|
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
if (windowScrollbarX <= 0) {
|
|
const doc = html.ownerDocument;
|
|
const body = doc.body;
|
|
const bodyStyles = getComputedStyle(body);
|
|
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
width -= clippingStableScrollbarWidth;
|
|
}
|
|
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
width += windowScrollbarX;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
__name(getViewportRect, "getViewportRect");
|
|
var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
function getInnerBoundingClientRect(element, strategy) {
|
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
const top = clientRect.top + element.clientTop;
|
|
const left = clientRect.left + element.clientLeft;
|
|
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
const width = element.clientWidth * scale.x;
|
|
const height = element.clientHeight * scale.y;
|
|
const x = left * scale.x;
|
|
const y = top * scale.y;
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
__name(getInnerBoundingClientRect, "getInnerBoundingClientRect");
|
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
let rect;
|
|
if (clippingAncestor === "viewport") {
|
|
rect = getViewportRect(element, strategy);
|
|
} else if (clippingAncestor === "document") {
|
|
rect = getDocumentRect(getDocumentElement(element));
|
|
} else if (isElement(clippingAncestor)) {
|
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
} else {
|
|
const visualOffsets = getVisualOffsets(element);
|
|
rect = {
|
|
x: clippingAncestor.x - visualOffsets.x,
|
|
y: clippingAncestor.y - visualOffsets.y,
|
|
width: clippingAncestor.width,
|
|
height: clippingAncestor.height
|
|
};
|
|
}
|
|
return rectToClientRect(rect);
|
|
}
|
|
__name(getClientRectFromClippingAncestor, "getClientRectFromClippingAncestor");
|
|
function hasFixedPositionAncestor(element, stopNode) {
|
|
const parentNode = getParentNode(element);
|
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
return false;
|
|
}
|
|
return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
}
|
|
__name(hasFixedPositionAncestor, "hasFixedPositionAncestor");
|
|
function getClippingElementAncestors(element, cache3) {
|
|
const cachedResult = cache3.get(element);
|
|
if (cachedResult) {
|
|
return cachedResult;
|
|
}
|
|
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
let currentContainingBlockComputedStyle = null;
|
|
const elementIsFixed = getComputedStyle2(element).position === "fixed";
|
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
const computedStyle = getComputedStyle2(currentNode);
|
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
currentContainingBlockComputedStyle = null;
|
|
}
|
|
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
if (shouldDropCurrentNode) {
|
|
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
} else {
|
|
currentContainingBlockComputedStyle = computedStyle;
|
|
}
|
|
currentNode = getParentNode(currentNode);
|
|
}
|
|
cache3.set(element, result);
|
|
return result;
|
|
}
|
|
__name(getClippingElementAncestors, "getClippingElementAncestors");
|
|
function getClippingRect(_ref) {
|
|
let {
|
|
element,
|
|
boundary,
|
|
rootBoundary,
|
|
strategy
|
|
} = _ref;
|
|
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
const firstClippingAncestor = clippingAncestors[0];
|
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
accRect.top = max(rect.top, accRect.top);
|
|
accRect.right = min(rect.right, accRect.right);
|
|
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
accRect.left = max(rect.left, accRect.left);
|
|
return accRect;
|
|
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
return {
|
|
width: clippingRect.right - clippingRect.left,
|
|
height: clippingRect.bottom - clippingRect.top,
|
|
x: clippingRect.left,
|
|
y: clippingRect.top
|
|
};
|
|
}
|
|
__name(getClippingRect, "getClippingRect");
|
|
function getDimensions(element) {
|
|
const {
|
|
width,
|
|
height
|
|
} = getCssDimensions(element);
|
|
return {
|
|
width,
|
|
height
|
|
};
|
|
}
|
|
__name(getDimensions, "getDimensions");
|
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
const documentElement = getDocumentElement(offsetParent);
|
|
const isFixed = strategy === "fixed";
|
|
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
let scroll = {
|
|
scrollLeft: 0,
|
|
scrollTop: 0
|
|
};
|
|
const offsets = createCoords(0);
|
|
function setLeftRTLScrollbarOffset() {
|
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
}
|
|
__name(setLeftRTLScrollbarOffset, "setLeftRTLScrollbarOffset");
|
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
scroll = getNodeScroll(offsetParent);
|
|
}
|
|
if (isOffsetParentAnElement) {
|
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
} else if (documentElement) {
|
|
setLeftRTLScrollbarOffset();
|
|
}
|
|
}
|
|
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
setLeftRTLScrollbarOffset();
|
|
}
|
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
return {
|
|
x,
|
|
y,
|
|
width: rect.width,
|
|
height: rect.height
|
|
};
|
|
}
|
|
__name(getRectRelativeToOffsetParent, "getRectRelativeToOffsetParent");
|
|
function isStaticPositioned(element) {
|
|
return getComputedStyle2(element).position === "static";
|
|
}
|
|
__name(isStaticPositioned, "isStaticPositioned");
|
|
function getTrueOffsetParent(element, polyfill) {
|
|
if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
|
|
return null;
|
|
}
|
|
if (polyfill) {
|
|
return polyfill(element);
|
|
}
|
|
let rawOffsetParent = element.offsetParent;
|
|
if (getDocumentElement(element) === rawOffsetParent) {
|
|
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
}
|
|
return rawOffsetParent;
|
|
}
|
|
__name(getTrueOffsetParent, "getTrueOffsetParent");
|
|
function getOffsetParent(element, polyfill) {
|
|
const win = getWindow(element);
|
|
if (isTopLayer(element)) {
|
|
return win;
|
|
}
|
|
if (!isHTMLElement(element)) {
|
|
let svgOffsetParent = getParentNode(element);
|
|
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
return svgOffsetParent;
|
|
}
|
|
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
}
|
|
return win;
|
|
}
|
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
}
|
|
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
return win;
|
|
}
|
|
return offsetParent || getContainingBlock(element) || win;
|
|
}
|
|
__name(getOffsetParent, "getOffsetParent");
|
|
var getElementRects = /* @__PURE__ */ __name(async function(data) {
|
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
const getDimensionsFn = this.getDimensions;
|
|
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
return {
|
|
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
floating: {
|
|
x: 0,
|
|
y: 0,
|
|
width: floatingDimensions.width,
|
|
height: floatingDimensions.height
|
|
}
|
|
};
|
|
}, "getElementRects");
|
|
function isRTL(element) {
|
|
return getComputedStyle2(element).direction === "rtl";
|
|
}
|
|
__name(isRTL, "isRTL");
|
|
var platform = {
|
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
getDocumentElement,
|
|
getClippingRect,
|
|
getOffsetParent,
|
|
getElementRects,
|
|
getClientRects,
|
|
getDimensions,
|
|
getScale,
|
|
isElement,
|
|
isRTL
|
|
};
|
|
function rectsAreEqual(a, b) {
|
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
}
|
|
__name(rectsAreEqual, "rectsAreEqual");
|
|
function observeMove(element, onMove) {
|
|
let io = null;
|
|
let timeoutId;
|
|
const root = getDocumentElement(element);
|
|
function cleanup2() {
|
|
var _io;
|
|
clearTimeout(timeoutId);
|
|
(_io = io) == null || _io.disconnect();
|
|
io = null;
|
|
}
|
|
__name(cleanup2, "cleanup");
|
|
function refresh(skip, threshold) {
|
|
if (skip === void 0) {
|
|
skip = false;
|
|
}
|
|
if (threshold === void 0) {
|
|
threshold = 1;
|
|
}
|
|
cleanup2();
|
|
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
const {
|
|
left,
|
|
top,
|
|
width,
|
|
height
|
|
} = elementRectForRootMargin;
|
|
if (!skip) {
|
|
onMove();
|
|
}
|
|
if (!width || !height) {
|
|
return;
|
|
}
|
|
const insetTop = floor(top);
|
|
const insetRight = floor(root.clientWidth - (left + width));
|
|
const insetBottom = floor(root.clientHeight - (top + height));
|
|
const insetLeft = floor(left);
|
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
const options = {
|
|
rootMargin,
|
|
threshold: max(0, min(1, threshold)) || 1
|
|
};
|
|
let isFirstUpdate = true;
|
|
function handleObserve(entries) {
|
|
const ratio = entries[0].intersectionRatio;
|
|
if (ratio !== threshold) {
|
|
if (!isFirstUpdate) {
|
|
return refresh();
|
|
}
|
|
if (!ratio) {
|
|
timeoutId = setTimeout(() => {
|
|
refresh(false, 1e-7);
|
|
}, 1e3);
|
|
} else {
|
|
refresh(false, ratio);
|
|
}
|
|
}
|
|
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
refresh();
|
|
}
|
|
isFirstUpdate = false;
|
|
}
|
|
__name(handleObserve, "handleObserve");
|
|
try {
|
|
io = new IntersectionObserver(handleObserve, {
|
|
...options,
|
|
// Handle <iframe>s
|
|
root: root.ownerDocument
|
|
});
|
|
} catch (_e) {
|
|
io = new IntersectionObserver(handleObserve, options);
|
|
}
|
|
io.observe(element);
|
|
}
|
|
__name(refresh, "refresh");
|
|
refresh(true);
|
|
return cleanup2;
|
|
}
|
|
__name(observeMove, "observeMove");
|
|
function autoUpdate(reference, floating, update, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
ancestorScroll = true,
|
|
ancestorResize = true,
|
|
elementResize = typeof ResizeObserver === "function",
|
|
layoutShift = typeof IntersectionObserver === "function",
|
|
animationFrame = false
|
|
} = options;
|
|
const referenceEl = unwrapElement(reference);
|
|
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
ancestors.forEach((ancestor) => {
|
|
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
passive: true
|
|
});
|
|
ancestorResize && ancestor.addEventListener("resize", update);
|
|
});
|
|
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
let reobserveFrame = -1;
|
|
let resizeObserver = null;
|
|
if (elementResize) {
|
|
resizeObserver = new ResizeObserver((_ref) => {
|
|
let [firstEntry] = _ref;
|
|
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
resizeObserver.unobserve(floating);
|
|
cancelAnimationFrame(reobserveFrame);
|
|
reobserveFrame = requestAnimationFrame(() => {
|
|
var _resizeObserver;
|
|
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
});
|
|
}
|
|
update();
|
|
});
|
|
if (referenceEl && !animationFrame) {
|
|
resizeObserver.observe(referenceEl);
|
|
}
|
|
resizeObserver.observe(floating);
|
|
}
|
|
let frameId;
|
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
if (animationFrame) {
|
|
frameLoop();
|
|
}
|
|
function frameLoop() {
|
|
const nextRefRect = getBoundingClientRect(reference);
|
|
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
update();
|
|
}
|
|
prevRefRect = nextRefRect;
|
|
frameId = requestAnimationFrame(frameLoop);
|
|
}
|
|
__name(frameLoop, "frameLoop");
|
|
update();
|
|
return () => {
|
|
var _resizeObserver2;
|
|
ancestors.forEach((ancestor) => {
|
|
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
});
|
|
cleanupIo == null || cleanupIo();
|
|
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
resizeObserver = null;
|
|
if (animationFrame) {
|
|
cancelAnimationFrame(frameId);
|
|
}
|
|
};
|
|
}
|
|
__name(autoUpdate, "autoUpdate");
|
|
var detectOverflow2 = detectOverflow;
|
|
var offset2 = offset;
|
|
var shift2 = shift;
|
|
var flip2 = flip;
|
|
var size2 = size;
|
|
var arrow2 = arrow;
|
|
var computePosition2 = /* @__PURE__ */ __name((reference, floating, options) => {
|
|
const cache3 = /* @__PURE__ */ new Map();
|
|
const mergedOptions = {
|
|
platform,
|
|
...options
|
|
};
|
|
const platformWithCache = {
|
|
...mergedOptions.platform,
|
|
_c: cache3
|
|
};
|
|
return computePosition(reference, floating, {
|
|
...mergedOptions,
|
|
platform: platformWithCache
|
|
});
|
|
}, "computePosition");
|
|
|
|
// node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
var React47 = __toESM(require("react"), 1);
|
|
var import_react37 = require("react");
|
|
var ReactDOM2 = __toESM(require("react-dom"), 1);
|
|
var isClient3 = typeof document !== "undefined";
|
|
var noop = /* @__PURE__ */ __name(function noop2() {
|
|
}, "noop");
|
|
var index = isClient3 ? import_react37.useLayoutEffect : noop;
|
|
function deepEqual(a, b) {
|
|
if (a === b) {
|
|
return true;
|
|
}
|
|
if (typeof a !== typeof b) {
|
|
return false;
|
|
}
|
|
if (typeof a === "function" && a.toString() === b.toString()) {
|
|
return true;
|
|
}
|
|
let length;
|
|
let i;
|
|
let keys;
|
|
if (a && b && typeof a === "object") {
|
|
if (Array.isArray(a)) {
|
|
length = a.length;
|
|
if (length !== b.length) return false;
|
|
for (i = length; i-- !== 0; ) {
|
|
if (!deepEqual(a[i], b[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
keys = Object.keys(a);
|
|
length = keys.length;
|
|
if (length !== Object.keys(b).length) {
|
|
return false;
|
|
}
|
|
for (i = length; i-- !== 0; ) {
|
|
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
for (i = length; i-- !== 0; ) {
|
|
const key = keys[i];
|
|
if (key === "_owner" && a.$$typeof) {
|
|
continue;
|
|
}
|
|
if (!deepEqual(a[key], b[key])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return a !== a && b !== b;
|
|
}
|
|
__name(deepEqual, "deepEqual");
|
|
function getDPR(element) {
|
|
if (typeof window === "undefined") {
|
|
return 1;
|
|
}
|
|
const win = element.ownerDocument.defaultView || window;
|
|
return win.devicePixelRatio || 1;
|
|
}
|
|
__name(getDPR, "getDPR");
|
|
function roundByDPR(element, value) {
|
|
const dpr = getDPR(element);
|
|
return Math.round(value * dpr) / dpr;
|
|
}
|
|
__name(roundByDPR, "roundByDPR");
|
|
function useLatestRef(value) {
|
|
const ref = React47.useRef(value);
|
|
index(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref;
|
|
}
|
|
__name(useLatestRef, "useLatestRef");
|
|
function useFloating(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
placement = "bottom",
|
|
strategy = "absolute",
|
|
middleware = [],
|
|
platform: platform2,
|
|
elements: {
|
|
reference: externalReference,
|
|
floating: externalFloating
|
|
} = {},
|
|
transform = true,
|
|
whileElementsMounted,
|
|
open
|
|
} = options;
|
|
const [data, setData] = React47.useState({
|
|
x: 0,
|
|
y: 0,
|
|
strategy,
|
|
placement,
|
|
middlewareData: {},
|
|
isPositioned: false
|
|
});
|
|
const [latestMiddleware, setLatestMiddleware] = React47.useState(middleware);
|
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
setLatestMiddleware(middleware);
|
|
}
|
|
const [_reference, _setReference] = React47.useState(null);
|
|
const [_floating, _setFloating] = React47.useState(null);
|
|
const setReference = React47.useCallback((node) => {
|
|
if (node !== referenceRef.current) {
|
|
referenceRef.current = node;
|
|
_setReference(node);
|
|
}
|
|
}, []);
|
|
const setFloating = React47.useCallback((node) => {
|
|
if (node !== floatingRef.current) {
|
|
floatingRef.current = node;
|
|
_setFloating(node);
|
|
}
|
|
}, []);
|
|
const referenceEl = externalReference || _reference;
|
|
const floatingEl = externalFloating || _floating;
|
|
const referenceRef = React47.useRef(null);
|
|
const floatingRef = React47.useRef(null);
|
|
const dataRef = React47.useRef(data);
|
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
const platformRef = useLatestRef(platform2);
|
|
const openRef = useLatestRef(open);
|
|
const update = React47.useCallback(() => {
|
|
if (!referenceRef.current || !floatingRef.current) {
|
|
return;
|
|
}
|
|
const config = {
|
|
placement,
|
|
strategy,
|
|
middleware: latestMiddleware
|
|
};
|
|
if (platformRef.current) {
|
|
config.platform = platformRef.current;
|
|
}
|
|
computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
|
|
const fullData = {
|
|
...data2,
|
|
// The floating element's position may be recomputed while it's closed
|
|
// but still mounted (such as when transitioning out). To ensure
|
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
// setting it to `true` when `open === false` (must be specified).
|
|
isPositioned: openRef.current !== false
|
|
};
|
|
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
dataRef.current = fullData;
|
|
ReactDOM2.flushSync(() => {
|
|
setData(fullData);
|
|
});
|
|
}
|
|
});
|
|
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
|
|
index(() => {
|
|
if (open === false && dataRef.current.isPositioned) {
|
|
dataRef.current.isPositioned = false;
|
|
setData((data2) => ({
|
|
...data2,
|
|
isPositioned: false
|
|
}));
|
|
}
|
|
}, [open]);
|
|
const isMountedRef = React47.useRef(false);
|
|
index(() => {
|
|
isMountedRef.current = true;
|
|
return () => {
|
|
isMountedRef.current = false;
|
|
};
|
|
}, []);
|
|
index(() => {
|
|
if (referenceEl) referenceRef.current = referenceEl;
|
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
if (referenceEl && floatingEl) {
|
|
if (whileElementsMountedRef.current) {
|
|
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
}
|
|
update();
|
|
}
|
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
const refs = React47.useMemo(() => ({
|
|
reference: referenceRef,
|
|
floating: floatingRef,
|
|
setReference,
|
|
setFloating
|
|
}), [setReference, setFloating]);
|
|
const elements = React47.useMemo(() => ({
|
|
reference: referenceEl,
|
|
floating: floatingEl
|
|
}), [referenceEl, floatingEl]);
|
|
const floatingStyles = React47.useMemo(() => {
|
|
const initialStyles = {
|
|
position: strategy,
|
|
left: 0,
|
|
top: 0
|
|
};
|
|
if (!elements.floating) {
|
|
return initialStyles;
|
|
}
|
|
const x = roundByDPR(elements.floating, data.x);
|
|
const y = roundByDPR(elements.floating, data.y);
|
|
if (transform) {
|
|
return {
|
|
...initialStyles,
|
|
transform: "translate(" + x + "px, " + y + "px)",
|
|
...getDPR(elements.floating) >= 1.5 && {
|
|
willChange: "transform"
|
|
}
|
|
};
|
|
}
|
|
return {
|
|
position: strategy,
|
|
left: x,
|
|
top: y
|
|
};
|
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
return React47.useMemo(() => ({
|
|
...data,
|
|
update,
|
|
refs,
|
|
elements,
|
|
floatingStyles
|
|
}), [data, update, refs, elements, floatingStyles]);
|
|
}
|
|
__name(useFloating, "useFloating");
|
|
var arrow$1 = /* @__PURE__ */ __name((options) => {
|
|
function isRef(value) {
|
|
return {}.hasOwnProperty.call(value, "current");
|
|
}
|
|
__name(isRef, "isRef");
|
|
return {
|
|
name: "arrow",
|
|
options,
|
|
fn(state) {
|
|
const {
|
|
element,
|
|
padding
|
|
} = typeof options === "function" ? options(state) : options;
|
|
if (element && isRef(element)) {
|
|
if (element.current != null) {
|
|
return arrow2({
|
|
element: element.current,
|
|
padding
|
|
}).fn(state);
|
|
}
|
|
return {};
|
|
}
|
|
if (element) {
|
|
return arrow2({
|
|
element,
|
|
padding
|
|
}).fn(state);
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
}, "arrow$1");
|
|
var offset3 = /* @__PURE__ */ __name((options, deps) => ({
|
|
...offset2(options),
|
|
options: [options, deps]
|
|
}), "offset");
|
|
var shift3 = /* @__PURE__ */ __name((options, deps) => ({
|
|
...shift2(options),
|
|
options: [options, deps]
|
|
}), "shift");
|
|
var flip3 = /* @__PURE__ */ __name((options, deps) => ({
|
|
...flip2(options),
|
|
options: [options, deps]
|
|
}), "flip");
|
|
var size3 = /* @__PURE__ */ __name((options, deps) => ({
|
|
...size2(options),
|
|
options: [options, deps]
|
|
}), "size");
|
|
var arrow3 = /* @__PURE__ */ __name((options, deps) => ({
|
|
...arrow$1(options),
|
|
options: [options, deps]
|
|
}), "arrow");
|
|
|
|
// node_modules/@tamagui/floating/dist/esm/useFloating.mjs
|
|
var import_react38 = __toESM(require("react"), 1);
|
|
var FloatingOverrideContext = import_react38.default.createContext(null);
|
|
var useFloating2 = /* @__PURE__ */ __name((props) => (import_react38.default.useContext(FloatingOverrideContext) || useFloating)?.({
|
|
...props,
|
|
middleware: [
|
|
// @ts-ignore
|
|
...props.middleware,
|
|
{
|
|
name: "rounded",
|
|
fn({
|
|
x,
|
|
y
|
|
}) {
|
|
return {
|
|
x: Math.round(x),
|
|
y: Math.round(y)
|
|
};
|
|
}
|
|
}
|
|
]
|
|
}), "useFloating");
|
|
|
|
// node_modules/@tamagui/popper/dist/esm/Popper.mjs
|
|
var import_core26 = require("@tamagui/core");
|
|
var React49 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
var PopperContextFast = (0, import_core26.createStyledContext)(
|
|
// since we always provide this we can avoid setting here
|
|
{},
|
|
"Popper__"
|
|
);
|
|
var PopperPositionContext = import_core26.createStyledContext;
|
|
var {
|
|
useStyledContext: usePopperContext,
|
|
Provider: PopperProviderFast
|
|
} = PopperContextFast;
|
|
var PopperContextSlow = (0, import_core26.createStyledContext)(
|
|
// since we always provide this we can avoid setting here
|
|
{},
|
|
"PopperSlow__"
|
|
);
|
|
var {
|
|
useStyledContext: usePopperContextSlow,
|
|
Provider: PopperProviderSlow
|
|
} = PopperContextSlow;
|
|
var PopperProvider = /* @__PURE__ */ __name(({
|
|
scope,
|
|
children,
|
|
...context2
|
|
}) => {
|
|
const slowContext = getContextSlow(context2);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PopperProviderFast, {
|
|
scope,
|
|
...context2,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PopperProviderSlow, {
|
|
scope,
|
|
...slowContext,
|
|
children
|
|
})
|
|
});
|
|
}, "PopperProvider");
|
|
function getContextSlow(context2) {
|
|
return {
|
|
refs: context2.refs,
|
|
size: context2.size,
|
|
arrowRef: context2.arrowRef,
|
|
arrowStyle: context2.arrowStyle,
|
|
onArrowSize: context2.onArrowSize,
|
|
hasFloating: context2.hasFloating,
|
|
strategy: context2.strategy,
|
|
update: context2.update,
|
|
context: context2.context,
|
|
getFloatingProps: context2.getFloatingProps,
|
|
getReferenceProps: context2.getReferenceProps,
|
|
open: context2.open
|
|
};
|
|
}
|
|
__name(getContextSlow, "getContextSlow");
|
|
var checkFloating = void 0;
|
|
var setupOptions = {};
|
|
function setupPopper(options) {
|
|
Object.assign(setupOptions, options);
|
|
}
|
|
__name(setupPopper, "setupPopper");
|
|
function Popper(props) {
|
|
const {
|
|
children,
|
|
size: size4,
|
|
strategy = "absolute",
|
|
placement = "bottom",
|
|
stayInFrame,
|
|
allowFlip,
|
|
offset: offset4,
|
|
disableRTL,
|
|
resize,
|
|
passThrough,
|
|
open,
|
|
scope
|
|
} = props, [arrowEl, setArrow] = React49.useState(null), [arrowSize, setArrowSize] = React49.useState(0), offsetOptions = offset4 ?? arrowSize, floatingStyle = React49.useRef({}), isOpen = passThrough ? false : open || true;
|
|
let floating = useFloating2({
|
|
open: isOpen,
|
|
strategy,
|
|
placement,
|
|
sameScrollView: false,
|
|
// this only takes effect on native
|
|
whileElementsMounted: isOpen ? autoUpdate : void 0,
|
|
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
...platform,
|
|
isRTL(element) {
|
|
return false;
|
|
}
|
|
} : platform,
|
|
middleware: [stayInFrame ? shift3(typeof stayInFrame == "boolean" ? {} : stayInFrame) : null, allowFlip ? flip3(typeof allowFlip == "boolean" ? {} : allowFlip) : null, arrowEl ? arrow3({
|
|
element: arrowEl
|
|
}) : null, typeof offsetOptions < "u" ? offset3(offsetOptions) : null, checkFloating, resize ? size3({
|
|
apply({
|
|
availableHeight,
|
|
availableWidth
|
|
}) {
|
|
if (passThrough) return;
|
|
Object.assign(floatingStyle.current, {
|
|
maxHeight: `${availableHeight}px`,
|
|
maxWidth: `${availableWidth}px`
|
|
});
|
|
const floatingChild = floating.refs.floating.current?.firstChild;
|
|
floatingChild && floatingChild instanceof HTMLElement && Object.assign(floatingChild.style, floatingStyle.current);
|
|
},
|
|
...typeof resize == "object" && resize
|
|
}) : null].filter(Boolean)
|
|
});
|
|
floating = React49.useMemo(() => {
|
|
const og = floating.getFloatingProps;
|
|
return resize && og && (floating.getFloatingProps = (props2) => og({
|
|
...props2,
|
|
style: {
|
|
...props2.style,
|
|
...floatingStyle.current
|
|
}
|
|
})), floating;
|
|
}, [floating, resize ? JSON.stringify(resize) : null]);
|
|
const {
|
|
middlewareData
|
|
} = floating, popperContext = React49.useMemo(() => ({
|
|
size: size4,
|
|
arrowRef: setArrow,
|
|
arrowStyle: middlewareData.arrow,
|
|
onArrowSize: setArrowSize,
|
|
hasFloating: middlewareData.checkFloating?.hasFloating,
|
|
open: !!open,
|
|
...floating
|
|
}), [open, size4, floating.x, floating.y, floating.placement, JSON.stringify(middlewareData.arrow || null), floating.isPositioned]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core26.LayoutMeasurementController, {
|
|
disable: !isOpen,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PopperProvider, {
|
|
scope,
|
|
...popperContext,
|
|
children
|
|
})
|
|
});
|
|
}
|
|
__name(Popper, "Popper");
|
|
var PopperAnchor = YStack.extractable(React49.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
virtualRef,
|
|
scope,
|
|
...anchorProps
|
|
} = props, context2 = usePopperContextSlow(scope), {
|
|
getReferenceProps,
|
|
refs,
|
|
update
|
|
} = context2, ref = React49.useRef(null);
|
|
React49.useEffect(() => {
|
|
virtualRef && refs.setReference(virtualRef.current);
|
|
}, [virtualRef]);
|
|
const stackProps = anchorProps, refProps = getReferenceProps ? getReferenceProps(stackProps) : null, shouldHandleInHover = isWeb && scope, composedRefs = useComposedRefs(
|
|
forwardedRef,
|
|
ref,
|
|
// web handles this onMouseEnter below so it can support multiple targets + hovering
|
|
shouldHandleInHover ? void 0 : refs.setReference
|
|
);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core26.View, {
|
|
...stackProps,
|
|
...refProps,
|
|
ref: composedRefs,
|
|
...shouldHandleInHover && {
|
|
// this helps us with handling scoped poppers with many different targets
|
|
// basically we wait for mouseEnter to ever set a reference and remove it on leave
|
|
// otherwise floating ui gets confused by having >1 reference
|
|
onMouseEnter: /* @__PURE__ */ __name((e) => {
|
|
ref.current instanceof HTMLElement && (refs.setReference(ref.current), refProps.onPointerEnter?.(e), update());
|
|
}, "onMouseEnter"),
|
|
onMouseLeave: /* @__PURE__ */ __name((e) => {
|
|
refProps?.onMouseLeave?.(e);
|
|
}, "onMouseLeave")
|
|
}
|
|
});
|
|
}));
|
|
var PopperContentFrame = (0, import_core26.styled)(ThemeableStack, {
|
|
name: "PopperContent",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
backgroundColor: "$background",
|
|
alignItems: "center",
|
|
radiused: true
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, {
|
|
tokens
|
|
}) => ({
|
|
padding: tokens.space[val],
|
|
borderRadius: tokens.radius[val]
|
|
}), "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var PopperContent = React49.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
enableAnimationForPositionChange,
|
|
children,
|
|
passThrough,
|
|
...rest
|
|
} = props, context2 = usePopperContext(scope), {
|
|
strategy,
|
|
placement,
|
|
refs,
|
|
x,
|
|
y,
|
|
getFloatingProps,
|
|
size: size4,
|
|
isPositioned
|
|
} = context2, contentRefs = useComposedRefs(refs.setFloating, forwardedRef), [needsMeasure, setNeedsMeasure] = React49.useState(enableAnimationForPositionChange);
|
|
useIsomorphicLayoutEffect(() => {
|
|
needsMeasure && x && y && setNeedsMeasure(false);
|
|
}, [needsMeasure, enableAnimationForPositionChange, x, y]);
|
|
const hide4 = x === 0 && y === 0, disableAnimationProp = (
|
|
// if they want to animate also when re-positioning allow it
|
|
enableAnimationForPositionChange === "even-when-repositioning" ? needsMeasure : !isPositioned || needsMeasure
|
|
), [disableAnimation, setDisableAnimation] = React49.useState(disableAnimationProp);
|
|
React49.useEffect(() => {
|
|
setDisableAnimation(disableAnimationProp);
|
|
}, [disableAnimationProp]);
|
|
const frameProps = {
|
|
ref: contentRefs,
|
|
x: x || 0,
|
|
y: y || 0,
|
|
top: 0,
|
|
left: 0,
|
|
position: strategy,
|
|
opacity: 1,
|
|
...enableAnimationForPositionChange && {
|
|
animation: rest.animation,
|
|
animateOnly: disableAnimation ? [] : rest.animateOnly,
|
|
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
animatePresence: false
|
|
},
|
|
...hide4 && {
|
|
opacity: 0,
|
|
animateOnly: []
|
|
}
|
|
}, {
|
|
style,
|
|
...floatingProps
|
|
} = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core26.View, {
|
|
passThrough,
|
|
ref: contentRefs,
|
|
contain: "layout style",
|
|
...passThrough ? null : floatingProps,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PopperContentFrame, {
|
|
passThrough,
|
|
...!passThrough && {
|
|
"data-placement": placement,
|
|
"data-strategy": strategy,
|
|
size: size4,
|
|
...style,
|
|
...rest
|
|
},
|
|
children
|
|
}, "popper-content-frame")
|
|
});
|
|
});
|
|
var PopperArrowFrame = (0, import_core26.styled)(YStack, {
|
|
name: "PopperArrow",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background",
|
|
position: "relative"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var PopperArrowOuterFrame = (0, import_core26.styled)(YStack, {
|
|
name: "PopperArrowOuter",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
position: "absolute",
|
|
zIndex: 1e6,
|
|
pointerEvents: "none",
|
|
overflow: "hidden",
|
|
alignItems: "center",
|
|
justifyContent: "center"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var opposites = {
|
|
top: "bottom",
|
|
right: "left",
|
|
bottom: "top",
|
|
left: "right"
|
|
};
|
|
var PopperArrow = React49.forwardRef(function(propsIn, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = propsIn, props = (0, import_core26.useProps)(rest), {
|
|
offset: offset4,
|
|
size: sizeProp,
|
|
borderWidth = 0,
|
|
...arrowProps
|
|
} = props, context2 = usePopperContext(scope), sizeVal = typeof sizeProp == "number" ? sizeProp : (0, import_core26.getVariableValue)(getSpace(sizeProp ?? context2.size, {
|
|
shift: -2,
|
|
bounds: [2]
|
|
})), size4 = Math.max(0, +sizeVal), {
|
|
placement
|
|
} = context2, refs = useComposedRefs(context2.arrowRef, forwardedRef), x = context2.arrowStyle?.x || 0, y = context2.arrowStyle?.y || 0, primaryPlacement = placement ? placement.split("-")[0] : "top", arrowStyle = {
|
|
x,
|
|
y,
|
|
width: size4,
|
|
height: size4
|
|
}, innerArrowStyle = {}, isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
if (primaryPlacement) {
|
|
arrowStyle[isVertical ? "width" : "height"] = size4 * 2;
|
|
const oppSide = opposites[primaryPlacement];
|
|
oppSide && (arrowStyle[oppSide] = -size4, innerArrowStyle[oppSide] = size4 / 2), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), useIsomorphicLayoutEffect(() => {
|
|
context2.onArrowSize?.(size4);
|
|
}, [size4, context2.onArrowSize]);
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PopperArrowOuterFrame, {
|
|
ref: refs,
|
|
...arrowStyle,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PopperArrowFrame, {
|
|
width: size4,
|
|
height: size4,
|
|
...arrowProps,
|
|
...innerArrowStyle,
|
|
rotate: "45deg",
|
|
...primaryPlacement === "bottom" && {
|
|
borderLeftWidth: borderWidth,
|
|
borderTopWidth: borderWidth
|
|
},
|
|
...primaryPlacement === "top" && {
|
|
borderBottomWidth: borderWidth,
|
|
borderRightWidth: borderWidth
|
|
},
|
|
...primaryPlacement === "right" && {
|
|
borderLeftWidth: borderWidth,
|
|
borderBottomWidth: borderWidth
|
|
},
|
|
...primaryPlacement === "left" && {
|
|
borderTopWidth: borderWidth,
|
|
borderRightWidth: borderWidth
|
|
}
|
|
})
|
|
});
|
|
});
|
|
|
|
// node_modules/@tamagui/popover/dist/esm/Popover.mjs
|
|
var React53 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/popover/dist/esm/useFloatingContext.mjs
|
|
var import_react40 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/popover/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
var React51 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/popover/node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs
|
|
var React50 = __toESM(require("react"), 1);
|
|
var import_react39 = require("react");
|
|
function getPlatform() {
|
|
const uaData = navigator.userAgentData;
|
|
if (uaData != null && uaData.platform) {
|
|
return uaData.platform;
|
|
}
|
|
return navigator.platform;
|
|
}
|
|
__name(getPlatform, "getPlatform");
|
|
function getUserAgent() {
|
|
const uaData = navigator.userAgentData;
|
|
if (uaData && Array.isArray(uaData.brands)) {
|
|
return uaData.brands.map((_ref) => {
|
|
let {
|
|
brand,
|
|
version
|
|
} = _ref;
|
|
return brand + "/" + version;
|
|
}).join(" ");
|
|
}
|
|
return navigator.userAgent;
|
|
}
|
|
__name(getUserAgent, "getUserAgent");
|
|
function isSafari() {
|
|
return /apple/i.test(navigator.vendor);
|
|
}
|
|
__name(isSafari, "isSafari");
|
|
function isMac() {
|
|
return getPlatform().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
}
|
|
__name(isMac, "isMac");
|
|
function isJSDOM() {
|
|
return getUserAgent().includes("jsdom/");
|
|
}
|
|
__name(isJSDOM, "isJSDOM");
|
|
var FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
|
|
var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
function activeElement(doc) {
|
|
let activeElement4 = doc.activeElement;
|
|
while (((_activeElement = activeElement4) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {
|
|
var _activeElement;
|
|
activeElement4 = activeElement4.shadowRoot.activeElement;
|
|
}
|
|
return activeElement4;
|
|
}
|
|
__name(activeElement, "activeElement");
|
|
function contains(parent, child) {
|
|
if (!parent || !child) {
|
|
return false;
|
|
}
|
|
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
if (parent.contains(child)) {
|
|
return true;
|
|
}
|
|
if (rootNode && isShadowRoot(rootNode)) {
|
|
let next = child;
|
|
while (next) {
|
|
if (parent === next) {
|
|
return true;
|
|
}
|
|
next = next.parentNode || next.host;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(contains, "contains");
|
|
function getTarget(event) {
|
|
if ("composedPath" in event) {
|
|
return event.composedPath()[0];
|
|
}
|
|
return event.target;
|
|
}
|
|
__name(getTarget, "getTarget");
|
|
function isEventTargetWithin(event, node) {
|
|
if (node == null) {
|
|
return false;
|
|
}
|
|
if ("composedPath" in event) {
|
|
return event.composedPath().includes(node);
|
|
}
|
|
const e = event;
|
|
return e.target != null && node.contains(e.target);
|
|
}
|
|
__name(isEventTargetWithin, "isEventTargetWithin");
|
|
function isRootElement(element) {
|
|
return element.matches("html,body");
|
|
}
|
|
__name(isRootElement, "isRootElement");
|
|
function getDocument(node) {
|
|
return (node == null ? void 0 : node.ownerDocument) || document;
|
|
}
|
|
__name(getDocument, "getDocument");
|
|
function isTypeableElement(element) {
|
|
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
|
|
}
|
|
__name(isTypeableElement, "isTypeableElement");
|
|
function matchesFocusVisible(element) {
|
|
if (!element || isJSDOM()) return true;
|
|
try {
|
|
return element.matches(":focus-visible");
|
|
} catch (_e) {
|
|
return true;
|
|
}
|
|
}
|
|
__name(matchesFocusVisible, "matchesFocusVisible");
|
|
function getFloatingFocusElement(floatingElement) {
|
|
if (!floatingElement) {
|
|
return null;
|
|
}
|
|
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector("[" + FOCUSABLE_ATTRIBUTE + "]") || floatingElement;
|
|
}
|
|
__name(getFloatingFocusElement, "getFloatingFocusElement");
|
|
function getNodeChildren(nodes, id, onlyOpenChildren) {
|
|
if (onlyOpenChildren === void 0) {
|
|
onlyOpenChildren = true;
|
|
}
|
|
const directChildren = nodes.filter((node) => {
|
|
var _node$context;
|
|
return node.parentId === id && (!onlyOpenChildren || ((_node$context = node.context) == null ? void 0 : _node$context.open));
|
|
});
|
|
return directChildren.flatMap((child) => [child, ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
|
|
}
|
|
__name(getNodeChildren, "getNodeChildren");
|
|
function isReactEvent(event) {
|
|
return "nativeEvent" in event;
|
|
}
|
|
__name(isReactEvent, "isReactEvent");
|
|
function isMouseLikePointerType(pointerType, strict) {
|
|
const values = ["mouse", "pen"];
|
|
if (!strict) {
|
|
values.push("", void 0);
|
|
}
|
|
return values.includes(pointerType);
|
|
}
|
|
__name(isMouseLikePointerType, "isMouseLikePointerType");
|
|
var isClient4 = typeof document !== "undefined";
|
|
var noop3 = /* @__PURE__ */ __name(function noop4() {
|
|
}, "noop");
|
|
var index2 = isClient4 ? import_react39.useLayoutEffect : noop3;
|
|
var SafeReact = {
|
|
...React50
|
|
};
|
|
function useLatestRef2(value) {
|
|
const ref = React50.useRef(value);
|
|
index2(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref;
|
|
}
|
|
__name(useLatestRef2, "useLatestRef");
|
|
var useInsertionEffect = SafeReact.useInsertionEffect;
|
|
var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn());
|
|
function useEffectEvent(callback) {
|
|
const ref = React50.useRef(() => {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
throw new Error("Cannot call an event handler while rendering.");
|
|
}
|
|
});
|
|
useSafeInsertionEffect(() => {
|
|
ref.current = callback;
|
|
});
|
|
return React50.useCallback(function() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return ref.current == null ? void 0 : ref.current(...args);
|
|
}, []);
|
|
}
|
|
__name(useEffectEvent, "useEffectEvent");
|
|
|
|
// node_modules/@tamagui/popover/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
var ReactDOM3 = __toESM(require("react-dom"), 1);
|
|
var FOCUSABLE_ATTRIBUTE2 = "data-floating-ui-focusable";
|
|
var ACTIVE_KEY = "active";
|
|
var SELECTED_KEY = "selected";
|
|
var ARROW_LEFT = "ArrowLeft";
|
|
var ARROW_RIGHT = "ArrowRight";
|
|
var ARROW_UP = "ArrowUp";
|
|
var ARROW_DOWN = "ArrowDown";
|
|
var horizontalKeys = [ARROW_LEFT, ARROW_RIGHT];
|
|
var verticalKeys = [ARROW_UP, ARROW_DOWN];
|
|
var allKeys = [...horizontalKeys, ...verticalKeys];
|
|
var SafeReact2 = {
|
|
...React51
|
|
};
|
|
var serverHandoffComplete = false;
|
|
var count = 0;
|
|
var genId = /* @__PURE__ */ __name(() => (
|
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
// on <React 18
|
|
"floating-ui-" + Math.random().toString(36).slice(2, 6) + count++
|
|
), "genId");
|
|
function useFloatingId() {
|
|
const [id, setId] = React51.useState(() => serverHandoffComplete ? genId() : void 0);
|
|
index2(() => {
|
|
if (id == null) {
|
|
setId(genId());
|
|
}
|
|
}, []);
|
|
React51.useEffect(() => {
|
|
serverHandoffComplete = true;
|
|
}, []);
|
|
return id;
|
|
}
|
|
__name(useFloatingId, "useFloatingId");
|
|
var useReactId = SafeReact2.useId;
|
|
var useId9 = useReactId || useFloatingId;
|
|
var devMessageSet;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
devMessageSet = /* @__PURE__ */ new Set();
|
|
}
|
|
function error() {
|
|
var _devMessageSet3;
|
|
for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
messages[_key2] = arguments[_key2];
|
|
}
|
|
const message = "Floating UI: " + messages.join(" ");
|
|
if (!((_devMessageSet3 = devMessageSet) != null && _devMessageSet3.has(message))) {
|
|
var _devMessageSet4;
|
|
(_devMessageSet4 = devMessageSet) == null || _devMessageSet4.add(message);
|
|
console.error(message);
|
|
}
|
|
}
|
|
__name(error, "error");
|
|
function createEventEmitter() {
|
|
const map = /* @__PURE__ */ new Map();
|
|
return {
|
|
emit(event, data) {
|
|
var _map$get;
|
|
(_map$get = map.get(event)) == null || _map$get.forEach((listener) => listener(data));
|
|
},
|
|
on(event, listener) {
|
|
if (!map.has(event)) {
|
|
map.set(event, /* @__PURE__ */ new Set());
|
|
}
|
|
map.get(event).add(listener);
|
|
},
|
|
off(event, listener) {
|
|
var _map$get2;
|
|
(_map$get2 = map.get(event)) == null || _map$get2.delete(listener);
|
|
}
|
|
};
|
|
}
|
|
__name(createEventEmitter, "createEventEmitter");
|
|
var FloatingNodeContext = /* @__PURE__ */ React51.createContext(null);
|
|
var FloatingTreeContext = /* @__PURE__ */ React51.createContext(null);
|
|
var useFloatingParentNodeId = /* @__PURE__ */ __name(() => {
|
|
var _React$useContext;
|
|
return ((_React$useContext = React51.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
|
|
}, "useFloatingParentNodeId");
|
|
var useFloatingTree = /* @__PURE__ */ __name(() => React51.useContext(FloatingTreeContext), "useFloatingTree");
|
|
function createAttribute(name) {
|
|
return "data-floating-ui-" + name;
|
|
}
|
|
__name(createAttribute, "createAttribute");
|
|
function clearTimeoutIfSet(timeoutRef) {
|
|
if (timeoutRef.current !== -1) {
|
|
clearTimeout(timeoutRef.current);
|
|
timeoutRef.current = -1;
|
|
}
|
|
}
|
|
__name(clearTimeoutIfSet, "clearTimeoutIfSet");
|
|
var safePolygonIdentifier = /* @__PURE__ */ createAttribute("safe-polygon");
|
|
function getDelay(value, prop, pointerType) {
|
|
if (pointerType && !isMouseLikePointerType(pointerType)) {
|
|
return 0;
|
|
}
|
|
if (typeof value === "number") {
|
|
return value;
|
|
}
|
|
if (typeof value === "function") {
|
|
const result = value();
|
|
if (typeof result === "number") {
|
|
return result;
|
|
}
|
|
return result == null ? void 0 : result[prop];
|
|
}
|
|
return value == null ? void 0 : value[prop];
|
|
}
|
|
__name(getDelay, "getDelay");
|
|
function getRestMs(value) {
|
|
if (typeof value === "function") {
|
|
return value();
|
|
}
|
|
return value;
|
|
}
|
|
__name(getRestMs, "getRestMs");
|
|
function useHover(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
dataRef,
|
|
events,
|
|
elements
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
delay = 0,
|
|
handleClose = null,
|
|
mouseOnly = false,
|
|
restMs = 0,
|
|
move = true
|
|
} = props;
|
|
const tree = useFloatingTree();
|
|
const parentId = useFloatingParentNodeId();
|
|
const handleCloseRef = useLatestRef2(handleClose);
|
|
const delayRef = useLatestRef2(delay);
|
|
const openRef = useLatestRef2(open);
|
|
const restMsRef = useLatestRef2(restMs);
|
|
const pointerTypeRef = React51.useRef();
|
|
const timeoutRef = React51.useRef(-1);
|
|
const handlerRef = React51.useRef();
|
|
const restTimeoutRef = React51.useRef(-1);
|
|
const blockMouseMoveRef = React51.useRef(true);
|
|
const performedPointerEventsMutationRef = React51.useRef(false);
|
|
const unbindMouseMoveRef = React51.useRef(() => {
|
|
});
|
|
const restTimeoutPendingRef = React51.useRef(false);
|
|
const isHoverOpen = useEffectEvent(() => {
|
|
var _dataRef$current$open;
|
|
const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;
|
|
return (type == null ? void 0 : type.includes("mouse")) && type !== "mousedown";
|
|
});
|
|
React51.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onOpenChange2(_ref) {
|
|
let {
|
|
open: open2
|
|
} = _ref;
|
|
if (!open2) {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
clearTimeoutIfSet(restTimeoutRef);
|
|
blockMouseMoveRef.current = true;
|
|
restTimeoutPendingRef.current = false;
|
|
}
|
|
}
|
|
__name(onOpenChange2, "onOpenChange");
|
|
events.on("openchange", onOpenChange2);
|
|
return () => {
|
|
events.off("openchange", onOpenChange2);
|
|
};
|
|
}, [enabled, events]);
|
|
React51.useEffect(() => {
|
|
if (!enabled) return;
|
|
if (!handleCloseRef.current) return;
|
|
if (!open) return;
|
|
function onLeave(event) {
|
|
if (isHoverOpen()) {
|
|
onOpenChange(false, event, "hover");
|
|
}
|
|
}
|
|
__name(onLeave, "onLeave");
|
|
const html = getDocument(elements.floating).documentElement;
|
|
html.addEventListener("mouseleave", onLeave);
|
|
return () => {
|
|
html.removeEventListener("mouseleave", onLeave);
|
|
};
|
|
}, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
|
|
const closeWithDelay = React51.useCallback(function(event, runElseBranch, reason) {
|
|
if (runElseBranch === void 0) {
|
|
runElseBranch = true;
|
|
}
|
|
if (reason === void 0) {
|
|
reason = "hover";
|
|
}
|
|
const closeDelay = getDelay(delayRef.current, "close", pointerTypeRef.current);
|
|
if (closeDelay && !handlerRef.current) {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay);
|
|
} else if (runElseBranch) {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
onOpenChange(false, event, reason);
|
|
}
|
|
}, [delayRef, onOpenChange]);
|
|
const cleanupMouseMoveHandler = useEffectEvent(() => {
|
|
unbindMouseMoveRef.current();
|
|
handlerRef.current = void 0;
|
|
});
|
|
const clearPointerEvents = useEffectEvent(() => {
|
|
if (performedPointerEventsMutationRef.current) {
|
|
const body = getDocument(elements.floating).body;
|
|
body.style.pointerEvents = "";
|
|
body.removeAttribute(safePolygonIdentifier);
|
|
performedPointerEventsMutationRef.current = false;
|
|
}
|
|
});
|
|
const isClickLikeOpenEvent = useEffectEvent(() => {
|
|
return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false;
|
|
});
|
|
React51.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onReferenceMouseEnter(event) {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
blockMouseMoveRef.current = false;
|
|
if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || getRestMs(restMsRef.current) > 0 && !getDelay(delayRef.current, "open")) {
|
|
return;
|
|
}
|
|
const openDelay = getDelay(delayRef.current, "open", pointerTypeRef.current);
|
|
if (openDelay) {
|
|
timeoutRef.current = window.setTimeout(() => {
|
|
if (!openRef.current) {
|
|
onOpenChange(true, event, "hover");
|
|
}
|
|
}, openDelay);
|
|
} else if (!open) {
|
|
onOpenChange(true, event, "hover");
|
|
}
|
|
}
|
|
__name(onReferenceMouseEnter, "onReferenceMouseEnter");
|
|
function onReferenceMouseLeave(event) {
|
|
if (isClickLikeOpenEvent()) {
|
|
clearPointerEvents();
|
|
return;
|
|
}
|
|
unbindMouseMoveRef.current();
|
|
const doc = getDocument(elements.floating);
|
|
clearTimeoutIfSet(restTimeoutRef);
|
|
restTimeoutPendingRef.current = false;
|
|
if (handleCloseRef.current && dataRef.current.floatingContext) {
|
|
if (!open) {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
}
|
|
handlerRef.current = handleCloseRef.current({
|
|
...dataRef.current.floatingContext,
|
|
tree,
|
|
x: event.clientX,
|
|
y: event.clientY,
|
|
onClose() {
|
|
clearPointerEvents();
|
|
cleanupMouseMoveHandler();
|
|
if (!isClickLikeOpenEvent()) {
|
|
closeWithDelay(event, true, "safe-polygon");
|
|
}
|
|
}
|
|
});
|
|
const handler = handlerRef.current;
|
|
doc.addEventListener("mousemove", handler);
|
|
unbindMouseMoveRef.current = () => {
|
|
doc.removeEventListener("mousemove", handler);
|
|
};
|
|
return;
|
|
}
|
|
const shouldClose = pointerTypeRef.current === "touch" ? !contains(elements.floating, event.relatedTarget) : true;
|
|
if (shouldClose) {
|
|
closeWithDelay(event);
|
|
}
|
|
}
|
|
__name(onReferenceMouseLeave, "onReferenceMouseLeave");
|
|
function onScrollMouseLeave(event) {
|
|
if (isClickLikeOpenEvent()) return;
|
|
if (!dataRef.current.floatingContext) return;
|
|
handleCloseRef.current == null || handleCloseRef.current({
|
|
...dataRef.current.floatingContext,
|
|
tree,
|
|
x: event.clientX,
|
|
y: event.clientY,
|
|
onClose() {
|
|
clearPointerEvents();
|
|
cleanupMouseMoveHandler();
|
|
if (!isClickLikeOpenEvent()) {
|
|
closeWithDelay(event);
|
|
}
|
|
}
|
|
})(event);
|
|
}
|
|
__name(onScrollMouseLeave, "onScrollMouseLeave");
|
|
function onFloatingMouseEnter() {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
}
|
|
__name(onFloatingMouseEnter, "onFloatingMouseEnter");
|
|
function onFloatingMouseLeave(event) {
|
|
if (!isClickLikeOpenEvent()) {
|
|
closeWithDelay(event, false);
|
|
}
|
|
}
|
|
__name(onFloatingMouseLeave, "onFloatingMouseLeave");
|
|
if (isElement(elements.domReference)) {
|
|
const reference2 = elements.domReference;
|
|
const floating = elements.floating;
|
|
if (open) {
|
|
reference2.addEventListener("mouseleave", onScrollMouseLeave);
|
|
}
|
|
if (move) {
|
|
reference2.addEventListener("mousemove", onReferenceMouseEnter, {
|
|
once: true
|
|
});
|
|
}
|
|
reference2.addEventListener("mouseenter", onReferenceMouseEnter);
|
|
reference2.addEventListener("mouseleave", onReferenceMouseLeave);
|
|
if (floating) {
|
|
floating.addEventListener("mouseleave", onScrollMouseLeave);
|
|
floating.addEventListener("mouseenter", onFloatingMouseEnter);
|
|
floating.addEventListener("mouseleave", onFloatingMouseLeave);
|
|
}
|
|
return () => {
|
|
if (open) {
|
|
reference2.removeEventListener("mouseleave", onScrollMouseLeave);
|
|
}
|
|
if (move) {
|
|
reference2.removeEventListener("mousemove", onReferenceMouseEnter);
|
|
}
|
|
reference2.removeEventListener("mouseenter", onReferenceMouseEnter);
|
|
reference2.removeEventListener("mouseleave", onReferenceMouseLeave);
|
|
if (floating) {
|
|
floating.removeEventListener("mouseleave", onScrollMouseLeave);
|
|
floating.removeEventListener("mouseenter", onFloatingMouseEnter);
|
|
floating.removeEventListener("mouseleave", onFloatingMouseLeave);
|
|
}
|
|
};
|
|
}
|
|
}, [elements, enabled, context2, mouseOnly, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent, restMsRef]);
|
|
index2(() => {
|
|
var _handleCloseRef$curre;
|
|
if (!enabled) return;
|
|
if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && (_handleCloseRef$curre = _handleCloseRef$curre.__options) != null && _handleCloseRef$curre.blockPointerEvents && isHoverOpen()) {
|
|
performedPointerEventsMutationRef.current = true;
|
|
const floatingEl = elements.floating;
|
|
if (isElement(elements.domReference) && floatingEl) {
|
|
var _tree$nodesRef$curren;
|
|
const body = getDocument(elements.floating).body;
|
|
body.setAttribute(safePolygonIdentifier, "");
|
|
const ref = elements.domReference;
|
|
const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find((node) => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;
|
|
if (parentFloating) {
|
|
parentFloating.style.pointerEvents = "";
|
|
}
|
|
body.style.pointerEvents = "none";
|
|
ref.style.pointerEvents = "auto";
|
|
floatingEl.style.pointerEvents = "auto";
|
|
return () => {
|
|
body.style.pointerEvents = "";
|
|
ref.style.pointerEvents = "";
|
|
floatingEl.style.pointerEvents = "";
|
|
};
|
|
}
|
|
}
|
|
}, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);
|
|
index2(() => {
|
|
if (!open) {
|
|
pointerTypeRef.current = void 0;
|
|
restTimeoutPendingRef.current = false;
|
|
cleanupMouseMoveHandler();
|
|
clearPointerEvents();
|
|
}
|
|
}, [open, cleanupMouseMoveHandler, clearPointerEvents]);
|
|
React51.useEffect(() => {
|
|
return () => {
|
|
cleanupMouseMoveHandler();
|
|
clearTimeoutIfSet(timeoutRef);
|
|
clearTimeoutIfSet(restTimeoutRef);
|
|
clearPointerEvents();
|
|
};
|
|
}, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);
|
|
const reference = React51.useMemo(() => {
|
|
function setPointerRef(event) {
|
|
pointerTypeRef.current = event.pointerType;
|
|
}
|
|
__name(setPointerRef, "setPointerRef");
|
|
return {
|
|
onPointerDown: setPointerRef,
|
|
onPointerEnter: setPointerRef,
|
|
onMouseMove(event) {
|
|
const {
|
|
nativeEvent
|
|
} = event;
|
|
function handleMouseMove() {
|
|
if (!blockMouseMoveRef.current && !openRef.current) {
|
|
onOpenChange(true, nativeEvent, "hover");
|
|
}
|
|
}
|
|
__name(handleMouseMove, "handleMouseMove");
|
|
if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {
|
|
return;
|
|
}
|
|
if (open || getRestMs(restMsRef.current) === 0) {
|
|
return;
|
|
}
|
|
if (restTimeoutPendingRef.current && event.movementX ** 2 + event.movementY ** 2 < 2) {
|
|
return;
|
|
}
|
|
clearTimeoutIfSet(restTimeoutRef);
|
|
if (pointerTypeRef.current === "touch") {
|
|
handleMouseMove();
|
|
} else {
|
|
restTimeoutPendingRef.current = true;
|
|
restTimeoutRef.current = window.setTimeout(handleMouseMove, getRestMs(restMsRef.current));
|
|
}
|
|
}
|
|
};
|
|
}, [mouseOnly, onOpenChange, open, openRef, restMsRef]);
|
|
return React51.useMemo(() => enabled ? {
|
|
reference
|
|
} : {}, [enabled, reference]);
|
|
}
|
|
__name(useHover, "useHover");
|
|
function contains2(parent, child) {
|
|
if (!parent || !child) {
|
|
return false;
|
|
}
|
|
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
if (parent.contains(child)) {
|
|
return true;
|
|
}
|
|
if (rootNode && isShadowRoot(rootNode)) {
|
|
let next = child;
|
|
while (next) {
|
|
if (parent === next) {
|
|
return true;
|
|
}
|
|
next = next.parentNode || next.host;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(contains2, "contains");
|
|
function getTarget2(event) {
|
|
if ("composedPath" in event) {
|
|
return event.composedPath()[0];
|
|
}
|
|
return event.target;
|
|
}
|
|
__name(getTarget2, "getTarget");
|
|
var bubbleHandlerKeys = {
|
|
pointerdown: "onPointerDown",
|
|
mousedown: "onMouseDown",
|
|
click: "onClick"
|
|
};
|
|
var captureHandlerKeys = {
|
|
pointerdown: "onPointerDownCapture",
|
|
mousedown: "onMouseDownCapture",
|
|
click: "onClickCapture"
|
|
};
|
|
var normalizeProp = /* @__PURE__ */ __name((normalizable) => {
|
|
var _normalizable$escapeK, _normalizable$outside;
|
|
return {
|
|
escapeKey: typeof normalizable === "boolean" ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,
|
|
outsidePress: typeof normalizable === "boolean" ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true
|
|
};
|
|
}, "normalizeProp");
|
|
function useDismiss(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
dataRef
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
escapeKey = true,
|
|
outsidePress: unstable_outsidePress = true,
|
|
outsidePressEvent = "pointerdown",
|
|
referencePress = false,
|
|
referencePressEvent = "pointerdown",
|
|
ancestorScroll = false,
|
|
bubbles,
|
|
capture
|
|
} = props;
|
|
const tree = useFloatingTree();
|
|
const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === "function" ? unstable_outsidePress : () => false);
|
|
const outsidePress = typeof unstable_outsidePress === "function" ? outsidePressFn : unstable_outsidePress;
|
|
const endedOrStartedInsideRef = React51.useRef(false);
|
|
const {
|
|
escapeKey: escapeKeyBubbles,
|
|
outsidePress: outsidePressBubbles
|
|
} = normalizeProp(bubbles);
|
|
const {
|
|
escapeKey: escapeKeyCapture,
|
|
outsidePress: outsidePressCapture
|
|
} = normalizeProp(capture);
|
|
const isComposingRef = React51.useRef(false);
|
|
const closeOnEscapeKeyDown = useEffectEvent((event) => {
|
|
var _dataRef$current$floa;
|
|
if (!open || !enabled || !escapeKey || event.key !== "Escape") {
|
|
return;
|
|
}
|
|
if (isComposingRef.current) {
|
|
return;
|
|
}
|
|
const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;
|
|
const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
|
|
if (!escapeKeyBubbles) {
|
|
event.stopPropagation();
|
|
if (children.length > 0) {
|
|
let shouldDismiss = true;
|
|
children.forEach((child) => {
|
|
var _child$context;
|
|
if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {
|
|
shouldDismiss = false;
|
|
return;
|
|
}
|
|
});
|
|
if (!shouldDismiss) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event, "escape-key");
|
|
});
|
|
const closeOnEscapeKeyDownCapture = useEffectEvent((event) => {
|
|
var _getTarget2;
|
|
const callback = /* @__PURE__ */ __name(() => {
|
|
var _getTarget;
|
|
closeOnEscapeKeyDown(event);
|
|
(_getTarget = getTarget(event)) == null || _getTarget.removeEventListener("keydown", callback);
|
|
}, "callback");
|
|
(_getTarget2 = getTarget(event)) == null || _getTarget2.addEventListener("keydown", callback);
|
|
});
|
|
const closeOnPressOutside = useEffectEvent((event) => {
|
|
var _dataRef$current$floa2;
|
|
const insideReactTree = dataRef.current.insideReactTree;
|
|
dataRef.current.insideReactTree = false;
|
|
const endedOrStartedInside = endedOrStartedInsideRef.current;
|
|
endedOrStartedInsideRef.current = false;
|
|
if (outsidePressEvent === "click" && endedOrStartedInside) {
|
|
return;
|
|
}
|
|
if (insideReactTree) {
|
|
return;
|
|
}
|
|
if (typeof outsidePress === "function" && !outsidePress(event)) {
|
|
return;
|
|
}
|
|
const target = getTarget(event);
|
|
const inertSelector = "[" + createAttribute("inert") + "]";
|
|
const markers = getDocument(elements.floating).querySelectorAll(inertSelector);
|
|
let targetRootAncestor = isElement(target) ? target : null;
|
|
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
|
|
const nextParent = getParentNode(targetRootAncestor);
|
|
if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
|
|
break;
|
|
}
|
|
targetRootAncestor = nextParent;
|
|
}
|
|
if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
!contains(target, elements.floating) && // If the target root element contains none of the markers, then the
|
|
// element was injected after the floating element rendered.
|
|
Array.from(markers).every((marker) => !contains(targetRootAncestor, marker))) {
|
|
return;
|
|
}
|
|
if (isHTMLElement(target) && floating) {
|
|
const lastTraversableNode = isLastTraversableNode(target);
|
|
const style = getComputedStyle2(target);
|
|
const scrollRe = /auto|scroll/;
|
|
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
|
|
const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
|
|
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
|
|
const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
|
|
const isRTL2 = style.direction === "rtl";
|
|
const pressedVerticalScrollbar = canScrollY && (isRTL2 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
|
|
const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
|
|
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
|
|
return;
|
|
}
|
|
}
|
|
const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;
|
|
const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => {
|
|
var _node$context;
|
|
return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
|
|
});
|
|
if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {
|
|
return;
|
|
}
|
|
const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
|
|
if (children.length > 0) {
|
|
let shouldDismiss = true;
|
|
children.forEach((child) => {
|
|
var _child$context2;
|
|
if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {
|
|
shouldDismiss = false;
|
|
return;
|
|
}
|
|
});
|
|
if (!shouldDismiss) {
|
|
return;
|
|
}
|
|
}
|
|
onOpenChange(false, event, "outside-press");
|
|
});
|
|
const closeOnPressOutsideCapture = useEffectEvent((event) => {
|
|
var _getTarget4;
|
|
const callback = /* @__PURE__ */ __name(() => {
|
|
var _getTarget3;
|
|
closeOnPressOutside(event);
|
|
(_getTarget3 = getTarget(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback);
|
|
}, "callback");
|
|
(_getTarget4 = getTarget(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback);
|
|
});
|
|
React51.useEffect(() => {
|
|
if (!open || !enabled) {
|
|
return;
|
|
}
|
|
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
|
|
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
|
|
let compositionTimeout = -1;
|
|
function onScroll(event) {
|
|
onOpenChange(false, event, "ancestor-scroll");
|
|
}
|
|
__name(onScroll, "onScroll");
|
|
function handleCompositionStart() {
|
|
window.clearTimeout(compositionTimeout);
|
|
isComposingRef.current = true;
|
|
}
|
|
__name(handleCompositionStart, "handleCompositionStart");
|
|
function handleCompositionEnd() {
|
|
compositionTimeout = window.setTimeout(
|
|
() => {
|
|
isComposingRef.current = false;
|
|
},
|
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
// Only apply to WebKit for the test to remain 0ms.
|
|
isWebKit() ? 5 : 0
|
|
);
|
|
}
|
|
__name(handleCompositionEnd, "handleCompositionEnd");
|
|
const doc = getDocument(elements.floating);
|
|
if (escapeKey) {
|
|
doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
doc.addEventListener("compositionstart", handleCompositionStart);
|
|
doc.addEventListener("compositionend", handleCompositionEnd);
|
|
}
|
|
outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
let ancestors = [];
|
|
if (ancestorScroll) {
|
|
if (isElement(elements.domReference)) {
|
|
ancestors = getOverflowAncestors(elements.domReference);
|
|
}
|
|
if (isElement(elements.floating)) {
|
|
ancestors = ancestors.concat(getOverflowAncestors(elements.floating));
|
|
}
|
|
if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {
|
|
ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));
|
|
}
|
|
}
|
|
ancestors = ancestors.filter((ancestor) => {
|
|
var _doc$defaultView;
|
|
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
});
|
|
ancestors.forEach((ancestor) => {
|
|
ancestor.addEventListener("scroll", onScroll, {
|
|
passive: true
|
|
});
|
|
});
|
|
return () => {
|
|
if (escapeKey) {
|
|
doc.removeEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
doc.removeEventListener("compositionstart", handleCompositionStart);
|
|
doc.removeEventListener("compositionend", handleCompositionEnd);
|
|
}
|
|
outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
ancestors.forEach((ancestor) => {
|
|
ancestor.removeEventListener("scroll", onScroll);
|
|
});
|
|
window.clearTimeout(compositionTimeout);
|
|
};
|
|
}, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
|
|
React51.useEffect(() => {
|
|
dataRef.current.insideReactTree = false;
|
|
}, [dataRef, outsidePress, outsidePressEvent]);
|
|
const reference = React51.useMemo(() => ({
|
|
onKeyDown: closeOnEscapeKeyDown,
|
|
...referencePress && {
|
|
[bubbleHandlerKeys[referencePressEvent]]: (event) => {
|
|
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
},
|
|
...referencePressEvent !== "click" && {
|
|
onClick(event) {
|
|
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
}
|
|
}
|
|
}
|
|
}), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);
|
|
const floating = React51.useMemo(() => ({
|
|
onKeyDown: closeOnEscapeKeyDown,
|
|
onMouseDown() {
|
|
endedOrStartedInsideRef.current = true;
|
|
},
|
|
onMouseUp() {
|
|
endedOrStartedInsideRef.current = true;
|
|
},
|
|
[captureHandlerKeys[outsidePressEvent]]: () => {
|
|
dataRef.current.insideReactTree = true;
|
|
}
|
|
}), [closeOnEscapeKeyDown, outsidePressEvent, dataRef]);
|
|
return React51.useMemo(() => enabled ? {
|
|
reference,
|
|
floating
|
|
} : {}, [enabled, reference, floating]);
|
|
}
|
|
__name(useDismiss, "useDismiss");
|
|
function useFloatingRootContext(options) {
|
|
const {
|
|
open = false,
|
|
onOpenChange: onOpenChangeProp,
|
|
elements: elementsProp
|
|
} = options;
|
|
const floatingId = useId9();
|
|
const dataRef = React51.useRef({});
|
|
const [events] = React51.useState(() => createEventEmitter());
|
|
const nested = useFloatingParentNodeId() != null;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
const optionDomReference = elementsProp.reference;
|
|
if (optionDomReference && !isElement(optionDomReference)) {
|
|
error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
}
|
|
}
|
|
const [positionReference, setPositionReference] = React51.useState(elementsProp.reference);
|
|
const onOpenChange = useEffectEvent((open2, event, reason) => {
|
|
dataRef.current.openEvent = open2 ? event : void 0;
|
|
events.emit("openchange", {
|
|
open: open2,
|
|
event,
|
|
reason,
|
|
nested
|
|
});
|
|
onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
|
|
});
|
|
const refs = React51.useMemo(() => ({
|
|
setPositionReference
|
|
}), []);
|
|
const elements = React51.useMemo(() => ({
|
|
reference: positionReference || elementsProp.reference || null,
|
|
floating: elementsProp.floating || null,
|
|
domReference: elementsProp.reference
|
|
}), [positionReference, elementsProp.reference, elementsProp.floating]);
|
|
return React51.useMemo(() => ({
|
|
dataRef,
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
events,
|
|
floatingId,
|
|
refs
|
|
}), [open, onOpenChange, elements, events, floatingId, refs]);
|
|
}
|
|
__name(useFloatingRootContext, "useFloatingRootContext");
|
|
function useFloating3(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
nodeId
|
|
} = options;
|
|
const internalRootContext = useFloatingRootContext({
|
|
...options,
|
|
elements: {
|
|
reference: null,
|
|
floating: null,
|
|
...options.elements
|
|
}
|
|
});
|
|
const rootContext = options.rootContext || internalRootContext;
|
|
const computedElements = rootContext.elements;
|
|
const [_domReference, setDomReference] = React51.useState(null);
|
|
const [positionReference, _setPositionReference] = React51.useState(null);
|
|
const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
|
|
const domReference = optionDomReference || _domReference;
|
|
const domReferenceRef = React51.useRef(null);
|
|
const tree = useFloatingTree();
|
|
index2(() => {
|
|
if (domReference) {
|
|
domReferenceRef.current = domReference;
|
|
}
|
|
}, [domReference]);
|
|
const position = useFloating({
|
|
...options,
|
|
elements: {
|
|
...computedElements,
|
|
...positionReference && {
|
|
reference: positionReference
|
|
}
|
|
}
|
|
});
|
|
const setPositionReference = React51.useCallback((node) => {
|
|
const computedPositionReference = isElement(node) ? {
|
|
getBoundingClientRect: /* @__PURE__ */ __name(() => node.getBoundingClientRect(), "getBoundingClientRect"),
|
|
getClientRects: /* @__PURE__ */ __name(() => node.getClientRects(), "getClientRects"),
|
|
contextElement: node
|
|
} : node;
|
|
_setPositionReference(computedPositionReference);
|
|
position.refs.setReference(computedPositionReference);
|
|
}, [position.refs]);
|
|
const setReference = React51.useCallback((node) => {
|
|
if (isElement(node) || node === null) {
|
|
domReferenceRef.current = node;
|
|
setDomReference(node);
|
|
}
|
|
if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
// `null` to support `positionReference` + an unstable `reference`
|
|
// callback ref.
|
|
node !== null && !isElement(node)) {
|
|
position.refs.setReference(node);
|
|
}
|
|
}, [position.refs]);
|
|
const refs = React51.useMemo(() => ({
|
|
...position.refs,
|
|
setReference,
|
|
setPositionReference,
|
|
domReference: domReferenceRef
|
|
}), [position.refs, setReference, setPositionReference]);
|
|
const elements = React51.useMemo(() => ({
|
|
...position.elements,
|
|
domReference
|
|
}), [position.elements, domReference]);
|
|
const context2 = React51.useMemo(() => ({
|
|
...position,
|
|
...rootContext,
|
|
refs,
|
|
elements,
|
|
nodeId
|
|
}), [position, refs, elements, nodeId, rootContext]);
|
|
index2(() => {
|
|
rootContext.dataRef.current.floatingContext = context2;
|
|
const node = tree == null ? void 0 : tree.nodesRef.current.find((node2) => node2.id === nodeId);
|
|
if (node) {
|
|
node.context = context2;
|
|
}
|
|
});
|
|
return React51.useMemo(() => ({
|
|
...position,
|
|
context: context2,
|
|
refs,
|
|
elements
|
|
}), [position, refs, elements, context2]);
|
|
}
|
|
__name(useFloating3, "useFloating");
|
|
function isMacSafari() {
|
|
return isMac() && isSafari();
|
|
}
|
|
__name(isMacSafari, "isMacSafari");
|
|
function useFocus(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
events,
|
|
dataRef,
|
|
elements
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
visibleOnly = true
|
|
} = props;
|
|
const blockFocusRef = React51.useRef(false);
|
|
const timeoutRef = React51.useRef(-1);
|
|
const keyboardModalityRef = React51.useRef(true);
|
|
React51.useEffect(() => {
|
|
if (!enabled) return;
|
|
const win = getWindow(elements.domReference);
|
|
function onBlur() {
|
|
if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference))) {
|
|
blockFocusRef.current = true;
|
|
}
|
|
}
|
|
__name(onBlur, "onBlur");
|
|
function onKeyDown() {
|
|
keyboardModalityRef.current = true;
|
|
}
|
|
__name(onKeyDown, "onKeyDown");
|
|
function onPointerDown() {
|
|
keyboardModalityRef.current = false;
|
|
}
|
|
__name(onPointerDown, "onPointerDown");
|
|
win.addEventListener("blur", onBlur);
|
|
if (isMacSafari()) {
|
|
win.addEventListener("keydown", onKeyDown, true);
|
|
win.addEventListener("pointerdown", onPointerDown, true);
|
|
}
|
|
return () => {
|
|
win.removeEventListener("blur", onBlur);
|
|
if (isMacSafari()) {
|
|
win.removeEventListener("keydown", onKeyDown, true);
|
|
win.removeEventListener("pointerdown", onPointerDown, true);
|
|
}
|
|
};
|
|
}, [elements.domReference, open, enabled]);
|
|
React51.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onOpenChange2(_ref) {
|
|
let {
|
|
reason
|
|
} = _ref;
|
|
if (reason === "reference-press" || reason === "escape-key") {
|
|
blockFocusRef.current = true;
|
|
}
|
|
}
|
|
__name(onOpenChange2, "onOpenChange");
|
|
events.on("openchange", onOpenChange2);
|
|
return () => {
|
|
events.off("openchange", onOpenChange2);
|
|
};
|
|
}, [events, enabled]);
|
|
React51.useEffect(() => {
|
|
return () => {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
};
|
|
}, []);
|
|
const reference = React51.useMemo(() => ({
|
|
onMouseLeave() {
|
|
blockFocusRef.current = false;
|
|
},
|
|
onFocus(event) {
|
|
if (blockFocusRef.current) return;
|
|
const target = getTarget(event.nativeEvent);
|
|
if (visibleOnly && isElement(target)) {
|
|
if (isMacSafari() && !event.relatedTarget) {
|
|
if (!keyboardModalityRef.current && !isTypeableElement(target)) {
|
|
return;
|
|
}
|
|
} else if (!matchesFocusVisible(target)) {
|
|
return;
|
|
}
|
|
}
|
|
onOpenChange(true, event.nativeEvent, "focus");
|
|
},
|
|
onBlur(event) {
|
|
blockFocusRef.current = false;
|
|
const relatedTarget = event.relatedTarget;
|
|
const nativeEvent = event.nativeEvent;
|
|
const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
|
|
timeoutRef.current = window.setTimeout(() => {
|
|
var _dataRef$current$floa;
|
|
const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);
|
|
if (!relatedTarget && activeEl === elements.domReference) return;
|
|
if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) {
|
|
return;
|
|
}
|
|
onOpenChange(false, nativeEvent, "focus");
|
|
});
|
|
}
|
|
}), [dataRef, elements.domReference, onOpenChange, visibleOnly]);
|
|
return React51.useMemo(() => enabled ? {
|
|
reference
|
|
} : {}, [enabled, reference]);
|
|
}
|
|
__name(useFocus, "useFocus");
|
|
function mergeProps(userProps, propsList, elementKey) {
|
|
const map = /* @__PURE__ */ new Map();
|
|
const isItem = elementKey === "item";
|
|
let domUserProps = userProps;
|
|
if (isItem && userProps) {
|
|
const {
|
|
[ACTIVE_KEY]: _,
|
|
[SELECTED_KEY]: __,
|
|
...validProps
|
|
} = userProps;
|
|
domUserProps = validProps;
|
|
}
|
|
return {
|
|
...elementKey === "floating" && {
|
|
tabIndex: -1,
|
|
[FOCUSABLE_ATTRIBUTE2]: ""
|
|
},
|
|
...domUserProps,
|
|
...propsList.map((value) => {
|
|
const propsOrGetProps = value ? value[elementKey] : null;
|
|
if (typeof propsOrGetProps === "function") {
|
|
return userProps ? propsOrGetProps(userProps) : null;
|
|
}
|
|
return propsOrGetProps;
|
|
}).concat(userProps).reduce((acc, props) => {
|
|
if (!props) {
|
|
return acc;
|
|
}
|
|
Object.entries(props).forEach((_ref) => {
|
|
let [key, value] = _ref;
|
|
if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) {
|
|
return;
|
|
}
|
|
if (key.indexOf("on") === 0) {
|
|
if (!map.has(key)) {
|
|
map.set(key, []);
|
|
}
|
|
if (typeof value === "function") {
|
|
var _map$get;
|
|
(_map$get = map.get(key)) == null || _map$get.push(value);
|
|
acc[key] = function() {
|
|
var _map$get2;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map((fn) => fn(...args)).find((val) => val !== void 0);
|
|
};
|
|
}
|
|
} else {
|
|
acc[key] = value;
|
|
}
|
|
});
|
|
return acc;
|
|
}, {})
|
|
};
|
|
}
|
|
__name(mergeProps, "mergeProps");
|
|
function useInteractions(propsList) {
|
|
if (propsList === void 0) {
|
|
propsList = [];
|
|
}
|
|
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
const getReferenceProps = React51.useCallback(
|
|
(userProps) => mergeProps(userProps, propsList, "reference"),
|
|
|
|
referenceDeps
|
|
);
|
|
const getFloatingProps = React51.useCallback(
|
|
(userProps) => mergeProps(userProps, propsList, "floating"),
|
|
|
|
floatingDeps
|
|
);
|
|
const getItemProps = React51.useCallback(
|
|
(userProps) => mergeProps(userProps, propsList, "item"),
|
|
|
|
itemDeps
|
|
);
|
|
return React51.useMemo(() => ({
|
|
getReferenceProps,
|
|
getFloatingProps,
|
|
getItemProps
|
|
}), [getReferenceProps, getFloatingProps, getItemProps]);
|
|
}
|
|
__name(useInteractions, "useInteractions");
|
|
var componentRoleToAriaRoleMap = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", false]]);
|
|
function useRole(context2, props) {
|
|
var _elements$domReferenc, _componentRoleToAriaR;
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
elements,
|
|
floatingId: defaultFloatingId
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
role = "dialog"
|
|
} = props;
|
|
const defaultReferenceId = useId9();
|
|
const referenceId = ((_elements$domReferenc = elements.domReference) == null ? void 0 : _elements$domReferenc.id) || defaultReferenceId;
|
|
const floatingId = React51.useMemo(() => {
|
|
var _getFloatingFocusElem;
|
|
return ((_getFloatingFocusElem = getFloatingFocusElement(elements.floating)) == null ? void 0 : _getFloatingFocusElem.id) || defaultFloatingId;
|
|
}, [elements.floating, defaultFloatingId]);
|
|
const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap.get(role)) != null ? _componentRoleToAriaR : role;
|
|
const parentId = useFloatingParentNodeId();
|
|
const isNested = parentId != null;
|
|
const reference = React51.useMemo(() => {
|
|
if (ariaRole === "tooltip" || role === "label") {
|
|
return {
|
|
["aria-" + (role === "label" ? "labelledby" : "describedby")]: open ? floatingId : void 0
|
|
};
|
|
}
|
|
return {
|
|
"aria-expanded": open ? "true" : "false",
|
|
"aria-haspopup": ariaRole === "alertdialog" ? "dialog" : ariaRole,
|
|
"aria-controls": open ? floatingId : void 0,
|
|
...ariaRole === "listbox" && {
|
|
role: "combobox"
|
|
},
|
|
...ariaRole === "menu" && {
|
|
id: referenceId
|
|
},
|
|
...ariaRole === "menu" && isNested && {
|
|
role: "menuitem"
|
|
},
|
|
...role === "select" && {
|
|
"aria-autocomplete": "none"
|
|
},
|
|
...role === "combobox" && {
|
|
"aria-autocomplete": "list"
|
|
}
|
|
};
|
|
}, [ariaRole, floatingId, isNested, open, referenceId, role]);
|
|
const floating = React51.useMemo(() => {
|
|
const floatingProps = {
|
|
id: floatingId,
|
|
...ariaRole && {
|
|
role: ariaRole
|
|
}
|
|
};
|
|
if (ariaRole === "tooltip" || role === "label") {
|
|
return floatingProps;
|
|
}
|
|
return {
|
|
...floatingProps,
|
|
...ariaRole === "menu" && {
|
|
"aria-labelledby": referenceId
|
|
}
|
|
};
|
|
}, [ariaRole, floatingId, referenceId, role]);
|
|
const item = React51.useCallback((_ref) => {
|
|
let {
|
|
active,
|
|
selected
|
|
} = _ref;
|
|
const commonProps = {
|
|
role: "option",
|
|
...active && {
|
|
id: floatingId + "-fui-option"
|
|
}
|
|
};
|
|
switch (role) {
|
|
case "select":
|
|
case "combobox":
|
|
return {
|
|
...commonProps,
|
|
"aria-selected": selected
|
|
};
|
|
}
|
|
return {};
|
|
}, [floatingId, role]);
|
|
return React51.useMemo(() => enabled ? {
|
|
reference,
|
|
floating,
|
|
item
|
|
} : {}, [enabled, reference, floating, item]);
|
|
}
|
|
__name(useRole, "useRole");
|
|
function getNodeChildren2(nodes, id, onlyOpenChildren) {
|
|
if (onlyOpenChildren === void 0) {
|
|
onlyOpenChildren = true;
|
|
}
|
|
const directChildren = nodes.filter((node) => {
|
|
var _node$context;
|
|
return node.parentId === id && (!onlyOpenChildren || ((_node$context = node.context) == null ? void 0 : _node$context.open));
|
|
});
|
|
return directChildren.flatMap((child) => [child, ...getNodeChildren2(nodes, child.id, onlyOpenChildren)]);
|
|
}
|
|
__name(getNodeChildren2, "getNodeChildren");
|
|
function isPointInPolygon(point, polygon) {
|
|
const [x, y] = point;
|
|
let isInside2 = false;
|
|
const length = polygon.length;
|
|
for (let i = 0, j = length - 1; i < length; j = i++) {
|
|
const [xi, yi] = polygon[i] || [0, 0];
|
|
const [xj, yj] = polygon[j] || [0, 0];
|
|
const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
if (intersect) {
|
|
isInside2 = !isInside2;
|
|
}
|
|
}
|
|
return isInside2;
|
|
}
|
|
__name(isPointInPolygon, "isPointInPolygon");
|
|
function isInside(point, rect) {
|
|
return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;
|
|
}
|
|
__name(isInside, "isInside");
|
|
function safePolygon(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
buffer = 0.5,
|
|
blockPointerEvents = false,
|
|
requireIntent = true
|
|
} = options;
|
|
const timeoutRef = {
|
|
current: -1
|
|
};
|
|
let hasLanded = false;
|
|
let lastX = null;
|
|
let lastY = null;
|
|
let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
|
|
function getCursorSpeed(x, y) {
|
|
const currentTime = performance.now();
|
|
const elapsedTime = currentTime - lastCursorTime;
|
|
if (lastX === null || lastY === null || elapsedTime === 0) {
|
|
lastX = x;
|
|
lastY = y;
|
|
lastCursorTime = currentTime;
|
|
return null;
|
|
}
|
|
const deltaX = x - lastX;
|
|
const deltaY = y - lastY;
|
|
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
const speed = distance / elapsedTime;
|
|
lastX = x;
|
|
lastY = y;
|
|
lastCursorTime = currentTime;
|
|
return speed;
|
|
}
|
|
__name(getCursorSpeed, "getCursorSpeed");
|
|
const fn = /* @__PURE__ */ __name((_ref) => {
|
|
let {
|
|
x,
|
|
y,
|
|
placement,
|
|
elements,
|
|
onClose,
|
|
nodeId,
|
|
tree
|
|
} = _ref;
|
|
return /* @__PURE__ */ __name(function onMouseMove(event) {
|
|
function close() {
|
|
clearTimeoutIfSet(timeoutRef);
|
|
onClose();
|
|
}
|
|
__name(close, "close");
|
|
clearTimeoutIfSet(timeoutRef);
|
|
if (!elements.domReference || !elements.floating || placement == null || x == null || y == null) {
|
|
return;
|
|
}
|
|
const {
|
|
clientX,
|
|
clientY
|
|
} = event;
|
|
const clientPoint = [clientX, clientY];
|
|
const target = getTarget2(event);
|
|
const isLeave = event.type === "mouseleave";
|
|
const isOverFloatingEl = contains2(elements.floating, target);
|
|
const isOverReferenceEl = contains2(elements.domReference, target);
|
|
const refRect = elements.domReference.getBoundingClientRect();
|
|
const rect = elements.floating.getBoundingClientRect();
|
|
const side = placement.split("-")[0];
|
|
const cursorLeaveFromRight = x > rect.right - rect.width / 2;
|
|
const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;
|
|
const isOverReferenceRect = isInside(clientPoint, refRect);
|
|
const isFloatingWider = rect.width > refRect.width;
|
|
const isFloatingTaller = rect.height > refRect.height;
|
|
const left = (isFloatingWider ? refRect : rect).left;
|
|
const right = (isFloatingWider ? refRect : rect).right;
|
|
const top = (isFloatingTaller ? refRect : rect).top;
|
|
const bottom = (isFloatingTaller ? refRect : rect).bottom;
|
|
if (isOverFloatingEl) {
|
|
hasLanded = true;
|
|
if (!isLeave) {
|
|
return;
|
|
}
|
|
}
|
|
if (isOverReferenceEl) {
|
|
hasLanded = false;
|
|
}
|
|
if (isOverReferenceEl && !isLeave) {
|
|
hasLanded = true;
|
|
return;
|
|
}
|
|
if (isLeave && isElement(event.relatedTarget) && contains2(elements.floating, event.relatedTarget)) {
|
|
return;
|
|
}
|
|
if (tree && getNodeChildren2(tree.nodesRef.current, nodeId).length) {
|
|
return;
|
|
}
|
|
if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) {
|
|
return close();
|
|
}
|
|
let rectPoly = [];
|
|
switch (side) {
|
|
case "top":
|
|
rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];
|
|
break;
|
|
case "bottom":
|
|
rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];
|
|
break;
|
|
case "left":
|
|
rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];
|
|
break;
|
|
case "right":
|
|
rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];
|
|
break;
|
|
}
|
|
function getPolygon(_ref2) {
|
|
let [x2, y2] = _ref2;
|
|
switch (side) {
|
|
case "top": {
|
|
const cursorPointOne = [isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 + buffer + 1];
|
|
const cursorPointTwo = [isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 + buffer + 1];
|
|
const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];
|
|
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
}
|
|
case "bottom": {
|
|
const cursorPointOne = [isFloatingWider ? x2 + buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 - buffer];
|
|
const cursorPointTwo = [isFloatingWider ? x2 - buffer / 2 : cursorLeaveFromRight ? x2 + buffer * 4 : x2 - buffer * 4, y2 - buffer];
|
|
const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];
|
|
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
}
|
|
case "left": {
|
|
const cursorPointOne = [x2 + buffer + 1, isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
const cursorPointTwo = [x2 + buffer + 1, isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];
|
|
return [...commonPoints, cursorPointOne, cursorPointTwo];
|
|
}
|
|
case "right": {
|
|
const cursorPointOne = [x2 - buffer, isFloatingTaller ? y2 + buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
const cursorPointTwo = [x2 - buffer, isFloatingTaller ? y2 - buffer / 2 : cursorLeaveFromBottom ? y2 + buffer * 4 : y2 - buffer * 4];
|
|
const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];
|
|
return [cursorPointOne, cursorPointTwo, ...commonPoints];
|
|
}
|
|
}
|
|
}
|
|
__name(getPolygon, "getPolygon");
|
|
if (isPointInPolygon([clientX, clientY], rectPoly)) {
|
|
return;
|
|
}
|
|
if (hasLanded && !isOverReferenceRect) {
|
|
return close();
|
|
}
|
|
if (!isLeave && requireIntent) {
|
|
const cursorSpeed = getCursorSpeed(event.clientX, event.clientY);
|
|
const cursorSpeedThreshold = 0.1;
|
|
if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {
|
|
return close();
|
|
}
|
|
}
|
|
if (!isPointInPolygon([clientX, clientY], getPolygon([x, y]))) {
|
|
close();
|
|
} else if (!hasLanded && requireIntent) {
|
|
timeoutRef.current = window.setTimeout(close, 40);
|
|
}
|
|
}, "onMouseMove");
|
|
}, "fn");
|
|
fn.__options = {
|
|
blockPointerEvents
|
|
};
|
|
return fn;
|
|
}
|
|
__name(safePolygon, "safePolygon");
|
|
|
|
// node_modules/@tamagui/popover/dist/esm/useFloatingContext.mjs
|
|
var useFloatingContext = /* @__PURE__ */ __name(({
|
|
open,
|
|
setOpen,
|
|
disable,
|
|
disableFocus,
|
|
hoverable
|
|
}) => import_react40.default.useCallback((props) => {
|
|
const floating = useFloating3({
|
|
...props,
|
|
open,
|
|
onOpenChange: /* @__PURE__ */ __name((val, event) => {
|
|
const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
|
|
setOpen(val, type);
|
|
}, "onOpenChange")
|
|
}), {
|
|
getReferenceProps,
|
|
getFloatingProps
|
|
} = useInteractions([hoverable ? useHover(floating.context, {
|
|
enabled: !disable && hoverable,
|
|
handleClose: safePolygon({
|
|
requireIntent: true,
|
|
blockPointerEvents: true,
|
|
buffer: 1
|
|
}),
|
|
...hoverable && typeof hoverable == "object" && hoverable
|
|
}) : useHover(floating.context, {
|
|
enabled: false
|
|
}), useFocus(floating.context, {
|
|
enabled: !disable && !disableFocus,
|
|
visibleOnly: true
|
|
}), useRole(floating.context, {
|
|
role: "dialog"
|
|
}), useDismiss(floating.context, {
|
|
enabled: !disable
|
|
})]);
|
|
return {
|
|
...floating,
|
|
open,
|
|
getReferenceProps,
|
|
getFloatingProps
|
|
};
|
|
}, [open, setOpen, disable, disableFocus, hoverable]), "useFloatingContext");
|
|
|
|
// node_modules/@tamagui/popover/dist/esm/Popover.mjs
|
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
var needsRepropagation2 = isAndroid || isIos && !USE_NATIVE_PORTAL;
|
|
var PopoverContext = (0, import_core27.createStyledContext)(
|
|
// since we always provide this we can avoid setting here
|
|
{},
|
|
"Popover__"
|
|
);
|
|
var usePopoverContext = PopoverContext.useStyledContext;
|
|
var PopoverAnchor = React53.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = props, context2 = usePopoverContext(scope), {
|
|
onCustomAnchorAdd,
|
|
onCustomAnchorRemove
|
|
} = context2 || {};
|
|
return React53.useEffect(() => (onCustomAnchorAdd(), () => onCustomAnchorRemove()), [onCustomAnchorAdd, onCustomAnchorRemove]), /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopperAnchor, {
|
|
scope,
|
|
...rest,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var PopoverTrigger = React53.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = props, context2 = usePopoverContext(scope), anchorTo = context2.anchorTo, composedTriggerRef = useComposedRefs(forwardedRef, context2.triggerRef);
|
|
if (!props.children) return null;
|
|
const trigger = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core27.View, {
|
|
"aria-expanded": context2.open,
|
|
"data-state": getState5(context2.open),
|
|
...rest,
|
|
ref: composedTriggerRef,
|
|
onPress: composeEventHandlers(props.onPress, context2.onOpenToggle)
|
|
}), virtualRef = React53.useMemo(() => anchorTo ? {
|
|
current: {
|
|
getBoundingClientRect: /* @__PURE__ */ __name(() => isWeb ? DOMRect.fromRect(anchorTo) : anchorTo, "getBoundingClientRect"),
|
|
...!isWeb && {
|
|
measure: /* @__PURE__ */ __name((c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height), "measure"),
|
|
measureInWindow: /* @__PURE__ */ __name((c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height), "measureInWindow")
|
|
}
|
|
}
|
|
} : null, [context2.anchorTo, anchorTo?.x, anchorTo?.y, anchorTo?.x, anchorTo?.height, anchorTo?.width]);
|
|
return context2.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopperAnchor, {
|
|
...virtualRef && {
|
|
virtualRef
|
|
},
|
|
scope,
|
|
asChild: true,
|
|
children: trigger
|
|
});
|
|
});
|
|
var PopoverContentFrame = (0, import_core27.styled)(PopperContentFrame, {
|
|
name: "Popover"
|
|
});
|
|
var PopoverContent = PopoverContentFrame.extractable(React53.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
trapFocus,
|
|
enableRemoveScroll = false,
|
|
zIndex,
|
|
scope,
|
|
...contentImplProps
|
|
} = props, context2 = usePopoverContext(scope), contentRef = React53.useRef(null), composedRefs = useComposedRefs(forwardedRef, contentRef), isRightClickOutsideRef = React53.useRef(false), [isFullyHidden, setIsFullyHidden] = React53.useState(!context2.open);
|
|
return context2.open && isFullyHidden && setIsFullyHidden(false), !context2.keepChildrenMounted && isFullyHidden ? null : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverPortal, {
|
|
passThrough: context2.breakpointActive,
|
|
context: context2,
|
|
zIndex,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core27.Stack, {
|
|
passThrough: context2.breakpointActive,
|
|
pointerEvents: context2.open ? contentImplProps.pointerEvents ?? "auto" : "none",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverContentImpl, {
|
|
...contentImplProps,
|
|
context: context2,
|
|
enableRemoveScroll,
|
|
ref: composedRefs,
|
|
setIsFullyHidden,
|
|
scope,
|
|
trapFocus: trapFocus ?? context2.open,
|
|
disableOutsidePointerEvents: true,
|
|
onCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
event.defaultPrevented || (event.preventDefault(), isRightClickOutsideRef.current || context2.triggerRef.current?.focus());
|
|
}),
|
|
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
const originalEvent = event.detail.originalEvent, ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true, isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
isRightClickOutsideRef.current = isRightClick;
|
|
}, {
|
|
checkDefaultPrevented: false
|
|
}),
|
|
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault(), {
|
|
checkDefaultPrevented: false
|
|
})
|
|
})
|
|
})
|
|
});
|
|
}));
|
|
var useParentContexts = /* @__PURE__ */ __name((scope) => {
|
|
const context2 = usePopoverContext(scope), popperContext = usePopperContext(scope), adaptContext = useAdaptContext(context2.adaptScope);
|
|
return {
|
|
popperContext,
|
|
adaptContext,
|
|
context: context2
|
|
};
|
|
}, "useParentContexts");
|
|
function RepropagateParentContexts({
|
|
adaptContext,
|
|
children,
|
|
context: context2,
|
|
popperContext
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopperProvider, {
|
|
scope: context2.popoverScope,
|
|
...popperContext,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverContext.Provider, {
|
|
...context2,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ProvideAdaptContext, {
|
|
...adaptContext,
|
|
children
|
|
})
|
|
})
|
|
});
|
|
}
|
|
__name(RepropagateParentContexts, "RepropagateParentContexts");
|
|
var PortalAdaptSafe = /* @__PURE__ */ __name(({
|
|
children,
|
|
context: context2
|
|
}) => {
|
|
if (needsRepropagation2) {
|
|
const parentContexts = useParentContexts(context2.popoverScope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdaptPortalContents, {
|
|
scope: context2.adaptScope,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(RepropagateParentContexts, {
|
|
...parentContexts,
|
|
children
|
|
})
|
|
});
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdaptPortalContents, {
|
|
scope: context2.adaptScope,
|
|
children
|
|
});
|
|
}, "PortalAdaptSafe");
|
|
function PopoverPortal({
|
|
context: context2,
|
|
zIndex,
|
|
passThrough,
|
|
children,
|
|
onPress
|
|
}) {
|
|
const themeName = (0, import_core27.useThemeName)();
|
|
let content = children;
|
|
if (needsRepropagation2) {
|
|
const parentContexts = useParentContexts(context2.popoverScope);
|
|
content = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(RepropagateParentContexts, {
|
|
...parentContexts,
|
|
children: content
|
|
});
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Portal, {
|
|
passThrough,
|
|
stackZIndex: true,
|
|
zIndex,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core27.Theme, {
|
|
passThrough,
|
|
contain: true,
|
|
forceClassName: true,
|
|
name: themeName,
|
|
children: [!!context2.open && !context2.breakpointActive && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(YStack, {
|
|
fullscreen: true,
|
|
onPress: composeEventHandlers(onPress, context2.onOpenToggle)
|
|
}), /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StackZIndexContext, {
|
|
zIndex: resolveViewZIndex(zIndex),
|
|
children: content
|
|
})]
|
|
})
|
|
});
|
|
}
|
|
__name(PopoverPortal, "PopoverPortal");
|
|
var PopoverContentImpl = React53.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
trapFocus,
|
|
scope,
|
|
onOpenAutoFocus,
|
|
onCloseAutoFocus,
|
|
disableOutsidePointerEvents,
|
|
disableFocusScope,
|
|
onEscapeKeyDown,
|
|
onPointerDownOutside,
|
|
onFocusOutside,
|
|
onInteractOutside,
|
|
children,
|
|
enableRemoveScroll,
|
|
freezeContentsWhenHidden,
|
|
setIsFullyHidden,
|
|
lazyMount,
|
|
context: context2,
|
|
...contentProps
|
|
} = props, {
|
|
open,
|
|
keepChildrenMounted
|
|
} = context2, handleExitComplete = React53.useCallback(() => {
|
|
setIsFullyHidden?.(true);
|
|
}, [setIsFullyHidden]);
|
|
let contents = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ResetPresence, {
|
|
disable: context2.breakpointActive,
|
|
children
|
|
});
|
|
return context2.breakpointActive || (contents = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(RemoveScroll, {
|
|
enabled: context2.breakpointActive ? false : enableRemoveScroll ? open : false,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FocusScope, {
|
|
loop: trapFocus !== false,
|
|
enabled: context2.breakpointActive || disableFocusScope ? false : open,
|
|
trapped: context2.breakpointActive ? false : trapFocus,
|
|
onMountAutoFocus: onOpenAutoFocus,
|
|
onUnmountAutoFocus: onCloseAutoFocus === false ? void 0 : onCloseAutoFocus,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", {
|
|
style: dspContentsStyle,
|
|
children: contents
|
|
})
|
|
})
|
|
})), /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Animate, {
|
|
type: "presence",
|
|
present: !!open,
|
|
keepChildrenMounted: !!keepChildrenMounted,
|
|
onExitComplete: handleExitComplete,
|
|
lazyMount,
|
|
passThrough: context2.breakpointActive,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopperContent, {
|
|
scope,
|
|
"data-state": getState5(open),
|
|
id: context2.contentId,
|
|
ref: forwardedRef,
|
|
passThrough: context2.breakpointActive,
|
|
...contentProps,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PortalAdaptSafe, {
|
|
context: context2,
|
|
children: contents
|
|
})
|
|
}, context2.contentId)
|
|
});
|
|
});
|
|
var dspContentsStyle = {
|
|
display: "contents"
|
|
};
|
|
var PopoverClose = React53.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = props, context2 = usePopoverContext(scope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(YStack, {
|
|
...rest,
|
|
ref: forwardedRef,
|
|
componentName: "PopoverClose",
|
|
onPress: composeEventHandlers(props.onPress, () => context2?.onOpenChange?.(false, "press"))
|
|
});
|
|
});
|
|
var PopoverArrow = PopperArrowFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = props, context2 = usePopoverContext(scope);
|
|
return useAdaptIsActive(context2.adaptScope) ? null : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopperArrow, {
|
|
scope,
|
|
componentName: "PopoverArrow",
|
|
...rest,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
var PopoverScrollView = React53.forwardRef(({
|
|
scope,
|
|
...props
|
|
}, ref) => {
|
|
const context2 = usePopoverContext(scope);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ScrollView, {
|
|
ref,
|
|
pointerEvents: context2.breakpointActive ? "none" : void 0,
|
|
scrollEnabled: !context2.breakpointActive,
|
|
passThrough: context2.breakpointActive,
|
|
...props
|
|
});
|
|
});
|
|
var DEFAULT_SCOPE = "";
|
|
var Popover = withStaticProperties(React53.forwardRef(function({
|
|
scope = DEFAULT_SCOPE,
|
|
...props
|
|
}, ref) {
|
|
const id = React53.useId(), adaptScope = `PopoverAdapt${scope}`;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdaptParent, {
|
|
scope: adaptScope,
|
|
portal: true,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverInner, {
|
|
adaptScope,
|
|
ref,
|
|
id,
|
|
scope,
|
|
...props
|
|
})
|
|
});
|
|
}), {
|
|
Anchor: PopoverAnchor,
|
|
Arrow: PopoverArrow,
|
|
Trigger: PopoverTrigger,
|
|
Content: PopoverContent,
|
|
Close: PopoverClose,
|
|
Adapt,
|
|
ScrollView: PopoverScrollView,
|
|
Sheet: Sheet.Controlled,
|
|
FocusScope: FocusScopeControllerComponent
|
|
});
|
|
var PopoverInner = React53.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
children,
|
|
open: openProp,
|
|
defaultOpen,
|
|
onOpenChange,
|
|
scope = DEFAULT_SCOPE,
|
|
keepChildrenMounted: keepChildrenMountedProp,
|
|
hoverable,
|
|
disableFocus,
|
|
id,
|
|
adaptScope,
|
|
...restProps
|
|
} = props, triggerRef = React53.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React53.useState(false), viaRef = React53.useRef(void 0), [keepChildrenMounted] = useControllableState({
|
|
prop: keepChildrenMountedProp,
|
|
defaultProp: false,
|
|
transition: keepChildrenMountedProp === "lazy"
|
|
}), [open, setOpen] = useControllableState({
|
|
prop: openProp,
|
|
defaultProp: defaultOpen || false,
|
|
onChange: /* @__PURE__ */ __name((val) => {
|
|
onOpenChange?.(val, viaRef.current);
|
|
}, "onChange")
|
|
}), handleOpenChange = (0, import_core27.useEvent)((val, via) => {
|
|
viaRef.current = via, setOpen(val);
|
|
}), isAdapted = useAdaptIsActive(adaptScope), floatingContext = useFloatingContext({
|
|
open,
|
|
setOpen: handleOpenChange,
|
|
disable: isAdapted,
|
|
hoverable,
|
|
disableFocus
|
|
}), [anchorTo, setAnchorToRaw] = React53.useState(), setAnchorTo = (0, import_core27.useCreateShallowSetState)(setAnchorToRaw);
|
|
React53.useImperativeHandle(forwardedRef, () => ({
|
|
anchorTo: setAnchorTo,
|
|
toggle: /* @__PURE__ */ __name(() => setOpen((prev) => !prev), "toggle"),
|
|
open: /* @__PURE__ */ __name(() => setOpen(true), "open"),
|
|
close: /* @__PURE__ */ __name(() => setOpen(false), "close"),
|
|
setOpen
|
|
}));
|
|
const popoverContext = {
|
|
popoverScope: scope,
|
|
adaptScope,
|
|
id,
|
|
contentId: React53.useId(),
|
|
triggerRef,
|
|
open,
|
|
breakpointActive: isAdapted,
|
|
onOpenChange: handleOpenChange,
|
|
onOpenToggle: (0, import_core27.useEvent)(() => {
|
|
open && isAdapted || setOpen(!open);
|
|
}),
|
|
hasCustomAnchor,
|
|
anchorTo,
|
|
onCustomAnchorAdd: React53.useCallback(() => setHasCustomAnchor(true), []),
|
|
onCustomAnchorRemove: React53.useCallback(() => setHasCustomAnchor(false), []),
|
|
keepChildrenMounted
|
|
}, memoizedChildren = React53.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverContext.Provider, {
|
|
scope,
|
|
...popoverContext,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverSheetController, {
|
|
context: popoverContext,
|
|
onOpenChange: setOpen,
|
|
children
|
|
})
|
|
}), [scope, setOpen, children, ...Object.values(popoverContext)]), contents = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Popper, {
|
|
open,
|
|
passThrough: isAdapted,
|
|
scope,
|
|
stayInFrame: true,
|
|
...restProps,
|
|
children: memoizedChildren
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, {
|
|
children: isWeb ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FloatingOverrideContext.Provider, {
|
|
value: floatingContext,
|
|
children: contents
|
|
}) : contents
|
|
});
|
|
});
|
|
function getState5(open) {
|
|
return open ? "open" : "closed";
|
|
}
|
|
__name(getState5, "getState");
|
|
var PopoverSheetController = /* @__PURE__ */ __name(({
|
|
context: context2,
|
|
...props
|
|
}) => {
|
|
const showSheet = useShowPopoverSheet(context2), breakpointActive = context2.breakpointActive, getShowSheet = (0, import_core27.useGet)(showSheet);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SheetController, {
|
|
onOpenChange: /* @__PURE__ */ __name((val) => {
|
|
getShowSheet() && props.onOpenChange?.(val);
|
|
}, "onOpenChange"),
|
|
open: context2.open,
|
|
hidden: !breakpointActive,
|
|
children: props.children
|
|
});
|
|
}, "PopoverSheetController");
|
|
var useShowPopoverSheet = /* @__PURE__ */ __name((context2) => {
|
|
const isAdapted = useAdaptIsActive(context2.adaptScope);
|
|
return context2.open === false ? false : isAdapted;
|
|
}, "useShowPopoverSheet");
|
|
|
|
// node_modules/@tamagui/progress/dist/esm/Progress.mjs
|
|
var import_core28 = require("@tamagui/core");
|
|
var React54 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
var PROGRESS_NAME = "Progress";
|
|
var [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);
|
|
var [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
var INDICATOR_NAME2 = "ProgressIndicator";
|
|
var ProgressIndicatorFrame = (0, import_core28.styled)(ThemeableStack, {
|
|
name: INDICATOR_NAME2,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
height: "100%",
|
|
width: "100%",
|
|
backgrounded: true
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ProgressIndicator = ProgressIndicatorFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
__scopeProgress,
|
|
animation,
|
|
...indicatorProps
|
|
} = props, context2 = useProgressContext(INDICATOR_NAME2, __scopeProgress), pct = context2.max - (context2.value ?? 0), x = -(context2.width === 0 ? 300 : context2.width) * (pct / 100);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ProgressIndicatorFrame, {
|
|
"data-state": getProgressState(context2.value, context2.max),
|
|
"data-value": context2.value ?? void 0,
|
|
"data-max": context2.max,
|
|
x,
|
|
width: context2.width,
|
|
...!props.unstyled && {
|
|
animateOnly: ["transform"],
|
|
opacity: context2.width === 0 ? 0 : 1
|
|
},
|
|
...indicatorProps,
|
|
ref: forwardedRef,
|
|
animation: context2.width ? animation : null
|
|
});
|
|
});
|
|
function defaultGetValueLabel(value, max2) {
|
|
return `${Math.round(value / max2 * 100)}%`;
|
|
}
|
|
__name(defaultGetValueLabel, "defaultGetValueLabel");
|
|
function getProgressState(value, maxValue) {
|
|
return value == null ? "indeterminate" : value === maxValue ? "complete" : "loading";
|
|
}
|
|
__name(getProgressState, "getProgressState");
|
|
function isNumber(value) {
|
|
return typeof value == "number";
|
|
}
|
|
__name(isNumber, "isNumber");
|
|
function isValidMaxNumber(max2) {
|
|
return isNumber(max2) && !Number.isNaN(max2) && max2 > 0;
|
|
}
|
|
__name(isValidMaxNumber, "isValidMaxNumber");
|
|
function isValidValueNumber(value, max2) {
|
|
return isNumber(value) && !Number.isNaN(value) && value <= max2 && value >= 0;
|
|
}
|
|
__name(isValidValueNumber, "isValidValueNumber");
|
|
var DEFAULT_MAX = 100;
|
|
var ProgressFrame = (0, import_core28.styled)(ThemeableStack, {
|
|
name: "Progress",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
borderRadius: 1e5,
|
|
overflow: "hidden",
|
|
backgrounded: true
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val) => {
|
|
const size4 = Math.round((0, import_core28.getVariableValue)(getSize(val)) * 0.25);
|
|
return {
|
|
height: size4,
|
|
minWidth: (0, import_core28.getVariableValue)(size4) * 20,
|
|
width: "100%"
|
|
};
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var Progress = withStaticProperties(ProgressFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
// @ts-expect-error
|
|
__scopeProgress,
|
|
value: valueProp,
|
|
max: maxProp,
|
|
getValueLabel = defaultGetValueLabel,
|
|
size: size4 = "$true",
|
|
...progressProps
|
|
} = props, max2 = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX, value = isValidValueNumber(valueProp, max2) ? valueProp : null, valueLabel = isNumber(value) ? getValueLabel(value, max2) : void 0, [width, setWidth] = React54.useState(0);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ProgressProvider, {
|
|
scope: __scopeProgress,
|
|
value,
|
|
max: max2,
|
|
width,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ProgressFrame, {
|
|
"aria-valuemax": max2,
|
|
"aria-valuemin": 0,
|
|
"aria-valuenow": isNumber(value) ? value : void 0,
|
|
"aria-valuetext": valueLabel,
|
|
role: "progressbar",
|
|
"data-state": getProgressState(value, max2),
|
|
"data-value": value ?? void 0,
|
|
"data-max": max2,
|
|
...progressProps.unstyled !== true && {
|
|
size: size4
|
|
},
|
|
...progressProps,
|
|
onLayout: /* @__PURE__ */ __name((e) => {
|
|
setWidth(e.nativeEvent.layout.width), progressProps.onLayout?.(e);
|
|
}, "onLayout"),
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
}), {
|
|
Indicator: ProgressIndicator
|
|
});
|
|
|
|
// node_modules/@tamagui/radio-group/dist/esm/RadioGroup.mjs
|
|
var import_core29 = require("@tamagui/core");
|
|
var RADIO_GROUP_ITEM_NAME = "RadioGroupItem";
|
|
var RadioGroupItemFrame = (0, import_core29.styled)(ThemeableStack, {
|
|
name: RADIO_GROUP_ITEM_NAME,
|
|
tag: "button",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
borderRadius: 1e3,
|
|
backgroundColor: "$background",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
borderWidth: 1,
|
|
borderColor: "$borderColor",
|
|
padding: 0,
|
|
hoverStyle: {
|
|
borderColor: "$borderColorHover",
|
|
backgroundColor: "$backgroundHover"
|
|
},
|
|
focusStyle: {
|
|
borderColor: "$borderColorHover",
|
|
backgroundColor: "$backgroundHover"
|
|
},
|
|
focusVisibleStyle: {
|
|
outlineStyle: "solid",
|
|
outlineWidth: 2,
|
|
outlineColor: "$outlineColor"
|
|
},
|
|
pressStyle: {
|
|
borderColor: "$borderColorFocus",
|
|
backgroundColor: "$backgroundFocus"
|
|
}
|
|
}
|
|
},
|
|
disabled: {
|
|
true: {
|
|
pointerEvents: "none",
|
|
userSelect: "none",
|
|
cursor: "not-allowed",
|
|
hoverStyle: {
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background"
|
|
},
|
|
pressStyle: {
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background"
|
|
},
|
|
focusVisibleStyle: {
|
|
outlineWidth: 0
|
|
}
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((value, {
|
|
props
|
|
}) => {
|
|
const size4 = Math.floor((0, import_core29.getVariableValue)(getSize(value)) * (props.scaleSize ?? 0.5));
|
|
return {
|
|
width: size4,
|
|
height: size4
|
|
};
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var RADIO_GROUP_INDICATOR_NAME = "RadioGroupIndicator";
|
|
var RadioGroupIndicatorFrame = (0, import_core29.styled)(ThemeableStack, {
|
|
name: RADIO_GROUP_INDICATOR_NAME,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
width: "33%",
|
|
height: "33%",
|
|
borderRadius: 1e3,
|
|
backgroundColor: "$color",
|
|
pressTheme: true
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var RADIO_GROUP_NAME = "RadioGroup";
|
|
var RadioGroupFrame = (0, import_core29.styled)(ThemeableStack, {
|
|
name: RADIO_GROUP_NAME,
|
|
variants: {
|
|
orientation: {
|
|
horizontal: {
|
|
flexDirection: "row",
|
|
spaceDirection: "horizontal"
|
|
},
|
|
vertical: {
|
|
flexDirection: "column",
|
|
spaceDirection: "vertical"
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/radio-group/dist/esm/createRadioGroup.mjs
|
|
var import_react44 = __toESM(require("react"), 1);
|
|
var import_core31 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/radio-headless/dist/esm/useRadioGroup.mjs
|
|
var import_react43 = require("react");
|
|
|
|
// node_modules/@tamagui/radio-headless/dist/esm/BubbleInput.mjs
|
|
var import_react42 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
var BubbleInput2 = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
checked,
|
|
bubbles = true,
|
|
control,
|
|
isHidden: isHidden2,
|
|
accentColor,
|
|
...inputProps
|
|
} = props, ref = import_react42.default.useRef(null), prevChecked = usePrevious(checked);
|
|
return import_react42.default.useEffect(() => {
|
|
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(inputProto, "checked").set;
|
|
if (prevChecked !== checked && setChecked) {
|
|
const event = new Event("click", {
|
|
bubbles
|
|
});
|
|
setChecked.call(input, checked), input.dispatchEvent(event);
|
|
}
|
|
}, [prevChecked, checked, bubbles]), /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", {
|
|
type: "radio",
|
|
defaultChecked: checked,
|
|
...inputProps,
|
|
tabIndex: -1,
|
|
ref,
|
|
"aria-hidden": isHidden2,
|
|
style: {
|
|
...isHidden2 ? {
|
|
// ...controlSize,
|
|
position: "absolute",
|
|
pointerEvents: "none",
|
|
opacity: 0,
|
|
margin: 0
|
|
} : {
|
|
appearance: "auto",
|
|
accentColor
|
|
},
|
|
...props.style
|
|
}
|
|
});
|
|
}, "BubbleInput");
|
|
|
|
// node_modules/@tamagui/radio-headless/dist/esm/utils.mjs
|
|
function getState6(checked) {
|
|
return checked ? "checked" : "unchecked";
|
|
}
|
|
__name(getState6, "getState");
|
|
|
|
// node_modules/@tamagui/radio-headless/dist/esm/useRadioGroup.mjs
|
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
function useRadioGroup(params) {
|
|
const {
|
|
value: valueProp,
|
|
onValueChange,
|
|
defaultValue: defaultValue2,
|
|
required,
|
|
disabled,
|
|
name,
|
|
native,
|
|
accentColor,
|
|
orientation,
|
|
ref
|
|
} = params, [value, setValue] = useControllableState({
|
|
prop: valueProp,
|
|
defaultProp: defaultValue2,
|
|
onChange: onValueChange
|
|
});
|
|
return {
|
|
providerValue: {
|
|
value,
|
|
onChange: setValue,
|
|
required,
|
|
disabled,
|
|
name,
|
|
native,
|
|
accentColor
|
|
},
|
|
frameAttrs: {
|
|
role: "radiogroup",
|
|
"aria-orientation": orientation,
|
|
"data-disabled": disabled ? "" : void 0
|
|
},
|
|
rovingFocusGroupAttrs: {
|
|
orientation,
|
|
loop: true
|
|
}
|
|
};
|
|
}
|
|
__name(useRadioGroup, "useRadioGroup");
|
|
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
var useRadioGroupItem = /* @__PURE__ */ __name((params) => {
|
|
const {
|
|
radioGroupContext,
|
|
value,
|
|
labelledBy: ariaLabelledby,
|
|
disabled: itemDisabled,
|
|
ref: refProp,
|
|
id,
|
|
onPress,
|
|
onKeyDown,
|
|
onFocus
|
|
} = params, {
|
|
value: groupValue,
|
|
disabled,
|
|
required,
|
|
onChange,
|
|
name,
|
|
native,
|
|
accentColor
|
|
} = (0, import_react43.useContext)(radioGroupContext), [button, setButton] = (0, import_react43.useState)(null), hasConsumerStoppedPropagationRef = (0, import_react43.useRef)(false), ref = (0, import_react43.useRef)(null), composedRefs = useComposedRefs(refProp, (node) => setButton(node), ref), isArrowKeyPressedRef = (0, import_react43.useRef)(false), isFormControl = isWeb ? button ? !!button.closest("form") : true : false, checked = groupValue === value, labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId;
|
|
(0, import_react43.useEffect)(() => {
|
|
if (isWeb) {
|
|
const handleKeyDown = /* @__PURE__ */ __name((event) => {
|
|
ARROW_KEYS.includes(event.key) && (isArrowKeyPressedRef.current = true);
|
|
}, "handleKeyDown"), handleKeyUp = /* @__PURE__ */ __name(() => {
|
|
isArrowKeyPressedRef.current = false;
|
|
}, "handleKeyUp");
|
|
return document.addEventListener("keydown", handleKeyDown), document.addEventListener("keyup", handleKeyUp), () => {
|
|
document.removeEventListener("keydown", handleKeyDown), document.removeEventListener("keyup", handleKeyUp);
|
|
};
|
|
}
|
|
}, []);
|
|
const isDisabled = disabled || itemDisabled;
|
|
return {
|
|
providerValue: {
|
|
checked
|
|
},
|
|
checked,
|
|
isFormControl,
|
|
bubbleInput: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(BubbleInput2, {
|
|
isHidden: !native,
|
|
control: button,
|
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
name,
|
|
value,
|
|
checked,
|
|
required,
|
|
disabled: isDisabled,
|
|
...isWeb && native && {
|
|
accentColor,
|
|
id
|
|
}
|
|
}),
|
|
native,
|
|
frameAttrs: {
|
|
"data-state": getState6(checked),
|
|
"data-disabled": isDisabled ? "" : void 0,
|
|
role: "radio",
|
|
"aria-labelledby": labelledBy,
|
|
"aria-checked": checked,
|
|
"aria-required": required,
|
|
disabled: isDisabled,
|
|
ref: composedRefs,
|
|
...isWeb && {
|
|
type: "button",
|
|
value
|
|
},
|
|
id,
|
|
onPress: composeEventHandlers(onPress, (event) => {
|
|
checked || onChange?.(value), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
}),
|
|
...isWeb && {
|
|
onKeyDown: composeEventHandlers(onKeyDown, (event) => {
|
|
event.key === "Enter" && event.preventDefault();
|
|
}),
|
|
onFocus: composeEventHandlers(onFocus, () => {
|
|
isArrowKeyPressedRef.current && ref.current?.click();
|
|
})
|
|
}
|
|
},
|
|
rovingFocusGroupAttrs: {
|
|
asChild: "expect-style",
|
|
focusable: !isDisabled,
|
|
active: checked
|
|
}
|
|
};
|
|
}, "useRadioGroupItem");
|
|
function useRadioGroupItemIndicator(params) {
|
|
const {
|
|
radioGroupItemContext,
|
|
disabled,
|
|
...rest
|
|
} = params, {
|
|
checked
|
|
} = (0, import_react43.useContext)(radioGroupItemContext);
|
|
return {
|
|
checked,
|
|
"data-state": getState6(checked),
|
|
"data-disabled": disabled ? "" : void 0,
|
|
...rest
|
|
};
|
|
}
|
|
__name(useRadioGroupItemIndicator, "useRadioGroupItemIndicator");
|
|
|
|
// node_modules/@tamagui/roving-focus/dist/esm/RovingFocusGroup.mjs
|
|
var import_core30 = require("@tamagui/core");
|
|
var React56 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
var EVENT_OPTIONS2 = {
|
|
bubbles: false,
|
|
cancelable: true
|
|
};
|
|
var RovingFocusGroupImpl = React56.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeRovingFocusGroup,
|
|
orientation,
|
|
loop = false,
|
|
dir,
|
|
currentTabStopId: currentTabStopIdProp,
|
|
defaultCurrentTabStopId,
|
|
onCurrentTabStopIdChange,
|
|
onEntryFocus,
|
|
...groupProps
|
|
} = props, ref = React56.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), direction = useDirection(dir), [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
prop: currentTabStopIdProp,
|
|
defaultProp: defaultCurrentTabStopId ?? null,
|
|
onChange: onCurrentTabStopIdChange
|
|
}), [isTabbingBackOut, setIsTabbingBackOut] = React56.useState(false), handleEntryFocus = (0, import_core30.useEvent)(onEntryFocus), getItems = useCollection2(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT), isClickFocusRef = React56.useRef(false), [focusableItemsCount, setFocusableItemsCount] = React56.useState(0);
|
|
return React56.useEffect(() => {
|
|
const node = ref.current;
|
|
if (node) return node.addEventListener(ENTRY_FOCUS, handleEntryFocus), () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
}, [handleEntryFocus]), /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RovingFocusProvider, {
|
|
scope: __scopeRovingFocusGroup,
|
|
orientation,
|
|
dir: direction,
|
|
loop,
|
|
currentTabStopId,
|
|
onItemFocus: React56.useCallback((tabStopId) => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]),
|
|
onItemShiftTab: React56.useCallback(() => setIsTabbingBackOut(true), []),
|
|
onFocusableItemAdd: React56.useCallback(() => setFocusableItemsCount((prevCount) => prevCount + 1), []),
|
|
onFocusableItemRemove: React56.useCallback(() => setFocusableItemsCount((prevCount) => prevCount - 1), []),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core30.Stack, {
|
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
"data-orientation": orientation,
|
|
...groupProps,
|
|
ref: composedRefs,
|
|
style: [{
|
|
outline: "none"
|
|
}, props.style],
|
|
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
isClickFocusRef.current = true;
|
|
}),
|
|
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
const isKeyboardFocus = !isClickFocusRef.current;
|
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS2);
|
|
if (event.currentTarget.dispatchEvent(entryFocusEvent), !entryFocusEvent.defaultPrevented) {
|
|
const items = getItems().filter((item) => item.focusable), activeItem = items.find((item) => item.active), currentItem = items.find((item) => item.id === currentTabStopId), candidateNodes = [activeItem, currentItem, ...items].filter(Boolean).map((item) => item.ref.current);
|
|
focusFirst2(candidateNodes);
|
|
}
|
|
}
|
|
isClickFocusRef.current = false;
|
|
}),
|
|
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
})
|
|
});
|
|
});
|
|
var ITEM_NAME2 = "RovingFocusGroupItem";
|
|
var RovingFocusGroupItem = React56.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeRovingFocusGroup,
|
|
focusable: focusable2 = true,
|
|
active = false,
|
|
tabStopId,
|
|
...itemProps
|
|
} = props, autoId = React56.useId(), id = tabStopId || autoId, context2 = useRovingFocusContext(__scopeRovingFocusGroup), isCurrentTabStop = context2.currentTabStopId === id, getItems = useCollection2(__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT), {
|
|
onFocusableItemAdd,
|
|
onFocusableItemRemove
|
|
} = context2;
|
|
return React56.useEffect(() => {
|
|
if (focusable2) return onFocusableItemAdd(), () => onFocusableItemRemove();
|
|
}, [focusable2, onFocusableItemAdd, onFocusableItemRemove]), /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Collection2.ItemSlot, {
|
|
scope: __scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
|
|
id,
|
|
focusable: focusable2,
|
|
active,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core30.Stack, {
|
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
"data-orientation": context2.orientation,
|
|
...itemProps,
|
|
ref: forwardedRef,
|
|
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
focusable2 ? context2.onItemFocus(id) : event.preventDefault();
|
|
}),
|
|
onFocus: composeEventHandlers(props.onFocus, () => context2.onItemFocus(id)),
|
|
...isWeb && {
|
|
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
if (event.key === "Tab" && event.shiftKey) {
|
|
context2.onItemShiftTab();
|
|
return;
|
|
}
|
|
if (event.target !== event.currentTarget) return;
|
|
const focusIntent = getFocusIntent(event, context2.orientation, context2.dir);
|
|
if (focusIntent !== void 0) {
|
|
event.preventDefault();
|
|
let candidateNodes = getItems().filter((item) => item.focusable).map((item) => item.ref.current);
|
|
if (focusIntent === "last") candidateNodes.reverse();
|
|
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
focusIntent === "prev" && candidateNodes.reverse();
|
|
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
candidateNodes = context2.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
}
|
|
setTimeout(() => focusFirst2(candidateNodes));
|
|
}
|
|
})
|
|
}
|
|
})
|
|
});
|
|
});
|
|
RovingFocusGroupItem.displayName = ITEM_NAME2;
|
|
var GROUP_NAME2 = "RovingFocusGroup";
|
|
var [Collection2, useCollection2] = createCollection(GROUP_NAME2);
|
|
var {
|
|
Provider: RovingFocusProvider,
|
|
useStyledContext: useRovingFocusContext
|
|
} = (0, import_core30.createStyledContext)();
|
|
var ROVING_FOCUS_GROUP_CONTEXT = "RovingFocusGroupContext";
|
|
var RovingFocusGroup = withStaticProperties(React56.forwardRef((props, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Collection2.Provider, {
|
|
scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Collection2.Slot, {
|
|
scope: props.__scopeRovingFocusGroup || ROVING_FOCUS_GROUP_CONTEXT,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RovingFocusGroupImpl, {
|
|
...props,
|
|
ref: forwardedRef
|
|
})
|
|
})
|
|
})), {
|
|
Item: RovingFocusGroupItem
|
|
});
|
|
RovingFocusGroup.displayName = GROUP_NAME2;
|
|
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
ArrowLeft: "prev",
|
|
ArrowUp: "prev",
|
|
ArrowRight: "next",
|
|
ArrowDown: "next",
|
|
PageUp: "first",
|
|
Home: "first",
|
|
PageDown: "last",
|
|
End: "last"
|
|
};
|
|
function getDirectionAwareKey(key, dir) {
|
|
return dir !== "rtl" ? key : key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
}
|
|
__name(getDirectionAwareKey, "getDirectionAwareKey");
|
|
function getFocusIntent(event, orientation, dir) {
|
|
const key = getDirectionAwareKey(event.key, dir);
|
|
if (!(orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) && !(orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key))) return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
}
|
|
__name(getFocusIntent, "getFocusIntent");
|
|
function focusFirst2(candidates) {
|
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
for (const candidate of candidates) if (candidate === PREVIOUSLY_FOCUSED_ELEMENT || (candidate.focus(), document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT)) return;
|
|
}
|
|
__name(focusFirst2, "focusFirst");
|
|
function wrapArray(array, startIndex) {
|
|
return array.map((_, index5) => array[(startIndex + index5) % array.length]);
|
|
}
|
|
__name(wrapArray, "wrapArray");
|
|
|
|
// node_modules/@tamagui/radio-group/dist/esm/createRadioGroup.mjs
|
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
var ensureContext2 = /* @__PURE__ */ __name((x) => {
|
|
x.context || (x.context = RadioGroupContext);
|
|
}, "ensureContext");
|
|
var RadioGroupContext = import_react44.default.createContext({});
|
|
var RadioGroupItemContext = import_react44.default.createContext({
|
|
checked: false,
|
|
disabled: false
|
|
});
|
|
function createRadioGroup(createProps) {
|
|
const {
|
|
disableActiveTheme,
|
|
Frame: Frame2 = RadioGroupFrame,
|
|
Indicator = RadioGroupIndicatorFrame,
|
|
Item = RadioGroupItemFrame
|
|
} = createProps;
|
|
ensureContext2(Frame2), ensureContext2(Indicator), ensureContext2(Item);
|
|
const RadioGroupImp = Frame2.styleable((props, ref) => {
|
|
const {
|
|
value,
|
|
defaultValue: defaultValue2,
|
|
onValueChange,
|
|
required = false,
|
|
disabled = false,
|
|
name,
|
|
native,
|
|
accentColor,
|
|
orientation = "vertical",
|
|
...rest
|
|
} = props, {
|
|
providerValue,
|
|
frameAttrs,
|
|
rovingFocusGroupAttrs
|
|
} = useRadioGroup({
|
|
orientation,
|
|
name,
|
|
defaultValue: defaultValue2,
|
|
value,
|
|
onValueChange,
|
|
required,
|
|
disabled,
|
|
native,
|
|
accentColor
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroupContext.Provider, {
|
|
value: providerValue,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RovingFocusGroup, {
|
|
...rovingFocusGroupAttrs,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroupFrame, {
|
|
...frameAttrs,
|
|
ref,
|
|
...rest
|
|
})
|
|
})
|
|
});
|
|
}), RadioGroupItemImp = Item.styleable((props, ref) => {
|
|
const {
|
|
value,
|
|
labelledBy,
|
|
onPress,
|
|
//@ts-expect-error
|
|
onKeyDown,
|
|
disabled,
|
|
id,
|
|
...rest
|
|
} = props, {
|
|
providerValue,
|
|
bubbleInput,
|
|
rovingFocusGroupAttrs,
|
|
frameAttrs,
|
|
isFormControl,
|
|
native
|
|
} = useRadioGroupItem({
|
|
radioGroupContext: RadioGroupContext,
|
|
value,
|
|
id,
|
|
labelledBy,
|
|
disabled,
|
|
onPress,
|
|
onKeyDown
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroupItemContext.Provider, {
|
|
value: providerValue,
|
|
children: import_core31.isWeb && native ? bubbleInput : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RovingFocusGroup.Item, {
|
|
...rovingFocusGroupAttrs,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroupItemFrame, {
|
|
...frameAttrs,
|
|
ref,
|
|
...rest
|
|
})
|
|
}), isFormControl && bubbleInput]
|
|
})
|
|
});
|
|
});
|
|
RadioGroupItemImp.displayName = "RadioGroupItem";
|
|
const RadioIndicator = Indicator.styleable((props, forwardedRef) => {
|
|
const {
|
|
forceMount,
|
|
disabled,
|
|
...indicatorProps
|
|
} = props, {
|
|
checked,
|
|
...useIndicatorRest
|
|
} = useRadioGroupItemIndicator({
|
|
radioGroupItemContext: RadioGroupItemContext,
|
|
disabled
|
|
});
|
|
return forceMount || checked ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Indicator, {
|
|
...useIndicatorRest,
|
|
ref: forwardedRef,
|
|
...indicatorProps
|
|
}) : null;
|
|
});
|
|
RadioIndicator.displayName = "RadioIndicator";
|
|
const RadioGroup2 = (0, import_core31.withStaticProperties)(RadioGroupImp, {
|
|
Item: RadioGroupItemImp,
|
|
Indicator: RadioIndicator
|
|
});
|
|
return RadioGroup2.displayName = "RadioGroup", RadioGroup2;
|
|
}
|
|
__name(createRadioGroup, "createRadioGroup");
|
|
|
|
// node_modules/@tamagui/radio-group/dist/esm/RadioGroupStyledContext.mjs
|
|
var import_core32 = require("@tamagui/core");
|
|
var RadioGroupStyledContext = (0, import_core32.createStyledContext)({
|
|
size: "$true",
|
|
scaleIcon: 1
|
|
}, "RadioGroup");
|
|
|
|
// node_modules/@tamagui/radio-group/dist/esm/index.mjs
|
|
var RadioGroup = createRadioGroup({
|
|
Frame: RadioGroupFrame,
|
|
Indicator: RadioGroupIndicatorFrame,
|
|
Item: RadioGroupItemFrame
|
|
});
|
|
|
|
// node_modules/@tamagui/select/dist/esm/Select.mjs
|
|
var import_core41 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/separator/dist/esm/Separator.mjs
|
|
var import_core33 = require("@tamagui/core");
|
|
var Separator = (0, import_core33.styled)(import_core33.Stack, {
|
|
name: "Separator",
|
|
borderColor: "$borderColor",
|
|
flexShrink: 0,
|
|
borderWidth: 0,
|
|
flex: 1,
|
|
height: 0,
|
|
maxHeight: 0,
|
|
borderBottomWidth: 1,
|
|
y: -0.5,
|
|
variants: {
|
|
vertical: {
|
|
true: {
|
|
y: 0,
|
|
x: -0.5,
|
|
height: isWeb ? "initial" : "auto",
|
|
// maxHeight auto WILL BE passed to style attribute, but for some reason not used?
|
|
// almost seems like a react or browser bug, but for now `initial` works
|
|
// also, it doesn't happen for `height`, but for consistency using the same values
|
|
maxHeight: isWeb ? "initial" : "auto",
|
|
width: 0,
|
|
maxWidth: 0,
|
|
borderBottomWidth: 0,
|
|
borderRightWidth: 1
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/use-debounce/dist/esm/index.mjs
|
|
var React58 = __toESM(require("react"), 1);
|
|
function debounce(func, wait, leading) {
|
|
let timeout, isCancelled = false;
|
|
function debounced() {
|
|
isCancelled = false;
|
|
const args = arguments;
|
|
leading && !timeout && func.apply(this, args), clearTimeout(timeout), timeout = setTimeout(() => {
|
|
timeout = null, leading || isCancelled || func.apply(this, args), isCancelled = false;
|
|
}, wait);
|
|
}
|
|
__name(debounced, "debounced");
|
|
return debounced.cancel = () => {
|
|
isCancelled = true;
|
|
}, debounced;
|
|
}
|
|
__name(debounce, "debounce");
|
|
var defaultOpts = {
|
|
leading: false
|
|
};
|
|
function useDebounce(fn, wait, options = defaultOpts, mountArgs = [fn]) {
|
|
const dbEffect = React58.useRef(null);
|
|
return React58.useEffect(() => () => {
|
|
dbEffect.current?.cancel();
|
|
}, []), React58.useMemo(() => (dbEffect.current = debounce(fn, wait, options.leading), dbEffect.current), [options.leading, ...mountArgs]);
|
|
}
|
|
__name(useDebounce, "useDebounce");
|
|
function useDebounceValue(val, amt = 0) {
|
|
const [state, setState] = React58.useState(val);
|
|
return React58.useEffect(() => {
|
|
const tm = setTimeout(() => {
|
|
setState((prev) => prev === val ? prev : val);
|
|
}, amt);
|
|
return () => {
|
|
clearTimeout(tm);
|
|
};
|
|
}, [val]), state;
|
|
}
|
|
__name(useDebounceValue, "useDebounceValue");
|
|
|
|
// node_modules/@tamagui/select/dist/esm/Select.mjs
|
|
var React67 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/select/dist/esm/context.mjs
|
|
var import_core34 = require("@tamagui/core");
|
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
var {
|
|
Provider: SelectProvider,
|
|
useStyledContext: useSelectContext
|
|
} = (0, import_core34.createStyledContext)(null, "Select");
|
|
var {
|
|
Provider: SelectItemParentProvider,
|
|
useStyledContext: useSelectItemParentContext
|
|
} = (0, import_core34.createStyledContext)(null, "SelectItem");
|
|
var ForwardSelectContext = /* @__PURE__ */ __name(({
|
|
context: context2,
|
|
itemContext,
|
|
children
|
|
}) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectProvider, {
|
|
isInSheet: true,
|
|
scope: context2.scopeName,
|
|
...context2,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectItemParentProvider, {
|
|
scope: context2.scopeName,
|
|
...itemContext,
|
|
children
|
|
})
|
|
}), "ForwardSelectContext");
|
|
|
|
// node_modules/@tamagui/select/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
var React60 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/select/node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs
|
|
var React59 = __toESM(require("react"), 1);
|
|
var import_react45 = require("react");
|
|
var import_tabbable = __toESM(require_dist(), 1);
|
|
function getPlatform2() {
|
|
const uaData = navigator.userAgentData;
|
|
if (uaData != null && uaData.platform) {
|
|
return uaData.platform;
|
|
}
|
|
return navigator.platform;
|
|
}
|
|
__name(getPlatform2, "getPlatform");
|
|
function getUserAgent2() {
|
|
const uaData = navigator.userAgentData;
|
|
if (uaData && Array.isArray(uaData.brands)) {
|
|
return uaData.brands.map((_ref) => {
|
|
let {
|
|
brand,
|
|
version
|
|
} = _ref;
|
|
return brand + "/" + version;
|
|
}).join(" ");
|
|
}
|
|
return navigator.userAgent;
|
|
}
|
|
__name(getUserAgent2, "getUserAgent");
|
|
function isSafari2() {
|
|
return /apple/i.test(navigator.vendor);
|
|
}
|
|
__name(isSafari2, "isSafari");
|
|
function isAndroid3() {
|
|
const re = /android/i;
|
|
return re.test(getPlatform2()) || re.test(getUserAgent2());
|
|
}
|
|
__name(isAndroid3, "isAndroid");
|
|
function isJSDOM2() {
|
|
return getUserAgent2().includes("jsdom/");
|
|
}
|
|
__name(isJSDOM2, "isJSDOM");
|
|
var FOCUSABLE_ATTRIBUTE3 = "data-floating-ui-focusable";
|
|
var TYPEABLE_SELECTOR2 = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
var ARROW_LEFT2 = "ArrowLeft";
|
|
var ARROW_RIGHT2 = "ArrowRight";
|
|
var ARROW_UP2 = "ArrowUp";
|
|
var ARROW_DOWN2 = "ArrowDown";
|
|
function activeElement2(doc) {
|
|
let activeElement4 = doc.activeElement;
|
|
while (((_activeElement = activeElement4) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {
|
|
var _activeElement;
|
|
activeElement4 = activeElement4.shadowRoot.activeElement;
|
|
}
|
|
return activeElement4;
|
|
}
|
|
__name(activeElement2, "activeElement");
|
|
function contains3(parent, child) {
|
|
if (!parent || !child) {
|
|
return false;
|
|
}
|
|
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
if (parent.contains(child)) {
|
|
return true;
|
|
}
|
|
if (rootNode && isShadowRoot(rootNode)) {
|
|
let next = child;
|
|
while (next) {
|
|
if (parent === next) {
|
|
return true;
|
|
}
|
|
next = next.parentNode || next.host;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(contains3, "contains");
|
|
function getTarget3(event) {
|
|
if ("composedPath" in event) {
|
|
return event.composedPath()[0];
|
|
}
|
|
return event.target;
|
|
}
|
|
__name(getTarget3, "getTarget");
|
|
function isEventTargetWithin2(event, node) {
|
|
if (node == null) {
|
|
return false;
|
|
}
|
|
if ("composedPath" in event) {
|
|
return event.composedPath().includes(node);
|
|
}
|
|
const e = event;
|
|
return e.target != null && node.contains(e.target);
|
|
}
|
|
__name(isEventTargetWithin2, "isEventTargetWithin");
|
|
function isRootElement2(element) {
|
|
return element.matches("html,body");
|
|
}
|
|
__name(isRootElement2, "isRootElement");
|
|
function getDocument2(node) {
|
|
return (node == null ? void 0 : node.ownerDocument) || document;
|
|
}
|
|
__name(getDocument2, "getDocument");
|
|
function isTypeableElement2(element) {
|
|
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR2);
|
|
}
|
|
__name(isTypeableElement2, "isTypeableElement");
|
|
function isTypeableCombobox2(element) {
|
|
if (!element) return false;
|
|
return element.getAttribute("role") === "combobox" && isTypeableElement2(element);
|
|
}
|
|
__name(isTypeableCombobox2, "isTypeableCombobox");
|
|
function getFloatingFocusElement2(floatingElement) {
|
|
if (!floatingElement) {
|
|
return null;
|
|
}
|
|
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE3) ? floatingElement : floatingElement.querySelector("[" + FOCUSABLE_ATTRIBUTE3 + "]") || floatingElement;
|
|
}
|
|
__name(getFloatingFocusElement2, "getFloatingFocusElement");
|
|
function getNodeChildren3(nodes, id, onlyOpenChildren) {
|
|
if (onlyOpenChildren === void 0) {
|
|
onlyOpenChildren = true;
|
|
}
|
|
const directChildren = nodes.filter((node) => {
|
|
var _node$context;
|
|
return node.parentId === id && (!onlyOpenChildren || ((_node$context = node.context) == null ? void 0 : _node$context.open));
|
|
});
|
|
return directChildren.flatMap((child) => [child, ...getNodeChildren3(nodes, child.id, onlyOpenChildren)]);
|
|
}
|
|
__name(getNodeChildren3, "getNodeChildren");
|
|
function getDeepestNode2(nodes, id) {
|
|
let deepestNodeId;
|
|
let maxDepth = -1;
|
|
function findDeepest(nodeId, depth) {
|
|
if (depth > maxDepth) {
|
|
deepestNodeId = nodeId;
|
|
maxDepth = depth;
|
|
}
|
|
const children = getNodeChildren3(nodes, nodeId);
|
|
children.forEach((child) => {
|
|
findDeepest(child.id, depth + 1);
|
|
});
|
|
}
|
|
__name(findDeepest, "findDeepest");
|
|
findDeepest(id, 0);
|
|
return nodes.find((node) => node.id === deepestNodeId);
|
|
}
|
|
__name(getDeepestNode2, "getDeepestNode");
|
|
function getNodeAncestors2(nodes, id) {
|
|
var _nodes$find;
|
|
let allAncestors = [];
|
|
let currentParentId = (_nodes$find = nodes.find((node) => node.id === id)) == null ? void 0 : _nodes$find.parentId;
|
|
while (currentParentId) {
|
|
const currentNode = nodes.find((node) => node.id === currentParentId);
|
|
currentParentId = currentNode == null ? void 0 : currentNode.parentId;
|
|
if (currentNode) {
|
|
allAncestors = allAncestors.concat(currentNode);
|
|
}
|
|
}
|
|
return allAncestors;
|
|
}
|
|
__name(getNodeAncestors2, "getNodeAncestors");
|
|
function stopEvent2(event) {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
}
|
|
__name(stopEvent2, "stopEvent");
|
|
function isReactEvent2(event) {
|
|
return "nativeEvent" in event;
|
|
}
|
|
__name(isReactEvent2, "isReactEvent");
|
|
function isVirtualClick2(event) {
|
|
if (event.mozInputSource === 0 && event.isTrusted) {
|
|
return true;
|
|
}
|
|
if (isAndroid3() && event.pointerType) {
|
|
return event.type === "click" && event.buttons === 1;
|
|
}
|
|
return event.detail === 0 && !event.pointerType;
|
|
}
|
|
__name(isVirtualClick2, "isVirtualClick");
|
|
function isVirtualPointerEvent2(event) {
|
|
if (isJSDOM2()) return false;
|
|
return !isAndroid3() && event.width === 0 && event.height === 0 || isAndroid3() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch";
|
|
}
|
|
__name(isVirtualPointerEvent2, "isVirtualPointerEvent");
|
|
function isMouseLikePointerType2(pointerType, strict) {
|
|
const values = ["mouse", "pen"];
|
|
if (!strict) {
|
|
values.push("", void 0);
|
|
}
|
|
return values.includes(pointerType);
|
|
}
|
|
__name(isMouseLikePointerType2, "isMouseLikePointerType");
|
|
var isClient5 = typeof document !== "undefined";
|
|
var noop5 = /* @__PURE__ */ __name(function noop6() {
|
|
}, "noop");
|
|
var index3 = isClient5 ? import_react45.useLayoutEffect : noop5;
|
|
var SafeReact3 = {
|
|
...React59
|
|
};
|
|
function useLatestRef3(value) {
|
|
const ref = React59.useRef(value);
|
|
index3(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref;
|
|
}
|
|
__name(useLatestRef3, "useLatestRef");
|
|
var useInsertionEffect2 = SafeReact3.useInsertionEffect;
|
|
var useSafeInsertionEffect2 = useInsertionEffect2 || ((fn) => fn());
|
|
function useEffectEvent2(callback) {
|
|
const ref = React59.useRef(() => {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
throw new Error("Cannot call an event handler while rendering.");
|
|
}
|
|
});
|
|
useSafeInsertionEffect2(() => {
|
|
ref.current = callback;
|
|
});
|
|
return React59.useCallback(function() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return ref.current == null ? void 0 : ref.current(...args);
|
|
}, []);
|
|
}
|
|
__name(useEffectEvent2, "useEffectEvent");
|
|
function isDifferentGridRow(index5, cols, prevRow) {
|
|
return Math.floor(index5 / cols) !== prevRow;
|
|
}
|
|
__name(isDifferentGridRow, "isDifferentGridRow");
|
|
function isIndexOutOfListBounds2(listRef, index5) {
|
|
return index5 < 0 || index5 >= listRef.current.length;
|
|
}
|
|
__name(isIndexOutOfListBounds2, "isIndexOutOfListBounds");
|
|
function getMinListIndex2(listRef, disabledIndices) {
|
|
return findNonDisabledListIndex2(listRef, {
|
|
disabledIndices
|
|
});
|
|
}
|
|
__name(getMinListIndex2, "getMinListIndex");
|
|
function getMaxListIndex2(listRef, disabledIndices) {
|
|
return findNonDisabledListIndex2(listRef, {
|
|
decrement: true,
|
|
startingIndex: listRef.current.length,
|
|
disabledIndices
|
|
});
|
|
}
|
|
__name(getMaxListIndex2, "getMaxListIndex");
|
|
function findNonDisabledListIndex2(listRef, _temp) {
|
|
let {
|
|
startingIndex = -1,
|
|
decrement = false,
|
|
disabledIndices,
|
|
amount = 1
|
|
} = _temp === void 0 ? {} : _temp;
|
|
let index5 = startingIndex;
|
|
do {
|
|
index5 += decrement ? -amount : amount;
|
|
} while (index5 >= 0 && index5 <= listRef.current.length - 1 && isListIndexDisabled2(listRef, index5, disabledIndices));
|
|
return index5;
|
|
}
|
|
__name(findNonDisabledListIndex2, "findNonDisabledListIndex");
|
|
function getGridNavigatedIndex2(listRef, _ref) {
|
|
let {
|
|
event,
|
|
orientation,
|
|
loop,
|
|
rtl,
|
|
cols,
|
|
disabledIndices,
|
|
minIndex,
|
|
maxIndex,
|
|
prevIndex,
|
|
stopEvent: stop = false
|
|
} = _ref;
|
|
let nextIndex = prevIndex;
|
|
if (event.key === ARROW_UP2) {
|
|
stop && stopEvent2(event);
|
|
if (prevIndex === -1) {
|
|
nextIndex = maxIndex;
|
|
} else {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: nextIndex,
|
|
amount: cols,
|
|
decrement: true,
|
|
disabledIndices
|
|
});
|
|
if (loop && (prevIndex - cols < minIndex || nextIndex < 0)) {
|
|
const col = prevIndex % cols;
|
|
const maxCol = maxIndex % cols;
|
|
const offset4 = maxIndex - (maxCol - col);
|
|
if (maxCol === col) {
|
|
nextIndex = maxIndex;
|
|
} else {
|
|
nextIndex = maxCol > col ? offset4 : offset4 - cols;
|
|
}
|
|
}
|
|
}
|
|
if (isIndexOutOfListBounds2(listRef, nextIndex)) {
|
|
nextIndex = prevIndex;
|
|
}
|
|
}
|
|
if (event.key === ARROW_DOWN2) {
|
|
stop && stopEvent2(event);
|
|
if (prevIndex === -1) {
|
|
nextIndex = minIndex;
|
|
} else {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex,
|
|
amount: cols,
|
|
disabledIndices
|
|
});
|
|
if (loop && prevIndex + cols > maxIndex) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex % cols - cols,
|
|
amount: cols,
|
|
disabledIndices
|
|
});
|
|
}
|
|
}
|
|
if (isIndexOutOfListBounds2(listRef, nextIndex)) {
|
|
nextIndex = prevIndex;
|
|
}
|
|
}
|
|
if (orientation === "both") {
|
|
const prevRow = floor(prevIndex / cols);
|
|
if (event.key === (rtl ? ARROW_LEFT2 : ARROW_RIGHT2)) {
|
|
stop && stopEvent2(event);
|
|
if (prevIndex % cols !== cols - 1) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex,
|
|
disabledIndices
|
|
});
|
|
if (loop && isDifferentGridRow(nextIndex, cols, prevRow)) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
disabledIndices
|
|
});
|
|
}
|
|
} else if (loop) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
disabledIndices
|
|
});
|
|
}
|
|
if (isDifferentGridRow(nextIndex, cols, prevRow)) {
|
|
nextIndex = prevIndex;
|
|
}
|
|
}
|
|
if (event.key === (rtl ? ARROW_RIGHT2 : ARROW_LEFT2)) {
|
|
stop && stopEvent2(event);
|
|
if (prevIndex % cols !== 0) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex,
|
|
decrement: true,
|
|
disabledIndices
|
|
});
|
|
if (loop && isDifferentGridRow(nextIndex, cols, prevRow)) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex + (cols - prevIndex % cols),
|
|
decrement: true,
|
|
disabledIndices
|
|
});
|
|
}
|
|
} else if (loop) {
|
|
nextIndex = findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex + (cols - prevIndex % cols),
|
|
decrement: true,
|
|
disabledIndices
|
|
});
|
|
}
|
|
if (isDifferentGridRow(nextIndex, cols, prevRow)) {
|
|
nextIndex = prevIndex;
|
|
}
|
|
}
|
|
const lastRow = floor(maxIndex / cols) === prevRow;
|
|
if (isIndexOutOfListBounds2(listRef, nextIndex)) {
|
|
if (loop && lastRow) {
|
|
nextIndex = event.key === (rtl ? ARROW_RIGHT2 : ARROW_LEFT2) ? maxIndex : findNonDisabledListIndex2(listRef, {
|
|
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
disabledIndices
|
|
});
|
|
} else {
|
|
nextIndex = prevIndex;
|
|
}
|
|
}
|
|
}
|
|
return nextIndex;
|
|
}
|
|
__name(getGridNavigatedIndex2, "getGridNavigatedIndex");
|
|
function createGridCellMap2(sizes, cols, dense) {
|
|
const cellMap = [];
|
|
let startIndex = 0;
|
|
sizes.forEach((_ref2, index5) => {
|
|
let {
|
|
width,
|
|
height
|
|
} = _ref2;
|
|
if (width > cols) {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
throw new Error("[Floating UI]: Invalid grid - item width at index " + index5 + " is greater than grid columns");
|
|
}
|
|
}
|
|
let itemPlaced = false;
|
|
if (dense) {
|
|
startIndex = 0;
|
|
}
|
|
while (!itemPlaced) {
|
|
const targetCells = [];
|
|
for (let i = 0; i < width; i++) {
|
|
for (let j = 0; j < height; j++) {
|
|
targetCells.push(startIndex + i + j * cols);
|
|
}
|
|
}
|
|
if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) {
|
|
targetCells.forEach((cell) => {
|
|
cellMap[cell] = index5;
|
|
});
|
|
itemPlaced = true;
|
|
} else {
|
|
startIndex++;
|
|
}
|
|
}
|
|
});
|
|
return [...cellMap];
|
|
}
|
|
__name(createGridCellMap2, "createGridCellMap");
|
|
function getGridCellIndexOfCorner2(index5, sizes, cellMap, cols, corner) {
|
|
if (index5 === -1) return -1;
|
|
const firstCellIndex = cellMap.indexOf(index5);
|
|
const sizeItem = sizes[index5];
|
|
switch (corner) {
|
|
case "tl":
|
|
return firstCellIndex;
|
|
case "tr":
|
|
if (!sizeItem) {
|
|
return firstCellIndex;
|
|
}
|
|
return firstCellIndex + sizeItem.width - 1;
|
|
case "bl":
|
|
if (!sizeItem) {
|
|
return firstCellIndex;
|
|
}
|
|
return firstCellIndex + (sizeItem.height - 1) * cols;
|
|
case "br":
|
|
return cellMap.lastIndexOf(index5);
|
|
}
|
|
}
|
|
__name(getGridCellIndexOfCorner2, "getGridCellIndexOfCorner");
|
|
function getGridCellIndices2(indices, cellMap) {
|
|
return cellMap.flatMap((index5, cellIndex) => indices.includes(index5) ? [cellIndex] : []);
|
|
}
|
|
__name(getGridCellIndices2, "getGridCellIndices");
|
|
function isListIndexDisabled2(listRef, index5, disabledIndices) {
|
|
if (typeof disabledIndices === "function") {
|
|
return disabledIndices(index5);
|
|
} else if (disabledIndices) {
|
|
return disabledIndices.includes(index5);
|
|
}
|
|
const element = listRef.current[index5];
|
|
return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
|
|
}
|
|
__name(isListIndexDisabled2, "isListIndexDisabled");
|
|
var getTabbableOptions2 = /* @__PURE__ */ __name(() => ({
|
|
getShadowRoot: true,
|
|
displayCheck: (
|
|
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
// determines if the current environment is JSDOM-like.
|
|
typeof ResizeObserver === "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
)
|
|
}), "getTabbableOptions");
|
|
function getTabbableIn(container, dir) {
|
|
const list = (0, import_tabbable.tabbable)(container, getTabbableOptions2());
|
|
const len = list.length;
|
|
if (len === 0) return;
|
|
const active = activeElement2(getDocument2(container));
|
|
const index5 = list.indexOf(active);
|
|
const nextIndex = index5 === -1 ? dir === 1 ? 0 : len - 1 : index5 + dir;
|
|
return list[nextIndex];
|
|
}
|
|
__name(getTabbableIn, "getTabbableIn");
|
|
function getNextTabbable2(referenceElement) {
|
|
return getTabbableIn(getDocument2(referenceElement).body, 1) || referenceElement;
|
|
}
|
|
__name(getNextTabbable2, "getNextTabbable");
|
|
function getPreviousTabbable2(referenceElement) {
|
|
return getTabbableIn(getDocument2(referenceElement).body, -1) || referenceElement;
|
|
}
|
|
__name(getPreviousTabbable2, "getPreviousTabbable");
|
|
function isOutsideEvent2(event, container) {
|
|
const containerElement = container || event.currentTarget;
|
|
const relatedTarget = event.relatedTarget;
|
|
return !relatedTarget || !contains3(containerElement, relatedTarget);
|
|
}
|
|
__name(isOutsideEvent2, "isOutsideEvent");
|
|
function disableFocusInside2(container) {
|
|
const tabbableElements = (0, import_tabbable.tabbable)(container, getTabbableOptions2());
|
|
tabbableElements.forEach((element) => {
|
|
element.dataset.tabindex = element.getAttribute("tabindex") || "";
|
|
element.setAttribute("tabindex", "-1");
|
|
});
|
|
}
|
|
__name(disableFocusInside2, "disableFocusInside");
|
|
function enableFocusInside2(container) {
|
|
const elements = container.querySelectorAll("[data-tabindex]");
|
|
elements.forEach((element) => {
|
|
const tabindex = element.dataset.tabindex;
|
|
delete element.dataset.tabindex;
|
|
if (tabindex) {
|
|
element.setAttribute("tabindex", tabindex);
|
|
} else {
|
|
element.removeAttribute("tabindex");
|
|
}
|
|
});
|
|
}
|
|
__name(enableFocusInside2, "enableFocusInside");
|
|
|
|
// node_modules/@tamagui/select/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
var import_tabbable2 = __toESM(require_dist(), 1);
|
|
var ReactDOM4 = __toESM(require("react-dom"), 1);
|
|
var FOCUSABLE_ATTRIBUTE4 = "data-floating-ui-focusable";
|
|
var ACTIVE_KEY2 = "active";
|
|
var SELECTED_KEY2 = "selected";
|
|
var ARROW_LEFT3 = "ArrowLeft";
|
|
var ARROW_RIGHT3 = "ArrowRight";
|
|
var ARROW_UP3 = "ArrowUp";
|
|
var ARROW_DOWN3 = "ArrowDown";
|
|
var horizontalKeys2 = [ARROW_LEFT3, ARROW_RIGHT3];
|
|
var verticalKeys2 = [ARROW_UP3, ARROW_DOWN3];
|
|
var allKeys2 = [...horizontalKeys2, ...verticalKeys2];
|
|
var SafeReact4 = {
|
|
...React60
|
|
};
|
|
var serverHandoffComplete2 = false;
|
|
var count2 = 0;
|
|
var genId2 = /* @__PURE__ */ __name(() => (
|
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
// on <React 18
|
|
"floating-ui-" + Math.random().toString(36).slice(2, 6) + count2++
|
|
), "genId");
|
|
function useFloatingId2() {
|
|
const [id, setId] = React60.useState(() => serverHandoffComplete2 ? genId2() : void 0);
|
|
index3(() => {
|
|
if (id == null) {
|
|
setId(genId2());
|
|
}
|
|
}, []);
|
|
React60.useEffect(() => {
|
|
serverHandoffComplete2 = true;
|
|
}, []);
|
|
return id;
|
|
}
|
|
__name(useFloatingId2, "useFloatingId");
|
|
var useReactId2 = SafeReact4.useId;
|
|
var useId12 = useReactId2 || useFloatingId2;
|
|
var devMessageSet2;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
devMessageSet2 = /* @__PURE__ */ new Set();
|
|
}
|
|
function warn() {
|
|
var _devMessageSet;
|
|
for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
messages[_key] = arguments[_key];
|
|
}
|
|
const message = "Floating UI: " + messages.join(" ");
|
|
if (!((_devMessageSet = devMessageSet2) != null && _devMessageSet.has(message))) {
|
|
var _devMessageSet2;
|
|
(_devMessageSet2 = devMessageSet2) == null || _devMessageSet2.add(message);
|
|
console.warn(message);
|
|
}
|
|
}
|
|
__name(warn, "warn");
|
|
function error2() {
|
|
var _devMessageSet3;
|
|
for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
messages[_key2] = arguments[_key2];
|
|
}
|
|
const message = "Floating UI: " + messages.join(" ");
|
|
if (!((_devMessageSet3 = devMessageSet2) != null && _devMessageSet3.has(message))) {
|
|
var _devMessageSet4;
|
|
(_devMessageSet4 = devMessageSet2) == null || _devMessageSet4.add(message);
|
|
console.error(message);
|
|
}
|
|
}
|
|
__name(error2, "error");
|
|
function createEventEmitter2() {
|
|
const map = /* @__PURE__ */ new Map();
|
|
return {
|
|
emit(event, data) {
|
|
var _map$get;
|
|
(_map$get = map.get(event)) == null || _map$get.forEach((listener) => listener(data));
|
|
},
|
|
on(event, listener) {
|
|
if (!map.has(event)) {
|
|
map.set(event, /* @__PURE__ */ new Set());
|
|
}
|
|
map.get(event).add(listener);
|
|
},
|
|
off(event, listener) {
|
|
var _map$get2;
|
|
(_map$get2 = map.get(event)) == null || _map$get2.delete(listener);
|
|
}
|
|
};
|
|
}
|
|
__name(createEventEmitter2, "createEventEmitter");
|
|
var FloatingNodeContext2 = /* @__PURE__ */ React60.createContext(null);
|
|
var FloatingTreeContext2 = /* @__PURE__ */ React60.createContext(null);
|
|
var useFloatingParentNodeId2 = /* @__PURE__ */ __name(() => {
|
|
var _React$useContext;
|
|
return ((_React$useContext = React60.useContext(FloatingNodeContext2)) == null ? void 0 : _React$useContext.id) || null;
|
|
}, "useFloatingParentNodeId");
|
|
var useFloatingTree2 = /* @__PURE__ */ __name(() => React60.useContext(FloatingTreeContext2), "useFloatingTree");
|
|
function createAttribute2(name) {
|
|
return "data-floating-ui-" + name;
|
|
}
|
|
__name(createAttribute2, "createAttribute");
|
|
function clearTimeoutIfSet2(timeoutRef) {
|
|
if (timeoutRef.current !== -1) {
|
|
clearTimeout(timeoutRef.current);
|
|
timeoutRef.current = -1;
|
|
}
|
|
}
|
|
__name(clearTimeoutIfSet2, "clearTimeoutIfSet");
|
|
var rafId = 0;
|
|
function enqueueFocus(el, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
preventScroll = false,
|
|
cancelPrevious = true,
|
|
sync = false
|
|
} = options;
|
|
cancelPrevious && cancelAnimationFrame(rafId);
|
|
const exec = /* @__PURE__ */ __name(() => el == null ? void 0 : el.focus({
|
|
preventScroll
|
|
}), "exec");
|
|
if (sync) {
|
|
exec();
|
|
} else {
|
|
rafId = requestAnimationFrame(exec);
|
|
}
|
|
}
|
|
__name(enqueueFocus, "enqueueFocus");
|
|
function getDocument3(node) {
|
|
return (node == null ? void 0 : node.ownerDocument) || document;
|
|
}
|
|
__name(getDocument3, "getDocument");
|
|
var counters = {
|
|
inert: /* @__PURE__ */ new WeakMap(),
|
|
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
none: /* @__PURE__ */ new WeakMap()
|
|
};
|
|
function getCounterMap(control) {
|
|
if (control === "inert") return counters.inert;
|
|
if (control === "aria-hidden") return counters["aria-hidden"];
|
|
return counters.none;
|
|
}
|
|
__name(getCounterMap, "getCounterMap");
|
|
var uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
|
|
var markerMap = {};
|
|
var lockCount$1 = 0;
|
|
var supportsInert = /* @__PURE__ */ __name(() => typeof HTMLElement !== "undefined" && "inert" in HTMLElement.prototype, "supportsInert");
|
|
var unwrapHost = /* @__PURE__ */ __name((node) => node && (node.host || unwrapHost(node.parentNode)), "unwrapHost");
|
|
var correctElements = /* @__PURE__ */ __name((parent, targets) => targets.map((target) => {
|
|
if (parent.contains(target)) {
|
|
return target;
|
|
}
|
|
const correctedTarget = unwrapHost(target);
|
|
if (parent.contains(correctedTarget)) {
|
|
return correctedTarget;
|
|
}
|
|
return null;
|
|
}).filter((x) => x != null), "correctElements");
|
|
function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert) {
|
|
const markerName = "data-floating-ui-inert";
|
|
const controlAttribute = inert ? "inert" : ariaHidden ? "aria-hidden" : null;
|
|
const avoidElements = correctElements(body, uncorrectedAvoidElements);
|
|
const elementsToKeep = /* @__PURE__ */ new Set();
|
|
const elementsToStop = new Set(avoidElements);
|
|
const hiddenElements = [];
|
|
if (!markerMap[markerName]) {
|
|
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
}
|
|
const markerCounter = markerMap[markerName];
|
|
avoidElements.forEach(keep);
|
|
deep(body);
|
|
elementsToKeep.clear();
|
|
function keep(el) {
|
|
if (!el || elementsToKeep.has(el)) {
|
|
return;
|
|
}
|
|
elementsToKeep.add(el);
|
|
el.parentNode && keep(el.parentNode);
|
|
}
|
|
__name(keep, "keep");
|
|
function deep(parent) {
|
|
if (!parent || elementsToStop.has(parent)) {
|
|
return;
|
|
}
|
|
[].forEach.call(parent.children, (node) => {
|
|
if (getNodeName(node) === "script") return;
|
|
if (elementsToKeep.has(node)) {
|
|
deep(node);
|
|
} else {
|
|
const attr2 = controlAttribute ? node.getAttribute(controlAttribute) : null;
|
|
const alreadyHidden = attr2 !== null && attr2 !== "false";
|
|
const counterMap = getCounterMap(controlAttribute);
|
|
const counterValue = (counterMap.get(node) || 0) + 1;
|
|
const markerValue = (markerCounter.get(node) || 0) + 1;
|
|
counterMap.set(node, counterValue);
|
|
markerCounter.set(node, markerValue);
|
|
hiddenElements.push(node);
|
|
if (counterValue === 1 && alreadyHidden) {
|
|
uncontrolledElementsSet.add(node);
|
|
}
|
|
if (markerValue === 1) {
|
|
node.setAttribute(markerName, "");
|
|
}
|
|
if (!alreadyHidden && controlAttribute) {
|
|
node.setAttribute(controlAttribute, controlAttribute === "inert" ? "" : "true");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
__name(deep, "deep");
|
|
lockCount$1++;
|
|
return () => {
|
|
hiddenElements.forEach((element) => {
|
|
const counterMap = getCounterMap(controlAttribute);
|
|
const currentCounterValue = counterMap.get(element) || 0;
|
|
const counterValue = currentCounterValue - 1;
|
|
const markerValue = (markerCounter.get(element) || 0) - 1;
|
|
counterMap.set(element, counterValue);
|
|
markerCounter.set(element, markerValue);
|
|
if (!counterValue) {
|
|
if (!uncontrolledElementsSet.has(element) && controlAttribute) {
|
|
element.removeAttribute(controlAttribute);
|
|
}
|
|
uncontrolledElementsSet.delete(element);
|
|
}
|
|
if (!markerValue) {
|
|
element.removeAttribute(markerName);
|
|
}
|
|
});
|
|
lockCount$1--;
|
|
if (!lockCount$1) {
|
|
counters.inert = /* @__PURE__ */ new WeakMap();
|
|
counters["aria-hidden"] = /* @__PURE__ */ new WeakMap();
|
|
counters.none = /* @__PURE__ */ new WeakMap();
|
|
uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
|
|
markerMap = {};
|
|
}
|
|
};
|
|
}
|
|
__name(applyAttributeToOthers, "applyAttributeToOthers");
|
|
function markOthers(avoidElements, ariaHidden, inert) {
|
|
if (ariaHidden === void 0) {
|
|
ariaHidden = false;
|
|
}
|
|
if (inert === void 0) {
|
|
inert = false;
|
|
}
|
|
const body = getDocument3(avoidElements[0]).body;
|
|
return applyAttributeToOthers(avoidElements.concat(Array.from(body.querySelectorAll('[aria-live],[role="status"],output'))), body, ariaHidden, inert);
|
|
}
|
|
__name(markOthers, "markOthers");
|
|
var HIDDEN_STYLES = {
|
|
border: 0,
|
|
clip: "rect(0 0 0 0)",
|
|
height: "1px",
|
|
margin: "-1px",
|
|
overflow: "hidden",
|
|
padding: 0,
|
|
position: "fixed",
|
|
whiteSpace: "nowrap",
|
|
width: "1px",
|
|
top: 0,
|
|
left: 0
|
|
};
|
|
var FocusGuard = /* @__PURE__ */ React60.forwardRef(/* @__PURE__ */ __name(function FocusGuard2(props, ref) {
|
|
const [role, setRole] = React60.useState();
|
|
index3(() => {
|
|
if (isSafari2()) {
|
|
setRole("button");
|
|
}
|
|
}, []);
|
|
const restProps = {
|
|
ref,
|
|
tabIndex: 0,
|
|
// Role is only for VoiceOver
|
|
role,
|
|
"aria-hidden": role ? void 0 : true,
|
|
[createAttribute2("focus-guard")]: "",
|
|
style: HIDDEN_STYLES
|
|
};
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", {
|
|
...props,
|
|
...restProps
|
|
});
|
|
}, "FocusGuard"));
|
|
var PortalContext = /* @__PURE__ */ React60.createContext(null);
|
|
var attr = /* @__PURE__ */ createAttribute2("portal");
|
|
function useFloatingPortalNode(props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
id,
|
|
root
|
|
} = props;
|
|
const uniqueId = useId12();
|
|
const portalContext = usePortalContext();
|
|
const [portalNode, setPortalNode] = React60.useState(null);
|
|
const portalNodeRef = React60.useRef(null);
|
|
index3(() => {
|
|
return () => {
|
|
portalNode == null || portalNode.remove();
|
|
queueMicrotask(() => {
|
|
portalNodeRef.current = null;
|
|
});
|
|
};
|
|
}, [portalNode]);
|
|
index3(() => {
|
|
if (!uniqueId) return;
|
|
if (portalNodeRef.current) return;
|
|
const existingIdRoot = id ? document.getElementById(id) : null;
|
|
if (!existingIdRoot) return;
|
|
const subRoot = document.createElement("div");
|
|
subRoot.id = uniqueId;
|
|
subRoot.setAttribute(attr, "");
|
|
existingIdRoot.appendChild(subRoot);
|
|
portalNodeRef.current = subRoot;
|
|
setPortalNode(subRoot);
|
|
}, [id, uniqueId]);
|
|
index3(() => {
|
|
if (root === null) return;
|
|
if (!uniqueId) return;
|
|
if (portalNodeRef.current) return;
|
|
let container = root || (portalContext == null ? void 0 : portalContext.portalNode);
|
|
if (container && !isNode(container)) container = container.current;
|
|
container = container || document.body;
|
|
let idWrapper = null;
|
|
if (id) {
|
|
idWrapper = document.createElement("div");
|
|
idWrapper.id = id;
|
|
container.appendChild(idWrapper);
|
|
}
|
|
const subRoot = document.createElement("div");
|
|
subRoot.id = uniqueId;
|
|
subRoot.setAttribute(attr, "");
|
|
container = idWrapper || container;
|
|
container.appendChild(subRoot);
|
|
portalNodeRef.current = subRoot;
|
|
setPortalNode(subRoot);
|
|
}, [id, root, uniqueId, portalContext]);
|
|
return portalNode;
|
|
}
|
|
__name(useFloatingPortalNode, "useFloatingPortalNode");
|
|
function FloatingPortal(props) {
|
|
const {
|
|
children,
|
|
id,
|
|
root,
|
|
preserveTabOrder = true
|
|
} = props;
|
|
const portalNode = useFloatingPortalNode({
|
|
id,
|
|
root
|
|
});
|
|
const [focusManagerState, setFocusManagerState] = React60.useState(null);
|
|
const beforeOutsideRef = React60.useRef(null);
|
|
const afterOutsideRef = React60.useRef(null);
|
|
const beforeInsideRef = React60.useRef(null);
|
|
const afterInsideRef = React60.useRef(null);
|
|
const modal = focusManagerState == null ? void 0 : focusManagerState.modal;
|
|
const open = focusManagerState == null ? void 0 : focusManagerState.open;
|
|
const shouldRenderGuards = (
|
|
// The FocusManager and therefore floating element are currently open/
|
|
// rendered.
|
|
!!focusManagerState && // Guards are only for non-modal focus management.
|
|
!focusManagerState.modal && // Don't render if unmount is transitioning.
|
|
focusManagerState.open && preserveTabOrder && !!(root || portalNode)
|
|
);
|
|
React60.useEffect(() => {
|
|
if (!portalNode || !preserveTabOrder || modal) {
|
|
return;
|
|
}
|
|
function onFocus(event) {
|
|
if (portalNode && isOutsideEvent2(event)) {
|
|
const focusing = event.type === "focusin";
|
|
const manageFocus = focusing ? enableFocusInside2 : disableFocusInside2;
|
|
manageFocus(portalNode);
|
|
}
|
|
}
|
|
__name(onFocus, "onFocus");
|
|
portalNode.addEventListener("focusin", onFocus, true);
|
|
portalNode.addEventListener("focusout", onFocus, true);
|
|
return () => {
|
|
portalNode.removeEventListener("focusin", onFocus, true);
|
|
portalNode.removeEventListener("focusout", onFocus, true);
|
|
};
|
|
}, [portalNode, preserveTabOrder, modal]);
|
|
React60.useEffect(() => {
|
|
if (!portalNode) return;
|
|
if (open) return;
|
|
enableFocusInside2(portalNode);
|
|
}, [open, portalNode]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(PortalContext.Provider, {
|
|
value: React60.useMemo(() => ({
|
|
preserveTabOrder,
|
|
beforeOutsideRef,
|
|
afterOutsideRef,
|
|
beforeInsideRef,
|
|
afterInsideRef,
|
|
portalNode,
|
|
setFocusManagerState
|
|
}), [preserveTabOrder, portalNode]),
|
|
children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FocusGuard, {
|
|
"data-type": "outside",
|
|
ref: beforeOutsideRef,
|
|
onFocus: /* @__PURE__ */ __name((event) => {
|
|
if (isOutsideEvent2(event, portalNode)) {
|
|
var _beforeInsideRef$curr;
|
|
(_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus();
|
|
} else {
|
|
const domReference = focusManagerState ? focusManagerState.domReference : null;
|
|
const prevTabbable = getPreviousTabbable2(domReference);
|
|
prevTabbable == null || prevTabbable.focus();
|
|
}
|
|
}, "onFocus")
|
|
}), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", {
|
|
"aria-owns": portalNode.id,
|
|
style: HIDDEN_STYLES
|
|
}), portalNode && /* @__PURE__ */ ReactDOM4.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FocusGuard, {
|
|
"data-type": "outside",
|
|
ref: afterOutsideRef,
|
|
onFocus: /* @__PURE__ */ __name((event) => {
|
|
if (isOutsideEvent2(event, portalNode)) {
|
|
var _afterInsideRef$curre;
|
|
(_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus();
|
|
} else {
|
|
const domReference = focusManagerState ? focusManagerState.domReference : null;
|
|
const nextTabbable = getNextTabbable2(domReference);
|
|
nextTabbable == null || nextTabbable.focus();
|
|
(focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, "focus-out"));
|
|
}
|
|
}, "onFocus")
|
|
})]
|
|
});
|
|
}
|
|
__name(FloatingPortal, "FloatingPortal");
|
|
var usePortalContext = /* @__PURE__ */ __name(() => React60.useContext(PortalContext), "usePortalContext");
|
|
function useLiteMergeRefs(refs) {
|
|
return React60.useMemo(() => {
|
|
return (value) => {
|
|
refs.forEach((ref) => {
|
|
if (ref) {
|
|
ref.current = value;
|
|
}
|
|
});
|
|
};
|
|
}, refs);
|
|
}
|
|
__name(useLiteMergeRefs, "useLiteMergeRefs");
|
|
var LIST_LIMIT = 20;
|
|
var previouslyFocusedElements = [];
|
|
function clearDisconnectedPreviouslyFocusedElements() {
|
|
previouslyFocusedElements = previouslyFocusedElements.filter((el) => el.isConnected);
|
|
}
|
|
__name(clearDisconnectedPreviouslyFocusedElements, "clearDisconnectedPreviouslyFocusedElements");
|
|
function addPreviouslyFocusedElement(element) {
|
|
clearDisconnectedPreviouslyFocusedElements();
|
|
if (element && getNodeName(element) !== "body") {
|
|
previouslyFocusedElements.push(element);
|
|
if (previouslyFocusedElements.length > LIST_LIMIT) {
|
|
previouslyFocusedElements = previouslyFocusedElements.slice(-20);
|
|
}
|
|
}
|
|
}
|
|
__name(addPreviouslyFocusedElement, "addPreviouslyFocusedElement");
|
|
function getPreviouslyFocusedElement() {
|
|
clearDisconnectedPreviouslyFocusedElements();
|
|
return previouslyFocusedElements[previouslyFocusedElements.length - 1];
|
|
}
|
|
__name(getPreviouslyFocusedElement, "getPreviouslyFocusedElement");
|
|
function getFirstTabbableElement(container) {
|
|
const tabbableOptions = getTabbableOptions2();
|
|
if ((0, import_tabbable2.isTabbable)(container, tabbableOptions)) {
|
|
return container;
|
|
}
|
|
return (0, import_tabbable2.tabbable)(container, tabbableOptions)[0] || container;
|
|
}
|
|
__name(getFirstTabbableElement, "getFirstTabbableElement");
|
|
function handleTabIndex(floatingFocusElement, orderRef) {
|
|
var _floatingFocusElement;
|
|
if (!orderRef.current.includes("floating") && !((_floatingFocusElement = floatingFocusElement.getAttribute("role")) != null && _floatingFocusElement.includes("dialog"))) {
|
|
return;
|
|
}
|
|
const options = getTabbableOptions2();
|
|
const focusableElements = (0, import_tabbable2.focusable)(floatingFocusElement, options);
|
|
const tabbableContent = focusableElements.filter((element) => {
|
|
const dataTabIndex = element.getAttribute("data-tabindex") || "";
|
|
return (0, import_tabbable2.isTabbable)(element, options) || element.hasAttribute("data-tabindex") && !dataTabIndex.startsWith("-");
|
|
});
|
|
const tabIndex = floatingFocusElement.getAttribute("tabindex");
|
|
if (orderRef.current.includes("floating") || tabbableContent.length === 0) {
|
|
if (tabIndex !== "0") {
|
|
floatingFocusElement.setAttribute("tabindex", "0");
|
|
}
|
|
} else if (tabIndex !== "-1" || floatingFocusElement.hasAttribute("data-tabindex") && floatingFocusElement.getAttribute("data-tabindex") !== "-1") {
|
|
floatingFocusElement.setAttribute("tabindex", "-1");
|
|
floatingFocusElement.setAttribute("data-tabindex", "-1");
|
|
}
|
|
}
|
|
__name(handleTabIndex, "handleTabIndex");
|
|
var VisuallyHiddenDismiss = /* @__PURE__ */ React60.forwardRef(/* @__PURE__ */ __name(function VisuallyHiddenDismiss2(props, ref) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", {
|
|
...props,
|
|
type: "button",
|
|
ref,
|
|
tabIndex: -1,
|
|
style: HIDDEN_STYLES
|
|
});
|
|
}, "VisuallyHiddenDismiss"));
|
|
function FloatingFocusManager(props) {
|
|
const {
|
|
context: context2,
|
|
children,
|
|
disabled = false,
|
|
order = ["content"],
|
|
guards: _guards = true,
|
|
initialFocus = 0,
|
|
returnFocus = true,
|
|
restoreFocus = false,
|
|
modal = true,
|
|
visuallyHiddenDismiss = false,
|
|
closeOnFocusOut = true,
|
|
outsideElementsInert = false,
|
|
getInsideElements: _getInsideElements = /* @__PURE__ */ __name(() => [], "_getInsideElements")
|
|
} = props;
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
events,
|
|
dataRef,
|
|
elements: {
|
|
domReference,
|
|
floating
|
|
}
|
|
} = context2;
|
|
const getNodeId = useEffectEvent2(() => {
|
|
var _dataRef$current$floa;
|
|
return (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;
|
|
});
|
|
const getInsideElements = useEffectEvent2(_getInsideElements);
|
|
const ignoreInitialFocus = typeof initialFocus === "number" && initialFocus < 0;
|
|
const isUntrappedTypeableCombobox = isTypeableCombobox2(domReference) && ignoreInitialFocus;
|
|
const inertSupported = supportsInert();
|
|
const guards = inertSupported ? _guards : true;
|
|
const useInert = !guards || inertSupported && outsideElementsInert;
|
|
const orderRef = useLatestRef3(order);
|
|
const initialFocusRef = useLatestRef3(initialFocus);
|
|
const returnFocusRef = useLatestRef3(returnFocus);
|
|
const tree = useFloatingTree2();
|
|
const portalContext = usePortalContext();
|
|
const startDismissButtonRef = React60.useRef(null);
|
|
const endDismissButtonRef = React60.useRef(null);
|
|
const preventReturnFocusRef = React60.useRef(false);
|
|
const isPointerDownRef = React60.useRef(false);
|
|
const tabbableIndexRef = React60.useRef(-1);
|
|
const blurTimeoutRef = React60.useRef(-1);
|
|
const isInsidePortal = portalContext != null;
|
|
const floatingFocusElement = getFloatingFocusElement2(floating);
|
|
const getTabbableContent = useEffectEvent2(function(container) {
|
|
if (container === void 0) {
|
|
container = floatingFocusElement;
|
|
}
|
|
return container ? (0, import_tabbable2.tabbable)(container, getTabbableOptions2()) : [];
|
|
});
|
|
const getTabbableElements = useEffectEvent2((container) => {
|
|
const content = getTabbableContent(container);
|
|
return orderRef.current.map((type) => {
|
|
if (domReference && type === "reference") {
|
|
return domReference;
|
|
}
|
|
if (floatingFocusElement && type === "floating") {
|
|
return floatingFocusElement;
|
|
}
|
|
return content;
|
|
}).filter(Boolean).flat();
|
|
});
|
|
React60.useEffect(() => {
|
|
if (disabled) return;
|
|
if (!modal) return;
|
|
function onKeyDown(event) {
|
|
if (event.key === "Tab") {
|
|
if (contains3(floatingFocusElement, activeElement2(getDocument2(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
|
|
stopEvent2(event);
|
|
}
|
|
const els = getTabbableElements();
|
|
const target = getTarget3(event);
|
|
if (orderRef.current[0] === "reference" && target === domReference) {
|
|
stopEvent2(event);
|
|
if (event.shiftKey) {
|
|
enqueueFocus(els[els.length - 1]);
|
|
} else {
|
|
enqueueFocus(els[1]);
|
|
}
|
|
}
|
|
if (orderRef.current[1] === "floating" && target === floatingFocusElement && event.shiftKey) {
|
|
stopEvent2(event);
|
|
enqueueFocus(els[0]);
|
|
}
|
|
}
|
|
}
|
|
__name(onKeyDown, "onKeyDown");
|
|
const doc = getDocument2(floatingFocusElement);
|
|
doc.addEventListener("keydown", onKeyDown);
|
|
return () => {
|
|
doc.removeEventListener("keydown", onKeyDown);
|
|
};
|
|
}, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]);
|
|
React60.useEffect(() => {
|
|
if (disabled) return;
|
|
if (!floating) return;
|
|
function handleFocusIn(event) {
|
|
const target = getTarget3(event);
|
|
const tabbableContent = getTabbableContent();
|
|
const tabbableIndex = tabbableContent.indexOf(target);
|
|
if (tabbableIndex !== -1) {
|
|
tabbableIndexRef.current = tabbableIndex;
|
|
}
|
|
}
|
|
__name(handleFocusIn, "handleFocusIn");
|
|
floating.addEventListener("focusin", handleFocusIn);
|
|
return () => {
|
|
floating.removeEventListener("focusin", handleFocusIn);
|
|
};
|
|
}, [disabled, floating, getTabbableContent]);
|
|
React60.useEffect(() => {
|
|
if (disabled) return;
|
|
if (!closeOnFocusOut) return;
|
|
function handlePointerDown() {
|
|
isPointerDownRef.current = true;
|
|
setTimeout(() => {
|
|
isPointerDownRef.current = false;
|
|
});
|
|
}
|
|
__name(handlePointerDown, "handlePointerDown");
|
|
function handleFocusOutside(event) {
|
|
const relatedTarget = event.relatedTarget;
|
|
const currentTarget = event.currentTarget;
|
|
const target = getTarget3(event);
|
|
queueMicrotask(() => {
|
|
const nodeId = getNodeId();
|
|
const movedToUnrelatedNode = !(contains3(domReference, relatedTarget) || contains3(floating, relatedTarget) || contains3(relatedTarget, floating) || contains3(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute2("focus-guard")) || tree && (getNodeChildren3(tree.nodesRef.current, nodeId).find((node) => {
|
|
var _node$context, _node$context2;
|
|
return contains3((_node$context = node.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains3((_node$context2 = node.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget);
|
|
}) || getNodeAncestors2(tree.nodesRef.current, nodeId).find((node) => {
|
|
var _node$context3, _node$context4, _node$context5;
|
|
return [(_node$context3 = node.context) == null ? void 0 : _node$context3.elements.floating, getFloatingFocusElement2((_node$context4 = node.context) == null ? void 0 : _node$context4.elements.floating)].includes(relatedTarget) || ((_node$context5 = node.context) == null ? void 0 : _node$context5.elements.domReference) === relatedTarget;
|
|
})));
|
|
if (currentTarget === domReference && floatingFocusElement) {
|
|
handleTabIndex(floatingFocusElement, orderRef);
|
|
}
|
|
if (restoreFocus && currentTarget !== domReference && !(target != null && target.isConnected) && activeElement2(getDocument2(floatingFocusElement)) === getDocument2(floatingFocusElement).body) {
|
|
if (isHTMLElement(floatingFocusElement)) {
|
|
floatingFocusElement.focus();
|
|
}
|
|
const prevTabbableIndex = tabbableIndexRef.current;
|
|
const tabbableContent = getTabbableContent();
|
|
const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
|
|
if (isHTMLElement(nodeToFocus)) {
|
|
nodeToFocus.focus();
|
|
}
|
|
}
|
|
if (dataRef.current.insideReactTree) {
|
|
dataRef.current.insideReactTree = false;
|
|
return;
|
|
}
|
|
if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
relatedTarget !== getPreviouslyFocusedElement()) {
|
|
preventReturnFocusRef.current = true;
|
|
onOpenChange(false, event, "focus-out");
|
|
}
|
|
});
|
|
}
|
|
__name(handleFocusOutside, "handleFocusOutside");
|
|
const shouldHandleBlurCapture = Boolean(!tree && portalContext);
|
|
function markInsideReactTree() {
|
|
clearTimeoutIfSet2(blurTimeoutRef);
|
|
dataRef.current.insideReactTree = true;
|
|
blurTimeoutRef.current = window.setTimeout(() => {
|
|
dataRef.current.insideReactTree = false;
|
|
});
|
|
}
|
|
__name(markInsideReactTree, "markInsideReactTree");
|
|
if (floating && isHTMLElement(domReference)) {
|
|
domReference.addEventListener("focusout", handleFocusOutside);
|
|
domReference.addEventListener("pointerdown", handlePointerDown);
|
|
floating.addEventListener("focusout", handleFocusOutside);
|
|
if (shouldHandleBlurCapture) {
|
|
floating.addEventListener("focusout", markInsideReactTree, true);
|
|
}
|
|
return () => {
|
|
domReference.removeEventListener("focusout", handleFocusOutside);
|
|
domReference.removeEventListener("pointerdown", handlePointerDown);
|
|
floating.removeEventListener("focusout", handleFocusOutside);
|
|
if (shouldHandleBlurCapture) {
|
|
floating.removeEventListener("focusout", markInsideReactTree, true);
|
|
}
|
|
};
|
|
}
|
|
}, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, onOpenChange, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef]);
|
|
const beforeGuardRef = React60.useRef(null);
|
|
const afterGuardRef = React60.useRef(null);
|
|
const mergedBeforeGuardRef = useLiteMergeRefs([beforeGuardRef, portalContext == null ? void 0 : portalContext.beforeInsideRef]);
|
|
const mergedAfterGuardRef = useLiteMergeRefs([afterGuardRef, portalContext == null ? void 0 : portalContext.afterInsideRef]);
|
|
React60.useEffect(() => {
|
|
var _portalContext$portal, _ancestors$find;
|
|
if (disabled) return;
|
|
if (!floating) return;
|
|
const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll("[" + createAttribute2("portal") + "]")) || []);
|
|
const ancestors = tree ? getNodeAncestors2(tree.nodesRef.current, getNodeId()) : [];
|
|
const rootAncestorComboboxDomReference = (_ancestors$find = ancestors.find((node) => {
|
|
var _node$context6;
|
|
return isTypeableCombobox2(((_node$context6 = node.context) == null ? void 0 : _node$context6.elements.domReference) || null);
|
|
})) == null || (_ancestors$find = _ancestors$find.context) == null ? void 0 : _ancestors$find.elements.domReference;
|
|
const insideElements = [floating, rootAncestorComboboxDomReference, ...portalNodes, ...getInsideElements(), startDismissButtonRef.current, endDismissButtonRef.current, beforeGuardRef.current, afterGuardRef.current, portalContext == null ? void 0 : portalContext.beforeOutsideRef.current, portalContext == null ? void 0 : portalContext.afterOutsideRef.current, orderRef.current.includes("reference") || isUntrappedTypeableCombobox ? domReference : null].filter((x) => x != null);
|
|
const cleanup2 = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, !useInert, useInert) : markOthers(insideElements);
|
|
return () => {
|
|
cleanup2();
|
|
};
|
|
}, [disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, guards, useInert, tree, getNodeId, getInsideElements]);
|
|
index3(() => {
|
|
if (disabled || !isHTMLElement(floatingFocusElement)) return;
|
|
const doc = getDocument2(floatingFocusElement);
|
|
const previouslyFocusedElement = activeElement2(doc);
|
|
queueMicrotask(() => {
|
|
const focusableElements = getTabbableElements(floatingFocusElement);
|
|
const initialFocusValue = initialFocusRef.current;
|
|
const elToFocus = (typeof initialFocusValue === "number" ? focusableElements[initialFocusValue] : initialFocusValue.current) || floatingFocusElement;
|
|
const focusAlreadyInsideFloatingEl = contains3(floatingFocusElement, previouslyFocusedElement);
|
|
if (!ignoreInitialFocus && !focusAlreadyInsideFloatingEl && open) {
|
|
enqueueFocus(elToFocus, {
|
|
preventScroll: elToFocus === floatingFocusElement
|
|
});
|
|
}
|
|
});
|
|
}, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef]);
|
|
index3(() => {
|
|
if (disabled || !floatingFocusElement) return;
|
|
const doc = getDocument2(floatingFocusElement);
|
|
const previouslyFocusedElement = activeElement2(doc);
|
|
addPreviouslyFocusedElement(previouslyFocusedElement);
|
|
function onOpenChange2(_ref) {
|
|
let {
|
|
reason,
|
|
event,
|
|
nested
|
|
} = _ref;
|
|
if (["hover", "safe-polygon"].includes(reason) && event.type === "mouseleave") {
|
|
preventReturnFocusRef.current = true;
|
|
}
|
|
if (reason !== "outside-press") return;
|
|
if (nested) {
|
|
preventReturnFocusRef.current = false;
|
|
} else if (isVirtualClick2(event) || isVirtualPointerEvent2(event)) {
|
|
preventReturnFocusRef.current = false;
|
|
} else {
|
|
let isPreventScrollSupported = false;
|
|
document.createElement("div").focus({
|
|
get preventScroll() {
|
|
isPreventScrollSupported = true;
|
|
return false;
|
|
}
|
|
});
|
|
if (isPreventScrollSupported) {
|
|
preventReturnFocusRef.current = false;
|
|
} else {
|
|
preventReturnFocusRef.current = true;
|
|
}
|
|
}
|
|
}
|
|
__name(onOpenChange2, "onOpenChange");
|
|
events.on("openchange", onOpenChange2);
|
|
const fallbackEl = doc.createElement("span");
|
|
fallbackEl.setAttribute("tabindex", "-1");
|
|
fallbackEl.setAttribute("aria-hidden", "true");
|
|
Object.assign(fallbackEl.style, HIDDEN_STYLES);
|
|
if (isInsidePortal && domReference) {
|
|
domReference.insertAdjacentElement("afterend", fallbackEl);
|
|
}
|
|
function getReturnElement() {
|
|
if (typeof returnFocusRef.current === "boolean") {
|
|
const el = domReference || getPreviouslyFocusedElement();
|
|
return el && el.isConnected ? el : fallbackEl;
|
|
}
|
|
return returnFocusRef.current.current || fallbackEl;
|
|
}
|
|
__name(getReturnElement, "getReturnElement");
|
|
return () => {
|
|
events.off("openchange", onOpenChange2);
|
|
const activeEl = activeElement2(doc);
|
|
const isFocusInsideFloatingTree = contains3(floating, activeEl) || tree && getNodeChildren3(tree.nodesRef.current, getNodeId(), false).some((node) => {
|
|
var _node$context7;
|
|
return contains3((_node$context7 = node.context) == null ? void 0 : _node$context7.elements.floating, activeEl);
|
|
});
|
|
const returnElement = getReturnElement();
|
|
queueMicrotask(() => {
|
|
const tabbableReturnElement = getFirstTabbableElement(returnElement);
|
|
if (
|
|
|
|
returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
// since it likely entered a different element which should be
|
|
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
(tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)
|
|
) {
|
|
tabbableReturnElement.focus({
|
|
preventScroll: true
|
|
});
|
|
}
|
|
fallbackEl.remove();
|
|
});
|
|
};
|
|
}, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, events, tree, isInsidePortal, domReference, getNodeId]);
|
|
React60.useEffect(() => {
|
|
queueMicrotask(() => {
|
|
preventReturnFocusRef.current = false;
|
|
});
|
|
return () => {
|
|
queueMicrotask(clearDisconnectedPreviouslyFocusedElements);
|
|
};
|
|
}, [disabled]);
|
|
index3(() => {
|
|
if (disabled) return;
|
|
if (!portalContext) return;
|
|
portalContext.setFocusManagerState({
|
|
modal,
|
|
closeOnFocusOut,
|
|
open,
|
|
onOpenChange,
|
|
domReference
|
|
});
|
|
return () => {
|
|
portalContext.setFocusManagerState(null);
|
|
};
|
|
}, [disabled, portalContext, modal, open, onOpenChange, closeOnFocusOut, domReference]);
|
|
index3(() => {
|
|
if (disabled) return;
|
|
if (!floatingFocusElement) return;
|
|
handleTabIndex(floatingFocusElement, orderRef);
|
|
}, [disabled, floatingFocusElement, orderRef]);
|
|
function renderDismissButton(location) {
|
|
if (disabled || !visuallyHiddenDismiss || !modal) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VisuallyHiddenDismiss, {
|
|
ref: location === "start" ? startDismissButtonRef : endDismissButtonRef,
|
|
onClick: /* @__PURE__ */ __name((event) => onOpenChange(false, event.nativeEvent), "onClick"),
|
|
children: typeof visuallyHiddenDismiss === "string" ? visuallyHiddenDismiss : "Dismiss"
|
|
});
|
|
}
|
|
__name(renderDismissButton, "renderDismissButton");
|
|
const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, {
|
|
children: [shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FocusGuard, {
|
|
"data-type": "inside",
|
|
ref: mergedBeforeGuardRef,
|
|
onFocus: /* @__PURE__ */ __name((event) => {
|
|
if (modal) {
|
|
const els = getTabbableElements();
|
|
enqueueFocus(order[0] === "reference" ? els[0] : els[els.length - 1]);
|
|
} else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {
|
|
preventReturnFocusRef.current = false;
|
|
if (isOutsideEvent2(event, portalContext.portalNode)) {
|
|
const nextTabbable = getNextTabbable2(domReference);
|
|
nextTabbable == null || nextTabbable.focus();
|
|
} else {
|
|
var _portalContext$before;
|
|
(_portalContext$before = portalContext.beforeOutsideRef.current) == null || _portalContext$before.focus();
|
|
}
|
|
}
|
|
}, "onFocus")
|
|
}), !isUntrappedTypeableCombobox && renderDismissButton("start"), children, renderDismissButton("end"), shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FocusGuard, {
|
|
"data-type": "inside",
|
|
ref: mergedAfterGuardRef,
|
|
onFocus: /* @__PURE__ */ __name((event) => {
|
|
if (modal) {
|
|
enqueueFocus(getTabbableElements()[0]);
|
|
} else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {
|
|
if (closeOnFocusOut) {
|
|
preventReturnFocusRef.current = true;
|
|
}
|
|
if (isOutsideEvent2(event, portalContext.portalNode)) {
|
|
const prevTabbable = getPreviousTabbable2(domReference);
|
|
prevTabbable == null || prevTabbable.focus();
|
|
} else {
|
|
var _portalContext$afterO;
|
|
(_portalContext$afterO = portalContext.afterOutsideRef.current) == null || _portalContext$afterO.focus();
|
|
}
|
|
}
|
|
}, "onFocus")
|
|
})]
|
|
});
|
|
}
|
|
__name(FloatingFocusManager, "FloatingFocusManager");
|
|
var lockCount = 0;
|
|
var scrollbarProperty = "--floating-ui-scrollbar-width";
|
|
function enableScrollLock() {
|
|
const platform2 = getPlatform2();
|
|
const isIOS = /iP(hone|ad|od)|iOS/.test(platform2) || // iPads can claim to be MacIntel
|
|
platform2 === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
const bodyStyle = document.body.style;
|
|
const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;
|
|
const paddingProp = scrollbarX ? "paddingLeft" : "paddingRight";
|
|
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX;
|
|
const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY;
|
|
bodyStyle.overflow = "hidden";
|
|
bodyStyle.setProperty(scrollbarProperty, scrollbarWidth + "px");
|
|
if (scrollbarWidth) {
|
|
bodyStyle[paddingProp] = scrollbarWidth + "px";
|
|
}
|
|
if (isIOS) {
|
|
var _window$visualViewpor, _window$visualViewpor2;
|
|
const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0;
|
|
const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0;
|
|
Object.assign(bodyStyle, {
|
|
position: "fixed",
|
|
top: -(scrollY - Math.floor(offsetTop)) + "px",
|
|
left: -(scrollX - Math.floor(offsetLeft)) + "px",
|
|
right: "0"
|
|
});
|
|
}
|
|
return () => {
|
|
Object.assign(bodyStyle, {
|
|
overflow: "",
|
|
[paddingProp]: ""
|
|
});
|
|
bodyStyle.removeProperty(scrollbarProperty);
|
|
if (isIOS) {
|
|
Object.assign(bodyStyle, {
|
|
position: "",
|
|
top: "",
|
|
left: "",
|
|
right: ""
|
|
});
|
|
window.scrollTo(scrollX, scrollY);
|
|
}
|
|
};
|
|
}
|
|
__name(enableScrollLock, "enableScrollLock");
|
|
var cleanup = /* @__PURE__ */ __name(() => {
|
|
}, "cleanup");
|
|
var FloatingOverlay = /* @__PURE__ */ React60.forwardRef(/* @__PURE__ */ __name(function FloatingOverlay2(props, ref) {
|
|
const {
|
|
lockScroll = false,
|
|
...rest
|
|
} = props;
|
|
index3(() => {
|
|
if (!lockScroll) return;
|
|
lockCount++;
|
|
if (lockCount === 1) {
|
|
cleanup = enableScrollLock();
|
|
}
|
|
return () => {
|
|
lockCount--;
|
|
if (lockCount === 0) {
|
|
cleanup();
|
|
}
|
|
};
|
|
}, [lockScroll]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", {
|
|
ref,
|
|
...rest,
|
|
style: {
|
|
position: "fixed",
|
|
overflow: "auto",
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
...rest.style
|
|
}
|
|
});
|
|
}, "FloatingOverlay"));
|
|
function isButtonTarget(event) {
|
|
return isHTMLElement(event.target) && event.target.tagName === "BUTTON";
|
|
}
|
|
__name(isButtonTarget, "isButtonTarget");
|
|
function isAnchorTarget(event) {
|
|
return isHTMLElement(event.target) && event.target.tagName === "A";
|
|
}
|
|
__name(isAnchorTarget, "isAnchorTarget");
|
|
function isSpaceIgnored(element) {
|
|
return isTypeableElement2(element);
|
|
}
|
|
__name(isSpaceIgnored, "isSpaceIgnored");
|
|
function useClick(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
dataRef,
|
|
elements: {
|
|
domReference
|
|
}
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
event: eventOption = "click",
|
|
toggle = true,
|
|
ignoreMouse = false,
|
|
keyboardHandlers = true,
|
|
stickIfOpen = true
|
|
} = props;
|
|
const pointerTypeRef = React60.useRef();
|
|
const didKeyDownRef = React60.useRef(false);
|
|
const reference = React60.useMemo(() => ({
|
|
onPointerDown(event) {
|
|
pointerTypeRef.current = event.pointerType;
|
|
},
|
|
onMouseDown(event) {
|
|
const pointerType = pointerTypeRef.current;
|
|
if (event.button !== 0) return;
|
|
if (eventOption === "click") return;
|
|
if (isMouseLikePointerType2(pointerType, true) && ignoreMouse) return;
|
|
if (open && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === "mousedown" : true)) {
|
|
onOpenChange(false, event.nativeEvent, "click");
|
|
} else {
|
|
event.preventDefault();
|
|
onOpenChange(true, event.nativeEvent, "click");
|
|
}
|
|
},
|
|
onClick(event) {
|
|
const pointerType = pointerTypeRef.current;
|
|
if (eventOption === "mousedown" && pointerTypeRef.current) {
|
|
pointerTypeRef.current = void 0;
|
|
return;
|
|
}
|
|
if (isMouseLikePointerType2(pointerType, true) && ignoreMouse) return;
|
|
if (open && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === "click" : true)) {
|
|
onOpenChange(false, event.nativeEvent, "click");
|
|
} else {
|
|
onOpenChange(true, event.nativeEvent, "click");
|
|
}
|
|
},
|
|
onKeyDown(event) {
|
|
pointerTypeRef.current = void 0;
|
|
if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event)) {
|
|
return;
|
|
}
|
|
if (event.key === " " && !isSpaceIgnored(domReference)) {
|
|
event.preventDefault();
|
|
didKeyDownRef.current = true;
|
|
}
|
|
if (isAnchorTarget(event)) {
|
|
return;
|
|
}
|
|
if (event.key === "Enter") {
|
|
if (open && toggle) {
|
|
onOpenChange(false, event.nativeEvent, "click");
|
|
} else {
|
|
onOpenChange(true, event.nativeEvent, "click");
|
|
}
|
|
}
|
|
},
|
|
onKeyUp(event) {
|
|
if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {
|
|
return;
|
|
}
|
|
if (event.key === " " && didKeyDownRef.current) {
|
|
didKeyDownRef.current = false;
|
|
if (open && toggle) {
|
|
onOpenChange(false, event.nativeEvent, "click");
|
|
} else {
|
|
onOpenChange(true, event.nativeEvent, "click");
|
|
}
|
|
}
|
|
}
|
|
}), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open, stickIfOpen, toggle]);
|
|
return React60.useMemo(() => enabled ? {
|
|
reference
|
|
} : {}, [enabled, reference]);
|
|
}
|
|
__name(useClick, "useClick");
|
|
var bubbleHandlerKeys2 = {
|
|
pointerdown: "onPointerDown",
|
|
mousedown: "onMouseDown",
|
|
click: "onClick"
|
|
};
|
|
var captureHandlerKeys2 = {
|
|
pointerdown: "onPointerDownCapture",
|
|
mousedown: "onMouseDownCapture",
|
|
click: "onClickCapture"
|
|
};
|
|
var normalizeProp2 = /* @__PURE__ */ __name((normalizable) => {
|
|
var _normalizable$escapeK, _normalizable$outside;
|
|
return {
|
|
escapeKey: typeof normalizable === "boolean" ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,
|
|
outsidePress: typeof normalizable === "boolean" ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true
|
|
};
|
|
}, "normalizeProp");
|
|
function useDismiss2(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
dataRef
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
escapeKey = true,
|
|
outsidePress: unstable_outsidePress = true,
|
|
outsidePressEvent = "pointerdown",
|
|
referencePress = false,
|
|
referencePressEvent = "pointerdown",
|
|
ancestorScroll = false,
|
|
bubbles,
|
|
capture
|
|
} = props;
|
|
const tree = useFloatingTree2();
|
|
const outsidePressFn = useEffectEvent2(typeof unstable_outsidePress === "function" ? unstable_outsidePress : () => false);
|
|
const outsidePress = typeof unstable_outsidePress === "function" ? outsidePressFn : unstable_outsidePress;
|
|
const endedOrStartedInsideRef = React60.useRef(false);
|
|
const {
|
|
escapeKey: escapeKeyBubbles,
|
|
outsidePress: outsidePressBubbles
|
|
} = normalizeProp2(bubbles);
|
|
const {
|
|
escapeKey: escapeKeyCapture,
|
|
outsidePress: outsidePressCapture
|
|
} = normalizeProp2(capture);
|
|
const isComposingRef = React60.useRef(false);
|
|
const closeOnEscapeKeyDown = useEffectEvent2((event) => {
|
|
var _dataRef$current$floa;
|
|
if (!open || !enabled || !escapeKey || event.key !== "Escape") {
|
|
return;
|
|
}
|
|
if (isComposingRef.current) {
|
|
return;
|
|
}
|
|
const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;
|
|
const children = tree ? getNodeChildren3(tree.nodesRef.current, nodeId) : [];
|
|
if (!escapeKeyBubbles) {
|
|
event.stopPropagation();
|
|
if (children.length > 0) {
|
|
let shouldDismiss = true;
|
|
children.forEach((child) => {
|
|
var _child$context;
|
|
if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {
|
|
shouldDismiss = false;
|
|
return;
|
|
}
|
|
});
|
|
if (!shouldDismiss) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
onOpenChange(false, isReactEvent2(event) ? event.nativeEvent : event, "escape-key");
|
|
});
|
|
const closeOnEscapeKeyDownCapture = useEffectEvent2((event) => {
|
|
var _getTarget2;
|
|
const callback = /* @__PURE__ */ __name(() => {
|
|
var _getTarget;
|
|
closeOnEscapeKeyDown(event);
|
|
(_getTarget = getTarget3(event)) == null || _getTarget.removeEventListener("keydown", callback);
|
|
}, "callback");
|
|
(_getTarget2 = getTarget3(event)) == null || _getTarget2.addEventListener("keydown", callback);
|
|
});
|
|
const closeOnPressOutside = useEffectEvent2((event) => {
|
|
var _dataRef$current$floa2;
|
|
const insideReactTree = dataRef.current.insideReactTree;
|
|
dataRef.current.insideReactTree = false;
|
|
const endedOrStartedInside = endedOrStartedInsideRef.current;
|
|
endedOrStartedInsideRef.current = false;
|
|
if (outsidePressEvent === "click" && endedOrStartedInside) {
|
|
return;
|
|
}
|
|
if (insideReactTree) {
|
|
return;
|
|
}
|
|
if (typeof outsidePress === "function" && !outsidePress(event)) {
|
|
return;
|
|
}
|
|
const target = getTarget3(event);
|
|
const inertSelector = "[" + createAttribute2("inert") + "]";
|
|
const markers = getDocument2(elements.floating).querySelectorAll(inertSelector);
|
|
let targetRootAncestor = isElement(target) ? target : null;
|
|
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
|
|
const nextParent = getParentNode(targetRootAncestor);
|
|
if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
|
|
break;
|
|
}
|
|
targetRootAncestor = nextParent;
|
|
}
|
|
if (markers.length && isElement(target) && !isRootElement2(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
!contains3(target, elements.floating) && // If the target root element contains none of the markers, then the
|
|
// element was injected after the floating element rendered.
|
|
Array.from(markers).every((marker) => !contains3(targetRootAncestor, marker))) {
|
|
return;
|
|
}
|
|
if (isHTMLElement(target) && floating) {
|
|
const lastTraversableNode = isLastTraversableNode(target);
|
|
const style = getComputedStyle2(target);
|
|
const scrollRe = /auto|scroll/;
|
|
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
|
|
const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
|
|
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
|
|
const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
|
|
const isRTL2 = style.direction === "rtl";
|
|
const pressedVerticalScrollbar = canScrollY && (isRTL2 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
|
|
const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
|
|
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
|
|
return;
|
|
}
|
|
}
|
|
const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;
|
|
const targetIsInsideChildren = tree && getNodeChildren3(tree.nodesRef.current, nodeId).some((node) => {
|
|
var _node$context;
|
|
return isEventTargetWithin2(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
|
|
});
|
|
if (isEventTargetWithin2(event, elements.floating) || isEventTargetWithin2(event, elements.domReference) || targetIsInsideChildren) {
|
|
return;
|
|
}
|
|
const children = tree ? getNodeChildren3(tree.nodesRef.current, nodeId) : [];
|
|
if (children.length > 0) {
|
|
let shouldDismiss = true;
|
|
children.forEach((child) => {
|
|
var _child$context2;
|
|
if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {
|
|
shouldDismiss = false;
|
|
return;
|
|
}
|
|
});
|
|
if (!shouldDismiss) {
|
|
return;
|
|
}
|
|
}
|
|
onOpenChange(false, event, "outside-press");
|
|
});
|
|
const closeOnPressOutsideCapture = useEffectEvent2((event) => {
|
|
var _getTarget4;
|
|
const callback = /* @__PURE__ */ __name(() => {
|
|
var _getTarget3;
|
|
closeOnPressOutside(event);
|
|
(_getTarget3 = getTarget3(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback);
|
|
}, "callback");
|
|
(_getTarget4 = getTarget3(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback);
|
|
});
|
|
React60.useEffect(() => {
|
|
if (!open || !enabled) {
|
|
return;
|
|
}
|
|
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
|
|
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
|
|
let compositionTimeout = -1;
|
|
function onScroll(event) {
|
|
onOpenChange(false, event, "ancestor-scroll");
|
|
}
|
|
__name(onScroll, "onScroll");
|
|
function handleCompositionStart() {
|
|
window.clearTimeout(compositionTimeout);
|
|
isComposingRef.current = true;
|
|
}
|
|
__name(handleCompositionStart, "handleCompositionStart");
|
|
function handleCompositionEnd() {
|
|
compositionTimeout = window.setTimeout(
|
|
() => {
|
|
isComposingRef.current = false;
|
|
},
|
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
// Only apply to WebKit for the test to remain 0ms.
|
|
isWebKit() ? 5 : 0
|
|
);
|
|
}
|
|
__name(handleCompositionEnd, "handleCompositionEnd");
|
|
const doc = getDocument2(elements.floating);
|
|
if (escapeKey) {
|
|
doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
doc.addEventListener("compositionstart", handleCompositionStart);
|
|
doc.addEventListener("compositionend", handleCompositionEnd);
|
|
}
|
|
outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
let ancestors = [];
|
|
if (ancestorScroll) {
|
|
if (isElement(elements.domReference)) {
|
|
ancestors = getOverflowAncestors(elements.domReference);
|
|
}
|
|
if (isElement(elements.floating)) {
|
|
ancestors = ancestors.concat(getOverflowAncestors(elements.floating));
|
|
}
|
|
if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {
|
|
ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));
|
|
}
|
|
}
|
|
ancestors = ancestors.filter((ancestor) => {
|
|
var _doc$defaultView;
|
|
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
});
|
|
ancestors.forEach((ancestor) => {
|
|
ancestor.addEventListener("scroll", onScroll, {
|
|
passive: true
|
|
});
|
|
});
|
|
return () => {
|
|
if (escapeKey) {
|
|
doc.removeEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
doc.removeEventListener("compositionstart", handleCompositionStart);
|
|
doc.removeEventListener("compositionend", handleCompositionEnd);
|
|
}
|
|
outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
ancestors.forEach((ancestor) => {
|
|
ancestor.removeEventListener("scroll", onScroll);
|
|
});
|
|
window.clearTimeout(compositionTimeout);
|
|
};
|
|
}, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
|
|
React60.useEffect(() => {
|
|
dataRef.current.insideReactTree = false;
|
|
}, [dataRef, outsidePress, outsidePressEvent]);
|
|
const reference = React60.useMemo(() => ({
|
|
onKeyDown: closeOnEscapeKeyDown,
|
|
...referencePress && {
|
|
[bubbleHandlerKeys2[referencePressEvent]]: (event) => {
|
|
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
},
|
|
...referencePressEvent !== "click" && {
|
|
onClick(event) {
|
|
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
}
|
|
}
|
|
}
|
|
}), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);
|
|
const floating = React60.useMemo(() => ({
|
|
onKeyDown: closeOnEscapeKeyDown,
|
|
onMouseDown() {
|
|
endedOrStartedInsideRef.current = true;
|
|
},
|
|
onMouseUp() {
|
|
endedOrStartedInsideRef.current = true;
|
|
},
|
|
[captureHandlerKeys2[outsidePressEvent]]: () => {
|
|
dataRef.current.insideReactTree = true;
|
|
}
|
|
}), [closeOnEscapeKeyDown, outsidePressEvent, dataRef]);
|
|
return React60.useMemo(() => enabled ? {
|
|
reference,
|
|
floating
|
|
} : {}, [enabled, reference, floating]);
|
|
}
|
|
__name(useDismiss2, "useDismiss");
|
|
function useFloatingRootContext2(options) {
|
|
const {
|
|
open = false,
|
|
onOpenChange: onOpenChangeProp,
|
|
elements: elementsProp
|
|
} = options;
|
|
const floatingId = useId12();
|
|
const dataRef = React60.useRef({});
|
|
const [events] = React60.useState(() => createEventEmitter2());
|
|
const nested = useFloatingParentNodeId2() != null;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
const optionDomReference = elementsProp.reference;
|
|
if (optionDomReference && !isElement(optionDomReference)) {
|
|
error2("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
}
|
|
}
|
|
const [positionReference, setPositionReference] = React60.useState(elementsProp.reference);
|
|
const onOpenChange = useEffectEvent2((open2, event, reason) => {
|
|
dataRef.current.openEvent = open2 ? event : void 0;
|
|
events.emit("openchange", {
|
|
open: open2,
|
|
event,
|
|
reason,
|
|
nested
|
|
});
|
|
onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
|
|
});
|
|
const refs = React60.useMemo(() => ({
|
|
setPositionReference
|
|
}), []);
|
|
const elements = React60.useMemo(() => ({
|
|
reference: positionReference || elementsProp.reference || null,
|
|
floating: elementsProp.floating || null,
|
|
domReference: elementsProp.reference
|
|
}), [positionReference, elementsProp.reference, elementsProp.floating]);
|
|
return React60.useMemo(() => ({
|
|
dataRef,
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
events,
|
|
floatingId,
|
|
refs
|
|
}), [open, onOpenChange, elements, events, floatingId, refs]);
|
|
}
|
|
__name(useFloatingRootContext2, "useFloatingRootContext");
|
|
function useFloating4(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
nodeId
|
|
} = options;
|
|
const internalRootContext = useFloatingRootContext2({
|
|
...options,
|
|
elements: {
|
|
reference: null,
|
|
floating: null,
|
|
...options.elements
|
|
}
|
|
});
|
|
const rootContext = options.rootContext || internalRootContext;
|
|
const computedElements = rootContext.elements;
|
|
const [_domReference, setDomReference] = React60.useState(null);
|
|
const [positionReference, _setPositionReference] = React60.useState(null);
|
|
const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
|
|
const domReference = optionDomReference || _domReference;
|
|
const domReferenceRef = React60.useRef(null);
|
|
const tree = useFloatingTree2();
|
|
index3(() => {
|
|
if (domReference) {
|
|
domReferenceRef.current = domReference;
|
|
}
|
|
}, [domReference]);
|
|
const position = useFloating({
|
|
...options,
|
|
elements: {
|
|
...computedElements,
|
|
...positionReference && {
|
|
reference: positionReference
|
|
}
|
|
}
|
|
});
|
|
const setPositionReference = React60.useCallback((node) => {
|
|
const computedPositionReference = isElement(node) ? {
|
|
getBoundingClientRect: /* @__PURE__ */ __name(() => node.getBoundingClientRect(), "getBoundingClientRect"),
|
|
getClientRects: /* @__PURE__ */ __name(() => node.getClientRects(), "getClientRects"),
|
|
contextElement: node
|
|
} : node;
|
|
_setPositionReference(computedPositionReference);
|
|
position.refs.setReference(computedPositionReference);
|
|
}, [position.refs]);
|
|
const setReference = React60.useCallback((node) => {
|
|
if (isElement(node) || node === null) {
|
|
domReferenceRef.current = node;
|
|
setDomReference(node);
|
|
}
|
|
if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
// `null` to support `positionReference` + an unstable `reference`
|
|
// callback ref.
|
|
node !== null && !isElement(node)) {
|
|
position.refs.setReference(node);
|
|
}
|
|
}, [position.refs]);
|
|
const refs = React60.useMemo(() => ({
|
|
...position.refs,
|
|
setReference,
|
|
setPositionReference,
|
|
domReference: domReferenceRef
|
|
}), [position.refs, setReference, setPositionReference]);
|
|
const elements = React60.useMemo(() => ({
|
|
...position.elements,
|
|
domReference
|
|
}), [position.elements, domReference]);
|
|
const context2 = React60.useMemo(() => ({
|
|
...position,
|
|
...rootContext,
|
|
refs,
|
|
elements,
|
|
nodeId
|
|
}), [position, refs, elements, nodeId, rootContext]);
|
|
index3(() => {
|
|
rootContext.dataRef.current.floatingContext = context2;
|
|
const node = tree == null ? void 0 : tree.nodesRef.current.find((node2) => node2.id === nodeId);
|
|
if (node) {
|
|
node.context = context2;
|
|
}
|
|
});
|
|
return React60.useMemo(() => ({
|
|
...position,
|
|
context: context2,
|
|
refs,
|
|
elements
|
|
}), [position, refs, elements, context2]);
|
|
}
|
|
__name(useFloating4, "useFloating");
|
|
function mergeProps2(userProps, propsList, elementKey) {
|
|
const map = /* @__PURE__ */ new Map();
|
|
const isItem = elementKey === "item";
|
|
let domUserProps = userProps;
|
|
if (isItem && userProps) {
|
|
const {
|
|
[ACTIVE_KEY2]: _,
|
|
[SELECTED_KEY2]: __,
|
|
...validProps
|
|
} = userProps;
|
|
domUserProps = validProps;
|
|
}
|
|
return {
|
|
...elementKey === "floating" && {
|
|
tabIndex: -1,
|
|
[FOCUSABLE_ATTRIBUTE4]: ""
|
|
},
|
|
...domUserProps,
|
|
...propsList.map((value) => {
|
|
const propsOrGetProps = value ? value[elementKey] : null;
|
|
if (typeof propsOrGetProps === "function") {
|
|
return userProps ? propsOrGetProps(userProps) : null;
|
|
}
|
|
return propsOrGetProps;
|
|
}).concat(userProps).reduce((acc, props) => {
|
|
if (!props) {
|
|
return acc;
|
|
}
|
|
Object.entries(props).forEach((_ref) => {
|
|
let [key, value] = _ref;
|
|
if (isItem && [ACTIVE_KEY2, SELECTED_KEY2].includes(key)) {
|
|
return;
|
|
}
|
|
if (key.indexOf("on") === 0) {
|
|
if (!map.has(key)) {
|
|
map.set(key, []);
|
|
}
|
|
if (typeof value === "function") {
|
|
var _map$get;
|
|
(_map$get = map.get(key)) == null || _map$get.push(value);
|
|
acc[key] = function() {
|
|
var _map$get2;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map((fn) => fn(...args)).find((val) => val !== void 0);
|
|
};
|
|
}
|
|
} else {
|
|
acc[key] = value;
|
|
}
|
|
});
|
|
return acc;
|
|
}, {})
|
|
};
|
|
}
|
|
__name(mergeProps2, "mergeProps");
|
|
function useInteractions2(propsList) {
|
|
if (propsList === void 0) {
|
|
propsList = [];
|
|
}
|
|
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
const getReferenceProps = React60.useCallback(
|
|
(userProps) => mergeProps2(userProps, propsList, "reference"),
|
|
|
|
referenceDeps
|
|
);
|
|
const getFloatingProps = React60.useCallback(
|
|
(userProps) => mergeProps2(userProps, propsList, "floating"),
|
|
|
|
floatingDeps
|
|
);
|
|
const getItemProps = React60.useCallback(
|
|
(userProps) => mergeProps2(userProps, propsList, "item"),
|
|
|
|
itemDeps
|
|
);
|
|
return React60.useMemo(() => ({
|
|
getReferenceProps,
|
|
getFloatingProps,
|
|
getItemProps
|
|
}), [getReferenceProps, getFloatingProps, getItemProps]);
|
|
}
|
|
__name(useInteractions2, "useInteractions");
|
|
var ESCAPE = "Escape";
|
|
function doSwitch(orientation, vertical, horizontal) {
|
|
switch (orientation) {
|
|
case "vertical":
|
|
return vertical;
|
|
case "horizontal":
|
|
return horizontal;
|
|
default:
|
|
return vertical || horizontal;
|
|
}
|
|
}
|
|
__name(doSwitch, "doSwitch");
|
|
function isMainOrientationKey(key, orientation) {
|
|
const vertical = key === ARROW_UP3 || key === ARROW_DOWN3;
|
|
const horizontal = key === ARROW_LEFT3 || key === ARROW_RIGHT3;
|
|
return doSwitch(orientation, vertical, horizontal);
|
|
}
|
|
__name(isMainOrientationKey, "isMainOrientationKey");
|
|
function isMainOrientationToEndKey(key, orientation, rtl) {
|
|
const vertical = key === ARROW_DOWN3;
|
|
const horizontal = rtl ? key === ARROW_LEFT3 : key === ARROW_RIGHT3;
|
|
return doSwitch(orientation, vertical, horizontal) || key === "Enter" || key === " " || key === "";
|
|
}
|
|
__name(isMainOrientationToEndKey, "isMainOrientationToEndKey");
|
|
function isCrossOrientationOpenKey(key, orientation, rtl) {
|
|
const vertical = rtl ? key === ARROW_LEFT3 : key === ARROW_RIGHT3;
|
|
const horizontal = key === ARROW_DOWN3;
|
|
return doSwitch(orientation, vertical, horizontal);
|
|
}
|
|
__name(isCrossOrientationOpenKey, "isCrossOrientationOpenKey");
|
|
function isCrossOrientationCloseKey(key, orientation, rtl, cols) {
|
|
const vertical = rtl ? key === ARROW_RIGHT3 : key === ARROW_LEFT3;
|
|
const horizontal = key === ARROW_UP3;
|
|
if (orientation === "both" || orientation === "horizontal" && cols && cols > 1) {
|
|
return key === ESCAPE;
|
|
}
|
|
return doSwitch(orientation, vertical, horizontal);
|
|
}
|
|
__name(isCrossOrientationCloseKey, "isCrossOrientationCloseKey");
|
|
function useListNavigation(context2, props) {
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
floatingId
|
|
} = context2;
|
|
const {
|
|
listRef,
|
|
activeIndex,
|
|
onNavigate: unstable_onNavigate = /* @__PURE__ */ __name(() => {
|
|
}, "unstable_onNavigate"),
|
|
enabled = true,
|
|
selectedIndex = null,
|
|
allowEscape = false,
|
|
loop = false,
|
|
nested = false,
|
|
rtl = false,
|
|
virtual = false,
|
|
focusItemOnOpen = "auto",
|
|
focusItemOnHover = true,
|
|
openOnArrowKeyDown = true,
|
|
disabledIndices = void 0,
|
|
orientation = "vertical",
|
|
parentOrientation,
|
|
cols = 1,
|
|
scrollItemIntoView = true,
|
|
virtualItemRef,
|
|
itemSizes,
|
|
dense = false
|
|
} = props;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
if (allowEscape) {
|
|
if (!loop) {
|
|
warn("`useListNavigation` looping must be enabled to allow escaping.");
|
|
}
|
|
if (!virtual) {
|
|
warn("`useListNavigation` must be virtual to allow escaping.");
|
|
}
|
|
}
|
|
if (orientation === "vertical" && cols > 1) {
|
|
warn("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".');
|
|
}
|
|
}
|
|
const floatingFocusElement = getFloatingFocusElement2(elements.floating);
|
|
const floatingFocusElementRef = useLatestRef3(floatingFocusElement);
|
|
const parentId = useFloatingParentNodeId2();
|
|
const tree = useFloatingTree2();
|
|
index3(() => {
|
|
context2.dataRef.current.orientation = orientation;
|
|
}, [context2, orientation]);
|
|
const onNavigate = useEffectEvent2(() => {
|
|
unstable_onNavigate(indexRef.current === -1 ? null : indexRef.current);
|
|
});
|
|
const typeableComboboxReference = isTypeableCombobox2(elements.domReference);
|
|
const focusItemOnOpenRef = React60.useRef(focusItemOnOpen);
|
|
const indexRef = React60.useRef(selectedIndex != null ? selectedIndex : -1);
|
|
const keyRef = React60.useRef(null);
|
|
const isPointerModalityRef = React60.useRef(true);
|
|
const previousOnNavigateRef = React60.useRef(onNavigate);
|
|
const previousMountedRef = React60.useRef(!!elements.floating);
|
|
const previousOpenRef = React60.useRef(open);
|
|
const forceSyncFocusRef = React60.useRef(false);
|
|
const forceScrollIntoViewRef = React60.useRef(false);
|
|
const disabledIndicesRef = useLatestRef3(disabledIndices);
|
|
const latestOpenRef = useLatestRef3(open);
|
|
const scrollItemIntoViewRef = useLatestRef3(scrollItemIntoView);
|
|
const selectedIndexRef = useLatestRef3(selectedIndex);
|
|
const [activeId, setActiveId] = React60.useState();
|
|
const [virtualId, setVirtualId] = React60.useState();
|
|
const focusItem = useEffectEvent2(() => {
|
|
function runFocus(item2) {
|
|
if (virtual) {
|
|
var _item$id;
|
|
if ((_item$id = item2.id) != null && _item$id.endsWith("-fui-option")) {
|
|
item2.id = floatingId + "-" + Math.random().toString(16).slice(2, 10);
|
|
}
|
|
setActiveId(item2.id);
|
|
tree == null || tree.events.emit("virtualfocus", item2);
|
|
if (virtualItemRef) {
|
|
virtualItemRef.current = item2;
|
|
}
|
|
} else {
|
|
enqueueFocus(item2, {
|
|
sync: forceSyncFocusRef.current,
|
|
preventScroll: true
|
|
});
|
|
}
|
|
}
|
|
__name(runFocus, "runFocus");
|
|
const initialItem = listRef.current[indexRef.current];
|
|
const forceScrollIntoView = forceScrollIntoViewRef.current;
|
|
if (initialItem) {
|
|
runFocus(initialItem);
|
|
}
|
|
const scheduler = forceSyncFocusRef.current ? (v) => v() : requestAnimationFrame;
|
|
scheduler(() => {
|
|
const waitedItem = listRef.current[indexRef.current] || initialItem;
|
|
if (!waitedItem) return;
|
|
if (!initialItem) {
|
|
runFocus(waitedItem);
|
|
}
|
|
const scrollIntoViewOptions = scrollItemIntoViewRef.current;
|
|
const shouldScrollIntoView = scrollIntoViewOptions && item && (forceScrollIntoView || !isPointerModalityRef.current);
|
|
if (shouldScrollIntoView) {
|
|
waitedItem.scrollIntoView == null || waitedItem.scrollIntoView(typeof scrollIntoViewOptions === "boolean" ? {
|
|
block: "nearest",
|
|
inline: "nearest"
|
|
} : scrollIntoViewOptions);
|
|
}
|
|
});
|
|
});
|
|
index3(() => {
|
|
if (!enabled) return;
|
|
if (open && elements.floating) {
|
|
if (focusItemOnOpenRef.current && selectedIndex != null) {
|
|
forceScrollIntoViewRef.current = true;
|
|
indexRef.current = selectedIndex;
|
|
onNavigate();
|
|
}
|
|
} else if (previousMountedRef.current) {
|
|
indexRef.current = -1;
|
|
previousOnNavigateRef.current();
|
|
}
|
|
}, [enabled, open, elements.floating, selectedIndex, onNavigate]);
|
|
index3(() => {
|
|
if (!enabled) return;
|
|
if (!open) return;
|
|
if (!elements.floating) return;
|
|
if (activeIndex == null) {
|
|
forceSyncFocusRef.current = false;
|
|
if (selectedIndexRef.current != null) {
|
|
return;
|
|
}
|
|
if (previousMountedRef.current) {
|
|
indexRef.current = -1;
|
|
focusItem();
|
|
}
|
|
if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {
|
|
let runs = 0;
|
|
const waitForListPopulated = /* @__PURE__ */ __name(() => {
|
|
if (listRef.current[0] == null) {
|
|
if (runs < 2) {
|
|
const scheduler = runs ? requestAnimationFrame : queueMicrotask;
|
|
scheduler(waitForListPopulated);
|
|
}
|
|
runs++;
|
|
} else {
|
|
indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex2(listRef, disabledIndicesRef.current) : getMaxListIndex2(listRef, disabledIndicesRef.current);
|
|
keyRef.current = null;
|
|
onNavigate();
|
|
}
|
|
}, "waitForListPopulated");
|
|
waitForListPopulated();
|
|
}
|
|
} else if (!isIndexOutOfListBounds2(listRef, activeIndex)) {
|
|
indexRef.current = activeIndex;
|
|
focusItem();
|
|
forceScrollIntoViewRef.current = false;
|
|
}
|
|
}, [enabled, open, elements.floating, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);
|
|
index3(() => {
|
|
var _nodes$find;
|
|
if (!enabled || elements.floating || !tree || virtual || !previousMountedRef.current) {
|
|
return;
|
|
}
|
|
const nodes = tree.nodesRef.current;
|
|
const parent = (_nodes$find = nodes.find((node) => node.id === parentId)) == null || (_nodes$find = _nodes$find.context) == null ? void 0 : _nodes$find.elements.floating;
|
|
const activeEl = activeElement2(getDocument2(elements.floating));
|
|
const treeContainsActiveEl = nodes.some((node) => node.context && contains3(node.context.elements.floating, activeEl));
|
|
if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {
|
|
parent.focus({
|
|
preventScroll: true
|
|
});
|
|
}
|
|
}, [enabled, elements.floating, tree, parentId, virtual]);
|
|
index3(() => {
|
|
if (!enabled) return;
|
|
if (!tree) return;
|
|
if (!virtual) return;
|
|
if (parentId) return;
|
|
function handleVirtualFocus(item2) {
|
|
setVirtualId(item2.id);
|
|
if (virtualItemRef) {
|
|
virtualItemRef.current = item2;
|
|
}
|
|
}
|
|
__name(handleVirtualFocus, "handleVirtualFocus");
|
|
tree.events.on("virtualfocus", handleVirtualFocus);
|
|
return () => {
|
|
tree.events.off("virtualfocus", handleVirtualFocus);
|
|
};
|
|
}, [enabled, tree, virtual, parentId, virtualItemRef]);
|
|
index3(() => {
|
|
previousOnNavigateRef.current = onNavigate;
|
|
previousOpenRef.current = open;
|
|
previousMountedRef.current = !!elements.floating;
|
|
});
|
|
index3(() => {
|
|
if (!open) {
|
|
keyRef.current = null;
|
|
focusItemOnOpenRef.current = focusItemOnOpen;
|
|
}
|
|
}, [open, focusItemOnOpen]);
|
|
const hasActiveIndex = activeIndex != null;
|
|
const item = React60.useMemo(() => {
|
|
function syncCurrentTarget(currentTarget) {
|
|
if (!latestOpenRef.current) return;
|
|
const index5 = listRef.current.indexOf(currentTarget);
|
|
if (index5 !== -1 && indexRef.current !== index5) {
|
|
indexRef.current = index5;
|
|
onNavigate();
|
|
}
|
|
}
|
|
__name(syncCurrentTarget, "syncCurrentTarget");
|
|
const props2 = {
|
|
onFocus(_ref) {
|
|
let {
|
|
currentTarget
|
|
} = _ref;
|
|
forceSyncFocusRef.current = true;
|
|
syncCurrentTarget(currentTarget);
|
|
},
|
|
onClick: /* @__PURE__ */ __name((_ref2) => {
|
|
let {
|
|
currentTarget
|
|
} = _ref2;
|
|
return currentTarget.focus({
|
|
preventScroll: true
|
|
});
|
|
}, "onClick"),
|
|
// Safari
|
|
onMouseMove(_ref3) {
|
|
let {
|
|
currentTarget
|
|
} = _ref3;
|
|
forceSyncFocusRef.current = true;
|
|
forceScrollIntoViewRef.current = false;
|
|
if (focusItemOnHover) {
|
|
syncCurrentTarget(currentTarget);
|
|
}
|
|
},
|
|
onPointerLeave(_ref4) {
|
|
let {
|
|
pointerType
|
|
} = _ref4;
|
|
if (!isPointerModalityRef.current || pointerType === "touch") {
|
|
return;
|
|
}
|
|
forceSyncFocusRef.current = true;
|
|
if (!focusItemOnHover) {
|
|
return;
|
|
}
|
|
indexRef.current = -1;
|
|
onNavigate();
|
|
if (!virtual) {
|
|
var _floatingFocusElement;
|
|
(_floatingFocusElement = floatingFocusElementRef.current) == null || _floatingFocusElement.focus({
|
|
preventScroll: true
|
|
});
|
|
}
|
|
}
|
|
};
|
|
return props2;
|
|
}, [latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, virtual]);
|
|
const getParentOrientation = React60.useCallback(() => {
|
|
var _tree$nodesRef$curren;
|
|
return parentOrientation != null ? parentOrientation : tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find((node) => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.dataRef) == null ? void 0 : _tree$nodesRef$curren.current.orientation;
|
|
}, [parentId, tree, parentOrientation]);
|
|
const commonOnKeyDown = useEffectEvent2((event) => {
|
|
isPointerModalityRef.current = false;
|
|
forceSyncFocusRef.current = true;
|
|
if (event.which === 229) {
|
|
return;
|
|
}
|
|
if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {
|
|
return;
|
|
}
|
|
if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, cols)) {
|
|
if (!isMainOrientationKey(event.key, getParentOrientation())) {
|
|
stopEvent2(event);
|
|
}
|
|
onOpenChange(false, event.nativeEvent, "list-navigation");
|
|
if (isHTMLElement(elements.domReference)) {
|
|
if (virtual) {
|
|
tree == null || tree.events.emit("virtualfocus", elements.domReference);
|
|
} else {
|
|
elements.domReference.focus();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
const currentIndex = indexRef.current;
|
|
const minIndex = getMinListIndex2(listRef, disabledIndices);
|
|
const maxIndex = getMaxListIndex2(listRef, disabledIndices);
|
|
if (!typeableComboboxReference) {
|
|
if (event.key === "Home") {
|
|
stopEvent2(event);
|
|
indexRef.current = minIndex;
|
|
onNavigate();
|
|
}
|
|
if (event.key === "End") {
|
|
stopEvent2(event);
|
|
indexRef.current = maxIndex;
|
|
onNavigate();
|
|
}
|
|
}
|
|
if (cols > 1) {
|
|
const sizes = itemSizes || Array.from({
|
|
length: listRef.current.length
|
|
}, () => ({
|
|
width: 1,
|
|
height: 1
|
|
}));
|
|
const cellMap = createGridCellMap2(sizes, cols, dense);
|
|
const minGridIndex = cellMap.findIndex((index6) => index6 != null && !isListIndexDisabled2(listRef, index6, disabledIndices));
|
|
const maxGridIndex = cellMap.reduce((foundIndex, index6, cellIndex) => index6 != null && !isListIndexDisabled2(listRef, index6, disabledIndices) ? cellIndex : foundIndex, -1);
|
|
const index5 = cellMap[getGridNavigatedIndex2({
|
|
current: cellMap.map((itemIndex) => itemIndex != null ? listRef.current[itemIndex] : null)
|
|
}, {
|
|
event,
|
|
orientation,
|
|
loop,
|
|
rtl,
|
|
cols,
|
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
// don't end up in them
|
|
disabledIndices: getGridCellIndices2([...(typeof disabledIndices !== "function" ? disabledIndices : null) || listRef.current.map((_, index6) => isListIndexDisabled2(listRef, index6, disabledIndices) ? index6 : void 0), void 0], cellMap),
|
|
minIndex: minGridIndex,
|
|
maxIndex: maxGridIndex,
|
|
prevIndex: getGridCellIndexOfCorner2(
|
|
indexRef.current > maxIndex ? minIndex : indexRef.current,
|
|
sizes,
|
|
cellMap,
|
|
cols,
|
|
// use a corner matching the edge closest to the direction
|
|
// we're moving in so we don't end up in the same item. Prefer
|
|
// top/left over bottom/right.
|
|
event.key === ARROW_DOWN3 ? "bl" : event.key === (rtl ? ARROW_LEFT3 : ARROW_RIGHT3) ? "tr" : "tl"
|
|
),
|
|
stopEvent: true
|
|
})];
|
|
if (index5 != null) {
|
|
indexRef.current = index5;
|
|
onNavigate();
|
|
}
|
|
if (orientation === "both") {
|
|
return;
|
|
}
|
|
}
|
|
if (isMainOrientationKey(event.key, orientation)) {
|
|
stopEvent2(event);
|
|
if (open && !virtual && activeElement2(event.currentTarget.ownerDocument) === event.currentTarget) {
|
|
indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;
|
|
onNavigate();
|
|
return;
|
|
}
|
|
if (isMainOrientationToEndKey(event.key, orientation, rtl)) {
|
|
if (loop) {
|
|
indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledListIndex2(listRef, {
|
|
startingIndex: currentIndex,
|
|
disabledIndices
|
|
});
|
|
} else {
|
|
indexRef.current = Math.min(maxIndex, findNonDisabledListIndex2(listRef, {
|
|
startingIndex: currentIndex,
|
|
disabledIndices
|
|
}));
|
|
}
|
|
} else {
|
|
if (loop) {
|
|
indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledListIndex2(listRef, {
|
|
startingIndex: currentIndex,
|
|
decrement: true,
|
|
disabledIndices
|
|
});
|
|
} else {
|
|
indexRef.current = Math.max(minIndex, findNonDisabledListIndex2(listRef, {
|
|
startingIndex: currentIndex,
|
|
decrement: true,
|
|
disabledIndices
|
|
}));
|
|
}
|
|
}
|
|
if (isIndexOutOfListBounds2(listRef, indexRef.current)) {
|
|
indexRef.current = -1;
|
|
}
|
|
onNavigate();
|
|
}
|
|
});
|
|
const ariaActiveDescendantProp = React60.useMemo(() => {
|
|
return virtual && open && hasActiveIndex && {
|
|
"aria-activedescendant": virtualId || activeId
|
|
};
|
|
}, [virtual, open, hasActiveIndex, virtualId, activeId]);
|
|
const floating = React60.useMemo(() => {
|
|
return {
|
|
"aria-orientation": orientation === "both" ? void 0 : orientation,
|
|
...!typeableComboboxReference ? ariaActiveDescendantProp : {},
|
|
onKeyDown: commonOnKeyDown,
|
|
onPointerMove() {
|
|
isPointerModalityRef.current = true;
|
|
}
|
|
};
|
|
}, [ariaActiveDescendantProp, commonOnKeyDown, orientation, typeableComboboxReference]);
|
|
const reference = React60.useMemo(() => {
|
|
function checkVirtualMouse(event) {
|
|
if (focusItemOnOpen === "auto" && isVirtualClick2(event.nativeEvent)) {
|
|
focusItemOnOpenRef.current = true;
|
|
}
|
|
}
|
|
__name(checkVirtualMouse, "checkVirtualMouse");
|
|
function checkVirtualPointer(event) {
|
|
focusItemOnOpenRef.current = focusItemOnOpen;
|
|
if (focusItemOnOpen === "auto" && isVirtualPointerEvent2(event.nativeEvent)) {
|
|
focusItemOnOpenRef.current = true;
|
|
}
|
|
}
|
|
__name(checkVirtualPointer, "checkVirtualPointer");
|
|
return {
|
|
...ariaActiveDescendantProp,
|
|
onKeyDown(event) {
|
|
isPointerModalityRef.current = false;
|
|
const isArrowKey = event.key.startsWith("Arrow");
|
|
const isHomeOrEndKey = ["Home", "End"].includes(event.key);
|
|
const isMoveKey = isArrowKey || isHomeOrEndKey;
|
|
const isCrossOpenKey = isCrossOrientationOpenKey(event.key, orientation, rtl);
|
|
const isCrossCloseKey = isCrossOrientationCloseKey(event.key, orientation, rtl, cols);
|
|
const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);
|
|
const isMainKey = isMainOrientationKey(event.key, orientation);
|
|
const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === "Enter" || event.key.trim() === "";
|
|
if (virtual && open) {
|
|
const rootNode = tree == null ? void 0 : tree.nodesRef.current.find((node) => node.parentId == null);
|
|
const deepestNode = tree && rootNode ? getDeepestNode2(tree.nodesRef.current, rootNode.id) : null;
|
|
if (isMoveKey && deepestNode && virtualItemRef) {
|
|
const eventObject = new KeyboardEvent("keydown", {
|
|
key: event.key,
|
|
bubbles: true
|
|
});
|
|
if (isCrossOpenKey || isCrossCloseKey) {
|
|
var _deepestNode$context, _deepestNode$context2;
|
|
const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ? void 0 : _deepestNode$context.elements.domReference) === event.currentTarget;
|
|
const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ? void 0 : _deepestNode$context2.elements.domReference : isCrossOpenKey ? listRef.current.find((item2) => (item2 == null ? void 0 : item2.id) === activeId) : null;
|
|
if (dispatchItem) {
|
|
stopEvent2(event);
|
|
dispatchItem.dispatchEvent(eventObject);
|
|
setVirtualId(void 0);
|
|
}
|
|
}
|
|
if ((isMainKey || isHomeOrEndKey) && deepestNode.context) {
|
|
if (deepestNode.context.open && deepestNode.parentId && event.currentTarget !== deepestNode.context.elements.domReference) {
|
|
var _deepestNode$context$;
|
|
stopEvent2(event);
|
|
(_deepestNode$context$ = deepestNode.context.elements.domReference) == null || _deepestNode$context$.dispatchEvent(eventObject);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
return commonOnKeyDown(event);
|
|
}
|
|
if (!open && !openOnArrowKeyDown && isArrowKey) {
|
|
return;
|
|
}
|
|
if (isNavigationKey) {
|
|
const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());
|
|
keyRef.current = nested && isParentMainKey ? null : event.key;
|
|
}
|
|
if (nested) {
|
|
if (isParentCrossOpenKey) {
|
|
stopEvent2(event);
|
|
if (open) {
|
|
indexRef.current = getMinListIndex2(listRef, disabledIndicesRef.current);
|
|
onNavigate();
|
|
} else {
|
|
onOpenChange(true, event.nativeEvent, "list-navigation");
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
if (isMainKey) {
|
|
if (selectedIndex != null) {
|
|
indexRef.current = selectedIndex;
|
|
}
|
|
stopEvent2(event);
|
|
if (!open && openOnArrowKeyDown) {
|
|
onOpenChange(true, event.nativeEvent, "list-navigation");
|
|
} else {
|
|
commonOnKeyDown(event);
|
|
}
|
|
if (open) {
|
|
onNavigate();
|
|
}
|
|
}
|
|
},
|
|
onFocus() {
|
|
if (open && !virtual) {
|
|
indexRef.current = -1;
|
|
onNavigate();
|
|
}
|
|
},
|
|
onPointerDown: checkVirtualPointer,
|
|
onPointerEnter: checkVirtualPointer,
|
|
onMouseDown: checkVirtualMouse,
|
|
onClick: checkVirtualMouse
|
|
};
|
|
}, [activeId, ariaActiveDescendantProp, cols, commonOnKeyDown, disabledIndicesRef, focusItemOnOpen, listRef, nested, onNavigate, onOpenChange, open, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndex, tree, virtual, virtualItemRef]);
|
|
return React60.useMemo(() => enabled ? {
|
|
reference,
|
|
floating,
|
|
item
|
|
} : {}, [enabled, reference, floating, item]);
|
|
}
|
|
__name(useListNavigation, "useListNavigation");
|
|
var componentRoleToAriaRoleMap2 = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", false]]);
|
|
function useRole2(context2, props) {
|
|
var _elements$domReferenc, _componentRoleToAriaR;
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
elements,
|
|
floatingId: defaultFloatingId
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
role = "dialog"
|
|
} = props;
|
|
const defaultReferenceId = useId12();
|
|
const referenceId = ((_elements$domReferenc = elements.domReference) == null ? void 0 : _elements$domReferenc.id) || defaultReferenceId;
|
|
const floatingId = React60.useMemo(() => {
|
|
var _getFloatingFocusElem;
|
|
return ((_getFloatingFocusElem = getFloatingFocusElement2(elements.floating)) == null ? void 0 : _getFloatingFocusElem.id) || defaultFloatingId;
|
|
}, [elements.floating, defaultFloatingId]);
|
|
const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap2.get(role)) != null ? _componentRoleToAriaR : role;
|
|
const parentId = useFloatingParentNodeId2();
|
|
const isNested = parentId != null;
|
|
const reference = React60.useMemo(() => {
|
|
if (ariaRole === "tooltip" || role === "label") {
|
|
return {
|
|
["aria-" + (role === "label" ? "labelledby" : "describedby")]: open ? floatingId : void 0
|
|
};
|
|
}
|
|
return {
|
|
"aria-expanded": open ? "true" : "false",
|
|
"aria-haspopup": ariaRole === "alertdialog" ? "dialog" : ariaRole,
|
|
"aria-controls": open ? floatingId : void 0,
|
|
...ariaRole === "listbox" && {
|
|
role: "combobox"
|
|
},
|
|
...ariaRole === "menu" && {
|
|
id: referenceId
|
|
},
|
|
...ariaRole === "menu" && isNested && {
|
|
role: "menuitem"
|
|
},
|
|
...role === "select" && {
|
|
"aria-autocomplete": "none"
|
|
},
|
|
...role === "combobox" && {
|
|
"aria-autocomplete": "list"
|
|
}
|
|
};
|
|
}, [ariaRole, floatingId, isNested, open, referenceId, role]);
|
|
const floating = React60.useMemo(() => {
|
|
const floatingProps = {
|
|
id: floatingId,
|
|
...ariaRole && {
|
|
role: ariaRole
|
|
}
|
|
};
|
|
if (ariaRole === "tooltip" || role === "label") {
|
|
return floatingProps;
|
|
}
|
|
return {
|
|
...floatingProps,
|
|
...ariaRole === "menu" && {
|
|
"aria-labelledby": referenceId
|
|
}
|
|
};
|
|
}, [ariaRole, floatingId, referenceId, role]);
|
|
const item = React60.useCallback((_ref) => {
|
|
let {
|
|
active,
|
|
selected
|
|
} = _ref;
|
|
const commonProps = {
|
|
role: "option",
|
|
...active && {
|
|
id: floatingId + "-fui-option"
|
|
}
|
|
};
|
|
switch (role) {
|
|
case "select":
|
|
case "combobox":
|
|
return {
|
|
...commonProps,
|
|
"aria-selected": selected
|
|
};
|
|
}
|
|
return {};
|
|
}, [floatingId, role]);
|
|
return React60.useMemo(() => enabled ? {
|
|
reference,
|
|
floating,
|
|
item
|
|
} : {}, [enabled, reference, floating, item]);
|
|
}
|
|
__name(useRole2, "useRole");
|
|
function useTypeahead(context2, props) {
|
|
var _ref;
|
|
const {
|
|
open,
|
|
dataRef
|
|
} = context2;
|
|
const {
|
|
listRef,
|
|
activeIndex,
|
|
onMatch: unstable_onMatch,
|
|
onTypingChange: unstable_onTypingChange,
|
|
enabled = true,
|
|
findMatch = null,
|
|
resetMs = 750,
|
|
ignoreKeys = [],
|
|
selectedIndex = null
|
|
} = props;
|
|
const timeoutIdRef = React60.useRef(-1);
|
|
const stringRef = React60.useRef("");
|
|
const prevIndexRef = React60.useRef((_ref = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref : -1);
|
|
const matchIndexRef = React60.useRef(null);
|
|
const onMatch = useEffectEvent2(unstable_onMatch);
|
|
const onTypingChange = useEffectEvent2(unstable_onTypingChange);
|
|
const findMatchRef = useLatestRef3(findMatch);
|
|
const ignoreKeysRef = useLatestRef3(ignoreKeys);
|
|
index3(() => {
|
|
if (open) {
|
|
clearTimeoutIfSet2(timeoutIdRef);
|
|
matchIndexRef.current = null;
|
|
stringRef.current = "";
|
|
}
|
|
}, [open]);
|
|
index3(() => {
|
|
if (open && stringRef.current === "") {
|
|
var _ref2;
|
|
prevIndexRef.current = (_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1;
|
|
}
|
|
}, [open, selectedIndex, activeIndex]);
|
|
const setTypingChange = useEffectEvent2((value) => {
|
|
if (value) {
|
|
if (!dataRef.current.typing) {
|
|
dataRef.current.typing = value;
|
|
onTypingChange(value);
|
|
}
|
|
} else {
|
|
if (dataRef.current.typing) {
|
|
dataRef.current.typing = value;
|
|
onTypingChange(value);
|
|
}
|
|
}
|
|
});
|
|
const onKeyDown = useEffectEvent2((event) => {
|
|
function getMatchingIndex(list, orderedList, string) {
|
|
const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find((text) => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(string.toLocaleLowerCase())) === 0);
|
|
return str ? list.indexOf(str) : -1;
|
|
}
|
|
__name(getMatchingIndex, "getMatchingIndex");
|
|
const listContent = listRef.current;
|
|
if (stringRef.current.length > 0 && stringRef.current[0] !== " ") {
|
|
if (getMatchingIndex(listContent, listContent, stringRef.current) === -1) {
|
|
setTypingChange(false);
|
|
} else if (event.key === " ") {
|
|
stopEvent2(event);
|
|
}
|
|
}
|
|
if (listContent == null || ignoreKeysRef.current.includes(event.key) || // Character key.
|
|
event.key.length !== 1 || // Modifier key.
|
|
event.ctrlKey || event.metaKey || event.altKey) {
|
|
return;
|
|
}
|
|
if (open && event.key !== " ") {
|
|
stopEvent2(event);
|
|
setTypingChange(true);
|
|
}
|
|
const allowRapidSuccessionOfFirstLetter = listContent.every((text) => {
|
|
var _text$, _text$2;
|
|
return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;
|
|
});
|
|
if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {
|
|
stringRef.current = "";
|
|
prevIndexRef.current = matchIndexRef.current;
|
|
}
|
|
stringRef.current += event.key;
|
|
clearTimeoutIfSet2(timeoutIdRef);
|
|
timeoutIdRef.current = window.setTimeout(() => {
|
|
stringRef.current = "";
|
|
prevIndexRef.current = matchIndexRef.current;
|
|
setTypingChange(false);
|
|
}, resetMs);
|
|
const prevIndex = prevIndexRef.current;
|
|
const index5 = getMatchingIndex(listContent, [...listContent.slice((prevIndex || 0) + 1), ...listContent.slice(0, (prevIndex || 0) + 1)], stringRef.current);
|
|
if (index5 !== -1) {
|
|
onMatch(index5);
|
|
matchIndexRef.current = index5;
|
|
} else if (event.key !== " ") {
|
|
stringRef.current = "";
|
|
setTypingChange(false);
|
|
}
|
|
});
|
|
const reference = React60.useMemo(() => ({
|
|
onKeyDown
|
|
}), [onKeyDown]);
|
|
const floating = React60.useMemo(() => {
|
|
return {
|
|
onKeyDown,
|
|
onKeyUp(event) {
|
|
if (event.key === " ") {
|
|
setTypingChange(false);
|
|
}
|
|
}
|
|
};
|
|
}, [onKeyDown, setTypingChange]);
|
|
return React60.useMemo(() => enabled ? {
|
|
reference,
|
|
floating
|
|
} : {}, [enabled, reference, floating]);
|
|
}
|
|
__name(useTypeahead, "useTypeahead");
|
|
function getArgsWithCustomFloatingHeight(state, height) {
|
|
return {
|
|
...state,
|
|
rects: {
|
|
...state.rects,
|
|
floating: {
|
|
...state.rects.floating,
|
|
height
|
|
}
|
|
}
|
|
};
|
|
}
|
|
__name(getArgsWithCustomFloatingHeight, "getArgsWithCustomFloatingHeight");
|
|
var inner = /* @__PURE__ */ __name((props) => ({
|
|
name: "inner",
|
|
options: props,
|
|
async fn(state) {
|
|
const {
|
|
listRef,
|
|
overflowRef,
|
|
onFallbackChange,
|
|
offset: innerOffset = 0,
|
|
index: index5 = 0,
|
|
minItemsVisible = 4,
|
|
referenceOverflowThreshold = 0,
|
|
scrollRef,
|
|
...detectOverflowOptions
|
|
} = evaluate(props, state);
|
|
const {
|
|
rects,
|
|
elements: {
|
|
floating
|
|
}
|
|
} = state;
|
|
const item = listRef.current[index5];
|
|
const scrollEl = (scrollRef == null ? void 0 : scrollRef.current) || floating;
|
|
const clientTop = floating.clientTop || scrollEl.clientTop;
|
|
const floatingIsBordered = floating.clientTop !== 0;
|
|
const scrollElIsBordered = scrollEl.clientTop !== 0;
|
|
const floatingIsScrollEl = floating === scrollEl;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
if (!state.placement.startsWith("bottom")) {
|
|
warn('`placement` side must be "bottom" when using the `inner`', "middleware.");
|
|
}
|
|
}
|
|
if (!item) {
|
|
return {};
|
|
}
|
|
const nextArgs = {
|
|
...state,
|
|
...await offset3(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state)
|
|
};
|
|
const overflow = await detectOverflow2(getArgsWithCustomFloatingHeight(nextArgs, scrollEl.scrollHeight + clientTop + floating.clientTop), detectOverflowOptions);
|
|
const refOverflow = await detectOverflow2(nextArgs, {
|
|
...detectOverflowOptions,
|
|
elementContext: "reference"
|
|
});
|
|
const diffY = max(0, overflow.top);
|
|
const nextY = nextArgs.y + diffY;
|
|
const isScrollable = scrollEl.scrollHeight > scrollEl.clientHeight;
|
|
const rounder = isScrollable ? (v) => v : round;
|
|
const maxHeight = rounder(max(0, scrollEl.scrollHeight + (floatingIsBordered && floatingIsScrollEl || scrollElIsBordered ? clientTop * 2 : 0) - diffY - max(0, overflow.bottom)));
|
|
scrollEl.style.maxHeight = maxHeight + "px";
|
|
scrollEl.scrollTop = diffY;
|
|
if (onFallbackChange) {
|
|
const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;
|
|
ReactDOM4.flushSync(() => onFallbackChange(shouldFallback));
|
|
}
|
|
if (overflowRef) {
|
|
overflowRef.current = await detectOverflow2(getArgsWithCustomFloatingHeight({
|
|
...nextArgs,
|
|
y: nextY
|
|
}, scrollEl.offsetHeight + clientTop + floating.clientTop), detectOverflowOptions);
|
|
}
|
|
return {
|
|
y: nextY
|
|
};
|
|
}
|
|
}), "inner");
|
|
function useInnerOffset(context2, props) {
|
|
const {
|
|
open,
|
|
elements
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
overflowRef,
|
|
scrollRef,
|
|
onChange: unstable_onChange
|
|
} = props;
|
|
const onChange = useEffectEvent2(unstable_onChange);
|
|
const controlledScrollingRef = React60.useRef(false);
|
|
const prevScrollTopRef = React60.useRef(null);
|
|
const initialOverflowRef = React60.useRef(null);
|
|
React60.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onWheel(e) {
|
|
if (e.ctrlKey || !el || overflowRef.current == null) {
|
|
return;
|
|
}
|
|
const dY = e.deltaY;
|
|
const isAtTop = overflowRef.current.top >= -0.5;
|
|
const isAtBottom = overflowRef.current.bottom >= -0.5;
|
|
const remainingScroll = el.scrollHeight - el.clientHeight;
|
|
const sign = dY < 0 ? -1 : 1;
|
|
const method = dY < 0 ? "max" : "min";
|
|
if (el.scrollHeight <= el.clientHeight) {
|
|
return;
|
|
}
|
|
if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
|
|
e.preventDefault();
|
|
ReactDOM4.flushSync(() => {
|
|
onChange((d) => d + Math[method](dY, remainingScroll * sign));
|
|
});
|
|
} else if (/firefox/i.test(getUserAgent2())) {
|
|
el.scrollTop += dY;
|
|
}
|
|
}
|
|
__name(onWheel, "onWheel");
|
|
const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;
|
|
if (open && el) {
|
|
el.addEventListener("wheel", onWheel);
|
|
requestAnimationFrame(() => {
|
|
prevScrollTopRef.current = el.scrollTop;
|
|
if (overflowRef.current != null) {
|
|
initialOverflowRef.current = {
|
|
...overflowRef.current
|
|
};
|
|
}
|
|
});
|
|
return () => {
|
|
prevScrollTopRef.current = null;
|
|
initialOverflowRef.current = null;
|
|
el.removeEventListener("wheel", onWheel);
|
|
};
|
|
}
|
|
}, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);
|
|
const floating = React60.useMemo(() => ({
|
|
onKeyDown() {
|
|
controlledScrollingRef.current = true;
|
|
},
|
|
onWheel() {
|
|
controlledScrollingRef.current = false;
|
|
},
|
|
onPointerMove() {
|
|
controlledScrollingRef.current = false;
|
|
},
|
|
onScroll() {
|
|
const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;
|
|
if (!overflowRef.current || !el || !controlledScrollingRef.current) {
|
|
return;
|
|
}
|
|
if (prevScrollTopRef.current !== null) {
|
|
const scrollDiff = el.scrollTop - prevScrollTopRef.current;
|
|
if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {
|
|
ReactDOM4.flushSync(() => onChange((d) => d + scrollDiff));
|
|
}
|
|
}
|
|
requestAnimationFrame(() => {
|
|
prevScrollTopRef.current = el.scrollTop;
|
|
});
|
|
}
|
|
}), [elements.floating, onChange, overflowRef, scrollRef]);
|
|
return React60.useMemo(() => enabled ? {
|
|
floating
|
|
} : {}, [enabled, floating]);
|
|
}
|
|
__name(useInnerOffset, "useInnerOffset");
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectContent.mjs
|
|
var import_core35 = require("@tamagui/core");
|
|
var import_react47 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/select/dist/esm/useSelectBreakpointActive.mjs
|
|
var useShowSelectSheet = /* @__PURE__ */ __name((context2) => {
|
|
const breakpointActive = useAdaptIsActive(context2.adaptScope);
|
|
return context2.open === false ? false : breakpointActive;
|
|
}, "useShowSelectSheet");
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectContent.mjs
|
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
var SelectContent = /* @__PURE__ */ __name(({
|
|
children,
|
|
scope,
|
|
zIndex = 1e3,
|
|
...focusScopeProps
|
|
}) => {
|
|
const context2 = useSelectContext(scope), itemParentContext = useSelectItemParentContext(scope), themeName = (0, import_core35.useThemeName)(), showSheet = useShowSelectSheet(context2), contents = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core35.Theme, {
|
|
forceClassName: true,
|
|
name: themeName,
|
|
children
|
|
}), touch = (0, import_core35.useIsTouchDevice)(), overlayStyle = import_react47.default.useMemo(() => ({
|
|
zIndex,
|
|
pointerEvents: context2.open ? "auto" : "none"
|
|
}), [context2.open]);
|
|
return itemParentContext.shouldRenderWebNative ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, {
|
|
children
|
|
}) : showSheet ? context2.open ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, {
|
|
children: contents
|
|
}) : null : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FloatingPortal, {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FloatingOverlay, {
|
|
style: overlayStyle,
|
|
lockScroll: !context2.disablePreventBodyScroll && !!context2.open && !touch,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FocusScope, {
|
|
loop: true,
|
|
enabled: !!context2.open,
|
|
trapped: true,
|
|
...focusScopeProps,
|
|
children: contents
|
|
})
|
|
})
|
|
});
|
|
}, "SelectContent");
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectImpl.mjs
|
|
var import_core36 = require("@tamagui/core");
|
|
var React62 = __toESM(require("react"), 1);
|
|
var import_react_dom6 = require("react-dom");
|
|
|
|
// node_modules/@tamagui/select/dist/esm/constants.mjs
|
|
var SCROLL_ARROW_THRESHOLD = 8;
|
|
var VIEWPORT_NAME = "SelectViewport";
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectImpl.mjs
|
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
var SelectInlineImpl = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
scope,
|
|
children,
|
|
open = false,
|
|
listContentRef
|
|
} = props, selectContext = useSelectContext(scope), selectItemParentContext = useSelectItemParentContext(scope), {
|
|
setActiveIndex,
|
|
selectedIndex,
|
|
activeIndex
|
|
} = selectContext, {
|
|
setOpen,
|
|
setSelectedIndex
|
|
} = selectItemParentContext, [scrollTop, setScrollTop] = React62.useState(0), touch = (0, import_core36.useIsTouchDevice)(), listItemsRef = React62.useRef([]), overflowRef = React62.useRef(null), upArrowRef = React62.useRef(null), downArrowRef = React62.useRef(null), allowSelectRef = React62.useRef(false), allowMouseUpRef = React62.useRef(true), selectTimeoutRef = React62.useRef(null), state = React62.useRef({
|
|
isMouseOutside: false,
|
|
isTyping: false
|
|
}), [controlledScrolling, setControlledScrolling] = React62.useState(false), [fallback, setFallback] = React62.useState(false), [innerOffset, setInnerOffset] = React62.useState(0), [blockSelection, setBlockSelection] = React62.useState(false), floatingStyle = React62.useRef({});
|
|
useIsomorphicLayoutEffect(() => {
|
|
queueMicrotask(() => {
|
|
open || (setScrollTop(0), setFallback(false), setActiveIndex(null), setControlledScrolling(false));
|
|
});
|
|
}, [open, setActiveIndex]), isWeb && isClient && useIsomorphicLayoutEffect(() => {
|
|
if (!open) return;
|
|
const mouseUp = /* @__PURE__ */ __name((e) => {
|
|
state.current.isMouseOutside && setOpen(false);
|
|
}, "mouseUp");
|
|
return document.addEventListener("mouseup", mouseUp), () => {
|
|
document.removeEventListener("mouseup", mouseUp);
|
|
};
|
|
}, [open]);
|
|
const {
|
|
x,
|
|
y,
|
|
strategy,
|
|
context: context2,
|
|
refs,
|
|
update
|
|
} = useFloating4({
|
|
open,
|
|
onOpenChange: setOpen,
|
|
placement: "bottom-start",
|
|
whileElementsMounted: autoUpdate,
|
|
// biome-ignore lint/correctness/noConstantCondition: <explanation>
|
|
middleware: [size3({
|
|
apply({
|
|
rects: {
|
|
reference: {
|
|
width
|
|
}
|
|
}
|
|
}) {
|
|
Object.assign(floatingStyle.current, {
|
|
minWidth: width + 8
|
|
}), refs.floating.current && Object.assign(refs.floating.current.style, floatingStyle.current);
|
|
}
|
|
}), inner({
|
|
listRef: listItemsRef,
|
|
overflowRef,
|
|
index: selectedIndex,
|
|
offset: innerOffset,
|
|
onFallbackChange: setFallback,
|
|
padding: 10,
|
|
minItemsVisible: touch ? 10 : 4,
|
|
referenceOverflowThreshold: 20
|
|
}), offset3({
|
|
crossAxis: -5
|
|
})]
|
|
}), floatingRef = refs.floating, showUpArrow = open && scrollTop > SCROLL_ARROW_THRESHOLD, showDownArrow = open && floatingRef.current && scrollTop < floatingRef.current.scrollHeight - floatingRef.current.clientHeight - SCROLL_ARROW_THRESHOLD, isScrollable = showDownArrow || showUpArrow;
|
|
useIsomorphicLayoutEffect(() => (window.addEventListener("resize", update), open && update(), () => window.removeEventListener("resize", update)), [update, open]);
|
|
const onMatch = (0, import_core36.useEvent)((index5) => (open ? setActiveIndex : setSelectedIndex)(index5)), interactionsProps = [useClick(context2, {
|
|
event: "mousedown",
|
|
keyboardHandlers: false
|
|
}), useDismiss2(context2, {
|
|
outsidePress: false
|
|
}), useRole2(context2, {
|
|
role: "listbox"
|
|
}), useInnerOffset(context2, {
|
|
enabled: !fallback && isScrollable,
|
|
onChange: setInnerOffset,
|
|
overflowRef,
|
|
scrollRef: refs.floating
|
|
}), useListNavigation(context2, {
|
|
listRef: listItemsRef,
|
|
activeIndex: activeIndex || 0,
|
|
selectedIndex,
|
|
onNavigate: setActiveIndex,
|
|
scrollItemIntoView: false
|
|
}), useTypeahead(context2, {
|
|
listRef: listContentRef,
|
|
onMatch,
|
|
selectedIndex,
|
|
activeIndex,
|
|
onTypingChange: /* @__PURE__ */ __name((e) => {
|
|
state.current.isTyping = e;
|
|
}, "onTypingChange")
|
|
})], interactions = useInteractions2(
|
|
// unfortunately these memos will just always break due to floating-ui context always changing :/
|
|
React62.useMemo(() => interactionsProps, interactionsProps)
|
|
), interactionsContext = React62.useMemo(() => ({
|
|
...interactions,
|
|
getReferenceProps() {
|
|
return interactions.getReferenceProps({
|
|
ref: refs.reference,
|
|
className: "SelectTrigger",
|
|
onKeyDown(event) {
|
|
(event.key === "Enter" || event.code === "Space" || event.key === " " && !state.current.isTyping) && (event.preventDefault(), setOpen(true));
|
|
}
|
|
});
|
|
},
|
|
getFloatingProps(props2) {
|
|
return interactions.getFloatingProps({
|
|
ref: refs.floating,
|
|
className: "Select",
|
|
...props2,
|
|
style: {
|
|
position: strategy,
|
|
top: y ?? "",
|
|
left: x ?? "",
|
|
outline: 0,
|
|
scrollbarWidth: "none",
|
|
...floatingStyle.current,
|
|
...props2?.style
|
|
},
|
|
onPointerEnter() {
|
|
setControlledScrolling(false), state.current.isMouseOutside = false;
|
|
},
|
|
onPointerLeave() {
|
|
state.current.isMouseOutside = true;
|
|
},
|
|
onPointerMove() {
|
|
state.current.isMouseOutside = false, setControlledScrolling(false);
|
|
},
|
|
onKeyDown() {
|
|
setControlledScrolling(true);
|
|
},
|
|
onContextMenu(e) {
|
|
e.preventDefault();
|
|
},
|
|
onScroll(event) {
|
|
(0, import_react_dom6.flushSync)(() => {
|
|
setScrollTop(event.currentTarget.scrollTop);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}), [refs.reference.current, x, y, refs.floating.current, interactions]);
|
|
return useIsomorphicLayoutEffect(() => {
|
|
if (open) return selectTimeoutRef.current = setTimeout(() => {
|
|
allowSelectRef.current = true;
|
|
}, 300), () => {
|
|
clearTimeout(selectTimeoutRef.current);
|
|
};
|
|
allowSelectRef.current = false, allowMouseUpRef.current = true, setInnerOffset(0), setFallback(false), setBlockSelection(false);
|
|
}, [open]), useIsomorphicLayoutEffect(() => {
|
|
!open && state.current.isMouseOutside && (state.current.isMouseOutside = false);
|
|
}, [open]), useIsomorphicLayoutEffect(() => {
|
|
function onPointerDown(e) {
|
|
const target = e.target;
|
|
refs.floating.current?.contains(target) || upArrowRef.current?.contains(target) || downArrowRef.current?.contains(target) || (setOpen(false), setControlledScrolling(false));
|
|
}
|
|
__name(onPointerDown, "onPointerDown");
|
|
if (open) return document.addEventListener("pointerdown", onPointerDown), () => {
|
|
document.removeEventListener("pointerdown", onPointerDown);
|
|
};
|
|
}, [open, refs, setOpen]), React62.useEffect(() => {
|
|
open && controlledScrolling && activeIndex != null && listItemsRef.current[activeIndex]?.scrollIntoView({
|
|
block: "nearest"
|
|
}), setScrollTop(refs.floating.current?.scrollTop ?? 0);
|
|
}, [open, refs, controlledScrolling, activeIndex]), React62.useEffect(() => {
|
|
open && fallback && selectedIndex != null && listItemsRef.current[selectedIndex]?.scrollIntoView({
|
|
block: "nearest"
|
|
});
|
|
}, [open, fallback, selectedIndex]), useIsomorphicLayoutEffect(() => {
|
|
refs.floating.current && fallback && (refs.floating.current.style.maxHeight = "");
|
|
}, [refs, fallback]), /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectProvider, {
|
|
scope,
|
|
...selectContext,
|
|
setScrollTop,
|
|
setInnerOffset,
|
|
fallback,
|
|
floatingContext: context2,
|
|
activeIndex,
|
|
canScrollDown: !!showDownArrow,
|
|
canScrollUp: !!showUpArrow,
|
|
controlledScrolling,
|
|
blockSelection,
|
|
upArrowRef,
|
|
downArrowRef,
|
|
update,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectItemParentProvider, {
|
|
scope,
|
|
...selectItemParentContext,
|
|
allowMouseUpRef,
|
|
allowSelectRef,
|
|
dataRef: context2.dataRef,
|
|
interactions: interactionsContext,
|
|
listRef: listItemsRef,
|
|
selectTimeoutRef,
|
|
children
|
|
})
|
|
});
|
|
}, "SelectInlineImpl");
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectItem.mjs
|
|
var import_core37 = require("@tamagui/core");
|
|
var React63 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
var ITEM_NAME3 = "SelectItem";
|
|
var {
|
|
Provider: SelectItemContextProvider,
|
|
useStyledContext: useSelectItemContext
|
|
} = (0, import_core37.createStyledContext)(null, ITEM_NAME3);
|
|
var SelectItem = ListItemFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
value,
|
|
disabled = false,
|
|
textValue: textValueProp,
|
|
index: index5,
|
|
...restProps
|
|
} = props, {
|
|
props: listItemProps
|
|
} = useListItem({
|
|
...!props.unstyled && {
|
|
ellipse: true
|
|
},
|
|
...restProps
|
|
}), context2 = useSelectItemParentContext(scope), {
|
|
setSelectedIndex,
|
|
listRef,
|
|
setOpen,
|
|
onChange,
|
|
activeIndexSubscribe,
|
|
valueSubscribe,
|
|
allowMouseUpRef,
|
|
allowSelectRef,
|
|
setValueAtIndex,
|
|
selectTimeoutRef,
|
|
dataRef,
|
|
interactions,
|
|
shouldRenderWebNative,
|
|
size: size4,
|
|
onActiveChange,
|
|
initialValue: initialValue2
|
|
} = context2, [isSelected, setSelected] = React63.useState(initialValue2 === value);
|
|
React63.useEffect(() => activeIndexSubscribe((i) => {
|
|
index5 === i && (onActiveChange(value, index5), listRef?.current[index5]?.focus());
|
|
}), [index5]), React63.useEffect(() => valueSubscribe((val) => {
|
|
setSelected(val === value);
|
|
}), [value]);
|
|
const textId = React63.useId(), refCallback = React63.useCallback((node) => {
|
|
isWeb && node instanceof HTMLElement && listRef && (listRef.current[index5] = node);
|
|
}, []), composedRefs = useComposedRefs(forwardedRef, refCallback);
|
|
useIsomorphicLayoutEffect(() => {
|
|
setValueAtIndex(index5, value);
|
|
}, [index5, setValueAtIndex, value]);
|
|
function handleSelect() {
|
|
setSelectedIndex(index5), onChange(value), setOpen(false);
|
|
}
|
|
__name(handleSelect, "handleSelect");
|
|
const selectItemProps = React63.useMemo(() => interactions ? interactions.getItemProps({
|
|
onTouchMove() {
|
|
allowSelectRef.current = true, allowMouseUpRef.current = false;
|
|
},
|
|
onTouchEnd() {
|
|
allowSelectRef.current = false, allowMouseUpRef.current = true;
|
|
},
|
|
onKeyDown(event) {
|
|
event.key === "Enter" || event.key === " " && !dataRef?.current.typing ? (event.preventDefault(), handleSelect()) : allowSelectRef.current = true;
|
|
},
|
|
onClick() {
|
|
allowSelectRef.current && handleSelect();
|
|
},
|
|
onMouseUp() {
|
|
allowMouseUpRef.current && (allowSelectRef.current && handleSelect(), clearTimeout(selectTimeoutRef.current), selectTimeoutRef.current = setTimeout(() => {
|
|
allowSelectRef.current = true;
|
|
}));
|
|
}
|
|
}) : {
|
|
onPress: handleSelect
|
|
}, [handleSelect]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItemContextProvider, {
|
|
scope,
|
|
value,
|
|
textId: textId || "",
|
|
isSelected,
|
|
children: shouldRenderWebNative ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", {
|
|
value,
|
|
children: props.children
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ListItemFrame, {
|
|
tag: "div",
|
|
componentName: ITEM_NAME3,
|
|
ref: composedRefs,
|
|
"aria-labelledby": textId,
|
|
"aria-selected": isSelected,
|
|
"data-state": isSelected ? "active" : "inactive",
|
|
"aria-disabled": disabled || void 0,
|
|
"data-disabled": disabled ? "" : void 0,
|
|
tabIndex: disabled ? void 0 : -1,
|
|
...!props.unstyled && {
|
|
backgrounded: true,
|
|
pressTheme: true,
|
|
hoverTheme: true,
|
|
focusTheme: true,
|
|
cursor: "default",
|
|
size: size4,
|
|
outlineOffset: -0.5,
|
|
focusVisibleStyle: {
|
|
outlineColor: "$outlineColor",
|
|
outlineWidth: 1,
|
|
outlineStyle: "solid"
|
|
}
|
|
},
|
|
...listItemProps,
|
|
...selectItemProps
|
|
})
|
|
});
|
|
}, {
|
|
disableTheme: true
|
|
});
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectItemText.mjs
|
|
var import_core38 = require("@tamagui/core");
|
|
var React64 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
var SelectItemTextFrame = (0, import_core38.styled)(SizableText2, {
|
|
name: ITEM_TEXT_NAME,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
userSelect: "none",
|
|
color: "$color",
|
|
ellipse: true
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var SelectItemText = SelectItemTextFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
className,
|
|
...itemTextProps
|
|
} = props, context2 = useSelectContext(scope), itemParentContext = useSelectItemParentContext(scope), ref = React64.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), itemContext = useSelectItemContext(scope), contents = React64.useRef(null);
|
|
return contents.current = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItemTextFrame, {
|
|
className,
|
|
size: itemParentContext.size,
|
|
id: itemContext.textId,
|
|
...itemTextProps,
|
|
ref: composedRefs
|
|
}), (0, import_core38.useIsomorphicLayoutEffect)(() => {
|
|
itemParentContext.initialValue === itemContext.value && !context2.selectedIndex && context2.setSelectedItem(contents.current);
|
|
}, []), (0, import_core38.useIsomorphicLayoutEffect)(() => itemParentContext.valueSubscribe((val) => {
|
|
val === itemContext.value && context2.setSelectedItem(contents.current);
|
|
}), [itemContext.value]), itemParentContext.shouldRenderWebNative ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, {
|
|
children: props.children
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, {
|
|
children: contents.current
|
|
});
|
|
});
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectScrollButton.mjs
|
|
var React65 = __toESM(require("react"), 1);
|
|
var import_react_dom7 = require("react-dom");
|
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
var SelectScrollUpButton = React65.forwardRef((props, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectScrollButtonImpl, {
|
|
componentName: SCROLL_UP_BUTTON_NAME,
|
|
...props,
|
|
dir: "up",
|
|
ref: forwardedRef
|
|
}));
|
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
var SelectScrollDownButton = React65.forwardRef((props, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectScrollButtonImpl, {
|
|
componentName: SCROLL_DOWN_BUTTON_NAME,
|
|
...props,
|
|
dir: "down",
|
|
ref: forwardedRef
|
|
}));
|
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
var SelectScrollButtonImpl = React65.memo(React65.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
scope,
|
|
dir,
|
|
componentName,
|
|
...scrollIndicatorProps
|
|
} = props, {
|
|
forceUpdate,
|
|
open,
|
|
fallback,
|
|
setScrollTop,
|
|
setInnerOffset,
|
|
...context2
|
|
} = useSelectContext(scope), floatingRef = context2.floatingContext?.refs.floating, statusRef = React65.useRef("idle"), isVisible = context2[dir === "down" ? "canScrollDown" : "canScrollUp"], frameRef = React65.useRef(null), {
|
|
x,
|
|
y,
|
|
refs,
|
|
strategy
|
|
} = useFloating4({
|
|
open: open && isVisible,
|
|
strategy: "fixed",
|
|
elements: {
|
|
reference: floatingRef?.current
|
|
},
|
|
placement: dir === "up" ? "top" : "bottom",
|
|
middleware: [offset3(({
|
|
rects
|
|
}) => -rects.floating.height)],
|
|
whileElementsMounted: /* @__PURE__ */ __name((...args) => autoUpdate(...args, {
|
|
animationFrame: true
|
|
}), "whileElementsMounted")
|
|
}), composedRef = useComposedRefs(forwardedRef, refs.setFloating);
|
|
if (!isVisible) return null;
|
|
const onScroll = /* @__PURE__ */ __name((amount) => {
|
|
const floating = floatingRef;
|
|
floating && (fallback ? floating.current && (floating.current.scrollTop -= amount, (0, import_react_dom7.flushSync)(() => setScrollTop(floating.current?.scrollTop ?? 0))) : (0, import_react_dom7.flushSync)(() => setInnerOffset((value) => value - amount)));
|
|
}, "onScroll");
|
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(YStack, {
|
|
ref: composedRef,
|
|
componentName,
|
|
"aria-hidden": true,
|
|
...scrollIndicatorProps,
|
|
zIndex: 1e3,
|
|
position: strategy,
|
|
left: x || 0,
|
|
top: y || 0,
|
|
width: `calc(${(floatingRef?.current?.offsetWidth ?? 0) - 2}px)`,
|
|
onPointerEnter: /* @__PURE__ */ __name(() => {
|
|
statusRef.current = "active";
|
|
let prevNow = Date.now();
|
|
function frame() {
|
|
const element = floatingRef?.current;
|
|
if (element) {
|
|
const currentNow = Date.now(), msElapsed = currentNow - prevNow;
|
|
prevNow = currentNow;
|
|
const pixelsToScroll = msElapsed / 2, remainingPixels = dir === "up" ? element.scrollTop : element.scrollHeight - element.clientHeight - element.scrollTop, scrollRemaining = dir === "up" ? element.scrollTop - pixelsToScroll > 0 : element.scrollTop + pixelsToScroll < element.scrollHeight - element.clientHeight;
|
|
onScroll(dir === "up" ? Math.min(pixelsToScroll, remainingPixels) : Math.max(-pixelsToScroll, -remainingPixels)), scrollRemaining && (frameRef.current = requestAnimationFrame(frame));
|
|
}
|
|
}
|
|
__name(frame, "frame");
|
|
cancelAnimationFrame(frameRef.current), frameRef.current = requestAnimationFrame(frame);
|
|
}, "onPointerEnter"),
|
|
onPointerLeave: /* @__PURE__ */ __name(() => {
|
|
statusRef.current = "idle", cancelAnimationFrame(frameRef.current);
|
|
}, "onPointerLeave")
|
|
});
|
|
}));
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectTrigger.mjs
|
|
var import_core39 = require("@tamagui/core");
|
|
var React66 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
var TRIGGER_NAME4 = "SelectTrigger";
|
|
var isPointerCoarse = import_core39.isWeb && import_core39.isClient ? window.matchMedia("(pointer:coarse)").matches : true;
|
|
var SelectTrigger = React66.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
disabled = false,
|
|
unstyled = false,
|
|
...triggerProps
|
|
} = props, context2 = useSelectContext(scope), itemParentContext = useSelectItemParentContext(scope), composedRefs = useComposedRefs(forwardedRef, context2.floatingContext?.refs.setReference);
|
|
return itemParentContext.shouldRenderWebNative ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ListItem2, {
|
|
componentName: TRIGGER_NAME4,
|
|
unstyled,
|
|
tag: "button",
|
|
type: "button",
|
|
id: itemParentContext.id,
|
|
...!unstyled && {
|
|
backgrounded: true,
|
|
radiused: true,
|
|
hoverTheme: true,
|
|
pressTheme: true,
|
|
focusable: true,
|
|
focusVisibleStyle: {
|
|
outlineStyle: "solid",
|
|
outlineWidth: 2,
|
|
outlineColor: "$outlineColor"
|
|
},
|
|
borderWidth: 1,
|
|
size: itemParentContext.size
|
|
},
|
|
"aria-expanded": context2.open,
|
|
"aria-autocomplete": "none",
|
|
dir: context2.dir,
|
|
disabled,
|
|
"data-disabled": disabled ? "" : void 0,
|
|
...triggerProps,
|
|
ref: composedRefs,
|
|
...itemParentContext.interactions ? {
|
|
...itemParentContext.interactions.getReferenceProps(),
|
|
...isPointerCoarse ? {
|
|
onPress() {
|
|
itemParentContext.setOpen(!context2.open);
|
|
}
|
|
} : {
|
|
onMouseDown() {
|
|
context2.floatingContext?.update(), itemParentContext.setOpen(!context2.open);
|
|
}
|
|
}
|
|
} : {
|
|
onPress() {
|
|
itemParentContext.setOpen(!context2.open);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
// node_modules/@tamagui/select/dist/esm/SelectViewport.mjs
|
|
var import_core40 = require("@tamagui/core");
|
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
var SelectViewportFrame = (0, import_core40.styled)(ThemeableStack, {
|
|
name: VIEWPORT_NAME,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$2",
|
|
backgroundColor: "$background",
|
|
elevate: true,
|
|
bordered: true,
|
|
userSelect: "none",
|
|
outlineWidth: 0
|
|
}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, {
|
|
tokens
|
|
}) => ({
|
|
borderRadius: tokens.radius[val] ?? val
|
|
}), "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var needsRepropagation3 = isAndroid || isIos && !USE_NATIVE_PORTAL;
|
|
var SelectViewport = SelectViewportFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
children,
|
|
disableScroll,
|
|
...viewportProps
|
|
} = props, context2 = useSelectContext(scope), itemContext = useSelectItemParentContext(scope), isAdapted = useAdaptIsActive(context2.adaptScope), composedRefs = useComposedRefs(
|
|
// @ts-ignore TODO react 19 type needs fix
|
|
forwardedRef,
|
|
context2.floatingContext?.refs.setFloating
|
|
);
|
|
if (useIsomorphicLayoutEffect(() => {
|
|
context2.update && context2.update();
|
|
}, [isAdapted]), itemContext.shouldRenderWebNative) return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, {
|
|
children
|
|
});
|
|
if (isAdapted || !isWeb) {
|
|
let content = children;
|
|
return needsRepropagation3 && (content = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ForwardSelectContext, {
|
|
itemContext,
|
|
context: context2,
|
|
children: content
|
|
})), /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AdaptPortalContents, {
|
|
scope: context2.adaptScope,
|
|
children: content
|
|
});
|
|
}
|
|
if (!itemContext.interactions) return process.env.NODE_ENV === "development" && console.warn("No interactions provided to Select, potentially missing Adapt"), null;
|
|
const {
|
|
style,
|
|
// remove this, it was set to "Select" always
|
|
className,
|
|
...floatingProps
|
|
} = itemContext.interactions.getFloatingProps();
|
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, {
|
|
children: [!disableScroll && !props.unstyled && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("style", {
|
|
dangerouslySetInnerHTML: {
|
|
__html: selectViewportCSS
|
|
}
|
|
}), /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AnimatePresence, {
|
|
children: context2.open ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FloatingFocusManager, {
|
|
context: context2.floatingContext,
|
|
modal: false,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectViewportFrame, {
|
|
size: itemContext.size,
|
|
role: "presentation",
|
|
...viewportProps,
|
|
...style,
|
|
...floatingProps,
|
|
...!props.unstyled && {
|
|
overflowY: disableScroll ? void 0 : style.overflow ?? "auto"
|
|
},
|
|
ref: composedRefs,
|
|
children
|
|
}, "select-viewport")
|
|
}) : null
|
|
}), !context2.open && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
|
|
style: {
|
|
display: "none"
|
|
},
|
|
children: props.children
|
|
})]
|
|
});
|
|
});
|
|
var selectViewportCSS = `
|
|
.is_SelectViewport {
|
|
scrollbar-width: none;
|
|
-webkit-overflow-scrolling: touch;
|
|
overscroll-behavior: contain;
|
|
}
|
|
|
|
.is_SelectViewport::-webkit-scrollbar{
|
|
display:none
|
|
}
|
|
`;
|
|
|
|
// node_modules/@tamagui/select/dist/esm/Select.mjs
|
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
var VALUE_NAME = "SelectValue";
|
|
var SelectValueFrame = (0, import_core41.styled)(SizableText2, {
|
|
name: VALUE_NAME,
|
|
userSelect: "none"
|
|
});
|
|
var SelectValue = SelectValueFrame.styleable(function({
|
|
scope,
|
|
children: childrenProp,
|
|
placeholder,
|
|
...props
|
|
}, forwardedRef) {
|
|
const context2 = useSelectContext(scope), itemParentContext = useSelectItemParentContext(scope), composedRefs = useComposedRefs(forwardedRef, context2.onValueNodeChange), children = childrenProp ?? context2.selectedItem, selectValueChildren = context2.value == null || context2.value === "" ? placeholder ?? children : children;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValueFrame, {
|
|
...!props.unstyled && {
|
|
size: itemParentContext.size,
|
|
ellipse: true,
|
|
// we don't want events from the portalled `SelectValue` children to bubble
|
|
// through the item they came from
|
|
pointerEvents: "none"
|
|
},
|
|
ref: composedRefs,
|
|
...props,
|
|
children: unwrapSelectItem(selectValueChildren)
|
|
});
|
|
});
|
|
function unwrapSelectItem(selectValueChildren) {
|
|
return React67.Children.map(selectValueChildren, (child) => {
|
|
if (child) {
|
|
if (child.type?.staticConfig?.componentName === ITEM_TEXT_NAME) return child.props.children;
|
|
if (child.props?.children) return unwrapSelectItem(child.props.children);
|
|
}
|
|
return child;
|
|
});
|
|
}
|
|
__name(unwrapSelectItem, "unwrapSelectItem");
|
|
var SelectIcon = (0, import_core41.styled)(XStack, {
|
|
name: "SelectIcon",
|
|
// @ts-ignore
|
|
"aria-hidden": true,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Paragraph, {
|
|
children: "\u25BC"
|
|
})
|
|
});
|
|
var SelectItemIndicatorFrame = (0, import_core41.styled)(XStack, {
|
|
name: "SelectItemIndicator"
|
|
});
|
|
var SelectItemIndicator = React67.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
scope,
|
|
...itemIndicatorProps
|
|
} = props, context2 = useSelectItemParentContext(scope), itemContext = useSelectItemContext(scope);
|
|
return context2.shouldRenderWebNative ? null : itemContext.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItemIndicatorFrame, {
|
|
"aria-hidden": true,
|
|
...itemIndicatorProps,
|
|
ref: forwardedRef
|
|
}) : null;
|
|
});
|
|
var GROUP_NAME3 = "SelectGroup";
|
|
var {
|
|
Provider: SelectGroupContextProvider,
|
|
useStyledContext: useSelectGroupContext
|
|
} = (0, import_core41.createStyledContext)({
|
|
id: ""
|
|
}, "SelectGroup");
|
|
var SelectGroupFrame = (0, import_core41.styled)(YStack, {
|
|
name: GROUP_NAME3,
|
|
width: "100%"
|
|
});
|
|
var NativeSelectTextFrame = (0, import_core41.styled)(SizableText2, {
|
|
tag: "select",
|
|
backgroundColor: "$background",
|
|
borderColor: "$borderColor",
|
|
hoverStyle: {
|
|
backgroundColor: "$backgroundHover"
|
|
}
|
|
});
|
|
var NativeSelectFrame = (0, import_core41.styled)(ThemeableStack, {
|
|
name: "NativeSelect",
|
|
bordered: true,
|
|
userSelect: "none",
|
|
outlineWidth: 0,
|
|
paddingRight: 10,
|
|
variants: {
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val, extras) => {
|
|
const {
|
|
tokens
|
|
} = extras, paddingHorizontal = (0, import_core41.getVariableValue)(tokens.space[val]);
|
|
return {
|
|
borderRadius: tokens.radius[val] ?? val,
|
|
minHeight: tokens.size[val],
|
|
paddingRight: paddingHorizontal + 20,
|
|
paddingLeft: paddingHorizontal,
|
|
paddingVertical: getSpace(val, {
|
|
shift: -3
|
|
})
|
|
};
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
size: "$2"
|
|
}
|
|
});
|
|
var SelectGroup = React67.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
scope,
|
|
...groupProps
|
|
} = props, groupId = React67.useId(), context2 = useSelectContext(scope), itemParentContext = useSelectItemParentContext(scope), size4 = itemParentContext.size ?? "$true", nativeSelectRef = React67.useRef(null), content = itemParentContext.shouldRenderWebNative ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NativeSelectFrame, {
|
|
asChild: true,
|
|
size: size4,
|
|
value: context2.value,
|
|
id: itemParentContext.id,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NativeSelectTextFrame, {
|
|
onChange: /* @__PURE__ */ __name((event) => {
|
|
itemParentContext.onChange(event.currentTarget.value);
|
|
}, "onChange"),
|
|
size: size4,
|
|
ref: nativeSelectRef,
|
|
style: {
|
|
color: "var(--color)",
|
|
// @ts-ignore
|
|
appearance: "none"
|
|
},
|
|
children: props.children
|
|
})
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectGroupFrame, {
|
|
role: "group",
|
|
"aria-labelledby": groupId,
|
|
...groupProps,
|
|
ref: forwardedRef
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectGroupContextProvider, {
|
|
scope,
|
|
id: groupId || "",
|
|
children: content
|
|
});
|
|
});
|
|
SelectGroup.displayName = GROUP_NAME3;
|
|
var LABEL_NAME = "SelectLabel";
|
|
var SelectLabel = React67.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
scope,
|
|
...labelProps
|
|
} = props, context2 = useSelectItemParentContext(scope), groupContext = useSelectGroupContext(scope);
|
|
return context2.shouldRenderWebNative ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ListItem2, {
|
|
tag: "div",
|
|
componentName: LABEL_NAME,
|
|
fontWeight: "800",
|
|
id: groupContext.id,
|
|
size: context2.size,
|
|
...labelProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
SelectLabel.displayName = LABEL_NAME;
|
|
var SelectSeparator = (0, import_core41.styled)(Separator, {
|
|
name: "SelectSeparator"
|
|
});
|
|
var SelectSheetController = /* @__PURE__ */ __name((props) => {
|
|
const context2 = useSelectContext(props.scope), showSheet = useShowSelectSheet(context2), isAdapted = useAdaptIsActive(context2.adaptScope), getShowSheet = (0, import_core41.useGet)(showSheet);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SheetController, {
|
|
onOpenChange: /* @__PURE__ */ __name((val) => {
|
|
getShowSheet() && props.onOpenChange(val);
|
|
}, "onOpenChange"),
|
|
open: context2.open,
|
|
hidden: !isAdapted,
|
|
children: props.children
|
|
});
|
|
}, "SelectSheetController");
|
|
var SelectSheetImpl = /* @__PURE__ */ __name((props) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_jsx_runtime54.Fragment, {
|
|
children: props.children
|
|
}), "SelectSheetImpl");
|
|
var Select = withStaticProperties(function(props) {
|
|
const adaptScope = `AdaptSelect${props.scope || ""}`;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(AdaptParent, {
|
|
scope: adaptScope,
|
|
portal: true,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectInner, {
|
|
scope: props.scope,
|
|
adaptScope,
|
|
...props
|
|
})
|
|
});
|
|
}, {
|
|
Adapt,
|
|
Content: SelectContent,
|
|
Group: SelectGroup,
|
|
Icon: SelectIcon,
|
|
Item: SelectItem,
|
|
ItemIndicator: SelectItemIndicator,
|
|
ItemText: SelectItemText,
|
|
Label: SelectLabel,
|
|
ScrollDownButton: SelectScrollDownButton,
|
|
ScrollUpButton: SelectScrollUpButton,
|
|
Trigger: SelectTrigger,
|
|
Value: SelectValue,
|
|
Viewport: SelectViewport,
|
|
Sheet: Sheet.Controlled,
|
|
FocusScope: FocusScopeControllerComponent
|
|
});
|
|
function useEmitter() {
|
|
const listeners = React67.useRef(null);
|
|
listeners.current || (listeners.current = /* @__PURE__ */ new Set());
|
|
const emit = /* @__PURE__ */ __name((value) => {
|
|
listeners.current.forEach((l) => l(value));
|
|
}, "emit"), subscribe3 = React67.useCallback((listener) => (listeners.current.add(listener), () => {
|
|
listeners.current.delete(listener);
|
|
}), []);
|
|
return [emit, subscribe3];
|
|
}
|
|
__name(useEmitter, "useEmitter");
|
|
function SelectInner(props) {
|
|
const {
|
|
scope = "",
|
|
adaptScope,
|
|
native,
|
|
children,
|
|
open: openProp,
|
|
defaultOpen,
|
|
onOpenChange,
|
|
value: valueProp,
|
|
defaultValue: defaultValue2,
|
|
onValueChange,
|
|
disablePreventBodyScroll,
|
|
size: sizeProp = "$true",
|
|
onActiveChange,
|
|
dir,
|
|
id
|
|
} = props, SelectImpl = useAdaptIsActive(adaptScope) || !isWeb ? SelectSheetImpl : SelectInlineImpl, forceUpdate = React67.useReducer(() => ({}), {})[1], [selectedItem, setSelectedItem] = React67.useState(null), [open, setOpen] = useControllableState({
|
|
prop: openProp,
|
|
defaultProp: defaultOpen || false,
|
|
onChange: onOpenChange
|
|
}), [value, setValue] = useControllableState({
|
|
prop: valueProp,
|
|
defaultProp: defaultValue2 || "",
|
|
onChange: onValueChange,
|
|
transition: true
|
|
});
|
|
React67.useEffect(() => {
|
|
open && emitValue(value);
|
|
}, [open]), React67.useEffect(() => {
|
|
emitValue(value);
|
|
}, [value]);
|
|
const [activeIndex, setActiveIndex] = React67.useState(0), [emitValue, valueSubscribe] = useEmitter(), [emitActiveIndex, activeIndexSubscribe] = useEmitter(), selectedIndexRef = React67.useRef(null), activeIndexRef = React67.useRef(null), listContentRef = React67.useRef([]), [selectedIndex, setSelectedIndex] = React67.useState(0), [valueNode, setValueNode] = React67.useState(null);
|
|
useIsomorphicLayoutEffect(() => {
|
|
selectedIndexRef.current = selectedIndex, activeIndexRef.current = activeIndex;
|
|
});
|
|
const shouldRenderWebNative = isWeb && (native === true || native === "web" || Array.isArray(native) && native.includes("web")), setActiveIndexDebounced = useDebounce((index5) => {
|
|
setActiveIndex((prev) => prev !== index5 ? (typeof index5 == "number" && emitActiveIndex(index5), index5) : prev);
|
|
}, 1, {}, []);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItemParentProvider, {
|
|
scopeName: scope,
|
|
scope,
|
|
adaptScope,
|
|
initialValue: React67.useMemo(() => value, [open]),
|
|
size: sizeProp,
|
|
activeIndexSubscribe,
|
|
valueSubscribe,
|
|
setOpen,
|
|
id,
|
|
onChange: React67.useCallback((val) => {
|
|
setValue(val), emitValue(val);
|
|
}, []),
|
|
onActiveChange: (0, import_core41.useEvent)((value2, index5) => {
|
|
onActiveChange?.(value2, index5);
|
|
}),
|
|
setSelectedIndex,
|
|
setValueAtIndex: React67.useCallback((index5, value2) => {
|
|
listContentRef.current[index5] = value2;
|
|
}, []),
|
|
shouldRenderWebNative,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectProvider, {
|
|
scope,
|
|
scopeName: scope,
|
|
adaptScope,
|
|
disablePreventBodyScroll,
|
|
dir,
|
|
blockSelection: false,
|
|
fallback: false,
|
|
selectedItem,
|
|
setSelectedItem,
|
|
forceUpdate,
|
|
valueNode,
|
|
onValueNodeChange: setValueNode,
|
|
activeIndex,
|
|
selectedIndex,
|
|
setActiveIndex: setActiveIndexDebounced,
|
|
value,
|
|
open,
|
|
native,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectSheetController, {
|
|
onOpenChange: setOpen,
|
|
scope,
|
|
children: shouldRenderWebNative ? children : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectImpl, {
|
|
activeIndexRef,
|
|
listContentRef,
|
|
selectedIndexRef,
|
|
...props,
|
|
open,
|
|
value,
|
|
children
|
|
})
|
|
})
|
|
})
|
|
});
|
|
}
|
|
__name(SelectInner, "SelectInner");
|
|
|
|
// node_modules/@tamagui/slider/dist/esm/Slider.mjs
|
|
var import_core44 = require("@tamagui/core");
|
|
var React69 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/slider/dist/esm/constants.mjs
|
|
var import_core42 = require("@tamagui/core");
|
|
var SLIDER_NAME = "Slider";
|
|
var SliderContext = (0, import_core42.createStyledContext)({
|
|
size: "$true",
|
|
min: 0,
|
|
max: 100,
|
|
orientation: "horizontal"
|
|
});
|
|
var {
|
|
Provider: SliderProvider,
|
|
useStyledContext: useSliderContext
|
|
} = SliderContext;
|
|
var {
|
|
Provider: SliderOrientationProvider,
|
|
useStyledContext: useSliderOrientationContext
|
|
} = (0, import_core42.createStyledContext)({
|
|
startEdge: "left",
|
|
endEdge: "right",
|
|
sizeProp: "width",
|
|
size: 0,
|
|
direction: 1
|
|
});
|
|
var PAGE_KEYS = ["PageUp", "PageDown"];
|
|
var ARROW_KEYS2 = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
var BACK_KEYS = {
|
|
ltr: ["ArrowDown", "Home", "ArrowLeft", "PageDown"],
|
|
rtl: ["ArrowDown", "Home", "ArrowRight", "PageDown"]
|
|
};
|
|
|
|
// node_modules/@tamagui/slider/dist/esm/helpers.mjs
|
|
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
const nextValues = [...prevValues];
|
|
return nextValues[atIndex] = nextValue, nextValues.sort((a, b) => a - b);
|
|
}
|
|
__name(getNextSortedValues, "getNextSortedValues");
|
|
function convertValueToPercentage(value, min2, max2) {
|
|
return 100 / (max2 - min2) * (value - min2);
|
|
}
|
|
__name(convertValueToPercentage, "convertValueToPercentage");
|
|
function getLabel(index5, totalValues) {
|
|
if (totalValues > 2) return `Value ${index5 + 1} of ${totalValues}`;
|
|
if (totalValues === 2) return ["Minimum", "Maximum"][index5];
|
|
}
|
|
__name(getLabel, "getLabel");
|
|
function getClosestValueIndex(values, nextValue) {
|
|
if (values.length === 1) return 0;
|
|
const distances = values.map((value) => Math.abs(value - nextValue)), closestDistance = Math.min(...distances);
|
|
return distances.indexOf(closestDistance);
|
|
}
|
|
__name(getClosestValueIndex, "getClosestValueIndex");
|
|
function getThumbInBoundsOffset(width, left, direction) {
|
|
const quarterWidth = width / 4, offset4 = linearScale([0, 50], [0, quarterWidth]);
|
|
return (quarterWidth - offset4(left) * direction) * direction;
|
|
}
|
|
__name(getThumbInBoundsOffset, "getThumbInBoundsOffset");
|
|
function getStepsBetweenValues(values) {
|
|
return values.slice(0, -1).map((value, index5) => values[index5 + 1] - value);
|
|
}
|
|
__name(getStepsBetweenValues, "getStepsBetweenValues");
|
|
function hasMinStepsBetweenValues(values, minStepsBetweenValues) {
|
|
if (minStepsBetweenValues > 0) {
|
|
const stepsBetweenValues = getStepsBetweenValues(values);
|
|
return Math.min(...stepsBetweenValues) >= minStepsBetweenValues;
|
|
}
|
|
return true;
|
|
}
|
|
__name(hasMinStepsBetweenValues, "hasMinStepsBetweenValues");
|
|
function linearScale(input, output) {
|
|
return (value) => {
|
|
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
return output[0] + ratio * (value - input[0]);
|
|
};
|
|
}
|
|
__name(linearScale, "linearScale");
|
|
function getDecimalCount(value) {
|
|
return (String(value).split(".")[1] || "").length;
|
|
}
|
|
__name(getDecimalCount, "getDecimalCount");
|
|
function roundValue(value, decimalCount) {
|
|
const rounder = 10 ** decimalCount;
|
|
return Math.round(value * rounder) / rounder;
|
|
}
|
|
__name(roundValue, "roundValue");
|
|
|
|
// node_modules/@tamagui/slider/dist/esm/SliderImpl.mjs
|
|
var import_core43 = require("@tamagui/core");
|
|
var React68 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
var SliderFrame = (0, import_core43.styled)(YStack, {
|
|
position: "relative",
|
|
variants: {
|
|
orientation: {
|
|
horizontal: {},
|
|
vertical: {}
|
|
},
|
|
size: /* @__PURE__ */ __name((val, extras) => {
|
|
if (!val) return;
|
|
const orientation = extras.props.orientation, size4 = Math.round((0, import_core43.getVariableValue)(getSize(val)) / 6);
|
|
return orientation === "horizontal" ? {
|
|
height: size4,
|
|
borderRadius: size4,
|
|
justifyContent: "center"
|
|
} : {
|
|
width: size4,
|
|
borderRadius: size4,
|
|
alignItems: "center"
|
|
};
|
|
}, "size")
|
|
}
|
|
});
|
|
var SliderImpl = React68.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeSlider,
|
|
onSlideStart,
|
|
onSlideMove,
|
|
onSlideEnd,
|
|
onHomeKeyDown,
|
|
onEndKeyDown,
|
|
onStepKeyDown,
|
|
...sliderProps
|
|
} = props, context2 = useSliderContext(__scopeSlider);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SliderFrame, {
|
|
size: "$4",
|
|
...sliderProps,
|
|
"data-orientation": sliderProps.orientation,
|
|
ref: forwardedRef,
|
|
...isWeb && {
|
|
onKeyDown: /* @__PURE__ */ __name((event) => {
|
|
event.key === "Home" ? (onHomeKeyDown(event), event.preventDefault()) : event.key === "End" ? (onEndKeyDown(event), event.preventDefault()) : PAGE_KEYS.concat(ARROW_KEYS2).includes(event.key) && (onStepKeyDown(event), event.preventDefault());
|
|
}, "onKeyDown")
|
|
},
|
|
onMoveShouldSetResponderCapture: /* @__PURE__ */ __name(() => true, "onMoveShouldSetResponderCapture"),
|
|
onScrollShouldSetResponder: /* @__PURE__ */ __name(() => true, "onScrollShouldSetResponder"),
|
|
onScrollShouldSetResponderCapture: /* @__PURE__ */ __name(() => true, "onScrollShouldSetResponderCapture"),
|
|
onMoveShouldSetResponder: /* @__PURE__ */ __name(() => true, "onMoveShouldSetResponder"),
|
|
onStartShouldSetResponder: /* @__PURE__ */ __name(() => true, "onStartShouldSetResponder"),
|
|
onResponderTerminationRequest: /* @__PURE__ */ __name(() => false, "onResponderTerminationRequest"),
|
|
onResponderGrant: composeEventHandlers(props.onResponderGrant, (event) => {
|
|
const target = event.target, thumbIndex = context2.thumbs.get(target), isStartingOnThumb = thumbIndex !== void 0;
|
|
isWeb && target instanceof HTMLElement && context2.thumbs.has(target) && target.focus(), !isWeb && isStartingOnThumb && (context2.valueIndexToChangeRef.current = thumbIndex), onSlideStart(event, isStartingOnThumb ? "thumb" : "track");
|
|
}),
|
|
onResponderMove: composeEventHandlers(props.onResponderMove, (event) => {
|
|
event.stopPropagation(), onSlideMove(event);
|
|
}),
|
|
onResponderRelease: composeEventHandlers(props.onResponderRelease, (event) => {
|
|
onSlideEnd(event);
|
|
})
|
|
});
|
|
});
|
|
|
|
// node_modules/@tamagui/slider/dist/esm/Slider.mjs
|
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
var activeSliderMeasureListeners = /* @__PURE__ */ new Set();
|
|
isWeb && isClient && (process.env.TAMAGUI_DISABLE_SLIDER_INTERVAL || setInterval?.(
|
|
() => {
|
|
activeSliderMeasureListeners.forEach((cb) => cb());
|
|
},
|
|
// really doesn't need to be super often
|
|
1e3
|
|
));
|
|
var SliderHorizontal = React69.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
min: min2,
|
|
max: max2,
|
|
dir,
|
|
onSlideStart,
|
|
onSlideMove,
|
|
onStepKeyDown,
|
|
onSlideEnd,
|
|
...sliderProps
|
|
} = props, direction = useDirection(dir), isDirectionLTR = direction === "ltr", sliderRef = React69.useRef(null), [state, setState_] = React69.useState(() => ({
|
|
size: 0,
|
|
offset: 0
|
|
})), setState = (0, import_core44.useCreateShallowSetState)(setState_);
|
|
function getValueFromPointer(pointerPosition) {
|
|
const input = [0, state.size];
|
|
return linearScale(input, isDirectionLTR ? [min2, max2] : [max2, min2])(pointerPosition);
|
|
}
|
|
__name(getValueFromPointer, "getValueFromPointer");
|
|
const measure = /* @__PURE__ */ __name(() => {
|
|
sliderRef.current?.measure((_x, _y, width, _height, pageX, _pageY) => {
|
|
setState({
|
|
size: width,
|
|
offset: pageX
|
|
});
|
|
});
|
|
}, "measure");
|
|
return isClient && (useOnDebouncedWindowResize(measure), React69.useEffect(() => {
|
|
const node = sliderRef.current;
|
|
if (!node) return;
|
|
let measureTm;
|
|
const debouncedMeasure = /* @__PURE__ */ __name(() => {
|
|
clearTimeout(measureTm), measureTm = setTimeout(() => {
|
|
measure();
|
|
}, 200);
|
|
}, "debouncedMeasure"), io = new IntersectionObserver((entries) => {
|
|
debouncedMeasure(), entries?.[0].isIntersecting ? activeSliderMeasureListeners.add(debouncedMeasure) : activeSliderMeasureListeners.delete(debouncedMeasure);
|
|
}, {
|
|
root: null,
|
|
// Use the viewport as the container.
|
|
rootMargin: "0px",
|
|
threshold: [0, 0.5, 1]
|
|
});
|
|
return io.observe(node), () => {
|
|
activeSliderMeasureListeners.delete(debouncedMeasure), io.disconnect();
|
|
};
|
|
}, [])), /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderOrientationProvider, {
|
|
scope: props.__scopeSlider,
|
|
startEdge: isDirectionLTR ? "left" : "right",
|
|
endEdge: isDirectionLTR ? "right" : "left",
|
|
direction: isDirectionLTR ? 1 : -1,
|
|
sizeProp: "width",
|
|
size: state.size,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderImpl, {
|
|
ref: composeRefs(forwardedRef, sliderRef),
|
|
dir: direction,
|
|
...sliderProps,
|
|
orientation: "horizontal",
|
|
onLayout: measure,
|
|
onSlideStart: /* @__PURE__ */ __name((event, target) => {
|
|
const value = getValueFromPointer(event.nativeEvent.locationX);
|
|
value && onSlideStart?.(value, target, event);
|
|
}, "onSlideStart"),
|
|
onSlideMove: /* @__PURE__ */ __name((event) => {
|
|
const value = getValueFromPointer(event.nativeEvent.pageX - state.offset);
|
|
value && onSlideMove?.(value, event);
|
|
}, "onSlideMove"),
|
|
onSlideEnd: /* @__PURE__ */ __name((event) => {
|
|
const value = getValueFromPointer(event.nativeEvent.pageX - state.offset);
|
|
value && onSlideEnd?.(event, value);
|
|
}, "onSlideEnd"),
|
|
onStepKeyDown: /* @__PURE__ */ __name((event) => {
|
|
const isBackKey = BACK_KEYS[direction].includes(event.key);
|
|
onStepKeyDown?.({
|
|
event,
|
|
direction: isBackKey ? -1 : 1
|
|
});
|
|
}, "onStepKeyDown")
|
|
})
|
|
});
|
|
});
|
|
function useOnDebouncedWindowResize(callback, amt = 200) {
|
|
React69.useEffect(() => {
|
|
let last;
|
|
const onResize = /* @__PURE__ */ __name(() => {
|
|
clearTimeout(last), last = setTimeout(callback, amt);
|
|
}, "onResize");
|
|
return window.addEventListener("resize", onResize), () => {
|
|
clearTimeout(last), window.removeEventListener("resize", onResize);
|
|
};
|
|
}, []);
|
|
}
|
|
__name(useOnDebouncedWindowResize, "useOnDebouncedWindowResize");
|
|
var SliderVertical = React69.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
min: min2,
|
|
max: max2,
|
|
onSlideStart,
|
|
onSlideMove,
|
|
onStepKeyDown,
|
|
onSlideEnd,
|
|
...sliderProps
|
|
} = props, [state, setState_] = React69.useState(() => ({
|
|
size: 0,
|
|
offset: 0
|
|
})), setState = (0, import_core44.useCreateShallowSetState)(setState_), sliderRef = React69.useRef(null);
|
|
function getValueFromPointer(pointerPosition) {
|
|
const input = [0, state.size];
|
|
return linearScale(input, [max2, min2])(pointerPosition);
|
|
}
|
|
__name(getValueFromPointer, "getValueFromPointer");
|
|
const measure = /* @__PURE__ */ __name(() => {
|
|
sliderRef.current?.measure((_x, _y, _width, height, _pageX, pageY) => {
|
|
setState({
|
|
size: height,
|
|
offset: pageY
|
|
});
|
|
});
|
|
}, "measure");
|
|
return isClient && useOnDebouncedWindowResize(measure), /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderOrientationProvider, {
|
|
scope: props.__scopeSlider,
|
|
startEdge: "bottom",
|
|
endEdge: "top",
|
|
sizeProp: "height",
|
|
size: state.size,
|
|
direction: 1,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderImpl, {
|
|
ref: composeRefs(forwardedRef, sliderRef),
|
|
...sliderProps,
|
|
orientation: "vertical",
|
|
onLayout: measure,
|
|
onSlideStart: /* @__PURE__ */ __name((event, target) => {
|
|
const value = getValueFromPointer(event.nativeEvent.locationY);
|
|
value && onSlideStart?.(value, target, event);
|
|
}, "onSlideStart"),
|
|
onSlideMove: /* @__PURE__ */ __name((event) => {
|
|
const value = getValueFromPointer(event.nativeEvent.pageY - state.offset);
|
|
value && onSlideMove?.(value, event);
|
|
}, "onSlideMove"),
|
|
onSlideEnd: /* @__PURE__ */ __name((event) => {
|
|
const value = getValueFromPointer(event.nativeEvent.pageY - state.offset);
|
|
onSlideEnd?.(event, value);
|
|
}, "onSlideEnd"),
|
|
onStepKeyDown: /* @__PURE__ */ __name((event) => {
|
|
const isBackKey = BACK_KEYS.ltr.includes(event.key);
|
|
onStepKeyDown?.({
|
|
event,
|
|
direction: isBackKey ? -1 : 1
|
|
});
|
|
}, "onStepKeyDown")
|
|
})
|
|
});
|
|
});
|
|
var TRACK_NAME = "SliderTrack";
|
|
var SliderTrackFrame = (0, import_core44.styled)(SliderFrame, {
|
|
name: "SliderTrack",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
height: "100%",
|
|
width: "100%",
|
|
backgroundColor: "$background",
|
|
position: "relative",
|
|
borderRadius: 1e5,
|
|
overflow: "hidden"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var SliderTrack = React69.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeSlider,
|
|
...trackProps
|
|
} = props, context2 = useSliderContext(__scopeSlider);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderTrackFrame, {
|
|
"data-disabled": context2.disabled ? "" : void 0,
|
|
"data-orientation": context2.orientation,
|
|
orientation: context2.orientation,
|
|
size: context2.size,
|
|
...trackProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
SliderTrack.displayName = TRACK_NAME;
|
|
var RANGE_NAME = "SliderTrackActive";
|
|
var SliderTrackActiveFrame = (0, import_core44.styled)(SliderFrame, {
|
|
name: "SliderTrackActive",
|
|
backgroundColor: "$background",
|
|
position: "absolute",
|
|
pointerEvents: "box-none"
|
|
});
|
|
var SliderTrackActive = React69.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeSlider,
|
|
...rangeProps
|
|
} = props, context2 = useSliderContext(__scopeSlider), orientation = useSliderOrientationContext(__scopeSlider), ref = React69.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), valuesCount = context2.values.length, percentages = context2.values.map((value) => convertValueToPercentage(value, context2.min, context2.max)), offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0, offsetEnd = 100 - Math.max(...percentages);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderTrackActiveFrame, {
|
|
orientation: context2.orientation,
|
|
"data-orientation": context2.orientation,
|
|
"data-disabled": context2.disabled ? "" : void 0,
|
|
size: context2.size,
|
|
animateOnly: ["left", "top", "right", "bottom"],
|
|
...rangeProps,
|
|
ref: composedRefs,
|
|
[orientation.startEdge]: `${offsetStart}%`,
|
|
[orientation.endEdge]: `${offsetEnd}%`,
|
|
...orientation.sizeProp === "width" ? {
|
|
height: "100%"
|
|
} : {
|
|
left: 0,
|
|
right: 0
|
|
}
|
|
});
|
|
});
|
|
SliderTrackActive.displayName = RANGE_NAME;
|
|
var getThumbSize = /* @__PURE__ */ __name((val) => {
|
|
const tokens = (0, import_core44.getTokens)(), size4 = typeof val == "number" ? val : getSize(tokens.size[val], {
|
|
shift: -1
|
|
});
|
|
return {
|
|
width: size4,
|
|
height: size4,
|
|
minWidth: size4,
|
|
minHeight: size4
|
|
};
|
|
}, "getThumbSize");
|
|
var SliderThumbFrame = (0, import_core44.styled)(ThemeableStack, {
|
|
name: "SliderThumb",
|
|
variants: {
|
|
size: {
|
|
"...size": getThumbSize
|
|
},
|
|
unstyled: {
|
|
false: {
|
|
position: "absolute",
|
|
bordered: 2,
|
|
borderWidth: 2,
|
|
backgrounded: true,
|
|
pressTheme: isWeb,
|
|
focusTheme: isWeb,
|
|
hoverTheme: isWeb
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
__scopeSlider,
|
|
index: index5,
|
|
circular: circular2,
|
|
size: sizeProp,
|
|
...thumbProps
|
|
} = props, context2 = useSliderContext(__scopeSlider), orientation = useSliderOrientationContext(__scopeSlider), [thumb, setThumb] = React69.useState(null), composedRefs = useComposedRefs(forwardedRef, setThumb), value = context2.values[index5], percent = value === void 0 ? 0 : convertValueToPercentage(value, context2.min, context2.max), label = getLabel(index5, context2.values.length), sizeIn = sizeProp ?? context2.size ?? "$true", [size4, setSize] = React69.useState(() => (0, import_core44.getVariableValue)(getThumbSize(sizeIn).width)), thumbInBoundsOffset = size4 ? getThumbInBoundsOffset(size4, percent, orientation.direction) : 0;
|
|
React69.useEffect(() => {
|
|
if (thumb) return context2.thumbs.set(thumb, index5), () => {
|
|
context2.thumbs.delete(thumb);
|
|
};
|
|
}, [thumb, context2.thumbs, index5]);
|
|
const positionalStyles = context2.orientation === "horizontal" ? {
|
|
x: thumbInBoundsOffset - size4 / 2,
|
|
y: -size4 / 2,
|
|
top: "50%",
|
|
...size4 === 0 && {
|
|
top: "auto",
|
|
bottom: "auto"
|
|
}
|
|
} : {
|
|
x: -size4 / 2,
|
|
y: size4 / 2,
|
|
left: "50%",
|
|
...size4 === 0 && {
|
|
left: "auto",
|
|
right: "auto"
|
|
}
|
|
};
|
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderThumbFrame, {
|
|
ref: composedRefs,
|
|
role: "slider",
|
|
"aria-label": props["aria-label"] || label,
|
|
"aria-valuemin": context2.min,
|
|
"aria-valuenow": value,
|
|
"aria-valuemax": context2.max,
|
|
"aria-orientation": context2.orientation,
|
|
"data-orientation": context2.orientation,
|
|
"data-disabled": context2.disabled ? "" : void 0,
|
|
tabIndex: context2.disabled ? void 0 : 0,
|
|
animateOnly: ["transform", "left", "top", "right", "bottom"],
|
|
...positionalStyles,
|
|
[orientation.startEdge]: `${percent}%`,
|
|
size: sizeIn,
|
|
circular: circular2,
|
|
...thumbProps,
|
|
onLayout: /* @__PURE__ */ __name((e) => {
|
|
setSize(e.nativeEvent.layout[orientation.sizeProp]);
|
|
}, "onLayout"),
|
|
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
context2.valueIndexToChangeRef.current = index5;
|
|
})
|
|
});
|
|
}, {
|
|
staticConfig: {
|
|
memo: true
|
|
}
|
|
});
|
|
var SliderComponent = React69.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
name,
|
|
min: min2 = 0,
|
|
max: max2 = 100,
|
|
step = 1,
|
|
orientation = "horizontal",
|
|
disabled = false,
|
|
minStepsBetweenThumbs = 0,
|
|
defaultValue: defaultValue2 = [min2],
|
|
value,
|
|
onValueChange = /* @__PURE__ */ __name(() => {
|
|
}, "onValueChange"),
|
|
size: sizeProp,
|
|
onSlideEnd,
|
|
onSlideMove,
|
|
onSlideStart,
|
|
...sliderProps
|
|
} = props, sliderRef = React69.useRef(null), composedRefs = useComposedRefs(sliderRef, forwardedRef), thumbRefs = React69.useRef(/* @__PURE__ */ new Map()), valueIndexToChangeRef = React69.useRef(0), isHorizontal = orientation === "horizontal", [values = [], setValues] = useControllableState({
|
|
prop: value,
|
|
defaultProp: defaultValue2,
|
|
transition: true,
|
|
onChange: /* @__PURE__ */ __name((value2) => {
|
|
updateThumbFocus(valueIndexToChangeRef.current), onValueChange(value2);
|
|
}, "onChange")
|
|
});
|
|
isWeb && React69.useEffect(() => {
|
|
const node = sliderRef.current;
|
|
if (!node) return;
|
|
const preventDefault = /* @__PURE__ */ __name((e) => {
|
|
e.preventDefault();
|
|
}, "preventDefault");
|
|
return node.addEventListener("touchstart", preventDefault), () => {
|
|
node.removeEventListener("touchstart", preventDefault);
|
|
};
|
|
}, []);
|
|
function updateThumbFocus(focusIndex) {
|
|
if (isWeb) {
|
|
for (const [node, index5] of thumbRefs.current.entries()) if (index5 === focusIndex) {
|
|
node.focus();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
__name(updateThumbFocus, "updateThumbFocus");
|
|
function handleSlideMove(value2, event) {
|
|
updateValues(value2, valueIndexToChangeRef.current), onSlideMove?.(event, value2);
|
|
}
|
|
__name(handleSlideMove, "handleSlideMove");
|
|
function updateValues(value2, atIndex) {
|
|
const decimalCount = getDecimalCount(step), snapToStep = roundValue(Math.round((value2 - min2) / step) * step + min2, decimalCount), nextValue = clamp(snapToStep, [min2, max2]);
|
|
setValues((prevValues = []) => {
|
|
const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);
|
|
return hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step) ? (valueIndexToChangeRef.current = nextValues.indexOf(nextValue), String(nextValues) === String(prevValues) ? prevValues : nextValues) : prevValues;
|
|
});
|
|
}
|
|
__name(updateValues, "updateValues");
|
|
const SliderOriented = isHorizontal ? SliderHorizontal : SliderVertical;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderProvider, {
|
|
scope: props.__scopeSlider,
|
|
disabled,
|
|
min: min2,
|
|
max: max2,
|
|
valueIndexToChangeRef,
|
|
thumbs: thumbRefs.current,
|
|
values,
|
|
orientation,
|
|
size: sizeProp,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SliderOriented, {
|
|
"aria-disabled": disabled,
|
|
"data-disabled": disabled ? "" : void 0,
|
|
...sliderProps,
|
|
ref: composedRefs,
|
|
min: min2,
|
|
max: max2,
|
|
onSlideEnd,
|
|
onSlideStart: disabled ? void 0 : (value2, target, event) => {
|
|
if (target !== "thumb") {
|
|
const closestIndex = getClosestValueIndex(values, value2);
|
|
updateValues(value2, closestIndex);
|
|
}
|
|
onSlideStart?.(event, value2, target);
|
|
},
|
|
onSlideMove: disabled ? void 0 : handleSlideMove,
|
|
onHomeKeyDown: /* @__PURE__ */ __name(() => !disabled && updateValues(min2, 0), "onHomeKeyDown"),
|
|
onEndKeyDown: /* @__PURE__ */ __name(() => !disabled && updateValues(max2, values.length - 1), "onEndKeyDown"),
|
|
onStepKeyDown: /* @__PURE__ */ __name(({
|
|
event,
|
|
direction: stepDirection
|
|
}) => {
|
|
if (!disabled) {
|
|
const multiplier = PAGE_KEYS.includes(event.key) || event.shiftKey && ARROW_KEYS2.includes(event.key) ? 10 : 1, atIndex = valueIndexToChangeRef.current, value2 = values[atIndex], stepInDirection = step * multiplier * stepDirection;
|
|
updateValues(value2 + stepInDirection, atIndex);
|
|
}
|
|
}, "onStepKeyDown")
|
|
})
|
|
});
|
|
});
|
|
var Slider = withStaticProperties(SliderComponent, {
|
|
Track: SliderTrack,
|
|
TrackActive: SliderTrackActive,
|
|
Thumb: SliderThumb
|
|
});
|
|
Slider.displayName = SLIDER_NAME;
|
|
var Track = SliderTrack;
|
|
var Range = SliderTrackActive;
|
|
var Thumb = SliderThumb;
|
|
|
|
// node_modules/@tamagui/switch/dist/esm/createSwitch.mjs
|
|
var import_core47 = require("@tamagui/core");
|
|
|
|
// node_modules/@tamagui/switch-headless/dist/esm/useSwitch.mjs
|
|
var React70 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
function getState7(checked) {
|
|
return checked ? "checked" : "unchecked";
|
|
}
|
|
__name(getState7, "getState");
|
|
var BubbleInput3 = /* @__PURE__ */ __name((props) => {
|
|
const {
|
|
control,
|
|
checked,
|
|
bubbles = true,
|
|
...inputProps
|
|
} = props, ref = React70.useRef(null), prevChecked = usePrevious(checked);
|
|
return React70.useEffect(() => {
|
|
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(inputProto, "checked").set;
|
|
if (prevChecked !== checked && setChecked) {
|
|
const event = new Event("click", {
|
|
bubbles
|
|
});
|
|
setChecked.call(input, checked), input.dispatchEvent(event);
|
|
}
|
|
}, [prevChecked, checked, bubbles]), // @ts-ignore
|
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", {
|
|
type: "checkbox",
|
|
"aria-hidden": true,
|
|
defaultChecked: checked,
|
|
...inputProps,
|
|
tabIndex: -1,
|
|
ref,
|
|
style: {
|
|
...props.style,
|
|
position: "absolute",
|
|
pointerEvents: "none",
|
|
opacity: 0,
|
|
margin: 0
|
|
}
|
|
});
|
|
}, "BubbleInput");
|
|
function useSwitch(props, [checked, setChecked], ref) {
|
|
{
|
|
const {
|
|
disabled,
|
|
name,
|
|
value,
|
|
required
|
|
} = props, hasConsumerStoppedPropagationRef = React70.useRef(false), [button, setButton] = React70.useState(null), composedRefs = useComposedRefs(ref, setButton), isFormControl = isWeb ? button ? !!button.closest("form") : true : false, labelId = useLabelContext(button), ariaLabelledBy = props["aria-labelledby"] || props.labeledBy || labelId;
|
|
return {
|
|
switchProps: {
|
|
role: "switch",
|
|
"aria-checked": checked,
|
|
...isWeb ? {
|
|
tabIndex: disabled ? void 0 : 0,
|
|
"data-state": getState7(checked),
|
|
"data-disabled": disabled ? "" : void 0,
|
|
disabled
|
|
} : {},
|
|
"aria-labelledby": ariaLabelledBy,
|
|
onPress: composeEventHandlers(props.onPress, (event) => {
|
|
setChecked((prevChecked) => !prevChecked), isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
})
|
|
},
|
|
switchRef: composedRefs,
|
|
/**
|
|
* insert as a sibling of your switch (should not be inside the switch)
|
|
*/
|
|
bubbleInput: isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BubbleInput3, {
|
|
control: button,
|
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
name,
|
|
value,
|
|
checked,
|
|
required,
|
|
disabled,
|
|
style: {
|
|
transform: "translateX(-100%)"
|
|
}
|
|
}) : null
|
|
};
|
|
}
|
|
}
|
|
__name(useSwitch, "useSwitch");
|
|
|
|
// node_modules/@tamagui/switch/dist/esm/createSwitch.mjs
|
|
var React71 = __toESM(require("react"), 1);
|
|
var import_react_native_web7 = __toESM(require_cjs(), 1);
|
|
|
|
// node_modules/@tamagui/switch/dist/esm/StyledContext.mjs
|
|
var import_core45 = require("@tamagui/core");
|
|
var SwitchStyledContext = (0, import_core45.createStyledContext)({
|
|
size: void 0,
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
});
|
|
|
|
// node_modules/@tamagui/switch/dist/esm/Switch.mjs
|
|
var import_core46 = require("@tamagui/core");
|
|
var SwitchThumb = (0, import_core46.styled)(ThemeableStack, {
|
|
name: "SwitchThumb",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
size: "$true",
|
|
backgroundColor: "$background",
|
|
borderRadius: 1e3
|
|
}
|
|
},
|
|
checked: {
|
|
true: {}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val) => {
|
|
const size4 = getSwitchHeight(val);
|
|
return {
|
|
height: size4,
|
|
width: size4
|
|
};
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var getSwitchHeight = /* @__PURE__ */ __name((val) => Math.round((0, import_core46.getVariableValue)(getSize(val)) * 0.65), "getSwitchHeight");
|
|
var getSwitchWidth = /* @__PURE__ */ __name((val) => getSwitchHeight(val) * 2, "getSwitchWidth");
|
|
var SwitchFrame = (0, import_core46.styled)(YStack, {
|
|
name: "Switch",
|
|
tag: "button",
|
|
tabIndex: 0,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
borderRadius: 1e3,
|
|
backgroundColor: "$background",
|
|
borderWidth: 2,
|
|
borderColor: "$background",
|
|
focusVisibleStyle: {
|
|
outlineColor: "$outlineColor",
|
|
outlineStyle: "solid",
|
|
outlineWidth: 2
|
|
}
|
|
}
|
|
},
|
|
checked: {
|
|
true: {}
|
|
},
|
|
size: {
|
|
"...size": /* @__PURE__ */ __name((val) => {
|
|
const height = getSwitchHeight(val) + 4, width = getSwitchWidth(val) + 4;
|
|
return {
|
|
height,
|
|
minHeight: height,
|
|
width
|
|
};
|
|
}, "...size")
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
|
|
// node_modules/@tamagui/switch/dist/esm/createSwitch.mjs
|
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
var SwitchContext = React71.createContext({
|
|
checked: false,
|
|
disabled: false,
|
|
frameWidth: 0
|
|
});
|
|
function createSwitch(createProps) {
|
|
const {
|
|
disableActiveTheme,
|
|
Frame: Frame2 = SwitchFrame,
|
|
Thumb: Thumb2 = SwitchThumb
|
|
} = createProps;
|
|
process.env.NODE_ENV === "development" && (Frame2 !== SwitchFrame && Frame2.staticConfig.context && Frame2.staticConfig.context !== SwitchStyledContext || Thumb2 !== SwitchThumb && Thumb2.staticConfig.context && Thumb2.staticConfig.context !== SwitchStyledContext) && console.warn("Warning: createSwitch() needs to control context to pass checked state from Frame to Thumb, any custom context passed will be overridden."), Frame2.staticConfig.context = SwitchStyledContext, Thumb2.staticConfig.context = SwitchStyledContext;
|
|
const SwitchThumbComponent = Thumb2.styleable(function(props, forwardedRef) {
|
|
const {
|
|
size: sizeProp,
|
|
unstyled: unstyledProp,
|
|
nativeID,
|
|
...thumbProps
|
|
} = props, context2 = React71.useContext(SwitchContext), {
|
|
checked,
|
|
disabled,
|
|
frameWidth
|
|
} = context2, styledContext = SwitchStyledContext.useStyledContext(), {
|
|
unstyled: unstyledContext,
|
|
size: sizeContext
|
|
} = styledContext, unstyled = process.env.TAMAGUI_HEADLESS === "1" ? true : unstyledProp ?? unstyledContext ?? false, size4 = sizeProp ?? sizeContext ?? "$true", initialChecked = React71.useRef(checked).current, initialWidth = (0, import_core47.getVariableValue)(props.width, "size"), [thumbWidth, setThumbWidth] = React71.useState(typeof initialWidth == "number" ? initialWidth : 0), distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Thumb2, {
|
|
ref: forwardedRef,
|
|
unstyled,
|
|
...unstyled === false && {
|
|
size: size4,
|
|
...!disableActiveTheme && !unstyled && {
|
|
theme: checked ? "active" : null
|
|
}
|
|
},
|
|
alignSelf: initialChecked ? "flex-end" : "flex-start",
|
|
x,
|
|
onLayout: (0, import_core47.composeEventHandlers)(props.onLayout, (e) => {
|
|
const next = e.nativeEvent.layout.width;
|
|
next !== thumbWidth && setThumbWidth(next);
|
|
}),
|
|
checked,
|
|
disabled,
|
|
...thumbProps
|
|
});
|
|
}), SwitchComponent = Frame2.styleable(function(_props, forwardedRef) {
|
|
const {
|
|
native,
|
|
nativeProps,
|
|
checked: checkedProp,
|
|
defaultChecked,
|
|
onCheckedChange,
|
|
...props
|
|
} = _props, [checked, setChecked] = useControllableState({
|
|
prop: checkedProp,
|
|
defaultProp: defaultChecked || false,
|
|
onChange: onCheckedChange,
|
|
transition: true
|
|
}), styledContext = React71.useContext(SwitchStyledContext.context);
|
|
let estimatedInitialWidth = 0;
|
|
const estWidth = (0, import_core47.getVariableValue)((0, import_core47.getShorthandValue)(props, "width"), "size");
|
|
if (estWidth) {
|
|
const estPad = (0, import_core47.getShorthandValue)(props, "paddingHorizontal") ?? (0, import_core47.getShorthandValue)(props, "padding") ?? 0, estLeftPad = (0, import_core47.getShorthandValue)(props, "paddingLeft") ?? estPad ?? 0, estRightPad = (0, import_core47.getShorthandValue)(props, "paddingRight") ?? estPad ?? 0;
|
|
estimatedInitialWidth = estWidth - (estLeftPad ? (0, import_core47.getVariableValue)(estLeftPad, "size") : 0) - (estRightPad ? (0, import_core47.getVariableValue)(estRightPad, "size") : 0);
|
|
}
|
|
const [frameWidth, setFrameInnerWidth] = React71.useState(estimatedInitialWidth), {
|
|
switchProps,
|
|
bubbleInput,
|
|
switchRef
|
|
} = useSwitch(
|
|
// @ts-ignore
|
|
props,
|
|
[checked, setChecked],
|
|
// @ts-ignore TODO tamagui react 19 type error
|
|
forwardedRef
|
|
), renderNative = (0, import_core47.shouldRenderNativePlatform)(native);
|
|
if (renderNative === "android" || renderNative === "ios") return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_native_web7.Switch, {
|
|
value: checked,
|
|
onValueChange: setChecked,
|
|
...nativeProps
|
|
});
|
|
const disabled = props.disabled, value = React71.useMemo(() => ({
|
|
checked,
|
|
disabled,
|
|
frameWidth
|
|
}), [checked, disabled, frameWidth]), handleLayout = /* @__PURE__ */ __name((e) => {
|
|
const next = e.nativeEvent.layout.width;
|
|
next !== frameWidth && setFrameInnerWidth(next);
|
|
}, "handleLayout"), unstyled = styledContext.unstyled ?? props.unstyled ?? false;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(SwitchContext.Provider, {
|
|
value,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Frame2, {
|
|
ref: switchRef,
|
|
tag: "button",
|
|
...import_core47.isWeb && {
|
|
type: "button"
|
|
},
|
|
...!unstyled && {
|
|
size: styledContext.size ?? props.size ?? "$true"
|
|
},
|
|
unstyled,
|
|
...props,
|
|
...switchProps,
|
|
...!disableActiveTheme && !props.unstyled && {
|
|
theme: checked ? "active" : null
|
|
},
|
|
checked,
|
|
disabled,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_native_web7.View, {
|
|
style: measureContainerStyle,
|
|
onLayout: handleLayout,
|
|
children: frameWidth ? props.children : null
|
|
})
|
|
}), bubbleInput]
|
|
});
|
|
}, {
|
|
disableTheme: true
|
|
});
|
|
return (0, import_core47.withStaticProperties)(SwitchComponent, {
|
|
Thumb: SwitchThumbComponent
|
|
});
|
|
}
|
|
__name(createSwitch, "createSwitch");
|
|
var measureContainerStyle = {
|
|
alignSelf: "stretch",
|
|
flex: 1
|
|
};
|
|
|
|
// node_modules/@tamagui/switch/dist/esm/index.mjs
|
|
var Switch = createSwitch({
|
|
Frame: SwitchFrame,
|
|
Thumb: SwitchThumb
|
|
});
|
|
|
|
// node_modules/@tamagui/tabs/dist/esm/createTabs.mjs
|
|
var import_web18 = require("@tamagui/core");
|
|
var React72 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/tabs/dist/esm/Tabs.mjs
|
|
var import_core48 = require("@tamagui/core");
|
|
var TABS_NAME = "Tabs";
|
|
var DefaultTabsFrame = (0, import_core48.styled)(SizableStack, {
|
|
name: TABS_NAME
|
|
});
|
|
var TRIGGER_NAME5 = "TabsTrigger";
|
|
var DefaultTabsTabFrame = (0, import_core48.styled)(ThemeableStack, {
|
|
name: TRIGGER_NAME5,
|
|
tag: "button",
|
|
variants: {
|
|
size: {
|
|
"...size": getButtonSized
|
|
},
|
|
disabled: {
|
|
true: {
|
|
pointerEvents: "none"
|
|
}
|
|
},
|
|
unstyled: {
|
|
false: {
|
|
borderWidth: 0,
|
|
backgroundColor: "$background",
|
|
userSelect: "none",
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
flexWrap: "nowrap",
|
|
flexDirection: "row",
|
|
cursor: "pointer",
|
|
pressStyle: {
|
|
backgroundColor: "$backgroundPress"
|
|
},
|
|
hoverStyle: {
|
|
backgroundColor: "$backgroundHover"
|
|
},
|
|
focusStyle: {
|
|
backgroundColor: "$backgroundFocus"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var CONTENT_NAME4 = "TabsContent";
|
|
var DefaultTabsContentFrame = (0, import_core48.styled)(ThemeableStack, {
|
|
name: CONTENT_NAME4
|
|
});
|
|
|
|
// node_modules/@tamagui/tabs/dist/esm/StyledContext.mjs
|
|
var import_core49 = require("@tamagui/core");
|
|
var {
|
|
Provider: TabsProvider,
|
|
useStyledContext: useTabsContext
|
|
} = (0, import_core49.createStyledContext)();
|
|
|
|
// node_modules/@tamagui/tabs/dist/esm/createTabs.mjs
|
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
function createTabs(createProps) {
|
|
const {
|
|
ContentFrame = DefaultTabsContentFrame,
|
|
TabFrame = DefaultTabsTabFrame,
|
|
TabsFrame = DefaultTabsFrame
|
|
} = createProps, TABS_CONTEXT = "TabsContext", TAB_LIST_NAME = "TabsList", TabsList = React72.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeTabs,
|
|
loop = true,
|
|
children,
|
|
...listProps
|
|
} = props, context2 = useTabsContext(__scopeTabs);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RovingFocusGroup, {
|
|
__scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,
|
|
orientation: context2.orientation,
|
|
dir: context2.dir,
|
|
loop,
|
|
asChild: true,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Group, {
|
|
role: "tablist",
|
|
componentName: TAB_LIST_NAME,
|
|
"aria-orientation": context2.orientation,
|
|
ref: forwardedRef,
|
|
orientation: context2.orientation,
|
|
...listProps,
|
|
children
|
|
})
|
|
});
|
|
});
|
|
TabsList.displayName = TAB_LIST_NAME;
|
|
const TRIGGER_NAME6 = "TabsTrigger", TabsTrigger = TabFrame.styleable((props, forwardedRef) => {
|
|
const {
|
|
__scopeTabs,
|
|
value,
|
|
disabled = false,
|
|
onInteraction,
|
|
disableActiveTheme,
|
|
...triggerProps
|
|
} = props, context2 = useTabsContext(__scopeTabs), triggerId = makeTriggerId(context2.baseId, value), contentId = makeContentId(context2.baseId, value), isSelected = value === context2.value, [layout, setLayout] = React72.useState(null), triggerRef = React72.useRef(null), groupItemProps = useGroupItem({
|
|
disabled: !!disabled
|
|
});
|
|
return React72.useEffect(() => (context2.registerTrigger(), () => context2.unregisterTrigger()), []), React72.useEffect(() => {
|
|
if (!triggerRef.current || !isWeb) return;
|
|
function getTriggerSize() {
|
|
triggerRef.current && setLayout({
|
|
width: triggerRef.current.offsetWidth,
|
|
height: triggerRef.current.offsetHeight,
|
|
x: triggerRef.current.offsetLeft,
|
|
y: triggerRef.current.offsetTop
|
|
});
|
|
}
|
|
__name(getTriggerSize, "getTriggerSize");
|
|
getTriggerSize();
|
|
const observer = new ResizeObserver(getTriggerSize);
|
|
return observer.observe(triggerRef.current), () => {
|
|
triggerRef.current && observer.unobserve(triggerRef.current);
|
|
};
|
|
}, [context2.triggersCount]), React72.useEffect(() => {
|
|
isSelected && layout && onInteraction?.("select", layout);
|
|
}, [isSelected, value, layout]), /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_web18.Theme, {
|
|
name: isSelected && !disableActiveTheme ? "active" : null,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RovingFocusGroup.Item, {
|
|
__scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,
|
|
asChild: true,
|
|
focusable: !disabled,
|
|
active: isSelected,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TabFrame, {
|
|
onLayout: /* @__PURE__ */ __name((event) => {
|
|
isWeb || setLayout(event.nativeEvent.layout);
|
|
}, "onLayout"),
|
|
onHoverIn: composeEventHandlers(props.onHoverIn, () => {
|
|
layout && onInteraction?.("hover", layout);
|
|
}),
|
|
onHoverOut: composeEventHandlers(props.onHoverOut, () => {
|
|
onInteraction?.("hover", null);
|
|
}),
|
|
role: "tab",
|
|
"aria-selected": isSelected,
|
|
"aria-controls": contentId,
|
|
"data-state": isSelected ? "active" : "inactive",
|
|
"data-disabled": disabled ? "" : void 0,
|
|
disabled,
|
|
id: triggerId,
|
|
...!props.unstyled && {
|
|
size: context2.size
|
|
},
|
|
...isSelected && {
|
|
forceStyle: "focus"
|
|
},
|
|
...groupItemProps,
|
|
...triggerProps,
|
|
ref: composeRefs(forwardedRef, triggerRef),
|
|
onPress: composeEventHandlers(props.onPress ?? void 0, (event) => {
|
|
const webChecks = !isWeb || event.button === 0 && event.ctrlKey === false;
|
|
!disabled && !isSelected && webChecks ? context2.onChange(value) : event.preventDefault();
|
|
}),
|
|
...isWeb && {
|
|
type: "button",
|
|
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
[" ", "Enter"].includes(event.key) && (context2.onChange(value), event.preventDefault());
|
|
}),
|
|
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
layout && onInteraction?.("focus", layout);
|
|
const isAutomaticActivation = context2.activationMode !== "manual";
|
|
!isSelected && !disabled && isAutomaticActivation && context2.onChange(value);
|
|
}),
|
|
onBlur: composeEventHandlers(props.onFocus, () => {
|
|
onInteraction?.("focus", null);
|
|
})
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
TabsTrigger.displayName = TRIGGER_NAME6;
|
|
const TabsContent = ContentFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
__scopeTabs,
|
|
value,
|
|
forceMount,
|
|
children,
|
|
...contentProps
|
|
} = props, context2 = useTabsContext(__scopeTabs), isSelected = value === context2.value, show = forceMount || isSelected, triggerId = makeTriggerId(context2.baseId, value), contentId = makeContentId(context2.baseId, value);
|
|
return show ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ContentFrame, {
|
|
"data-state": isSelected ? "active" : "inactive",
|
|
"data-orientation": context2.orientation,
|
|
role: "tabpanel",
|
|
"aria-labelledby": triggerId,
|
|
hidden: !show,
|
|
id: contentId,
|
|
tabIndex: 0,
|
|
...contentProps,
|
|
ref: forwardedRef,
|
|
children
|
|
}, value) : null;
|
|
}), TabsComponent = TabsFrame.styleable(function(props, forwardedRef) {
|
|
const {
|
|
__scopeTabs,
|
|
value: valueProp,
|
|
onValueChange,
|
|
defaultValue: defaultValue2,
|
|
orientation = "horizontal",
|
|
dir,
|
|
activationMode = "automatic",
|
|
size: size4 = "$true",
|
|
...tabsProps
|
|
} = props, direction = useDirection(dir), [value, setValue] = useControllableState({
|
|
prop: valueProp,
|
|
onChange: onValueChange,
|
|
defaultProp: defaultValue2 ?? ""
|
|
}), [triggersCount, setTriggersCount] = React72.useState(0), registerTrigger = (0, import_web18.useEvent)(() => setTriggersCount((v) => v + 1)), unregisterTrigger = (0, import_web18.useEvent)(() => setTriggersCount((v) => v - 1));
|
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TabsProvider, {
|
|
scope: __scopeTabs,
|
|
baseId: React72.useId(),
|
|
value,
|
|
onChange: setValue,
|
|
orientation,
|
|
dir: direction,
|
|
activationMode,
|
|
size: size4,
|
|
registerTrigger,
|
|
triggersCount,
|
|
unregisterTrigger,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TabsFrame, {
|
|
direction,
|
|
"data-orientation": orientation,
|
|
...tabsProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
return withStaticProperties(TabsComponent, {
|
|
List: TabsList,
|
|
/**
|
|
* @deprecated Use Tabs.Tab instead
|
|
*/
|
|
Trigger: TabsTrigger,
|
|
Tab: TabsTrigger,
|
|
Content: TabsContent
|
|
});
|
|
}
|
|
__name(createTabs, "createTabs");
|
|
function makeTriggerId(baseId, value) {
|
|
return `${baseId}-trigger-${value}`;
|
|
}
|
|
__name(makeTriggerId, "makeTriggerId");
|
|
function makeContentId(baseId, value) {
|
|
return `${baseId}-content-${value}`;
|
|
}
|
|
__name(makeContentId, "makeContentId");
|
|
|
|
// node_modules/@tamagui/tabs/dist/esm/index.mjs
|
|
var Tabs = createTabs({
|
|
ContentFrame: DefaultTabsContentFrame,
|
|
TabFrame: DefaultTabsTabFrame,
|
|
TabsFrame: DefaultTabsFrame
|
|
});
|
|
|
|
// node_modules/@tamagui/theme/dist/esm/_mutateTheme.mjs
|
|
var import_web19 = require("@tamagui/core");
|
|
function mutateThemes({
|
|
themes,
|
|
batch,
|
|
insertCSS = true,
|
|
...props
|
|
}) {
|
|
const allThemesProxied = {}, allThemesRaw = {};
|
|
for (const {
|
|
name,
|
|
theme
|
|
} of themes) {
|
|
const res = _mutateTheme({
|
|
...props,
|
|
name,
|
|
theme,
|
|
// we'll do one update at the end
|
|
avoidUpdate: true,
|
|
// always add which also replaces but doesnt fail first time
|
|
mutationType: "add"
|
|
});
|
|
res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
|
|
}
|
|
const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
|
|
return startTransition(() => {
|
|
for (const themeName in allThemesProxied) {
|
|
const theme = allThemesProxied[themeName];
|
|
updateThemeConfig(themeName, theme);
|
|
}
|
|
updateThemeStates();
|
|
}), {
|
|
themes: allThemesProxied,
|
|
themesRaw: allThemesRaw,
|
|
cssRules
|
|
};
|
|
}
|
|
__name(mutateThemes, "mutateThemes");
|
|
function _mutateTheme(props) {
|
|
if (isServer) {
|
|
process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
|
|
return;
|
|
}
|
|
const config = (0, import_web19.getConfig)(), {
|
|
name: themeName,
|
|
theme: themeIn,
|
|
insertCSS,
|
|
mutationType
|
|
} = props;
|
|
if (process.env.NODE_ENV === "development") {
|
|
if (!config) throw new Error("No config");
|
|
const theme2 = config.themes[props.name];
|
|
if (mutationType !== "add" && !theme2) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
|
|
}
|
|
const theme = {
|
|
...mutationType === "update" ? config.themes[themeName] ?? {} : {},
|
|
...themeIn
|
|
};
|
|
for (const key in theme) (0, import_web19.ensureThemeVariable)(theme, key);
|
|
const themeProxied = (0, import_web19.proxyThemeToParents)(themeName, theme), response = {
|
|
themeRaw: theme,
|
|
theme: themeProxied,
|
|
cssRules: []
|
|
};
|
|
return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
|
|
[themeName]: theme
|
|
})), updateThemeConfig(themeName, themeProxied), updateThemeStates()), response;
|
|
}
|
|
__name(_mutateTheme, "_mutateTheme");
|
|
function updateThemeConfig(themeName, theme) {
|
|
const config = (0, import_web19.getConfig)();
|
|
config.themes[themeName] = theme, (0, import_web19.updateConfig)("themes", config.themes);
|
|
}
|
|
__name(updateThemeConfig, "updateThemeConfig");
|
|
function updateThemeStates() {
|
|
(0, import_web19.forceUpdateThemes)();
|
|
}
|
|
__name(updateThemeStates, "updateThemeStates");
|
|
function insertThemeCSS(themes, batch = false) {
|
|
const config = (0, import_web19.getConfig)();
|
|
let cssRules = [];
|
|
for (const themeName in themes) {
|
|
const theme = themes[themeName], rules = (0, import_web19.getThemeCSSRules)({
|
|
config,
|
|
themeName,
|
|
names: [themeName],
|
|
hasDarkLight: true,
|
|
theme
|
|
});
|
|
cssRules = [...cssRules, ...rules], batch || updateStyle(`t_theme_style_${themeName}`, rules);
|
|
}
|
|
if (batch) {
|
|
const id = typeof batch == "string" ? batch : (0, import_web19.simpleHash)(Object.keys(themes).join(""));
|
|
updateStyle(`t_theme_style_${id}`, cssRules);
|
|
}
|
|
return cssRules;
|
|
}
|
|
__name(insertThemeCSS, "insertThemeCSS");
|
|
function updateStyle(id, rules) {
|
|
const existing = document.querySelector(`#${id}`), style = document.createElement("style");
|
|
style.id = id, style.appendChild(document.createTextNode(rules.join(`
|
|
`))), document.head.appendChild(style), existing && existing.parentElement?.removeChild(existing);
|
|
}
|
|
__name(updateStyle, "updateStyle");
|
|
|
|
// node_modules/@tamagui/theme/dist/esm/addTheme.mjs
|
|
function addTheme(props) {
|
|
return _mutateTheme({
|
|
...props,
|
|
insertCSS: true,
|
|
mutationType: "add"
|
|
});
|
|
}
|
|
__name(addTheme, "addTheme");
|
|
|
|
// node_modules/@tamagui/theme/dist/esm/updateTheme.mjs
|
|
function updateTheme({
|
|
name,
|
|
theme
|
|
}) {
|
|
return _mutateTheme({
|
|
name,
|
|
theme,
|
|
insertCSS: true,
|
|
mutationType: "update"
|
|
});
|
|
}
|
|
__name(updateTheme, "updateTheme");
|
|
|
|
// node_modules/@tamagui/theme/dist/esm/replaceTheme.mjs
|
|
function replaceTheme({
|
|
name,
|
|
theme
|
|
}) {
|
|
return _mutateTheme({
|
|
name,
|
|
theme,
|
|
insertCSS: true,
|
|
mutationType: "replace"
|
|
});
|
|
}
|
|
__name(replaceTheme, "replaceTheme");
|
|
|
|
// node_modules/@tamagui/toggle-group/dist/esm/ToggleGroup.mjs
|
|
var import_web21 = require("@tamagui/core");
|
|
var import_react51 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/toggle-group/dist/esm/Toggle.mjs
|
|
var import_web20 = require("@tamagui/core");
|
|
var React73 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
var context = (0, import_web20.createStyledContext)({
|
|
color: ""
|
|
});
|
|
var NAME3 = "Toggle";
|
|
var ToggleFrame = (0, import_web20.styled)(ThemeableStack, {
|
|
name: NAME3,
|
|
tag: "button",
|
|
context,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
pressTheme: true,
|
|
backgroundColor: "$background",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
display: "flex",
|
|
borderColor: "$borderColor",
|
|
borderWidth: 1,
|
|
margin: -1,
|
|
hoverStyle: {
|
|
backgroundColor: "$backgroundHover"
|
|
},
|
|
pressStyle: {
|
|
backgroundColor: "$backgroundPress"
|
|
},
|
|
focusStyle: {
|
|
borderColor: "$borderColorFocus"
|
|
},
|
|
focusVisibleStyle: {
|
|
outlineColor: "$outlineColor",
|
|
outlineWidth: 2,
|
|
outlineStyle: "solid"
|
|
}
|
|
}
|
|
},
|
|
color: {
|
|
"...color": /* @__PURE__ */ __name(() => ({}), "...color")
|
|
},
|
|
active: {
|
|
true: {
|
|
zIndex: 1,
|
|
hoverStyle: {
|
|
backgroundColor: "$background"
|
|
},
|
|
focusStyle: {
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background"
|
|
}
|
|
}
|
|
},
|
|
orientation: {
|
|
horizontal: {
|
|
flexDirection: "row",
|
|
spaceDirection: "horizontal"
|
|
},
|
|
vertical: {
|
|
flexDirection: "column",
|
|
spaceDirection: "vertical"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var Toggle = React73.forwardRef(function(props, forwardedRef) {
|
|
const {
|
|
pressed: pressedProp,
|
|
defaultPressed = false,
|
|
onPressedChange,
|
|
...buttonProps
|
|
} = props, [pressed = false, setPressed] = useControllableState({
|
|
prop: pressedProp,
|
|
onChange: onPressedChange,
|
|
defaultProp: defaultPressed
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ToggleFrame, {
|
|
...!props.unstyled && {
|
|
theme: pressed ? "active" : null,
|
|
themeShallow: true
|
|
},
|
|
active: props.unstyled ? void 0 : pressed,
|
|
"aria-pressed": pressed,
|
|
"data-state": pressed ? "on" : "off",
|
|
"data-disabled": props.disabled ? "" : void 0,
|
|
...buttonProps,
|
|
ref: forwardedRef,
|
|
onPress: composeEventHandlers(props.onPress ?? void 0, () => {
|
|
props.disabled || setPressed(!pressed);
|
|
})
|
|
});
|
|
});
|
|
|
|
// node_modules/@tamagui/toggle-group/dist/esm/ToggleGroup.mjs
|
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
var TOGGLE_GROUP_NAME = "ToggleGroup";
|
|
var TOGGLE_GROUP_ITEM_NAME = "ToggleGroupItem";
|
|
var TOGGLE_GROUP_CONTEXT = "ToggleGroup";
|
|
var {
|
|
Provider: ToggleGroupItemProvider,
|
|
useStyledContext: useToggleGroupItemContext
|
|
} = (0, import_web21.createStyledContext)();
|
|
var {
|
|
Provider: ToggleGroupContext,
|
|
useStyledContext: useToggleGroupContext
|
|
} = (0, import_web21.createStyledContext)();
|
|
var ToggleGroupItem = ToggleFrame.extractable(import_react51.default.forwardRef((props, forwardedRef) => {
|
|
const [_, {
|
|
color
|
|
}] = (0, import_web21.usePropsAndStyle)(props), {
|
|
disablePassStyles,
|
|
...rest
|
|
} = props, valueContext = useToggleGroupValueContext(props.__scopeToggleGroup), context2 = useToggleGroupContext(props.__scopeToggleGroup), pressed = valueContext?.value.includes(props.value), disabled = context2.disabled || props.disabled || false, groupItemProps = useGroupItem({
|
|
disabled
|
|
}), size4 = props.size ?? context2.size, sizeProps = props.unstyled ? {} : {
|
|
width: void 0,
|
|
height: void 0,
|
|
padding: (0, import_web21.getVariableValue)(size4) * 0.6
|
|
}, iconSize = (typeof size4 == "number" ? size4 * 0.7 : getFontSize(size4)) * 1.2, theme = (0, import_web21.useTheme)(), getThemedIcon = useGetThemedIcon({
|
|
size: iconSize,
|
|
color: color ?? theme.color
|
|
}), children = import_react51.default.Children.toArray(props.children).map((child) => props.disablePassStyles || !import_react51.default.isValidElement(child) ? child : getThemedIcon(child)), commonProps = {
|
|
pressed,
|
|
disabled,
|
|
...sizeProps,
|
|
...rest,
|
|
children
|
|
}, inner2 = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupItemImpl, {
|
|
...commonProps,
|
|
ref: forwardedRef,
|
|
tabIndex: disabled ? -1 : 0,
|
|
disabled,
|
|
...groupItemProps
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupItemProvider, {
|
|
scope: props.__scopeToggleGroup,
|
|
children: context2.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RovingFocusGroup.Item, {
|
|
asChild: "except-style",
|
|
__scopeRovingFocusGroup: props.__scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
|
|
focusable: !disabled,
|
|
active: pressed,
|
|
children: inner2
|
|
}) : inner2
|
|
});
|
|
}));
|
|
ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
|
|
var ToggleGroupItemImpl = import_react51.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeToggleGroup,
|
|
value,
|
|
...itemProps
|
|
} = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
|
|
"aria-pressed": void 0
|
|
}, typeProps = valueContext.type === "single" ? singleProps : void 0;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Toggle, {
|
|
...typeProps,
|
|
...itemProps,
|
|
ref: forwardedRef,
|
|
onPressedChange: /* @__PURE__ */ __name((pressed) => {
|
|
pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
|
|
}, "onPressedChange")
|
|
});
|
|
});
|
|
var ToggleGroup = withStaticProperties(import_react51.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
type,
|
|
...toggleGroupProps
|
|
} = props;
|
|
if (isWeb || import_react51.default.useEffect(() => {
|
|
if (props.id) return registerFocusable(props.id, {
|
|
// TODO: would be nice to focus on the first child later - could be done with reforest
|
|
// for now leaving it empty
|
|
focus: /* @__PURE__ */ __name(() => {
|
|
}, "focus")
|
|
});
|
|
}, [props.id]), type === "single") return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupImplSingle, {
|
|
...toggleGroupProps,
|
|
ref: forwardedRef
|
|
});
|
|
if (type === "multiple") return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupImplMultiple, {
|
|
...toggleGroupProps,
|
|
ref: forwardedRef
|
|
});
|
|
throw new Error(`Missing prop \`type\` expected on \`${TOGGLE_GROUP_NAME}\``);
|
|
}), {
|
|
Item: ToggleGroupItem
|
|
});
|
|
ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
var {
|
|
Provider: ToggleGroupValueProvider,
|
|
useStyledContext: useToggleGroupValueContext
|
|
} = (0, import_web21.createStyledContext)();
|
|
var ToggleGroupImplSingle = import_react51.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
value: valueProp,
|
|
defaultValue: defaultValue2,
|
|
onValueChange = /* @__PURE__ */ __name(() => {
|
|
}, "onValueChange"),
|
|
disableDeactivation = false,
|
|
...toggleGroupSingleProps
|
|
} = props, [value, setValue] = useControllableState({
|
|
prop: valueProp,
|
|
defaultProp: defaultValue2,
|
|
onChange: onValueChange
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupValueProvider, {
|
|
scope: props.__scopeToggleGroup,
|
|
type: "single",
|
|
value: value ? [value] : [],
|
|
defaultValue: value,
|
|
onItemActivate: setValue,
|
|
onItemDeactivate: import_react51.default.useCallback(() => disableDeactivation ? null : setValue(""), [setValue, disableDeactivation]),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupImpl, {
|
|
...toggleGroupSingleProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
var ToggleGroupImplMultiple = import_react51.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
value: valueProp,
|
|
defaultValue: defaultValue2,
|
|
onValueChange = /* @__PURE__ */ __name(() => {
|
|
}, "onValueChange"),
|
|
disableDeactivation,
|
|
...toggleGroupMultipleProps
|
|
} = props, [value = [], setValue] = useControllableState({
|
|
prop: valueProp,
|
|
defaultProp: defaultValue2,
|
|
onChange: onValueChange
|
|
}), handleButtonActivate = import_react51.default.useCallback((itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]), [setValue]), handleButtonDeactivate = import_react51.default.useCallback((itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)), [setValue]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupValueProvider, {
|
|
scope: props.__scopeToggleGroup,
|
|
type: "multiple",
|
|
value,
|
|
defaultValue: value,
|
|
onItemActivate: handleButtonActivate,
|
|
onItemDeactivate: handleButtonDeactivate,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupImpl, {
|
|
...toggleGroupMultipleProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
var ToggleGroupImplElementFrame = (0, import_web21.styled)(Group, {
|
|
name: TOGGLE_GROUP_NAME,
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
backgroundColor: "$background"
|
|
}
|
|
},
|
|
orientation: {
|
|
vertical: {
|
|
flexDirection: "column",
|
|
spaceDirection: "vertical"
|
|
},
|
|
horizontal: {
|
|
flexDirection: "row",
|
|
spaceDirection: "horizontal"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var ToggleGroupImpl = ToggleGroupImplElementFrame.extractable(import_react51.default.forwardRef((props, forwardedRef) => {
|
|
const {
|
|
__scopeToggleGroup,
|
|
disabled = false,
|
|
orientation = "horizontal",
|
|
dir,
|
|
rovingFocus = true,
|
|
loop = true,
|
|
unstyled = false,
|
|
size: sizeProp = "$true",
|
|
sizeAdjust = 0,
|
|
...toggleGroupProps
|
|
} = props, direction = useDirection(dir), commonProps = {
|
|
role: "group",
|
|
dir: direction,
|
|
...toggleGroupProps
|
|
}, adjustedSize = (0, import_web21.getVariableValue)(getSize(sizeProp, {
|
|
shift: sizeAdjust
|
|
})), size4 = Math.round(adjustedSize * 0.45);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupContext, {
|
|
scope: __scopeToggleGroup,
|
|
rovingFocus,
|
|
disabled,
|
|
size: size4,
|
|
children: rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RovingFocusGroup, {
|
|
asChild: "except-style",
|
|
__scopeRovingFocusGroup: __scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
|
|
orientation,
|
|
dir: direction,
|
|
loop,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupImplElementFrame, {
|
|
"aria-orientation": orientation,
|
|
orientation,
|
|
axis: orientation,
|
|
ref: forwardedRef,
|
|
"data-disabled": disabled ? "" : void 0,
|
|
unstyled,
|
|
...commonProps
|
|
})
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ToggleGroupImplElementFrame, {
|
|
"aria-orientation": orientation,
|
|
ref: forwardedRef,
|
|
orientation,
|
|
"data-disabled": disabled ? "" : void 0,
|
|
unstyled,
|
|
...commonProps
|
|
})
|
|
});
|
|
}));
|
|
|
|
// node_modules/@tamagui/tooltip/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
var React76 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/tooltip/node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs
|
|
var React75 = __toESM(require("react"), 1);
|
|
var import_react52 = require("react");
|
|
function getPlatform3() {
|
|
const uaData = navigator.userAgentData;
|
|
if (uaData != null && uaData.platform) {
|
|
return uaData.platform;
|
|
}
|
|
return navigator.platform;
|
|
}
|
|
__name(getPlatform3, "getPlatform");
|
|
function getUserAgent3() {
|
|
const uaData = navigator.userAgentData;
|
|
if (uaData && Array.isArray(uaData.brands)) {
|
|
return uaData.brands.map((_ref) => {
|
|
let {
|
|
brand,
|
|
version
|
|
} = _ref;
|
|
return brand + "/" + version;
|
|
}).join(" ");
|
|
}
|
|
return navigator.userAgent;
|
|
}
|
|
__name(getUserAgent3, "getUserAgent");
|
|
function isSafari3() {
|
|
return /apple/i.test(navigator.vendor);
|
|
}
|
|
__name(isSafari3, "isSafari");
|
|
function isMac3() {
|
|
return getPlatform3().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
}
|
|
__name(isMac3, "isMac");
|
|
function isJSDOM3() {
|
|
return getUserAgent3().includes("jsdom/");
|
|
}
|
|
__name(isJSDOM3, "isJSDOM");
|
|
var FOCUSABLE_ATTRIBUTE5 = "data-floating-ui-focusable";
|
|
var TYPEABLE_SELECTOR3 = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
function activeElement3(doc) {
|
|
let activeElement4 = doc.activeElement;
|
|
while (((_activeElement = activeElement4) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {
|
|
var _activeElement;
|
|
activeElement4 = activeElement4.shadowRoot.activeElement;
|
|
}
|
|
return activeElement4;
|
|
}
|
|
__name(activeElement3, "activeElement");
|
|
function contains4(parent, child) {
|
|
if (!parent || !child) {
|
|
return false;
|
|
}
|
|
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
if (parent.contains(child)) {
|
|
return true;
|
|
}
|
|
if (rootNode && isShadowRoot(rootNode)) {
|
|
let next = child;
|
|
while (next) {
|
|
if (parent === next) {
|
|
return true;
|
|
}
|
|
next = next.parentNode || next.host;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
__name(contains4, "contains");
|
|
function getTarget4(event) {
|
|
if ("composedPath" in event) {
|
|
return event.composedPath()[0];
|
|
}
|
|
return event.target;
|
|
}
|
|
__name(getTarget4, "getTarget");
|
|
function isEventTargetWithin3(event, node) {
|
|
if (node == null) {
|
|
return false;
|
|
}
|
|
if ("composedPath" in event) {
|
|
return event.composedPath().includes(node);
|
|
}
|
|
const e = event;
|
|
return e.target != null && node.contains(e.target);
|
|
}
|
|
__name(isEventTargetWithin3, "isEventTargetWithin");
|
|
function isRootElement3(element) {
|
|
return element.matches("html,body");
|
|
}
|
|
__name(isRootElement3, "isRootElement");
|
|
function getDocument4(node) {
|
|
return (node == null ? void 0 : node.ownerDocument) || document;
|
|
}
|
|
__name(getDocument4, "getDocument");
|
|
function isTypeableElement3(element) {
|
|
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR3);
|
|
}
|
|
__name(isTypeableElement3, "isTypeableElement");
|
|
function matchesFocusVisible3(element) {
|
|
if (!element || isJSDOM3()) return true;
|
|
try {
|
|
return element.matches(":focus-visible");
|
|
} catch (_e) {
|
|
return true;
|
|
}
|
|
}
|
|
__name(matchesFocusVisible3, "matchesFocusVisible");
|
|
function getFloatingFocusElement3(floatingElement) {
|
|
if (!floatingElement) {
|
|
return null;
|
|
}
|
|
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE5) ? floatingElement : floatingElement.querySelector("[" + FOCUSABLE_ATTRIBUTE5 + "]") || floatingElement;
|
|
}
|
|
__name(getFloatingFocusElement3, "getFloatingFocusElement");
|
|
function getNodeChildren4(nodes, id, onlyOpenChildren) {
|
|
if (onlyOpenChildren === void 0) {
|
|
onlyOpenChildren = true;
|
|
}
|
|
const directChildren = nodes.filter((node) => {
|
|
var _node$context;
|
|
return node.parentId === id && (!onlyOpenChildren || ((_node$context = node.context) == null ? void 0 : _node$context.open));
|
|
});
|
|
return directChildren.flatMap((child) => [child, ...getNodeChildren4(nodes, child.id, onlyOpenChildren)]);
|
|
}
|
|
__name(getNodeChildren4, "getNodeChildren");
|
|
function isReactEvent3(event) {
|
|
return "nativeEvent" in event;
|
|
}
|
|
__name(isReactEvent3, "isReactEvent");
|
|
function isMouseLikePointerType3(pointerType, strict) {
|
|
const values = ["mouse", "pen"];
|
|
if (!strict) {
|
|
values.push("", void 0);
|
|
}
|
|
return values.includes(pointerType);
|
|
}
|
|
__name(isMouseLikePointerType3, "isMouseLikePointerType");
|
|
var isClient7 = typeof document !== "undefined";
|
|
var noop7 = /* @__PURE__ */ __name(function noop8() {
|
|
}, "noop");
|
|
var index4 = isClient7 ? import_react52.useLayoutEffect : noop7;
|
|
var SafeReact5 = {
|
|
...React75
|
|
};
|
|
function useLatestRef4(value) {
|
|
const ref = React75.useRef(value);
|
|
index4(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref;
|
|
}
|
|
__name(useLatestRef4, "useLatestRef");
|
|
var useInsertionEffect3 = SafeReact5.useInsertionEffect;
|
|
var useSafeInsertionEffect3 = useInsertionEffect3 || ((fn) => fn());
|
|
function useEffectEvent3(callback) {
|
|
const ref = React75.useRef(() => {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
throw new Error("Cannot call an event handler while rendering.");
|
|
}
|
|
});
|
|
useSafeInsertionEffect3(() => {
|
|
ref.current = callback;
|
|
});
|
|
return React75.useCallback(function() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return ref.current == null ? void 0 : ref.current(...args);
|
|
}, []);
|
|
}
|
|
__name(useEffectEvent3, "useEffectEvent");
|
|
|
|
// node_modules/@tamagui/tooltip/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
var ReactDOM5 = __toESM(require("react-dom"), 1);
|
|
var FOCUSABLE_ATTRIBUTE6 = "data-floating-ui-focusable";
|
|
var ACTIVE_KEY3 = "active";
|
|
var SELECTED_KEY3 = "selected";
|
|
var ARROW_LEFT4 = "ArrowLeft";
|
|
var ARROW_RIGHT4 = "ArrowRight";
|
|
var ARROW_UP4 = "ArrowUp";
|
|
var ARROW_DOWN4 = "ArrowDown";
|
|
var horizontalKeys3 = [ARROW_LEFT4, ARROW_RIGHT4];
|
|
var verticalKeys3 = [ARROW_UP4, ARROW_DOWN4];
|
|
var allKeys3 = [...horizontalKeys3, ...verticalKeys3];
|
|
var SafeReact6 = {
|
|
...React76
|
|
};
|
|
var serverHandoffComplete3 = false;
|
|
var count3 = 0;
|
|
var genId3 = /* @__PURE__ */ __name(() => (
|
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
// on <React 18
|
|
"floating-ui-" + Math.random().toString(36).slice(2, 6) + count3++
|
|
), "genId");
|
|
function useFloatingId3() {
|
|
const [id, setId] = React76.useState(() => serverHandoffComplete3 ? genId3() : void 0);
|
|
index4(() => {
|
|
if (id == null) {
|
|
setId(genId3());
|
|
}
|
|
}, []);
|
|
React76.useEffect(() => {
|
|
serverHandoffComplete3 = true;
|
|
}, []);
|
|
return id;
|
|
}
|
|
__name(useFloatingId3, "useFloatingId");
|
|
var useReactId3 = SafeReact6.useId;
|
|
var useId16 = useReactId3 || useFloatingId3;
|
|
var devMessageSet3;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
devMessageSet3 = /* @__PURE__ */ new Set();
|
|
}
|
|
function error3() {
|
|
var _devMessageSet3;
|
|
for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
messages[_key2] = arguments[_key2];
|
|
}
|
|
const message = "Floating UI: " + messages.join(" ");
|
|
if (!((_devMessageSet3 = devMessageSet3) != null && _devMessageSet3.has(message))) {
|
|
var _devMessageSet4;
|
|
(_devMessageSet4 = devMessageSet3) == null || _devMessageSet4.add(message);
|
|
console.error(message);
|
|
}
|
|
}
|
|
__name(error3, "error");
|
|
function createEventEmitter3() {
|
|
const map = /* @__PURE__ */ new Map();
|
|
return {
|
|
emit(event, data) {
|
|
var _map$get;
|
|
(_map$get = map.get(event)) == null || _map$get.forEach((listener) => listener(data));
|
|
},
|
|
on(event, listener) {
|
|
if (!map.has(event)) {
|
|
map.set(event, /* @__PURE__ */ new Set());
|
|
}
|
|
map.get(event).add(listener);
|
|
},
|
|
off(event, listener) {
|
|
var _map$get2;
|
|
(_map$get2 = map.get(event)) == null || _map$get2.delete(listener);
|
|
}
|
|
};
|
|
}
|
|
__name(createEventEmitter3, "createEventEmitter");
|
|
var FloatingNodeContext3 = /* @__PURE__ */ React76.createContext(null);
|
|
var FloatingTreeContext3 = /* @__PURE__ */ React76.createContext(null);
|
|
var useFloatingParentNodeId3 = /* @__PURE__ */ __name(() => {
|
|
var _React$useContext;
|
|
return ((_React$useContext = React76.useContext(FloatingNodeContext3)) == null ? void 0 : _React$useContext.id) || null;
|
|
}, "useFloatingParentNodeId");
|
|
var useFloatingTree3 = /* @__PURE__ */ __name(() => React76.useContext(FloatingTreeContext3), "useFloatingTree");
|
|
function createAttribute3(name) {
|
|
return "data-floating-ui-" + name;
|
|
}
|
|
__name(createAttribute3, "createAttribute");
|
|
function clearTimeoutIfSet3(timeoutRef) {
|
|
if (timeoutRef.current !== -1) {
|
|
clearTimeout(timeoutRef.current);
|
|
timeoutRef.current = -1;
|
|
}
|
|
}
|
|
__name(clearTimeoutIfSet3, "clearTimeoutIfSet");
|
|
var safePolygonIdentifier2 = /* @__PURE__ */ createAttribute3("safe-polygon");
|
|
function getDelay2(value, prop, pointerType) {
|
|
if (pointerType && !isMouseLikePointerType3(pointerType)) {
|
|
return 0;
|
|
}
|
|
if (typeof value === "number") {
|
|
return value;
|
|
}
|
|
if (typeof value === "function") {
|
|
const result = value();
|
|
if (typeof result === "number") {
|
|
return result;
|
|
}
|
|
return result == null ? void 0 : result[prop];
|
|
}
|
|
return value == null ? void 0 : value[prop];
|
|
}
|
|
__name(getDelay2, "getDelay");
|
|
function getRestMs2(value) {
|
|
if (typeof value === "function") {
|
|
return value();
|
|
}
|
|
return value;
|
|
}
|
|
__name(getRestMs2, "getRestMs");
|
|
function useHover2(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
dataRef,
|
|
events,
|
|
elements
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
delay = 0,
|
|
handleClose = null,
|
|
mouseOnly = false,
|
|
restMs = 0,
|
|
move = true
|
|
} = props;
|
|
const tree = useFloatingTree3();
|
|
const parentId = useFloatingParentNodeId3();
|
|
const handleCloseRef = useLatestRef4(handleClose);
|
|
const delayRef = useLatestRef4(delay);
|
|
const openRef = useLatestRef4(open);
|
|
const restMsRef = useLatestRef4(restMs);
|
|
const pointerTypeRef = React76.useRef();
|
|
const timeoutRef = React76.useRef(-1);
|
|
const handlerRef = React76.useRef();
|
|
const restTimeoutRef = React76.useRef(-1);
|
|
const blockMouseMoveRef = React76.useRef(true);
|
|
const performedPointerEventsMutationRef = React76.useRef(false);
|
|
const unbindMouseMoveRef = React76.useRef(() => {
|
|
});
|
|
const restTimeoutPendingRef = React76.useRef(false);
|
|
const isHoverOpen = useEffectEvent3(() => {
|
|
var _dataRef$current$open;
|
|
const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;
|
|
return (type == null ? void 0 : type.includes("mouse")) && type !== "mousedown";
|
|
});
|
|
React76.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onOpenChange2(_ref) {
|
|
let {
|
|
open: open2
|
|
} = _ref;
|
|
if (!open2) {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
clearTimeoutIfSet3(restTimeoutRef);
|
|
blockMouseMoveRef.current = true;
|
|
restTimeoutPendingRef.current = false;
|
|
}
|
|
}
|
|
__name(onOpenChange2, "onOpenChange");
|
|
events.on("openchange", onOpenChange2);
|
|
return () => {
|
|
events.off("openchange", onOpenChange2);
|
|
};
|
|
}, [enabled, events]);
|
|
React76.useEffect(() => {
|
|
if (!enabled) return;
|
|
if (!handleCloseRef.current) return;
|
|
if (!open) return;
|
|
function onLeave(event) {
|
|
if (isHoverOpen()) {
|
|
onOpenChange(false, event, "hover");
|
|
}
|
|
}
|
|
__name(onLeave, "onLeave");
|
|
const html = getDocument4(elements.floating).documentElement;
|
|
html.addEventListener("mouseleave", onLeave);
|
|
return () => {
|
|
html.removeEventListener("mouseleave", onLeave);
|
|
};
|
|
}, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
|
|
const closeWithDelay = React76.useCallback(function(event, runElseBranch, reason) {
|
|
if (runElseBranch === void 0) {
|
|
runElseBranch = true;
|
|
}
|
|
if (reason === void 0) {
|
|
reason = "hover";
|
|
}
|
|
const closeDelay = getDelay2(delayRef.current, "close", pointerTypeRef.current);
|
|
if (closeDelay && !handlerRef.current) {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay);
|
|
} else if (runElseBranch) {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
onOpenChange(false, event, reason);
|
|
}
|
|
}, [delayRef, onOpenChange]);
|
|
const cleanupMouseMoveHandler = useEffectEvent3(() => {
|
|
unbindMouseMoveRef.current();
|
|
handlerRef.current = void 0;
|
|
});
|
|
const clearPointerEvents = useEffectEvent3(() => {
|
|
if (performedPointerEventsMutationRef.current) {
|
|
const body = getDocument4(elements.floating).body;
|
|
body.style.pointerEvents = "";
|
|
body.removeAttribute(safePolygonIdentifier2);
|
|
performedPointerEventsMutationRef.current = false;
|
|
}
|
|
});
|
|
const isClickLikeOpenEvent = useEffectEvent3(() => {
|
|
return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false;
|
|
});
|
|
React76.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onReferenceMouseEnter(event) {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
blockMouseMoveRef.current = false;
|
|
if (mouseOnly && !isMouseLikePointerType3(pointerTypeRef.current) || getRestMs2(restMsRef.current) > 0 && !getDelay2(delayRef.current, "open")) {
|
|
return;
|
|
}
|
|
const openDelay = getDelay2(delayRef.current, "open", pointerTypeRef.current);
|
|
if (openDelay) {
|
|
timeoutRef.current = window.setTimeout(() => {
|
|
if (!openRef.current) {
|
|
onOpenChange(true, event, "hover");
|
|
}
|
|
}, openDelay);
|
|
} else if (!open) {
|
|
onOpenChange(true, event, "hover");
|
|
}
|
|
}
|
|
__name(onReferenceMouseEnter, "onReferenceMouseEnter");
|
|
function onReferenceMouseLeave(event) {
|
|
if (isClickLikeOpenEvent()) {
|
|
clearPointerEvents();
|
|
return;
|
|
}
|
|
unbindMouseMoveRef.current();
|
|
const doc = getDocument4(elements.floating);
|
|
clearTimeoutIfSet3(restTimeoutRef);
|
|
restTimeoutPendingRef.current = false;
|
|
if (handleCloseRef.current && dataRef.current.floatingContext) {
|
|
if (!open) {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
}
|
|
handlerRef.current = handleCloseRef.current({
|
|
...dataRef.current.floatingContext,
|
|
tree,
|
|
x: event.clientX,
|
|
y: event.clientY,
|
|
onClose() {
|
|
clearPointerEvents();
|
|
cleanupMouseMoveHandler();
|
|
if (!isClickLikeOpenEvent()) {
|
|
closeWithDelay(event, true, "safe-polygon");
|
|
}
|
|
}
|
|
});
|
|
const handler = handlerRef.current;
|
|
doc.addEventListener("mousemove", handler);
|
|
unbindMouseMoveRef.current = () => {
|
|
doc.removeEventListener("mousemove", handler);
|
|
};
|
|
return;
|
|
}
|
|
const shouldClose = pointerTypeRef.current === "touch" ? !contains4(elements.floating, event.relatedTarget) : true;
|
|
if (shouldClose) {
|
|
closeWithDelay(event);
|
|
}
|
|
}
|
|
__name(onReferenceMouseLeave, "onReferenceMouseLeave");
|
|
function onScrollMouseLeave(event) {
|
|
if (isClickLikeOpenEvent()) return;
|
|
if (!dataRef.current.floatingContext) return;
|
|
handleCloseRef.current == null || handleCloseRef.current({
|
|
...dataRef.current.floatingContext,
|
|
tree,
|
|
x: event.clientX,
|
|
y: event.clientY,
|
|
onClose() {
|
|
clearPointerEvents();
|
|
cleanupMouseMoveHandler();
|
|
if (!isClickLikeOpenEvent()) {
|
|
closeWithDelay(event);
|
|
}
|
|
}
|
|
})(event);
|
|
}
|
|
__name(onScrollMouseLeave, "onScrollMouseLeave");
|
|
function onFloatingMouseEnter() {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
}
|
|
__name(onFloatingMouseEnter, "onFloatingMouseEnter");
|
|
function onFloatingMouseLeave(event) {
|
|
if (!isClickLikeOpenEvent()) {
|
|
closeWithDelay(event, false);
|
|
}
|
|
}
|
|
__name(onFloatingMouseLeave, "onFloatingMouseLeave");
|
|
if (isElement(elements.domReference)) {
|
|
const reference2 = elements.domReference;
|
|
const floating = elements.floating;
|
|
if (open) {
|
|
reference2.addEventListener("mouseleave", onScrollMouseLeave);
|
|
}
|
|
if (move) {
|
|
reference2.addEventListener("mousemove", onReferenceMouseEnter, {
|
|
once: true
|
|
});
|
|
}
|
|
reference2.addEventListener("mouseenter", onReferenceMouseEnter);
|
|
reference2.addEventListener("mouseleave", onReferenceMouseLeave);
|
|
if (floating) {
|
|
floating.addEventListener("mouseleave", onScrollMouseLeave);
|
|
floating.addEventListener("mouseenter", onFloatingMouseEnter);
|
|
floating.addEventListener("mouseleave", onFloatingMouseLeave);
|
|
}
|
|
return () => {
|
|
if (open) {
|
|
reference2.removeEventListener("mouseleave", onScrollMouseLeave);
|
|
}
|
|
if (move) {
|
|
reference2.removeEventListener("mousemove", onReferenceMouseEnter);
|
|
}
|
|
reference2.removeEventListener("mouseenter", onReferenceMouseEnter);
|
|
reference2.removeEventListener("mouseleave", onReferenceMouseLeave);
|
|
if (floating) {
|
|
floating.removeEventListener("mouseleave", onScrollMouseLeave);
|
|
floating.removeEventListener("mouseenter", onFloatingMouseEnter);
|
|
floating.removeEventListener("mouseleave", onFloatingMouseLeave);
|
|
}
|
|
};
|
|
}
|
|
}, [elements, enabled, context2, mouseOnly, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent, restMsRef]);
|
|
index4(() => {
|
|
var _handleCloseRef$curre;
|
|
if (!enabled) return;
|
|
if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && (_handleCloseRef$curre = _handleCloseRef$curre.__options) != null && _handleCloseRef$curre.blockPointerEvents && isHoverOpen()) {
|
|
performedPointerEventsMutationRef.current = true;
|
|
const floatingEl = elements.floating;
|
|
if (isElement(elements.domReference) && floatingEl) {
|
|
var _tree$nodesRef$curren;
|
|
const body = getDocument4(elements.floating).body;
|
|
body.setAttribute(safePolygonIdentifier2, "");
|
|
const ref = elements.domReference;
|
|
const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find((node) => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;
|
|
if (parentFloating) {
|
|
parentFloating.style.pointerEvents = "";
|
|
}
|
|
body.style.pointerEvents = "none";
|
|
ref.style.pointerEvents = "auto";
|
|
floatingEl.style.pointerEvents = "auto";
|
|
return () => {
|
|
body.style.pointerEvents = "";
|
|
ref.style.pointerEvents = "";
|
|
floatingEl.style.pointerEvents = "";
|
|
};
|
|
}
|
|
}
|
|
}, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);
|
|
index4(() => {
|
|
if (!open) {
|
|
pointerTypeRef.current = void 0;
|
|
restTimeoutPendingRef.current = false;
|
|
cleanupMouseMoveHandler();
|
|
clearPointerEvents();
|
|
}
|
|
}, [open, cleanupMouseMoveHandler, clearPointerEvents]);
|
|
React76.useEffect(() => {
|
|
return () => {
|
|
cleanupMouseMoveHandler();
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
clearTimeoutIfSet3(restTimeoutRef);
|
|
clearPointerEvents();
|
|
};
|
|
}, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);
|
|
const reference = React76.useMemo(() => {
|
|
function setPointerRef(event) {
|
|
pointerTypeRef.current = event.pointerType;
|
|
}
|
|
__name(setPointerRef, "setPointerRef");
|
|
return {
|
|
onPointerDown: setPointerRef,
|
|
onPointerEnter: setPointerRef,
|
|
onMouseMove(event) {
|
|
const {
|
|
nativeEvent
|
|
} = event;
|
|
function handleMouseMove() {
|
|
if (!blockMouseMoveRef.current && !openRef.current) {
|
|
onOpenChange(true, nativeEvent, "hover");
|
|
}
|
|
}
|
|
__name(handleMouseMove, "handleMouseMove");
|
|
if (mouseOnly && !isMouseLikePointerType3(pointerTypeRef.current)) {
|
|
return;
|
|
}
|
|
if (open || getRestMs2(restMsRef.current) === 0) {
|
|
return;
|
|
}
|
|
if (restTimeoutPendingRef.current && event.movementX ** 2 + event.movementY ** 2 < 2) {
|
|
return;
|
|
}
|
|
clearTimeoutIfSet3(restTimeoutRef);
|
|
if (pointerTypeRef.current === "touch") {
|
|
handleMouseMove();
|
|
} else {
|
|
restTimeoutPendingRef.current = true;
|
|
restTimeoutRef.current = window.setTimeout(handleMouseMove, getRestMs2(restMsRef.current));
|
|
}
|
|
}
|
|
};
|
|
}, [mouseOnly, onOpenChange, open, openRef, restMsRef]);
|
|
return React76.useMemo(() => enabled ? {
|
|
reference
|
|
} : {}, [enabled, reference]);
|
|
}
|
|
__name(useHover2, "useHover");
|
|
var NOOP = /* @__PURE__ */ __name(() => {
|
|
}, "NOOP");
|
|
var FloatingDelayGroupContext = /* @__PURE__ */ React76.createContext({
|
|
delay: 0,
|
|
initialDelay: 0,
|
|
timeoutMs: 0,
|
|
currentId: null,
|
|
setCurrentId: NOOP,
|
|
setState: NOOP,
|
|
isInstantPhase: false
|
|
});
|
|
var useDelayGroupContext = /* @__PURE__ */ __name(() => React76.useContext(FloatingDelayGroupContext), "useDelayGroupContext");
|
|
function FloatingDelayGroup(props) {
|
|
const {
|
|
children,
|
|
delay,
|
|
timeoutMs = 0
|
|
} = props;
|
|
const [state, setState] = React76.useReducer((prev, next) => ({
|
|
...prev,
|
|
...next
|
|
}), {
|
|
delay,
|
|
timeoutMs,
|
|
initialDelay: delay,
|
|
currentId: null,
|
|
isInstantPhase: false
|
|
});
|
|
const initialCurrentIdRef = React76.useRef(null);
|
|
const setCurrentId = React76.useCallback((currentId) => {
|
|
setState({
|
|
currentId
|
|
});
|
|
}, []);
|
|
index4(() => {
|
|
if (state.currentId) {
|
|
if (initialCurrentIdRef.current === null) {
|
|
initialCurrentIdRef.current = state.currentId;
|
|
} else if (!state.isInstantPhase) {
|
|
setState({
|
|
isInstantPhase: true
|
|
});
|
|
}
|
|
} else {
|
|
if (state.isInstantPhase) {
|
|
setState({
|
|
isInstantPhase: false
|
|
});
|
|
}
|
|
initialCurrentIdRef.current = null;
|
|
}
|
|
}, [state.currentId, state.isInstantPhase]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FloatingDelayGroupContext.Provider, {
|
|
value: React76.useMemo(() => ({
|
|
...state,
|
|
setState,
|
|
setCurrentId
|
|
}), [state, setCurrentId]),
|
|
children
|
|
});
|
|
}
|
|
__name(FloatingDelayGroup, "FloatingDelayGroup");
|
|
function useDelayGroup(context2, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
floatingId
|
|
} = context2;
|
|
const {
|
|
id: optionId,
|
|
enabled = true
|
|
} = options;
|
|
const id = optionId != null ? optionId : floatingId;
|
|
const groupContext = useDelayGroupContext();
|
|
const {
|
|
currentId,
|
|
setCurrentId,
|
|
initialDelay,
|
|
setState,
|
|
timeoutMs
|
|
} = groupContext;
|
|
index4(() => {
|
|
if (!enabled) return;
|
|
if (!currentId) return;
|
|
setState({
|
|
delay: {
|
|
open: 1,
|
|
close: getDelay2(initialDelay, "close")
|
|
}
|
|
});
|
|
if (currentId !== id) {
|
|
onOpenChange(false);
|
|
}
|
|
}, [enabled, id, onOpenChange, setState, currentId, initialDelay]);
|
|
index4(() => {
|
|
function unset() {
|
|
onOpenChange(false);
|
|
setState({
|
|
delay: initialDelay,
|
|
currentId: null
|
|
});
|
|
}
|
|
__name(unset, "unset");
|
|
if (!enabled) return;
|
|
if (!currentId) return;
|
|
if (!open && currentId === id) {
|
|
if (timeoutMs) {
|
|
const timeout = window.setTimeout(unset, timeoutMs);
|
|
return () => {
|
|
clearTimeout(timeout);
|
|
};
|
|
}
|
|
unset();
|
|
}
|
|
}, [enabled, open, setState, currentId, id, onOpenChange, initialDelay, timeoutMs]);
|
|
index4(() => {
|
|
if (!enabled) return;
|
|
if (setCurrentId === NOOP || !open) return;
|
|
setCurrentId(id);
|
|
}, [enabled, open, setCurrentId, id]);
|
|
return groupContext;
|
|
}
|
|
__name(useDelayGroup, "useDelayGroup");
|
|
var bubbleHandlerKeys3 = {
|
|
pointerdown: "onPointerDown",
|
|
mousedown: "onMouseDown",
|
|
click: "onClick"
|
|
};
|
|
var captureHandlerKeys3 = {
|
|
pointerdown: "onPointerDownCapture",
|
|
mousedown: "onMouseDownCapture",
|
|
click: "onClickCapture"
|
|
};
|
|
var normalizeProp3 = /* @__PURE__ */ __name((normalizable) => {
|
|
var _normalizable$escapeK, _normalizable$outside;
|
|
return {
|
|
escapeKey: typeof normalizable === "boolean" ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,
|
|
outsidePress: typeof normalizable === "boolean" ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true
|
|
};
|
|
}, "normalizeProp");
|
|
function useDismiss3(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
dataRef
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
escapeKey = true,
|
|
outsidePress: unstable_outsidePress = true,
|
|
outsidePressEvent = "pointerdown",
|
|
referencePress = false,
|
|
referencePressEvent = "pointerdown",
|
|
ancestorScroll = false,
|
|
bubbles,
|
|
capture
|
|
} = props;
|
|
const tree = useFloatingTree3();
|
|
const outsidePressFn = useEffectEvent3(typeof unstable_outsidePress === "function" ? unstable_outsidePress : () => false);
|
|
const outsidePress = typeof unstable_outsidePress === "function" ? outsidePressFn : unstable_outsidePress;
|
|
const endedOrStartedInsideRef = React76.useRef(false);
|
|
const {
|
|
escapeKey: escapeKeyBubbles,
|
|
outsidePress: outsidePressBubbles
|
|
} = normalizeProp3(bubbles);
|
|
const {
|
|
escapeKey: escapeKeyCapture,
|
|
outsidePress: outsidePressCapture
|
|
} = normalizeProp3(capture);
|
|
const isComposingRef = React76.useRef(false);
|
|
const closeOnEscapeKeyDown = useEffectEvent3((event) => {
|
|
var _dataRef$current$floa;
|
|
if (!open || !enabled || !escapeKey || event.key !== "Escape") {
|
|
return;
|
|
}
|
|
if (isComposingRef.current) {
|
|
return;
|
|
}
|
|
const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;
|
|
const children = tree ? getNodeChildren4(tree.nodesRef.current, nodeId) : [];
|
|
if (!escapeKeyBubbles) {
|
|
event.stopPropagation();
|
|
if (children.length > 0) {
|
|
let shouldDismiss = true;
|
|
children.forEach((child) => {
|
|
var _child$context;
|
|
if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {
|
|
shouldDismiss = false;
|
|
return;
|
|
}
|
|
});
|
|
if (!shouldDismiss) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
onOpenChange(false, isReactEvent3(event) ? event.nativeEvent : event, "escape-key");
|
|
});
|
|
const closeOnEscapeKeyDownCapture = useEffectEvent3((event) => {
|
|
var _getTarget2;
|
|
const callback = /* @__PURE__ */ __name(() => {
|
|
var _getTarget;
|
|
closeOnEscapeKeyDown(event);
|
|
(_getTarget = getTarget4(event)) == null || _getTarget.removeEventListener("keydown", callback);
|
|
}, "callback");
|
|
(_getTarget2 = getTarget4(event)) == null || _getTarget2.addEventListener("keydown", callback);
|
|
});
|
|
const closeOnPressOutside = useEffectEvent3((event) => {
|
|
var _dataRef$current$floa2;
|
|
const insideReactTree = dataRef.current.insideReactTree;
|
|
dataRef.current.insideReactTree = false;
|
|
const endedOrStartedInside = endedOrStartedInsideRef.current;
|
|
endedOrStartedInsideRef.current = false;
|
|
if (outsidePressEvent === "click" && endedOrStartedInside) {
|
|
return;
|
|
}
|
|
if (insideReactTree) {
|
|
return;
|
|
}
|
|
if (typeof outsidePress === "function" && !outsidePress(event)) {
|
|
return;
|
|
}
|
|
const target = getTarget4(event);
|
|
const inertSelector = "[" + createAttribute3("inert") + "]";
|
|
const markers = getDocument4(elements.floating).querySelectorAll(inertSelector);
|
|
let targetRootAncestor = isElement(target) ? target : null;
|
|
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
|
|
const nextParent = getParentNode(targetRootAncestor);
|
|
if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
|
|
break;
|
|
}
|
|
targetRootAncestor = nextParent;
|
|
}
|
|
if (markers.length && isElement(target) && !isRootElement3(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
!contains4(target, elements.floating) && // If the target root element contains none of the markers, then the
|
|
// element was injected after the floating element rendered.
|
|
Array.from(markers).every((marker) => !contains4(targetRootAncestor, marker))) {
|
|
return;
|
|
}
|
|
if (isHTMLElement(target) && floating) {
|
|
const lastTraversableNode = isLastTraversableNode(target);
|
|
const style = getComputedStyle2(target);
|
|
const scrollRe = /auto|scroll/;
|
|
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
|
|
const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
|
|
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
|
|
const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
|
|
const isRTL2 = style.direction === "rtl";
|
|
const pressedVerticalScrollbar = canScrollY && (isRTL2 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
|
|
const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
|
|
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
|
|
return;
|
|
}
|
|
}
|
|
const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;
|
|
const targetIsInsideChildren = tree && getNodeChildren4(tree.nodesRef.current, nodeId).some((node) => {
|
|
var _node$context;
|
|
return isEventTargetWithin3(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
|
|
});
|
|
if (isEventTargetWithin3(event, elements.floating) || isEventTargetWithin3(event, elements.domReference) || targetIsInsideChildren) {
|
|
return;
|
|
}
|
|
const children = tree ? getNodeChildren4(tree.nodesRef.current, nodeId) : [];
|
|
if (children.length > 0) {
|
|
let shouldDismiss = true;
|
|
children.forEach((child) => {
|
|
var _child$context2;
|
|
if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {
|
|
shouldDismiss = false;
|
|
return;
|
|
}
|
|
});
|
|
if (!shouldDismiss) {
|
|
return;
|
|
}
|
|
}
|
|
onOpenChange(false, event, "outside-press");
|
|
});
|
|
const closeOnPressOutsideCapture = useEffectEvent3((event) => {
|
|
var _getTarget4;
|
|
const callback = /* @__PURE__ */ __name(() => {
|
|
var _getTarget3;
|
|
closeOnPressOutside(event);
|
|
(_getTarget3 = getTarget4(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback);
|
|
}, "callback");
|
|
(_getTarget4 = getTarget4(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback);
|
|
});
|
|
React76.useEffect(() => {
|
|
if (!open || !enabled) {
|
|
return;
|
|
}
|
|
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
|
|
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
|
|
let compositionTimeout = -1;
|
|
function onScroll(event) {
|
|
onOpenChange(false, event, "ancestor-scroll");
|
|
}
|
|
__name(onScroll, "onScroll");
|
|
function handleCompositionStart() {
|
|
window.clearTimeout(compositionTimeout);
|
|
isComposingRef.current = true;
|
|
}
|
|
__name(handleCompositionStart, "handleCompositionStart");
|
|
function handleCompositionEnd() {
|
|
compositionTimeout = window.setTimeout(
|
|
() => {
|
|
isComposingRef.current = false;
|
|
},
|
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
// Only apply to WebKit for the test to remain 0ms.
|
|
isWebKit() ? 5 : 0
|
|
);
|
|
}
|
|
__name(handleCompositionEnd, "handleCompositionEnd");
|
|
const doc = getDocument4(elements.floating);
|
|
if (escapeKey) {
|
|
doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
doc.addEventListener("compositionstart", handleCompositionStart);
|
|
doc.addEventListener("compositionend", handleCompositionEnd);
|
|
}
|
|
outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
let ancestors = [];
|
|
if (ancestorScroll) {
|
|
if (isElement(elements.domReference)) {
|
|
ancestors = getOverflowAncestors(elements.domReference);
|
|
}
|
|
if (isElement(elements.floating)) {
|
|
ancestors = ancestors.concat(getOverflowAncestors(elements.floating));
|
|
}
|
|
if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {
|
|
ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));
|
|
}
|
|
}
|
|
ancestors = ancestors.filter((ancestor) => {
|
|
var _doc$defaultView;
|
|
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
});
|
|
ancestors.forEach((ancestor) => {
|
|
ancestor.addEventListener("scroll", onScroll, {
|
|
passive: true
|
|
});
|
|
});
|
|
return () => {
|
|
if (escapeKey) {
|
|
doc.removeEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
doc.removeEventListener("compositionstart", handleCompositionStart);
|
|
doc.removeEventListener("compositionend", handleCompositionEnd);
|
|
}
|
|
outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
ancestors.forEach((ancestor) => {
|
|
ancestor.removeEventListener("scroll", onScroll);
|
|
});
|
|
window.clearTimeout(compositionTimeout);
|
|
};
|
|
}, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
|
|
React76.useEffect(() => {
|
|
dataRef.current.insideReactTree = false;
|
|
}, [dataRef, outsidePress, outsidePressEvent]);
|
|
const reference = React76.useMemo(() => ({
|
|
onKeyDown: closeOnEscapeKeyDown,
|
|
...referencePress && {
|
|
[bubbleHandlerKeys3[referencePressEvent]]: (event) => {
|
|
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
},
|
|
...referencePressEvent !== "click" && {
|
|
onClick(event) {
|
|
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
}
|
|
}
|
|
}
|
|
}), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);
|
|
const floating = React76.useMemo(() => ({
|
|
onKeyDown: closeOnEscapeKeyDown,
|
|
onMouseDown() {
|
|
endedOrStartedInsideRef.current = true;
|
|
},
|
|
onMouseUp() {
|
|
endedOrStartedInsideRef.current = true;
|
|
},
|
|
[captureHandlerKeys3[outsidePressEvent]]: () => {
|
|
dataRef.current.insideReactTree = true;
|
|
}
|
|
}), [closeOnEscapeKeyDown, outsidePressEvent, dataRef]);
|
|
return React76.useMemo(() => enabled ? {
|
|
reference,
|
|
floating
|
|
} : {}, [enabled, reference, floating]);
|
|
}
|
|
__name(useDismiss3, "useDismiss");
|
|
function useFloatingRootContext3(options) {
|
|
const {
|
|
open = false,
|
|
onOpenChange: onOpenChangeProp,
|
|
elements: elementsProp
|
|
} = options;
|
|
const floatingId = useId16();
|
|
const dataRef = React76.useRef({});
|
|
const [events] = React76.useState(() => createEventEmitter3());
|
|
const nested = useFloatingParentNodeId3() != null;
|
|
if (process.env.NODE_ENV !== "production") {
|
|
const optionDomReference = elementsProp.reference;
|
|
if (optionDomReference && !isElement(optionDomReference)) {
|
|
error3("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
}
|
|
}
|
|
const [positionReference, setPositionReference] = React76.useState(elementsProp.reference);
|
|
const onOpenChange = useEffectEvent3((open2, event, reason) => {
|
|
dataRef.current.openEvent = open2 ? event : void 0;
|
|
events.emit("openchange", {
|
|
open: open2,
|
|
event,
|
|
reason,
|
|
nested
|
|
});
|
|
onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
|
|
});
|
|
const refs = React76.useMemo(() => ({
|
|
setPositionReference
|
|
}), []);
|
|
const elements = React76.useMemo(() => ({
|
|
reference: positionReference || elementsProp.reference || null,
|
|
floating: elementsProp.floating || null,
|
|
domReference: elementsProp.reference
|
|
}), [positionReference, elementsProp.reference, elementsProp.floating]);
|
|
return React76.useMemo(() => ({
|
|
dataRef,
|
|
open,
|
|
onOpenChange,
|
|
elements,
|
|
events,
|
|
floatingId,
|
|
refs
|
|
}), [open, onOpenChange, elements, events, floatingId, refs]);
|
|
}
|
|
__name(useFloatingRootContext3, "useFloatingRootContext");
|
|
function useFloating5(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const {
|
|
nodeId
|
|
} = options;
|
|
const internalRootContext = useFloatingRootContext3({
|
|
...options,
|
|
elements: {
|
|
reference: null,
|
|
floating: null,
|
|
...options.elements
|
|
}
|
|
});
|
|
const rootContext = options.rootContext || internalRootContext;
|
|
const computedElements = rootContext.elements;
|
|
const [_domReference, setDomReference] = React76.useState(null);
|
|
const [positionReference, _setPositionReference] = React76.useState(null);
|
|
const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
|
|
const domReference = optionDomReference || _domReference;
|
|
const domReferenceRef = React76.useRef(null);
|
|
const tree = useFloatingTree3();
|
|
index4(() => {
|
|
if (domReference) {
|
|
domReferenceRef.current = domReference;
|
|
}
|
|
}, [domReference]);
|
|
const position = useFloating({
|
|
...options,
|
|
elements: {
|
|
...computedElements,
|
|
...positionReference && {
|
|
reference: positionReference
|
|
}
|
|
}
|
|
});
|
|
const setPositionReference = React76.useCallback((node) => {
|
|
const computedPositionReference = isElement(node) ? {
|
|
getBoundingClientRect: /* @__PURE__ */ __name(() => node.getBoundingClientRect(), "getBoundingClientRect"),
|
|
getClientRects: /* @__PURE__ */ __name(() => node.getClientRects(), "getClientRects"),
|
|
contextElement: node
|
|
} : node;
|
|
_setPositionReference(computedPositionReference);
|
|
position.refs.setReference(computedPositionReference);
|
|
}, [position.refs]);
|
|
const setReference = React76.useCallback((node) => {
|
|
if (isElement(node) || node === null) {
|
|
domReferenceRef.current = node;
|
|
setDomReference(node);
|
|
}
|
|
if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
// `null` to support `positionReference` + an unstable `reference`
|
|
// callback ref.
|
|
node !== null && !isElement(node)) {
|
|
position.refs.setReference(node);
|
|
}
|
|
}, [position.refs]);
|
|
const refs = React76.useMemo(() => ({
|
|
...position.refs,
|
|
setReference,
|
|
setPositionReference,
|
|
domReference: domReferenceRef
|
|
}), [position.refs, setReference, setPositionReference]);
|
|
const elements = React76.useMemo(() => ({
|
|
...position.elements,
|
|
domReference
|
|
}), [position.elements, domReference]);
|
|
const context2 = React76.useMemo(() => ({
|
|
...position,
|
|
...rootContext,
|
|
refs,
|
|
elements,
|
|
nodeId
|
|
}), [position, refs, elements, nodeId, rootContext]);
|
|
index4(() => {
|
|
rootContext.dataRef.current.floatingContext = context2;
|
|
const node = tree == null ? void 0 : tree.nodesRef.current.find((node2) => node2.id === nodeId);
|
|
if (node) {
|
|
node.context = context2;
|
|
}
|
|
});
|
|
return React76.useMemo(() => ({
|
|
...position,
|
|
context: context2,
|
|
refs,
|
|
elements
|
|
}), [position, refs, elements, context2]);
|
|
}
|
|
__name(useFloating5, "useFloating");
|
|
function isMacSafari2() {
|
|
return isMac3() && isSafari3();
|
|
}
|
|
__name(isMacSafari2, "isMacSafari");
|
|
function useFocus2(context2, props) {
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
onOpenChange,
|
|
events,
|
|
dataRef,
|
|
elements
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
visibleOnly = true
|
|
} = props;
|
|
const blockFocusRef = React76.useRef(false);
|
|
const timeoutRef = React76.useRef(-1);
|
|
const keyboardModalityRef = React76.useRef(true);
|
|
React76.useEffect(() => {
|
|
if (!enabled) return;
|
|
const win = getWindow(elements.domReference);
|
|
function onBlur() {
|
|
if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement3(getDocument4(elements.domReference))) {
|
|
blockFocusRef.current = true;
|
|
}
|
|
}
|
|
__name(onBlur, "onBlur");
|
|
function onKeyDown() {
|
|
keyboardModalityRef.current = true;
|
|
}
|
|
__name(onKeyDown, "onKeyDown");
|
|
function onPointerDown() {
|
|
keyboardModalityRef.current = false;
|
|
}
|
|
__name(onPointerDown, "onPointerDown");
|
|
win.addEventListener("blur", onBlur);
|
|
if (isMacSafari2()) {
|
|
win.addEventListener("keydown", onKeyDown, true);
|
|
win.addEventListener("pointerdown", onPointerDown, true);
|
|
}
|
|
return () => {
|
|
win.removeEventListener("blur", onBlur);
|
|
if (isMacSafari2()) {
|
|
win.removeEventListener("keydown", onKeyDown, true);
|
|
win.removeEventListener("pointerdown", onPointerDown, true);
|
|
}
|
|
};
|
|
}, [elements.domReference, open, enabled]);
|
|
React76.useEffect(() => {
|
|
if (!enabled) return;
|
|
function onOpenChange2(_ref) {
|
|
let {
|
|
reason
|
|
} = _ref;
|
|
if (reason === "reference-press" || reason === "escape-key") {
|
|
blockFocusRef.current = true;
|
|
}
|
|
}
|
|
__name(onOpenChange2, "onOpenChange");
|
|
events.on("openchange", onOpenChange2);
|
|
return () => {
|
|
events.off("openchange", onOpenChange2);
|
|
};
|
|
}, [events, enabled]);
|
|
React76.useEffect(() => {
|
|
return () => {
|
|
clearTimeoutIfSet3(timeoutRef);
|
|
};
|
|
}, []);
|
|
const reference = React76.useMemo(() => ({
|
|
onMouseLeave() {
|
|
blockFocusRef.current = false;
|
|
},
|
|
onFocus(event) {
|
|
if (blockFocusRef.current) return;
|
|
const target = getTarget4(event.nativeEvent);
|
|
if (visibleOnly && isElement(target)) {
|
|
if (isMacSafari2() && !event.relatedTarget) {
|
|
if (!keyboardModalityRef.current && !isTypeableElement3(target)) {
|
|
return;
|
|
}
|
|
} else if (!matchesFocusVisible3(target)) {
|
|
return;
|
|
}
|
|
}
|
|
onOpenChange(true, event.nativeEvent, "focus");
|
|
},
|
|
onBlur(event) {
|
|
blockFocusRef.current = false;
|
|
const relatedTarget = event.relatedTarget;
|
|
const nativeEvent = event.nativeEvent;
|
|
const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute3("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
|
|
timeoutRef.current = window.setTimeout(() => {
|
|
var _dataRef$current$floa;
|
|
const activeEl = activeElement3(elements.domReference ? elements.domReference.ownerDocument : document);
|
|
if (!relatedTarget && activeEl === elements.domReference) return;
|
|
if (contains4((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains4(elements.domReference, activeEl) || movedToFocusGuard) {
|
|
return;
|
|
}
|
|
onOpenChange(false, nativeEvent, "focus");
|
|
});
|
|
}
|
|
}), [dataRef, elements.domReference, onOpenChange, visibleOnly]);
|
|
return React76.useMemo(() => enabled ? {
|
|
reference
|
|
} : {}, [enabled, reference]);
|
|
}
|
|
__name(useFocus2, "useFocus");
|
|
function mergeProps3(userProps, propsList, elementKey) {
|
|
const map = /* @__PURE__ */ new Map();
|
|
const isItem = elementKey === "item";
|
|
let domUserProps = userProps;
|
|
if (isItem && userProps) {
|
|
const {
|
|
[ACTIVE_KEY3]: _,
|
|
[SELECTED_KEY3]: __,
|
|
...validProps
|
|
} = userProps;
|
|
domUserProps = validProps;
|
|
}
|
|
return {
|
|
...elementKey === "floating" && {
|
|
tabIndex: -1,
|
|
[FOCUSABLE_ATTRIBUTE6]: ""
|
|
},
|
|
...domUserProps,
|
|
...propsList.map((value) => {
|
|
const propsOrGetProps = value ? value[elementKey] : null;
|
|
if (typeof propsOrGetProps === "function") {
|
|
return userProps ? propsOrGetProps(userProps) : null;
|
|
}
|
|
return propsOrGetProps;
|
|
}).concat(userProps).reduce((acc, props) => {
|
|
if (!props) {
|
|
return acc;
|
|
}
|
|
Object.entries(props).forEach((_ref) => {
|
|
let [key, value] = _ref;
|
|
if (isItem && [ACTIVE_KEY3, SELECTED_KEY3].includes(key)) {
|
|
return;
|
|
}
|
|
if (key.indexOf("on") === 0) {
|
|
if (!map.has(key)) {
|
|
map.set(key, []);
|
|
}
|
|
if (typeof value === "function") {
|
|
var _map$get;
|
|
(_map$get = map.get(key)) == null || _map$get.push(value);
|
|
acc[key] = function() {
|
|
var _map$get2;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map((fn) => fn(...args)).find((val) => val !== void 0);
|
|
};
|
|
}
|
|
} else {
|
|
acc[key] = value;
|
|
}
|
|
});
|
|
return acc;
|
|
}, {})
|
|
};
|
|
}
|
|
__name(mergeProps3, "mergeProps");
|
|
function useInteractions3(propsList) {
|
|
if (propsList === void 0) {
|
|
propsList = [];
|
|
}
|
|
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
const getReferenceProps = React76.useCallback(
|
|
(userProps) => mergeProps3(userProps, propsList, "reference"),
|
|
|
|
referenceDeps
|
|
);
|
|
const getFloatingProps = React76.useCallback(
|
|
(userProps) => mergeProps3(userProps, propsList, "floating"),
|
|
|
|
floatingDeps
|
|
);
|
|
const getItemProps = React76.useCallback(
|
|
(userProps) => mergeProps3(userProps, propsList, "item"),
|
|
|
|
itemDeps
|
|
);
|
|
return React76.useMemo(() => ({
|
|
getReferenceProps,
|
|
getFloatingProps,
|
|
getItemProps
|
|
}), [getReferenceProps, getFloatingProps, getItemProps]);
|
|
}
|
|
__name(useInteractions3, "useInteractions");
|
|
var componentRoleToAriaRoleMap3 = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", false]]);
|
|
function useRole3(context2, props) {
|
|
var _elements$domReferenc, _componentRoleToAriaR;
|
|
if (props === void 0) {
|
|
props = {};
|
|
}
|
|
const {
|
|
open,
|
|
elements,
|
|
floatingId: defaultFloatingId
|
|
} = context2;
|
|
const {
|
|
enabled = true,
|
|
role = "dialog"
|
|
} = props;
|
|
const defaultReferenceId = useId16();
|
|
const referenceId = ((_elements$domReferenc = elements.domReference) == null ? void 0 : _elements$domReferenc.id) || defaultReferenceId;
|
|
const floatingId = React76.useMemo(() => {
|
|
var _getFloatingFocusElem;
|
|
return ((_getFloatingFocusElem = getFloatingFocusElement3(elements.floating)) == null ? void 0 : _getFloatingFocusElem.id) || defaultFloatingId;
|
|
}, [elements.floating, defaultFloatingId]);
|
|
const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap3.get(role)) != null ? _componentRoleToAriaR : role;
|
|
const parentId = useFloatingParentNodeId3();
|
|
const isNested = parentId != null;
|
|
const reference = React76.useMemo(() => {
|
|
if (ariaRole === "tooltip" || role === "label") {
|
|
return {
|
|
["aria-" + (role === "label" ? "labelledby" : "describedby")]: open ? floatingId : void 0
|
|
};
|
|
}
|
|
return {
|
|
"aria-expanded": open ? "true" : "false",
|
|
"aria-haspopup": ariaRole === "alertdialog" ? "dialog" : ariaRole,
|
|
"aria-controls": open ? floatingId : void 0,
|
|
...ariaRole === "listbox" && {
|
|
role: "combobox"
|
|
},
|
|
...ariaRole === "menu" && {
|
|
id: referenceId
|
|
},
|
|
...ariaRole === "menu" && isNested && {
|
|
role: "menuitem"
|
|
},
|
|
...role === "select" && {
|
|
"aria-autocomplete": "none"
|
|
},
|
|
...role === "combobox" && {
|
|
"aria-autocomplete": "list"
|
|
}
|
|
};
|
|
}, [ariaRole, floatingId, isNested, open, referenceId, role]);
|
|
const floating = React76.useMemo(() => {
|
|
const floatingProps = {
|
|
id: floatingId,
|
|
...ariaRole && {
|
|
role: ariaRole
|
|
}
|
|
};
|
|
if (ariaRole === "tooltip" || role === "label") {
|
|
return floatingProps;
|
|
}
|
|
return {
|
|
...floatingProps,
|
|
...ariaRole === "menu" && {
|
|
"aria-labelledby": referenceId
|
|
}
|
|
};
|
|
}, [ariaRole, floatingId, referenceId, role]);
|
|
const item = React76.useCallback((_ref) => {
|
|
let {
|
|
active,
|
|
selected
|
|
} = _ref;
|
|
const commonProps = {
|
|
role: "option",
|
|
...active && {
|
|
id: floatingId + "-fui-option"
|
|
}
|
|
};
|
|
switch (role) {
|
|
case "select":
|
|
case "combobox":
|
|
return {
|
|
...commonProps,
|
|
"aria-selected": selected
|
|
};
|
|
}
|
|
return {};
|
|
}, [floatingId, role]);
|
|
return React76.useMemo(() => enabled ? {
|
|
reference,
|
|
floating,
|
|
item
|
|
} : {}, [enabled, reference, floating, item]);
|
|
}
|
|
__name(useRole3, "useRole");
|
|
|
|
// node_modules/@tamagui/tooltip/dist/esm/Tooltip.mjs
|
|
var import_core50 = require("@tamagui/core");
|
|
var React77 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
var TOOLTIP_SCOPE = "";
|
|
var TooltipContent = PopperContentFrame.extractable(React77.forwardRef((props, ref) => {
|
|
const preventAnimation = React77.useContext(PreventTooltipAnimationContext);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PopoverContent, {
|
|
scope: props.scope || TOOLTIP_SCOPE,
|
|
componentName: "Tooltip",
|
|
disableFocusScope: true,
|
|
...!props.unstyled && {
|
|
pointerEvents: "none"
|
|
},
|
|
ref,
|
|
...props,
|
|
...preventAnimation && {
|
|
animation: null
|
|
}
|
|
});
|
|
}));
|
|
var TooltipArrow = React77.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PopoverArrow, {
|
|
scope: props.scope || TOOLTIP_SCOPE,
|
|
componentName: "Tooltip",
|
|
ref,
|
|
...props
|
|
}));
|
|
var PreventTooltipAnimationContext = React77.createContext(false);
|
|
var TooltipGroup = /* @__PURE__ */ __name(({
|
|
children,
|
|
delay,
|
|
preventAnimation = false,
|
|
timeoutMs
|
|
}) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PreventTooltipAnimationContext.Provider, {
|
|
value: preventAnimation,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FloatingDelayGroup, {
|
|
timeoutMs,
|
|
delay: React77.useMemo(() => delay, [JSON.stringify(delay)]),
|
|
children
|
|
})
|
|
}), "TooltipGroup");
|
|
var setOpens = /* @__PURE__ */ new Set();
|
|
var closeOpenTooltips = /* @__PURE__ */ __name(() => {
|
|
setOpens.forEach((x) => x(false));
|
|
}, "closeOpenTooltips");
|
|
var TooltipComponent = React77.forwardRef(function(props, ref) {
|
|
const {
|
|
children,
|
|
delay: delayProp = 400,
|
|
restMs = typeof delayProp > "u" ? 0 : typeof delayProp == "number" ? delayProp : 0,
|
|
onOpenChange: onOpenChangeProp,
|
|
focus: focus2,
|
|
open: openProp,
|
|
disableAutoCloseOnScroll,
|
|
scope = TOOLTIP_SCOPE,
|
|
...restProps
|
|
} = props, triggerRef = React77.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React77.useState(false), {
|
|
delay: delayGroup,
|
|
setCurrentId
|
|
} = useDelayGroupContext(), delay = delayProp ?? delayGroup ?? 0, [open, setOpen] = useControllableState({
|
|
prop: openProp,
|
|
defaultProp: false,
|
|
onChange: onOpenChangeProp
|
|
}), id = props.groupId, onOpenChange = (0, import_core50.useEvent)((open2) => {
|
|
open2 && setCurrentId(id), setOpen(open2);
|
|
});
|
|
React77.useEffect(() => {
|
|
if (!open || disableAutoCloseOnScroll || typeof document > "u") return;
|
|
const closeIt = /* @__PURE__ */ __name(() => {
|
|
setOpen(false);
|
|
}, "closeIt");
|
|
return setOpens.add(setOpen), document.documentElement.addEventListener("scroll", closeIt), () => {
|
|
setOpens.delete(setOpen), document.documentElement.removeEventListener("scroll", closeIt);
|
|
};
|
|
}, [open, disableAutoCloseOnScroll]);
|
|
const useFloatingFn = /* @__PURE__ */ __name((props2) => {
|
|
const floating = useFloating5({
|
|
...props2,
|
|
open,
|
|
onOpenChange
|
|
}), {
|
|
delay: delayContext
|
|
} = useDelayGroup(floating.context, {
|
|
id
|
|
}), delayOut = delay ?? delayContext, {
|
|
getReferenceProps,
|
|
getFloatingProps
|
|
} = useInteractions3([useHover2(floating.context, {
|
|
delay: delayOut,
|
|
restMs
|
|
}), useFocus2(floating.context, focus2), useRole3(floating.context, {
|
|
role: "tooltip"
|
|
}), useDismiss3(floating.context)]);
|
|
return {
|
|
...floating,
|
|
open,
|
|
getReferenceProps,
|
|
getFloatingProps
|
|
};
|
|
}, "useFloatingFn"), useFloatingContext2 = React77.useCallback(useFloatingFn, [id, delay, open, restMs, focus2 ? JSON.stringify(focus2) : 0]), onCustomAnchorAdd = React77.useCallback(() => setHasCustomAnchor(true), []), onCustomAnchorRemove = React77.useCallback(() => setHasCustomAnchor(false), []), contentId = React77.useId(), smallerSize = props.unstyled ? null : getSize("$true", {
|
|
shift: -2,
|
|
bounds: [0]
|
|
});
|
|
return (
|
|
// TODO: FloatingOverrideContext might also need to be scoped
|
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FloatingOverrideContext.Provider, {
|
|
value: useFloatingContext2,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Popper, {
|
|
scope,
|
|
size: smallerSize?.key,
|
|
allowFlip: true,
|
|
stayInFrame: true,
|
|
open,
|
|
...restProps,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PopoverContext.Provider, {
|
|
popoverScope: scope,
|
|
scope,
|
|
contentId,
|
|
triggerRef,
|
|
open,
|
|
onOpenChange: setOpen,
|
|
onOpenToggle: voidFn,
|
|
hasCustomAnchor,
|
|
onCustomAnchorAdd,
|
|
onCustomAnchorRemove,
|
|
children
|
|
})
|
|
})
|
|
})
|
|
);
|
|
});
|
|
var TooltipTrigger = React77.forwardRef(function(props, ref) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PopoverTrigger, {
|
|
...rest,
|
|
scope: scope || TOOLTIP_SCOPE,
|
|
ref
|
|
});
|
|
});
|
|
var TooltipAnchor = React77.forwardRef(function(props, ref) {
|
|
const {
|
|
scope,
|
|
...rest
|
|
} = props;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PopoverAnchor, {
|
|
...rest,
|
|
scope: scope || TOOLTIP_SCOPE,
|
|
ref
|
|
});
|
|
});
|
|
var Tooltip2 = withStaticProperties(TooltipComponent, {
|
|
Anchor: TooltipAnchor,
|
|
Arrow: TooltipArrow,
|
|
Content: TooltipContent,
|
|
Trigger: TooltipTrigger
|
|
});
|
|
var voidFn = /* @__PURE__ */ __name(() => {
|
|
}, "voidFn");
|
|
|
|
// node_modules/@tamagui/tooltip/dist/esm/TooltipSimple.mjs
|
|
var React78 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
var TooltipSimple = React78.forwardRef(({
|
|
label,
|
|
children,
|
|
contentProps,
|
|
disabled,
|
|
...tooltipProps
|
|
}, ref) => {
|
|
const child = React78.Children.only(children);
|
|
return label ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Tooltip2, {
|
|
disableRTL: true,
|
|
offset: 15,
|
|
restMs: 40,
|
|
delay: 40,
|
|
...tooltipProps,
|
|
...disabled ? {
|
|
open: false
|
|
} : null,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Tooltip2.Trigger, {
|
|
...typeof label == "string" && {
|
|
"aria-label": label
|
|
},
|
|
asChild: "except-style",
|
|
children: ref && React78.isValidElement(child) ? React78.cloneElement(child, {
|
|
ref
|
|
}) : child
|
|
}), /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Tooltip2.Content, {
|
|
zIndex: 1e9,
|
|
enterStyle: {
|
|
y: -4,
|
|
opacity: 0,
|
|
scale: 0.96
|
|
},
|
|
exitStyle: {
|
|
y: -4,
|
|
opacity: 0,
|
|
scale: 0.96
|
|
},
|
|
scale: 1,
|
|
elevation: "$0.5",
|
|
opacity: 1,
|
|
pointerEvents: "none",
|
|
paddingVertical: getSpace(tooltipProps.size || "$true", {
|
|
shift: -4
|
|
}),
|
|
animateOnly: ["transform", "opacity"],
|
|
animation: ["quicker", {
|
|
opacity: {
|
|
overshootClamping: true
|
|
}
|
|
}],
|
|
...contentProps,
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Tooltip2.Arrow, {}), /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Paragraph, {
|
|
size: "$3",
|
|
children: label
|
|
})]
|
|
})]
|
|
}) : children;
|
|
});
|
|
|
|
// node_modules/@tamagui/use-window-dimensions/dist/esm/index.mjs
|
|
var import_react54 = __toESM(require("react"), 1);
|
|
|
|
// node_modules/@tamagui/use-window-dimensions/dist/esm/initialValue.mjs
|
|
var initialValue = {
|
|
width: 800,
|
|
height: 600,
|
|
scale: 1,
|
|
fontScale: 1
|
|
};
|
|
function configureInitialWindowDimensions(next) {
|
|
Object.assign(initialValue, next);
|
|
}
|
|
__name(configureInitialWindowDimensions, "configureInitialWindowDimensions");
|
|
|
|
// node_modules/@tamagui/use-window-dimensions/dist/esm/helpers.mjs
|
|
var lastSize = initialValue;
|
|
var docEl = null;
|
|
function getWindowSize() {
|
|
if (!isClient) return initialValue;
|
|
docEl ||= window.document.documentElement;
|
|
const nextSize = {
|
|
fontScale: 1,
|
|
height: docEl.clientHeight,
|
|
scale: window.devicePixelRatio || 1,
|
|
width: docEl.clientWidth
|
|
};
|
|
return nextSize.height !== lastSize.height || nextSize.width !== lastSize.width || nextSize.scale !== lastSize.scale ? (lastSize = nextSize, nextSize) : lastSize;
|
|
}
|
|
__name(getWindowSize, "getWindowSize");
|
|
var cbs = /* @__PURE__ */ new Set();
|
|
if (isClient) {
|
|
let flushUpdate = /* @__PURE__ */ __name(function() {
|
|
lastUpdate = Date.now(), cbs.forEach((cb) => cb(getWindowSize()));
|
|
}, "flushUpdate"), lastUpdate = Date.now(), tm;
|
|
const USER_MAX_MS = process.env.TAMAGUI_USE_WINDOW_DIMENSIONS_MAX_UPDATE_MS, updateMaxMs = USER_MAX_MS ? +USER_MAX_MS : 100, onResize = /* @__PURE__ */ __name(() => {
|
|
clearTimeout(tm);
|
|
const timeSinceLast = Date.now() - lastUpdate;
|
|
timeSinceLast < updateMaxMs ? setTimeout(() => {
|
|
flushUpdate();
|
|
}, updateMaxMs - timeSinceLast) : flushUpdate();
|
|
}, "onResize");
|
|
window.addEventListener("resize", onResize);
|
|
}
|
|
function subscribe2(cb) {
|
|
return cbs.add(cb), () => cbs.delete(cb);
|
|
}
|
|
__name(subscribe2, "subscribe");
|
|
|
|
// node_modules/@tamagui/use-window-dimensions/dist/esm/index.mjs
|
|
function useWindowDimensions({
|
|
serverValue = initialValue
|
|
} = {}) {
|
|
return import_react54.default.useSyncExternalStore(subscribe2, getWindowSize, () => isWeb ? serverValue : getWindowSize());
|
|
}
|
|
__name(useWindowDimensions, "useWindowDimensions");
|
|
|
|
// node_modules/@tamagui/visually-hidden/dist/esm/VisuallyHidden.mjs
|
|
var import_web22 = require("@tamagui/core");
|
|
var VisuallyHidden = (0, import_web22.styled)(import_web22.Text, {
|
|
position: "absolute",
|
|
width: 1,
|
|
height: 1,
|
|
margin: -1,
|
|
zIndex: -1e4,
|
|
overflow: "hidden",
|
|
opacity: 1e-8,
|
|
pointerEvents: "none",
|
|
variants: {
|
|
preserveDimensions: {
|
|
true: {
|
|
position: "relative",
|
|
width: "auto",
|
|
height: "auto"
|
|
}
|
|
},
|
|
visible: {
|
|
true: {
|
|
position: "relative",
|
|
width: "auto",
|
|
height: "auto",
|
|
margin: 0,
|
|
zIndex: 1,
|
|
overflow: "visible",
|
|
opacity: 1,
|
|
pointerEvents: "auto"
|
|
}
|
|
}
|
|
}
|
|
});
|
|
VisuallyHidden.isVisuallyHidden = true;
|
|
|
|
// node_modules/tamagui/dist/esm/createTamagui.mjs
|
|
var import_core51 = require("@tamagui/core");
|
|
var createTamagui = process.env.NODE_ENV !== "development" ? import_core51.createTamagui : (conf) => {
|
|
const sizeTokenKeys = ["$true"], hasKeys = /* @__PURE__ */ __name((expectedKeys, obj) => expectedKeys.every((k) => typeof obj[k] < "u"), "hasKeys"), tamaguiConfig = (0, import_core51.createTamagui)(conf);
|
|
for (const name of ["size", "space"]) {
|
|
const tokenSet = tamaguiConfig.tokensParsed[name];
|
|
if (!tokenSet) throw new Error(`Expected tokens for "${name}" in ${Object.keys(tamaguiConfig.tokensParsed).join(", ")}`);
|
|
if (!hasKeys(sizeTokenKeys, tokenSet)) throw new Error(`
|
|
createTamagui() missing expected tokens.${name}:
|
|
|
|
Received: ${Object.keys(tokenSet).join(", ")}
|
|
|
|
Expected: ${sizeTokenKeys.join(", ")}
|
|
|
|
Tamagui expects a "true" key that is the same value as your default size. This is so
|
|
it can size things up or down from the defaults without assuming which keys you use.
|
|
|
|
Please define a "true" or "$true" key on your size and space tokens like so (example):
|
|
|
|
size: {
|
|
sm: 2,
|
|
md: 10,
|
|
true: 10, // this means "md" is your default size
|
|
lg: 20,
|
|
}
|
|
|
|
`);
|
|
}
|
|
const expected = Object.keys(tamaguiConfig.tokensParsed.size);
|
|
for (const name of ["radius", "zIndex"]) {
|
|
const tokenSet = tamaguiConfig.tokensParsed[name], received = Object.keys(tokenSet);
|
|
if (!received.some((rk) => expected.includes(rk))) throw new Error(`
|
|
createTamagui() invalid tokens.${name}:
|
|
|
|
Received: ${received.join(", ")}
|
|
|
|
Expected a subset of: ${expected.join(", ")}
|
|
|
|
`);
|
|
}
|
|
return tamaguiConfig;
|
|
};
|
|
|
|
// node_modules/tamagui/dist/esm/views/TamaguiProvider.mjs
|
|
var import_core52 = require("@tamagui/core");
|
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
var TamaguiProvider = /* @__PURE__ */ __name(({
|
|
children,
|
|
...props
|
|
}) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_core52.TamaguiProvider, {
|
|
...props,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ZIndexStackContext.Provider, {
|
|
value: 1,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(PortalProvider, {
|
|
shouldAddRootHost: true,
|
|
children
|
|
})
|
|
})
|
|
}), "TamaguiProvider");
|
|
|
|
// node_modules/tamagui/dist/esm/views/Anchor.mjs
|
|
var import_core53 = require("@tamagui/core");
|
|
var import_react_native_web8 = __toESM(require_cjs(), 1);
|
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
var AnchorFrame = (0, import_core53.styled)(SizableText2, {
|
|
name: "Anchor",
|
|
tag: "a",
|
|
accessibilityRole: "link"
|
|
});
|
|
var Anchor = AnchorFrame.styleable(({
|
|
href,
|
|
target,
|
|
...props
|
|
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AnchorFrame, {
|
|
...props,
|
|
...isWeb ? {
|
|
href,
|
|
target
|
|
} : {
|
|
onPress: /* @__PURE__ */ __name((event) => {
|
|
props.onPress?.(event), href !== void 0 && import_react_native_web8.Linking.openURL(href);
|
|
}, "onPress")
|
|
},
|
|
ref
|
|
}));
|
|
|
|
// node_modules/tamagui/dist/esm/views/EnsureFlexed.mjs
|
|
var import_core54 = require("@tamagui/core");
|
|
var EnsureFlexed = (0, import_core54.styled)(import_core54.Text, {
|
|
opacity: 0,
|
|
lineHeight: 0,
|
|
height: 0,
|
|
display: "flex",
|
|
fontSize: 200,
|
|
children: "wwwwwwwwwwwwwwwwwww",
|
|
pointerEvents: "none"
|
|
});
|
|
EnsureFlexed.isVisuallyHidden = true;
|
|
|
|
// node_modules/tamagui/dist/esm/views/Fieldset.mjs
|
|
var import_core55 = require("@tamagui/core");
|
|
var Fieldset = (0, import_core55.styled)(YStack, {
|
|
name: "Fieldset",
|
|
tag: "fieldset",
|
|
// remove browser default styling
|
|
borderWidth: 0,
|
|
variants: {
|
|
horizontal: {
|
|
true: {
|
|
flexDirection: "row",
|
|
alignItems: "center"
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/tamagui/dist/esm/views/Input.mjs
|
|
var import_react55 = __toESM(require("react"), 1);
|
|
var import_core57 = require("@tamagui/core");
|
|
var import_react_native_web9 = __toESM(require_cjs(), 1);
|
|
|
|
// node_modules/tamagui/dist/esm/helpers/inputHelpers.mjs
|
|
var import_core56 = require("@tamagui/core");
|
|
var inputSizeVariant = /* @__PURE__ */ __name((val = "$true", extras) => {
|
|
if (extras.props.multiline || extras.props.numberOfLines > 1) return textAreaSizeVariant(val, extras);
|
|
const buttonStyles = getButtonSized(val, extras), paddingHorizontal = getSpace(val, {
|
|
shift: -1,
|
|
bounds: [2]
|
|
}), fontStyle = getFontSized(val, extras);
|
|
return !import_core56.isWeb && fontStyle && delete fontStyle.lineHeight, {
|
|
...fontStyle,
|
|
...buttonStyles,
|
|
paddingHorizontal
|
|
};
|
|
}, "inputSizeVariant");
|
|
var textAreaSizeVariant = /* @__PURE__ */ __name((val = "$true", extras) => {
|
|
const {
|
|
props
|
|
} = extras, buttonStyles = getButtonSized(val, extras), fontStyle = getFontSized(val, extras), lines = props.rows ?? props.numberOfLines, height = typeof lines == "number" ? lines * (0, import_core56.getVariableValue)(fontStyle.lineHeight) : "auto", paddingVertical = getSpace(val, {
|
|
shift: -2,
|
|
bounds: [2]
|
|
}), paddingHorizontal = getSpace(val, {
|
|
shift: -1,
|
|
bounds: [2]
|
|
});
|
|
return {
|
|
...buttonStyles,
|
|
...fontStyle,
|
|
paddingVertical,
|
|
paddingHorizontal,
|
|
height
|
|
};
|
|
}, "textAreaSizeVariant");
|
|
|
|
// node_modules/tamagui/dist/esm/views/Input.mjs
|
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
var defaultStyles = {
|
|
size: "$true",
|
|
fontFamily: "$body",
|
|
borderWidth: 1,
|
|
outlineWidth: 0,
|
|
color: "$color",
|
|
...isWeb ? {
|
|
tabIndex: 0
|
|
} : {
|
|
focusable: true
|
|
},
|
|
borderColor: "$borderColor",
|
|
backgroundColor: "$background",
|
|
// this fixes a flex bug where it overflows container
|
|
minWidth: 0,
|
|
hoverStyle: {
|
|
borderColor: "$borderColorHover"
|
|
},
|
|
focusStyle: {
|
|
borderColor: "$borderColorFocus"
|
|
},
|
|
focusVisibleStyle: {
|
|
outlineColor: "$outlineColor",
|
|
outlineWidth: 2,
|
|
outlineStyle: "solid"
|
|
}
|
|
};
|
|
var InputFrame = (0, import_core57.styled)(import_react_native_web9.TextInput, {
|
|
name: "Input",
|
|
variants: {
|
|
unstyled: {
|
|
false: defaultStyles
|
|
},
|
|
size: {
|
|
"...size": inputSizeVariant
|
|
},
|
|
disabled: {
|
|
true: {}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
}, {
|
|
isInput: true,
|
|
accept: {
|
|
placeholderTextColor: "color",
|
|
selectionColor: "color"
|
|
}
|
|
});
|
|
var Input = InputFrame.styleable((propsIn, forwardedRef) => {
|
|
const ref = import_react55.default.useRef(null), composedRefs = (0, import_core57.useComposedRefs)(forwardedRef, ref), props = useInputProps(propsIn, composedRefs);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(InputFrame, {
|
|
...props
|
|
});
|
|
});
|
|
function useInputProps(props, ref) {
|
|
const theme = (0, import_core57.useTheme)(), focusableProps = useFocusable({
|
|
props,
|
|
ref,
|
|
isInput: true
|
|
}), placeholderTextColor = import_react55.default.useMemo(() => {
|
|
const placeholderColorProp = props.placeholderTextColor;
|
|
return theme[placeholderColorProp]?.get() ?? placeholderColorProp ?? theme.placeholderColor?.get();
|
|
}, [props.placeholderTextColor, theme]);
|
|
return import_react55.default.useMemo(() => ({
|
|
ref: focusableProps.ref,
|
|
readOnly: props.disabled,
|
|
...props,
|
|
placeholderTextColor,
|
|
onChangeText: focusableProps.onChangeText
|
|
}), [focusableProps.ref, focusableProps.onChangeText, props.disabled, props, placeholderTextColor]);
|
|
}
|
|
__name(useInputProps, "useInputProps");
|
|
|
|
// node_modules/tamagui/dist/esm/views/Spinner.mjs
|
|
var import_core58 = require("@tamagui/core");
|
|
var React81 = __toESM(require("react"), 1);
|
|
var import_react_native_web10 = __toESM(require_cjs(), 1);
|
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
var Spinner = YStack.extractable((0, import_core58.themeable)(React81.forwardRef((props, ref) => {
|
|
const {
|
|
size: size4,
|
|
color: colorProp,
|
|
...stackProps
|
|
} = props, theme = (0, import_core58.useTheme)();
|
|
let color = colorProp;
|
|
return color && color[0] === "$" && (color = (0, import_core58.variableToString)(theme[color])), /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(YStack, {
|
|
ref,
|
|
...stackProps,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react_native_web10.ActivityIndicator, {
|
|
size: size4,
|
|
color
|
|
})
|
|
});
|
|
}), {
|
|
componentName: "Spinner"
|
|
}));
|
|
|
|
// node_modules/tamagui/dist/esm/views/TextArea.mjs
|
|
var import_core59 = require("@tamagui/core");
|
|
var import_react56 = __toESM(require("react"), 1);
|
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
var TextAreaFrame = (0, import_core59.styled)(InputFrame, {
|
|
name: "TextArea",
|
|
multiline: true,
|
|
// this attribute fixes firefox newline issue
|
|
whiteSpace: "pre-wrap",
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
height: "auto",
|
|
...defaultStyles
|
|
}
|
|
},
|
|
size: {
|
|
"...size": textAreaSizeVariant
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
var TextArea = TextAreaFrame.styleable((propsIn, forwardedRef) => {
|
|
const ref = import_react56.default.useRef(null), composedRefs = (0, import_core59.useComposedRefs)(forwardedRef, ref), props = useInputProps(propsIn, composedRefs), linesProp = {
|
|
// web uses rows now, but native not caught up :/
|
|
[isWeb ? "rows" : "numberOfLines"]: propsIn.unstyled ? void 0 : 4
|
|
};
|
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TextAreaFrame, {
|
|
...linesProp,
|
|
...props
|
|
});
|
|
});
|
|
|
|
// node_modules/tamagui/dist/esm/views/Text.mjs
|
|
var import_core60 = require("@tamagui/core");
|
|
var Text5 = (0, import_core60.styled)(import_core60.Text, {
|
|
variants: {
|
|
unstyled: {
|
|
false: {
|
|
color: "$color"
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
}
|
|
});
|
|
|
|
// node_modules/tamagui/dist/esm/index.mjs
|
|
var import_core61 = require("@tamagui/core");
|
|
// Annotate the CommonJS export names for ESM import in node:
|
|
0 && (module.exports = {
|
|
ACTIONS,
|
|
Accordion,
|
|
Adapt,
|
|
AdaptContents,
|
|
AdaptContext,
|
|
AdaptParent,
|
|
AdaptPortalContents,
|
|
AlertDialog,
|
|
AlertDialogAction,
|
|
AlertDialogCancel,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogOverlay,
|
|
AlertDialogPortal,
|
|
AlertDialogTitle,
|
|
AlertDialogTrigger,
|
|
Anchor,
|
|
AnimatePresence,
|
|
Article,
|
|
Aside,
|
|
Avatar,
|
|
AvatarFallback,
|
|
AvatarFallbackFrame,
|
|
AvatarFrame,
|
|
AvatarImage,
|
|
Button,
|
|
ButtonContext,
|
|
ButtonFrame,
|
|
ButtonIcon,
|
|
ButtonNestingContext,
|
|
ButtonText,
|
|
Card,
|
|
CardBackground,
|
|
CardFooter,
|
|
CardFrame,
|
|
CardHeader,
|
|
Checkbox,
|
|
CheckboxContext,
|
|
CheckboxFrame,
|
|
CheckboxIndicatorFrame,
|
|
CheckboxStyledContext,
|
|
Circle,
|
|
ClientOnly,
|
|
ComponentContext,
|
|
Configuration,
|
|
Dialog,
|
|
DialogClose,
|
|
DialogContent,
|
|
DialogContext,
|
|
DialogDescription,
|
|
DialogOverlay,
|
|
DialogOverlayFrame,
|
|
DialogPortal,
|
|
DialogPortalFrame,
|
|
DialogProvider,
|
|
DialogTitle,
|
|
DialogTrigger,
|
|
DialogWarningProvider,
|
|
EnsureFlexed,
|
|
Fieldset,
|
|
FontLanguage,
|
|
Footer,
|
|
Form,
|
|
FormFrame,
|
|
FormProvider,
|
|
FormTrigger,
|
|
ForwardSelectContext,
|
|
Frame,
|
|
Group,
|
|
GroupContext,
|
|
GroupFrame,
|
|
H1,
|
|
H2,
|
|
H3,
|
|
H4,
|
|
H5,
|
|
H6,
|
|
Handle,
|
|
Header,
|
|
Heading,
|
|
INITIAL_STATE,
|
|
IS_FABRIC,
|
|
Image,
|
|
Input,
|
|
InputFrame,
|
|
Label,
|
|
LabelFrame,
|
|
ListItem,
|
|
ListItemFrame,
|
|
ListItemSubtitle,
|
|
ListItemText,
|
|
ListItemTitle,
|
|
Main,
|
|
Nav,
|
|
Overlay,
|
|
Paragraph,
|
|
ParentSheetContext,
|
|
Popover,
|
|
PopoverAnchor,
|
|
PopoverArrow,
|
|
PopoverClose,
|
|
PopoverContent,
|
|
PopoverContext,
|
|
PopoverTrigger,
|
|
Popper,
|
|
PopperAnchor,
|
|
PopperArrow,
|
|
PopperArrowFrame,
|
|
PopperContent,
|
|
PopperContentFrame,
|
|
PopperContextFast,
|
|
PopperContextSlow,
|
|
PopperPositionContext,
|
|
PopperProvider,
|
|
PopperProviderFast,
|
|
PopperProviderSlow,
|
|
Portal,
|
|
PortalHost,
|
|
PortalItem,
|
|
PortalProvider,
|
|
PresenceChild,
|
|
PresenceContext,
|
|
Progress,
|
|
ProgressFrame,
|
|
ProgressIndicator,
|
|
ProgressIndicatorFrame,
|
|
ProvideAdaptContext,
|
|
RadioGroup,
|
|
RadioGroupFrame,
|
|
RadioGroupIndicatorFrame,
|
|
RadioGroupItemFrame,
|
|
RadioGroupStyledContext,
|
|
Range,
|
|
ResetPresence,
|
|
ScrollView,
|
|
Section,
|
|
Select,
|
|
SelectGroupFrame,
|
|
SelectIcon,
|
|
SelectItemParentProvider,
|
|
SelectProvider,
|
|
SelectSeparator,
|
|
Separator,
|
|
Sheet,
|
|
SheetController,
|
|
SheetControllerContext,
|
|
SheetHandleFrame,
|
|
SheetInsideSheetContext,
|
|
SheetOverlayFrame,
|
|
SheetScrollView,
|
|
SizableStack,
|
|
SizableText,
|
|
Slider,
|
|
SliderContext,
|
|
SliderFrame,
|
|
SliderThumb,
|
|
SliderThumbFrame,
|
|
SliderTrack,
|
|
SliderTrackActive,
|
|
SliderTrackActiveFrame,
|
|
SliderTrackFrame,
|
|
Spacer,
|
|
Spinner,
|
|
Square,
|
|
Stack,
|
|
StyleObjectIdentifier,
|
|
StyleObjectProperty,
|
|
StyleObjectPseudo,
|
|
StyleObjectRules,
|
|
StyleObjectValue,
|
|
Switch,
|
|
SwitchContext,
|
|
SwitchFrame,
|
|
SwitchStyledContext,
|
|
SwitchThumb,
|
|
Tabs,
|
|
TabsProvider,
|
|
TamaguiProvider,
|
|
Text,
|
|
TextArea,
|
|
TextAreaFrame,
|
|
Theme,
|
|
ThemeableStack,
|
|
Thumb,
|
|
ToggleGroup,
|
|
Tooltip,
|
|
TooltipGroup,
|
|
TooltipSimple,
|
|
Track,
|
|
USE_NATIVE_PORTAL,
|
|
Unspaced,
|
|
View,
|
|
VisuallyHidden,
|
|
XGroup,
|
|
XStack,
|
|
YGroup,
|
|
YStack,
|
|
ZStack,
|
|
addTheme,
|
|
allPortalHosts,
|
|
clamp,
|
|
closeOpenTooltips,
|
|
composeEventHandlers,
|
|
composeRefs,
|
|
configureInitialWindowDimensions,
|
|
createAvatarScope,
|
|
createCheckbox,
|
|
createComponent,
|
|
createContext,
|
|
createContextScope,
|
|
createFont,
|
|
createMedia,
|
|
createProgressScope,
|
|
createRadioGroup,
|
|
createSheet,
|
|
createSheetScope,
|
|
createShorthands,
|
|
createStyledContext,
|
|
createSwitch,
|
|
createTabs,
|
|
createTamagui,
|
|
createTheme,
|
|
createTokens,
|
|
createVariable,
|
|
debounce,
|
|
defaultStyles,
|
|
fullscreenStyle,
|
|
getCSSStylesAtomic,
|
|
getConfig,
|
|
getFontSize,
|
|
getFontSizeToken,
|
|
getFontSizeVariable,
|
|
getMedia,
|
|
getNativeSheet,
|
|
getShapeSize,
|
|
getThemes,
|
|
getToken,
|
|
getTokenValue,
|
|
getTokens,
|
|
getVariable,
|
|
getVariableName,
|
|
getVariableValue,
|
|
insertFont,
|
|
isChrome,
|
|
isClient,
|
|
isPresent,
|
|
isServer,
|
|
isServerSide,
|
|
isTamaguiComponent,
|
|
isTamaguiElement,
|
|
isTouchable,
|
|
isVariable,
|
|
isWeb,
|
|
isWebTouchable,
|
|
matchMedia,
|
|
mediaObjectToString,
|
|
mediaQueryConfig,
|
|
mediaState,
|
|
mutateThemes,
|
|
portalListeners,
|
|
prevent,
|
|
replaceTheme,
|
|
resolveViewZIndex,
|
|
setConfig,
|
|
setOnLayoutStrategy,
|
|
setRef,
|
|
setupDev,
|
|
setupNativeSheet,
|
|
setupPopper,
|
|
setupReactNative,
|
|
shouldRenderNativePlatform,
|
|
simpleHash,
|
|
spacedChildren,
|
|
stylePropsAll,
|
|
stylePropsText,
|
|
stylePropsTextOnly,
|
|
stylePropsTransform,
|
|
stylePropsUnitless,
|
|
stylePropsView,
|
|
styled,
|
|
themeable,
|
|
themeableVariants,
|
|
tokenCategories,
|
|
updateTheme,
|
|
useAdaptContext,
|
|
useAdaptIsActive,
|
|
useButton,
|
|
useComposedRefs,
|
|
useConfiguration,
|
|
useControllableState,
|
|
useCurrentColor,
|
|
useDebounce,
|
|
useDebounceValue,
|
|
useDialogContext,
|
|
useDidFinishSSR,
|
|
useEvent,
|
|
useFloatingContext,
|
|
useForceUpdate,
|
|
useFormContext,
|
|
useGet,
|
|
useGetThemedIcon,
|
|
useGroupItem,
|
|
useInputProps,
|
|
useIsPresent,
|
|
useIsTouchDevice,
|
|
useIsomorphicLayoutEffect,
|
|
useLabelContext,
|
|
useListItem,
|
|
useMedia,
|
|
usePopoverContext,
|
|
usePopperContext,
|
|
usePopperContextSlow,
|
|
usePortal,
|
|
usePresence,
|
|
useProps,
|
|
usePropsAndStyle,
|
|
useSelectContext,
|
|
useSelectItemParentContext,
|
|
useSheet,
|
|
useSheetController,
|
|
useSheetOffscreenSize,
|
|
useSheetOpenState,
|
|
useStyle,
|
|
useTabsContext,
|
|
useTheme,
|
|
useThemeName,
|
|
useWindowDimensions,
|
|
validPseudoKeys,
|
|
validStyles,
|
|
variableToString,
|
|
withStaticProperties,
|
|
wrapChildrenInText
|
|
});
|
|
/*! Bundled license information:
|
|
|
|
tabbable/dist/index.js:
|
|
(*!
|
|
* tabbable 6.3.0
|
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
*)
|
|
*/
|