@valaxyjs/devtools 0.22.17 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{about-BPd5MeUN.js → about-CRK8PaDm.js} +1 -1
- package/dist/client/assets/{categories-B9M6tHIx.js → categories-C0H9vvj4.js} +1 -1
- package/dist/client/assets/{index-C1CSGtTH.js → index-B4DtXRkC.js} +422 -328
- package/dist/client/assets/index-Bu5CF1lM.css +428 -0
- package/dist/client/assets/{index-CHypEGrE.js → index-hMYuAPVg.js} +729 -446
- package/dist/client/assets/{migration-BNqK2gmS.js → migration-KEAnRKjM.js} +2 -2
- package/dist/client/assets/{splitpanes.es-Jgun55i8.js → splitpanes.es-vyPv2JLR.js} +3 -1
- package/dist/client/assets/{tags-CWy-2M3D.js → tags-CQ8R6nFj.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +12 -13
- package/dist/client/assets/index-RHgX5GjR.css +0 -428
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
true&&(function polyfill() {
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-hMYuAPVg.js","./splitpanes.es-vyPv2JLR.js","./index-DKnSvpEK.css","./migration-KEAnRKjM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
true &&(function polyfill() {
|
|
3
3
|
const relList = document.createElement("link").relList;
|
|
4
4
|
if (relList && relList.supports && relList.supports("modulepreload")) {
|
|
5
5
|
return;
|
|
@@ -376,6 +376,11 @@ function getWindowScrollTop() {
|
|
|
376
376
|
return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
+
// src/dom/methods/isRTL.ts
|
|
380
|
+
function isRTL(element) {
|
|
381
|
+
return element ? getComputedStyle(element).direction === "rtl" : false;
|
|
382
|
+
}
|
|
383
|
+
|
|
379
384
|
// src/dom/methods/absolutePosition.ts
|
|
380
385
|
function absolutePosition(element, target, gutter = true) {
|
|
381
386
|
var _a, _b, _c, _d;
|
|
@@ -401,8 +406,12 @@ function absolutePosition(element, target, gutter = true) {
|
|
|
401
406
|
}
|
|
402
407
|
if (targetOffset.left + elementOuterWidth > viewport.width) left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);
|
|
403
408
|
else left = targetOffset.left + windowScrollLeft;
|
|
409
|
+
if (isRTL(element)) {
|
|
410
|
+
element.style.insetInlineEnd = left + "px";
|
|
411
|
+
} else {
|
|
412
|
+
element.style.insetInlineStart = left + "px";
|
|
413
|
+
}
|
|
404
414
|
element.style.top = top + "px";
|
|
405
|
-
element.style.insetInlineStart = left + "px";
|
|
406
415
|
element.style.transformOrigin = origin;
|
|
407
416
|
if (gutter) element.style.marginTop = origin === "bottom" ? `calc(${(_b = (_a = getCSSVariableByRegex(/-anchor-gutter$/)) == null ? void 0 : _a.value) != null ? _b : "2px"} * -1)` : (_d = (_c = getCSSVariableByRegex(/-anchor-gutter$/)) == null ? void 0 : _c.value) != null ? _d : "";
|
|
408
417
|
}
|
|
@@ -479,7 +488,7 @@ function isExist(element) {
|
|
|
479
488
|
|
|
480
489
|
// src/dom/methods/isElement.ts
|
|
481
490
|
function isElement(element) {
|
|
482
|
-
return typeof
|
|
491
|
+
return typeof Element !== "undefined" ? element instanceof Element : element !== null && typeof element === "object" && element.nodeType === 1 && typeof element.nodeName === "string";
|
|
483
492
|
}
|
|
484
493
|
|
|
485
494
|
// src/dom/methods/clearSelection.ts
|
|
@@ -1416,7 +1425,7 @@ var o$a={background:"{content.background}",borderColor:"{content.border.color}",
|
|
|
1416
1425
|
|
|
1417
1426
|
var e$8={minHeight:"5rem"},r$8={eventContent:{padding:"1rem 0"}},o$9={eventContent:{padding:"0 1rem"}},n$3={size:"1.125rem",borderRadius:"50%",borderWidth:"2px",background:"{content.background}",borderColor:"{content.border.color}",content:{borderRadius:"50%",size:"0.375rem",background:"{primary.color}",insetShadow:"0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"}},t$3={color:"{content.border.color}",size:"2px"},d$4={event:e$8,horizontal:r$8,vertical:o$9,eventMarker:n$3,eventConnector:t$3};/* Injected with object hook! */
|
|
1418
1427
|
|
|
1419
|
-
var o$8={width:"25rem",borderRadius:"{content.border.radius}",borderWidth:"1px",transitionDuration:"{transition.duration}"},r$7={size:"1.125rem"},e$7={padding:"{overlay.popover.padding}",gap:"0.5rem"},n$2={gap:"0.5rem"},a$2={fontWeight:"500",fontSize:"1rem"},s$1={fontWeight:"500",fontSize:"0.875rem"},c$4={width:"1.75rem",height:"1.75rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",offset:"{focus.ring.offset}"}},l$2={size:"1rem"},t$2={light:{blur:"1.5px",info:{background:"color-mix(in srgb, {blue.50}, transparent 5%)",borderColor:"{blue.200}",color:"{blue.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"{blue.100}",focusRing:{color:"{blue.600}",shadow:"none"}}},success:{background:"color-mix(in srgb, {green.50}, transparent 5%)",borderColor:"{green.200}",color:"{green.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"{green.100}",focusRing:{color:"{green.600}",shadow:"none"}}},warn:{background:"color-mix(in srgb,{yellow.50}, transparent 5%)",borderColor:"{yellow.200}",color:"{yellow.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"{yellow.100}",focusRing:{color:"{yellow.600}",shadow:"none"}}},error:{background:"color-mix(in srgb, {red.50}, transparent 5%)",borderColor:"{red.200}",color:"{red.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"{red.100}",focusRing:{color:"{red.600}",shadow:"none"}}},secondary:{background:"{surface.100}",borderColor:"{surface.200}",color:"{surface.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.200}",focusRing:{color:"{surface.600}",shadow:"none"}}},contrast:{background:"{surface.900}",borderColor:"{surface.950}",color:"{surface.50}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.800}",focusRing:{color:"{surface.50}",shadow:"none"}}}},dark:{blur:"10px",info:{background:"color-mix(in srgb, {blue.500}, transparent 84%)",borderColor:"color-mix(in srgb, {blue.700}, transparent 64%)",color:"{blue.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{blue.500}",shadow:"none"}}},success:{background:"color-mix(in srgb, {green.500}, transparent 84%)",borderColor:"color-mix(in srgb, {green.700}, transparent 64%)",color:"{green.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{green.500}",shadow:"none"}}},warn:{background:"color-mix(in srgb, {yellow.500}, transparent 84%)",borderColor:"color-mix(in srgb, {yellow.700}, transparent 64%)",color:"{yellow.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{yellow.500}",shadow:"none"}}},error:{background:"color-mix(in srgb, {red.500}, transparent 84%)",borderColor:"color-mix(in srgb, {red.700}, transparent 64%)",color:"{red.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{red.500}",shadow:"none"}}},secondary:{background:"{surface.800}",borderColor:"{surface.700}",color:"{surface.300}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.700}",focusRing:{color:"{surface.300}",shadow:"none"}}},contrast:{background:"{surface.0}",borderColor:"{surface.100}",color:"{surface.950}",detailColor:"{surface.950}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.100}",focusRing:{color:"{surface.950}",shadow:"none"}}}}},u$1={root:o$8,icon:r$7,content:e$7,text:n$2,summary:a$2,detail:s$1,closeButton:c$4,closeIcon:l$2,colorScheme:t$2};/* Injected with object hook! */
|
|
1428
|
+
var o$8={width:"25rem",borderRadius:"{content.border.radius}",borderWidth:"1px",transitionDuration:"{transition.duration}"},r$7={size:"1.125rem"},e$7={padding:"{overlay.popover.padding}",gap:"0.5rem"},n$2={gap:"0.5rem"},a$2={fontWeight:"500",fontSize:"1rem"},s$1={fontWeight:"500",fontSize:"0.875rem"},c$4={width:"1.75rem",height:"1.75rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",offset:"{focus.ring.offset}"}},l$2={size:"1rem"},t$2={light:{root:{blur:"1.5px"},info:{background:"color-mix(in srgb, {blue.50}, transparent 5%)",borderColor:"{blue.200}",color:"{blue.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"{blue.100}",focusRing:{color:"{blue.600}",shadow:"none"}}},success:{background:"color-mix(in srgb, {green.50}, transparent 5%)",borderColor:"{green.200}",color:"{green.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"{green.100}",focusRing:{color:"{green.600}",shadow:"none"}}},warn:{background:"color-mix(in srgb,{yellow.50}, transparent 5%)",borderColor:"{yellow.200}",color:"{yellow.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"{yellow.100}",focusRing:{color:"{yellow.600}",shadow:"none"}}},error:{background:"color-mix(in srgb, {red.50}, transparent 5%)",borderColor:"{red.200}",color:"{red.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"{red.100}",focusRing:{color:"{red.600}",shadow:"none"}}},secondary:{background:"{surface.100}",borderColor:"{surface.200}",color:"{surface.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.200}",focusRing:{color:"{surface.600}",shadow:"none"}}},contrast:{background:"{surface.900}",borderColor:"{surface.950}",color:"{surface.50}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.800}",focusRing:{color:"{surface.50}",shadow:"none"}}}},dark:{root:{blur:"10px"},info:{background:"color-mix(in srgb, {blue.500}, transparent 84%)",borderColor:"color-mix(in srgb, {blue.700}, transparent 64%)",color:"{blue.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{blue.500}",shadow:"none"}}},success:{background:"color-mix(in srgb, {green.500}, transparent 84%)",borderColor:"color-mix(in srgb, {green.700}, transparent 64%)",color:"{green.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{green.500}",shadow:"none"}}},warn:{background:"color-mix(in srgb, {yellow.500}, transparent 84%)",borderColor:"color-mix(in srgb, {yellow.700}, transparent 64%)",color:"{yellow.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{yellow.500}",shadow:"none"}}},error:{background:"color-mix(in srgb, {red.500}, transparent 84%)",borderColor:"color-mix(in srgb, {red.700}, transparent 64%)",color:"{red.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{red.500}",shadow:"none"}}},secondary:{background:"{surface.800}",borderColor:"{surface.700}",color:"{surface.300}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.700}",focusRing:{color:"{surface.300}",shadow:"none"}}},contrast:{background:"{surface.0}",borderColor:"{surface.100}",color:"{surface.950}",detailColor:"{surface.950}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.100}",focusRing:{color:"{surface.950}",shadow:"none"}}}}},u$1={root:o$8,icon:r$7,content:e$7,text:n$2,summary:a$2,detail:s$1,closeButton:c$4,closeIcon:l$2,colorScheme:t$2};/* Injected with object hook! */
|
|
1420
1429
|
|
|
1421
1430
|
var r$6={padding:"0.25rem",borderRadius:"{content.border.radius}",gap:"0.5rem",fontWeight:"500",disabledBackground:"{form.field.disabled.background}",disabledBorderColor:"{form.field.disabled.background}",disabledColor:"{form.field.disabled.color}",invalidBorderColor:"{form.field.invalid.border.color}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",padding:"0.25rem"},lg:{fontSize:"{form.field.lg.font.size}",padding:"0.25rem"}},o$7={disabledColor:"{form.field.disabled.color}"},e$6={padding:"0.25rem 0.75rem",borderRadius:"{content.border.radius}",checkedShadow:"0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04)",sm:{padding:"0.25rem 0.75rem"},lg:{padding:"0.25rem 0.75rem"}},d$3={light:{root:{background:"{surface.100}",checkedBackground:"{surface.100}",hoverBackground:"{surface.100}",borderColor:"{surface.100}",color:"{surface.500}",hoverColor:"{surface.700}",checkedColor:"{surface.900}",checkedBorderColor:"{surface.100}"},content:{checkedBackground:"{surface.0}"},icon:{color:"{surface.500}",hoverColor:"{surface.700}",checkedColor:"{surface.900}"}},dark:{root:{background:"{surface.950}",checkedBackground:"{surface.950}",hoverBackground:"{surface.950}",borderColor:"{surface.950}",color:"{surface.400}",hoverColor:"{surface.300}",checkedColor:"{surface.0}",checkedBorderColor:"{surface.950}"},content:{checkedBackground:"{surface.800}"},icon:{color:"{surface.400}",hoverColor:"{surface.300}",checkedColor:"{surface.0}"}}},c$3={root:r$6,icon:o$7,content:e$6,colorScheme:d$3};/* Injected with object hook! */
|
|
1422
1431
|
|
|
@@ -3034,6 +3043,9 @@ class RefImpl {
|
|
|
3034
3043
|
function unref(ref2) {
|
|
3035
3044
|
return isRef(ref2) ? ref2.value : ref2;
|
|
3036
3045
|
}
|
|
3046
|
+
function toValue(source) {
|
|
3047
|
+
return isFunction$1(source) ? source() : unref(source);
|
|
3048
|
+
}
|
|
3037
3049
|
const shallowUnwrapHandlers = {
|
|
3038
3050
|
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
|
|
3039
3051
|
set: (target, key, value, receiver) => {
|
|
@@ -5385,6 +5397,9 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
5385
5397
|
} else ;
|
|
5386
5398
|
}
|
|
5387
5399
|
}
|
|
5400
|
+
function hasInjectionContext() {
|
|
5401
|
+
return !!(currentInstance || currentRenderingInstance || currentApp);
|
|
5402
|
+
}
|
|
5388
5403
|
const internalObjectProto = {};
|
|
5389
5404
|
const createInternalObject = () => Object.create(internalObjectProto);
|
|
5390
5405
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
@@ -9074,8 +9089,164 @@ function normalizeContainer(container) {
|
|
|
9074
9089
|
|
|
9075
9090
|
/* Injected with object hook! */
|
|
9076
9091
|
|
|
9092
|
+
const TYPE_REQUEST = "q";
|
|
9093
|
+
const TYPE_RESPONSE = "s";
|
|
9094
|
+
const DEFAULT_TIMEOUT = 6e4;
|
|
9095
|
+
function defaultSerialize(i) {
|
|
9096
|
+
return i;
|
|
9097
|
+
}
|
|
9098
|
+
const defaultDeserialize = defaultSerialize;
|
|
9099
|
+
const { clearTimeout: clearTimeout$1, setTimeout: setTimeout$1 } = globalThis;
|
|
9100
|
+
const random = Math.random.bind(Math);
|
|
9101
|
+
function createBirpc(functions, options) {
|
|
9102
|
+
const {
|
|
9103
|
+
post,
|
|
9104
|
+
on,
|
|
9105
|
+
off = () => {
|
|
9106
|
+
},
|
|
9107
|
+
eventNames = [],
|
|
9108
|
+
serialize = defaultSerialize,
|
|
9109
|
+
deserialize = defaultDeserialize,
|
|
9110
|
+
resolver,
|
|
9111
|
+
bind = "rpc",
|
|
9112
|
+
timeout = DEFAULT_TIMEOUT
|
|
9113
|
+
} = options;
|
|
9114
|
+
const rpcPromiseMap = /* @__PURE__ */ new Map();
|
|
9115
|
+
let _promise;
|
|
9116
|
+
let closed = false;
|
|
9117
|
+
const rpc = new Proxy({}, {
|
|
9118
|
+
get(_, method) {
|
|
9119
|
+
if (method === "$functions")
|
|
9120
|
+
return functions;
|
|
9121
|
+
if (method === "$close")
|
|
9122
|
+
return close;
|
|
9123
|
+
if (method === "then" && !eventNames.includes("then") && !("then" in functions))
|
|
9124
|
+
return void 0;
|
|
9125
|
+
const sendEvent = (...args) => {
|
|
9126
|
+
post(serialize({ m: method, a: args, t: TYPE_REQUEST }));
|
|
9127
|
+
};
|
|
9128
|
+
if (eventNames.includes(method)) {
|
|
9129
|
+
sendEvent.asEvent = sendEvent;
|
|
9130
|
+
return sendEvent;
|
|
9131
|
+
}
|
|
9132
|
+
const sendCall = async (...args) => {
|
|
9133
|
+
if (closed)
|
|
9134
|
+
throw new Error(`[birpc] rpc is closed, cannot call "${method}"`);
|
|
9135
|
+
if (_promise) {
|
|
9136
|
+
try {
|
|
9137
|
+
await _promise;
|
|
9138
|
+
} finally {
|
|
9139
|
+
_promise = void 0;
|
|
9140
|
+
}
|
|
9141
|
+
}
|
|
9142
|
+
return new Promise((resolve, reject) => {
|
|
9143
|
+
const id = nanoid();
|
|
9144
|
+
let timeoutId;
|
|
9145
|
+
if (timeout >= 0) {
|
|
9146
|
+
timeoutId = setTimeout$1(() => {
|
|
9147
|
+
try {
|
|
9148
|
+
const handleResult = options.onTimeoutError?.(method, args);
|
|
9149
|
+
if (handleResult !== true)
|
|
9150
|
+
throw new Error(`[birpc] timeout on calling "${method}"`);
|
|
9151
|
+
} catch (e) {
|
|
9152
|
+
reject(e);
|
|
9153
|
+
}
|
|
9154
|
+
rpcPromiseMap.delete(id);
|
|
9155
|
+
}, timeout);
|
|
9156
|
+
if (typeof timeoutId === "object")
|
|
9157
|
+
timeoutId = timeoutId.unref?.();
|
|
9158
|
+
}
|
|
9159
|
+
rpcPromiseMap.set(id, { resolve, reject, timeoutId, method });
|
|
9160
|
+
post(serialize({ m: method, a: args, i: id, t: "q" }));
|
|
9161
|
+
});
|
|
9162
|
+
};
|
|
9163
|
+
sendCall.asEvent = sendEvent;
|
|
9164
|
+
return sendCall;
|
|
9165
|
+
}
|
|
9166
|
+
});
|
|
9167
|
+
function close(error) {
|
|
9168
|
+
closed = true;
|
|
9169
|
+
rpcPromiseMap.forEach(({ reject, method }) => {
|
|
9170
|
+
reject(error || new Error(`[birpc] rpc is closed, cannot call "${method}"`));
|
|
9171
|
+
});
|
|
9172
|
+
rpcPromiseMap.clear();
|
|
9173
|
+
off(onMessage);
|
|
9174
|
+
}
|
|
9175
|
+
async function onMessage(data, ...extra) {
|
|
9176
|
+
let msg;
|
|
9177
|
+
try {
|
|
9178
|
+
msg = deserialize(data);
|
|
9179
|
+
} catch (e) {
|
|
9180
|
+
if (options.onGeneralError?.(e) !== true)
|
|
9181
|
+
throw e;
|
|
9182
|
+
return;
|
|
9183
|
+
}
|
|
9184
|
+
if (msg.t === TYPE_REQUEST) {
|
|
9185
|
+
const { m: method, a: args } = msg;
|
|
9186
|
+
let result, error;
|
|
9187
|
+
const fn = resolver ? resolver(method, functions[method]) : functions[method];
|
|
9188
|
+
if (!fn) {
|
|
9189
|
+
error = new Error(`[birpc] function "${method}" not found`);
|
|
9190
|
+
} else {
|
|
9191
|
+
try {
|
|
9192
|
+
result = await fn.apply(bind === "rpc" ? rpc : functions, args);
|
|
9193
|
+
} catch (e) {
|
|
9194
|
+
error = e;
|
|
9195
|
+
}
|
|
9196
|
+
}
|
|
9197
|
+
if (msg.i) {
|
|
9198
|
+
if (error && options.onError)
|
|
9199
|
+
options.onError(error, method, args);
|
|
9200
|
+
if (error && options.onFunctionError) {
|
|
9201
|
+
if (options.onFunctionError(error, method, args) === true)
|
|
9202
|
+
return;
|
|
9203
|
+
}
|
|
9204
|
+
if (!error) {
|
|
9205
|
+
try {
|
|
9206
|
+
post(serialize({ t: TYPE_RESPONSE, i: msg.i, r: result }), ...extra);
|
|
9207
|
+
return;
|
|
9208
|
+
} catch (e) {
|
|
9209
|
+
error = e;
|
|
9210
|
+
if (options.onGeneralError?.(e, method, args) !== true)
|
|
9211
|
+
throw e;
|
|
9212
|
+
}
|
|
9213
|
+
}
|
|
9214
|
+
try {
|
|
9215
|
+
post(serialize({ t: TYPE_RESPONSE, i: msg.i, e: error }), ...extra);
|
|
9216
|
+
} catch (e) {
|
|
9217
|
+
if (options.onGeneralError?.(e, method, args) !== true)
|
|
9218
|
+
throw e;
|
|
9219
|
+
}
|
|
9220
|
+
}
|
|
9221
|
+
} else {
|
|
9222
|
+
const { i: ack, r: result, e: error } = msg;
|
|
9223
|
+
const promise = rpcPromiseMap.get(ack);
|
|
9224
|
+
if (promise) {
|
|
9225
|
+
clearTimeout$1(promise.timeoutId);
|
|
9226
|
+
if (error)
|
|
9227
|
+
promise.reject(error);
|
|
9228
|
+
else
|
|
9229
|
+
promise.resolve(result);
|
|
9230
|
+
}
|
|
9231
|
+
rpcPromiseMap.delete(ack);
|
|
9232
|
+
}
|
|
9233
|
+
}
|
|
9234
|
+
_promise = on(onMessage);
|
|
9235
|
+
return rpc;
|
|
9236
|
+
}
|
|
9237
|
+
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
9238
|
+
function nanoid(size = 21) {
|
|
9239
|
+
let id = "";
|
|
9240
|
+
let i = size;
|
|
9241
|
+
while (i--)
|
|
9242
|
+
id += urlAlphabet[random() * 64 | 0];
|
|
9243
|
+
return id;
|
|
9244
|
+
}
|
|
9245
|
+
|
|
9246
|
+
/* Injected with object hook! */
|
|
9247
|
+
|
|
9077
9248
|
/*!
|
|
9078
|
-
* pinia v3.0.
|
|
9249
|
+
* pinia v3.0.2
|
|
9079
9250
|
* (c) 2025 Eduardo San Martin Morote
|
|
9080
9251
|
* @license MIT
|
|
9081
9252
|
*/
|
|
@@ -9153,7 +9324,7 @@ function _toPropertyKey$2(t) { var i = _toPrimitive$2(t, "string"); return "symb
|
|
|
9153
9324
|
function _toPrimitive$2(t, r) { if ("object" != _typeof$2(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$2(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9154
9325
|
function tryOnMounted$1(fn) {
|
|
9155
9326
|
var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
9156
|
-
if (getCurrentInstance()) onMounted(fn);else if (sync) fn();else nextTick(fn);
|
|
9327
|
+
if (getCurrentInstance() && getCurrentInstance().components) onMounted(fn);else if (sync) fn();else nextTick(fn);
|
|
9157
9328
|
}
|
|
9158
9329
|
var _id = 0;
|
|
9159
9330
|
function useStyle(css) {
|
|
@@ -9229,6 +9400,7 @@ function useStyle(css) {
|
|
|
9229
9400
|
stop();
|
|
9230
9401
|
isExist(styleRef.value) && document.head.removeChild(styleRef.value);
|
|
9231
9402
|
isLoaded.value = false;
|
|
9403
|
+
styleRef.value = null;
|
|
9232
9404
|
};
|
|
9233
9405
|
if (immediate && !manual) tryOnMounted$1(load);
|
|
9234
9406
|
|
|
@@ -11520,13 +11692,23 @@ function useRoute(_name) {
|
|
|
11520
11692
|
|
|
11521
11693
|
const scriptRel = 'modulepreload';const assetsURL = function(dep, importerUrl) { return new URL(dep, importerUrl).href };const seen = {};const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
11522
11694
|
let promise = Promise.resolve();
|
|
11523
|
-
if (true
|
|
11695
|
+
if (true && deps && deps.length > 0) {
|
|
11696
|
+
let allSettled2 = function(promises) {
|
|
11697
|
+
return Promise.all(
|
|
11698
|
+
promises.map(
|
|
11699
|
+
(p) => Promise.resolve(p).then(
|
|
11700
|
+
(value) => ({ status: "fulfilled", value }),
|
|
11701
|
+
(reason) => ({ status: "rejected", reason })
|
|
11702
|
+
)
|
|
11703
|
+
)
|
|
11704
|
+
);
|
|
11705
|
+
};
|
|
11524
11706
|
const links = document.getElementsByTagName("link");
|
|
11525
11707
|
const cspNonceMeta = document.querySelector(
|
|
11526
11708
|
"meta[property=csp-nonce]"
|
|
11527
11709
|
);
|
|
11528
11710
|
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
|
|
11529
|
-
promise =
|
|
11711
|
+
promise = allSettled2(
|
|
11530
11712
|
deps.map((dep) => {
|
|
11531
11713
|
dep = assetsURL(dep, importerUrl);
|
|
11532
11714
|
if (dep in seen) return;
|
|
@@ -11591,31 +11773,31 @@ const routes = [
|
|
|
11591
11773
|
{
|
|
11592
11774
|
path: "/",
|
|
11593
11775
|
name: "/",
|
|
11594
|
-
component: () => __vitePreload(() => import('./index-
|
|
11776
|
+
component: () => __vitePreload(() => import('./index-hMYuAPVg.js'),true ?__vite__mapDeps([0,1,2]):void 0,import.meta.url)
|
|
11595
11777
|
/* no children */
|
|
11596
11778
|
},
|
|
11597
11779
|
{
|
|
11598
11780
|
path: "/about",
|
|
11599
11781
|
name: "/about",
|
|
11600
|
-
component: () => __vitePreload(() => import('./about-
|
|
11782
|
+
component: () => __vitePreload(() => import('./about-CRK8PaDm.js'),true ?[]:void 0,import.meta.url)
|
|
11601
11783
|
/* no children */
|
|
11602
11784
|
},
|
|
11603
11785
|
{
|
|
11604
11786
|
path: "/categories",
|
|
11605
11787
|
name: "/categories",
|
|
11606
|
-
component: () => __vitePreload(() => import('./categories-
|
|
11788
|
+
component: () => __vitePreload(() => import('./categories-C0H9vvj4.js'),true ?[]:void 0,import.meta.url)
|
|
11607
11789
|
/* no children */
|
|
11608
11790
|
},
|
|
11609
11791
|
{
|
|
11610
11792
|
path: "/migration",
|
|
11611
11793
|
name: "/migration",
|
|
11612
|
-
component: () => __vitePreload(() => import('./migration-
|
|
11794
|
+
component: () => __vitePreload(() => import('./migration-KEAnRKjM.js'),true ?__vite__mapDeps([3,1]):void 0,import.meta.url)
|
|
11613
11795
|
/* no children */
|
|
11614
11796
|
},
|
|
11615
11797
|
{
|
|
11616
11798
|
path: "/tags",
|
|
11617
11799
|
name: "/tags",
|
|
11618
|
-
component: () => __vitePreload(() => import('./tags-
|
|
11800
|
+
component: () => __vitePreload(() => import('./tags-CQ8R6nFj.js'),true ?[]:void 0,import.meta.url)
|
|
11619
11801
|
/* no children */
|
|
11620
11802
|
}
|
|
11621
11803
|
];
|
|
@@ -11642,7 +11824,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
11642
11824
|
/* Injected with object hook! */
|
|
11643
11825
|
|
|
11644
11826
|
/*!
|
|
11645
|
-
* shared v11.1.
|
|
11827
|
+
* shared v11.1.3
|
|
11646
11828
|
* (c) 2025 kazuya kawaguchi
|
|
11647
11829
|
* Released under the MIT License.
|
|
11648
11830
|
*/
|
|
@@ -11720,7 +11902,7 @@ function deepCopy(src, des) {
|
|
|
11720
11902
|
/* Injected with object hook! */
|
|
11721
11903
|
|
|
11722
11904
|
/*!
|
|
11723
|
-
* message-compiler v11.1.
|
|
11905
|
+
* message-compiler v11.1.3
|
|
11724
11906
|
* (c) 2025 kazuya kawaguchi
|
|
11725
11907
|
* Released under the MIT License.
|
|
11726
11908
|
*/
|
|
@@ -13143,7 +13325,7 @@ function baseCompile$1(source, options = {}) {
|
|
|
13143
13325
|
/* Injected with object hook! */
|
|
13144
13326
|
|
|
13145
13327
|
/*!
|
|
13146
|
-
* core-base v11.1.
|
|
13328
|
+
* core-base v11.1.3
|
|
13147
13329
|
* (c) 2025 kazuya kawaguchi
|
|
13148
13330
|
* Released under the MIT License.
|
|
13149
13331
|
*/
|
|
@@ -13152,6 +13334,76 @@ function initFeatureFlags$1() {
|
|
|
13152
13334
|
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
|
13153
13335
|
}
|
|
13154
13336
|
}
|
|
13337
|
+
function isMessageAST(val) {
|
|
13338
|
+
return isObject$1(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body"));
|
|
13339
|
+
}
|
|
13340
|
+
const PROPS_BODY = ["b", "body"];
|
|
13341
|
+
function resolveBody(node) {
|
|
13342
|
+
return resolveProps(node, PROPS_BODY);
|
|
13343
|
+
}
|
|
13344
|
+
const PROPS_CASES = ["c", "cases"];
|
|
13345
|
+
function resolveCases(node) {
|
|
13346
|
+
return resolveProps(node, PROPS_CASES, []);
|
|
13347
|
+
}
|
|
13348
|
+
const PROPS_STATIC = ["s", "static"];
|
|
13349
|
+
function resolveStatic(node) {
|
|
13350
|
+
return resolveProps(node, PROPS_STATIC);
|
|
13351
|
+
}
|
|
13352
|
+
const PROPS_ITEMS = ["i", "items"];
|
|
13353
|
+
function resolveItems(node) {
|
|
13354
|
+
return resolveProps(node, PROPS_ITEMS, []);
|
|
13355
|
+
}
|
|
13356
|
+
const PROPS_TYPE = ["t", "type"];
|
|
13357
|
+
function resolveType(node) {
|
|
13358
|
+
return resolveProps(node, PROPS_TYPE);
|
|
13359
|
+
}
|
|
13360
|
+
const PROPS_VALUE = ["v", "value"];
|
|
13361
|
+
function resolveValue$1(node, type) {
|
|
13362
|
+
const resolved = resolveProps(node, PROPS_VALUE);
|
|
13363
|
+
if (resolved != null) {
|
|
13364
|
+
return resolved;
|
|
13365
|
+
} else {
|
|
13366
|
+
throw createUnhandleNodeError(type);
|
|
13367
|
+
}
|
|
13368
|
+
}
|
|
13369
|
+
const PROPS_MODIFIER = ["m", "modifier"];
|
|
13370
|
+
function resolveLinkedModifier(node) {
|
|
13371
|
+
return resolveProps(node, PROPS_MODIFIER);
|
|
13372
|
+
}
|
|
13373
|
+
const PROPS_KEY = ["k", "key"];
|
|
13374
|
+
function resolveLinkedKey(node) {
|
|
13375
|
+
const resolved = resolveProps(node, PROPS_KEY);
|
|
13376
|
+
if (resolved) {
|
|
13377
|
+
return resolved;
|
|
13378
|
+
} else {
|
|
13379
|
+
throw createUnhandleNodeError(
|
|
13380
|
+
6
|
|
13381
|
+
/* NodeTypes.Linked */
|
|
13382
|
+
);
|
|
13383
|
+
}
|
|
13384
|
+
}
|
|
13385
|
+
function resolveProps(node, props, defaultValue) {
|
|
13386
|
+
for (let i = 0; i < props.length; i++) {
|
|
13387
|
+
const prop = props[i];
|
|
13388
|
+
if (hasOwn(node, prop) && node[prop] != null) {
|
|
13389
|
+
return node[prop];
|
|
13390
|
+
}
|
|
13391
|
+
}
|
|
13392
|
+
return defaultValue;
|
|
13393
|
+
}
|
|
13394
|
+
const AST_NODE_PROPS_KEYS = [
|
|
13395
|
+
...PROPS_BODY,
|
|
13396
|
+
...PROPS_CASES,
|
|
13397
|
+
...PROPS_STATIC,
|
|
13398
|
+
...PROPS_ITEMS,
|
|
13399
|
+
...PROPS_KEY,
|
|
13400
|
+
...PROPS_MODIFIER,
|
|
13401
|
+
...PROPS_VALUE,
|
|
13402
|
+
...PROPS_TYPE
|
|
13403
|
+
];
|
|
13404
|
+
function createUnhandleNodeError(type) {
|
|
13405
|
+
return new Error(`unhandled node type: ${type}`);
|
|
13406
|
+
}
|
|
13155
13407
|
function format(ast) {
|
|
13156
13408
|
const msg = (ctx) => formatParts(ctx, ast);
|
|
13157
13409
|
return msg;
|
|
@@ -13176,14 +13428,6 @@ function formatParts(ctx, ast) {
|
|
|
13176
13428
|
return formatMessageParts(ctx, body);
|
|
13177
13429
|
}
|
|
13178
13430
|
}
|
|
13179
|
-
const PROPS_BODY = ["b", "body"];
|
|
13180
|
-
function resolveBody(node) {
|
|
13181
|
-
return resolveProps(node, PROPS_BODY);
|
|
13182
|
-
}
|
|
13183
|
-
const PROPS_CASES = ["c", "cases"];
|
|
13184
|
-
function resolveCases(node) {
|
|
13185
|
-
return resolveProps(node, PROPS_CASES, []);
|
|
13186
|
-
}
|
|
13187
13431
|
function formatMessageParts(ctx, node) {
|
|
13188
13432
|
const static_ = resolveStatic(node);
|
|
13189
13433
|
if (static_ != null) {
|
|
@@ -13193,14 +13437,6 @@ function formatMessageParts(ctx, node) {
|
|
|
13193
13437
|
return ctx.normalize(messages);
|
|
13194
13438
|
}
|
|
13195
13439
|
}
|
|
13196
|
-
const PROPS_STATIC = ["s", "static"];
|
|
13197
|
-
function resolveStatic(node) {
|
|
13198
|
-
return resolveProps(node, PROPS_STATIC);
|
|
13199
|
-
}
|
|
13200
|
-
const PROPS_ITEMS = ["i", "items"];
|
|
13201
|
-
function resolveItems(node) {
|
|
13202
|
-
return resolveProps(node, PROPS_ITEMS, []);
|
|
13203
|
-
}
|
|
13204
13440
|
function formatMessagePart(ctx, node) {
|
|
13205
13441
|
const type = resolveType(node);
|
|
13206
13442
|
switch (type) {
|
|
@@ -13246,52 +13482,8 @@ function formatMessagePart(ctx, node) {
|
|
|
13246
13482
|
throw new Error(`unhandled node on format message part: ${type}`);
|
|
13247
13483
|
}
|
|
13248
13484
|
}
|
|
13249
|
-
const PROPS_TYPE = ["t", "type"];
|
|
13250
|
-
function resolveType(node) {
|
|
13251
|
-
return resolveProps(node, PROPS_TYPE);
|
|
13252
|
-
}
|
|
13253
|
-
const PROPS_VALUE = ["v", "value"];
|
|
13254
|
-
function resolveValue$1(node, type) {
|
|
13255
|
-
const resolved = resolveProps(node, PROPS_VALUE);
|
|
13256
|
-
if (resolved) {
|
|
13257
|
-
return resolved;
|
|
13258
|
-
} else {
|
|
13259
|
-
throw createUnhandleNodeError(type);
|
|
13260
|
-
}
|
|
13261
|
-
}
|
|
13262
|
-
const PROPS_MODIFIER = ["m", "modifier"];
|
|
13263
|
-
function resolveLinkedModifier(node) {
|
|
13264
|
-
return resolveProps(node, PROPS_MODIFIER);
|
|
13265
|
-
}
|
|
13266
|
-
const PROPS_KEY = ["k", "key"];
|
|
13267
|
-
function resolveLinkedKey(node) {
|
|
13268
|
-
const resolved = resolveProps(node, PROPS_KEY);
|
|
13269
|
-
if (resolved) {
|
|
13270
|
-
return resolved;
|
|
13271
|
-
} else {
|
|
13272
|
-
throw createUnhandleNodeError(
|
|
13273
|
-
6
|
|
13274
|
-
/* NodeTypes.Linked */
|
|
13275
|
-
);
|
|
13276
|
-
}
|
|
13277
|
-
}
|
|
13278
|
-
function resolveProps(node, props, defaultValue) {
|
|
13279
|
-
for (let i = 0; i < props.length; i++) {
|
|
13280
|
-
const prop = props[i];
|
|
13281
|
-
if (hasOwn(node, prop) && node[prop] != null) {
|
|
13282
|
-
return node[prop];
|
|
13283
|
-
}
|
|
13284
|
-
}
|
|
13285
|
-
return defaultValue;
|
|
13286
|
-
}
|
|
13287
|
-
function createUnhandleNodeError(type) {
|
|
13288
|
-
return new Error(`unhandled node type: ${type}`);
|
|
13289
|
-
}
|
|
13290
13485
|
const defaultOnCacheKey = (message) => message;
|
|
13291
13486
|
let compileCache = create();
|
|
13292
|
-
function isMessageAST(val) {
|
|
13293
|
-
return isObject$1(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body"));
|
|
13294
|
-
}
|
|
13295
13487
|
function baseCompile(message, options = {}) {
|
|
13296
13488
|
let detectError = false;
|
|
13297
13489
|
const onError = options.onError || defaultOnError;
|
|
@@ -13884,7 +14076,11 @@ function resolveValue(obj, path) {
|
|
|
13884
14076
|
let last = obj;
|
|
13885
14077
|
let i = 0;
|
|
13886
14078
|
while (i < len) {
|
|
13887
|
-
const
|
|
14079
|
+
const key = hit[i];
|
|
14080
|
+
if (AST_NODE_PROPS_KEYS.includes(key) && isMessageAST(last)) {
|
|
14081
|
+
return null;
|
|
14082
|
+
}
|
|
14083
|
+
const val = last[key];
|
|
13888
14084
|
if (val === void 0) {
|
|
13889
14085
|
return null;
|
|
13890
14086
|
}
|
|
@@ -13896,7 +14092,7 @@ function resolveValue(obj, path) {
|
|
|
13896
14092
|
}
|
|
13897
14093
|
return last;
|
|
13898
14094
|
}
|
|
13899
|
-
const VERSION$1 = "11.1.
|
|
14095
|
+
const VERSION$1 = "11.1.3";
|
|
13900
14096
|
const NOT_REOSLVED = -1;
|
|
13901
14097
|
const DEFAULT_LOCALE = "en-US";
|
|
13902
14098
|
const MISSING_RESOLVE_VALUE = "";
|
|
@@ -14587,11 +14783,11 @@ function getMessageContextOptions(context, locale, message, options) {
|
|
|
14587
14783
|
/* Injected with object hook! */
|
|
14588
14784
|
|
|
14589
14785
|
/*!
|
|
14590
|
-
* vue-i18n v11.1.
|
|
14786
|
+
* vue-i18n v11.1.3
|
|
14591
14787
|
* (c) 2025 kazuya kawaguchi
|
|
14592
14788
|
* Released under the MIT License.
|
|
14593
14789
|
*/
|
|
14594
|
-
const VERSION = "11.1.
|
|
14790
|
+
const VERSION = "11.1.3";
|
|
14595
14791
|
function initFeatureFlags() {
|
|
14596
14792
|
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
|
|
14597
14793
|
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
|
@@ -14625,6 +14821,9 @@ function handleFlatJson(obj) {
|
|
|
14625
14821
|
if (!isObject$1(obj)) {
|
|
14626
14822
|
return obj;
|
|
14627
14823
|
}
|
|
14824
|
+
if (isMessageAST(obj)) {
|
|
14825
|
+
return obj;
|
|
14826
|
+
}
|
|
14628
14827
|
for (const key in obj) {
|
|
14629
14828
|
if (!hasOwn(obj, key)) {
|
|
14630
14829
|
continue;
|
|
@@ -14652,11 +14851,20 @@ function handleFlatJson(obj) {
|
|
|
14652
14851
|
currentObj = currentObj[subKeys[i]];
|
|
14653
14852
|
}
|
|
14654
14853
|
if (!hasStringValue) {
|
|
14655
|
-
currentObj
|
|
14656
|
-
|
|
14854
|
+
if (!isMessageAST(currentObj)) {
|
|
14855
|
+
currentObj[subKeys[lastIndex]] = obj[key];
|
|
14856
|
+
delete obj[key];
|
|
14857
|
+
} else {
|
|
14858
|
+
if (!AST_NODE_PROPS_KEYS.includes(subKeys[lastIndex])) {
|
|
14859
|
+
delete obj[key];
|
|
14860
|
+
}
|
|
14861
|
+
}
|
|
14657
14862
|
}
|
|
14658
|
-
if (
|
|
14659
|
-
|
|
14863
|
+
if (!isMessageAST(currentObj)) {
|
|
14864
|
+
const target = currentObj[subKeys[lastIndex]];
|
|
14865
|
+
if (isObject$1(target)) {
|
|
14866
|
+
handleFlatJson(target);
|
|
14867
|
+
}
|
|
14660
14868
|
}
|
|
14661
14869
|
}
|
|
14662
14870
|
}
|
|
@@ -15628,9 +15836,18 @@ function tryOnScopeDispose(fn) {
|
|
|
15628
15836
|
return false;
|
|
15629
15837
|
}
|
|
15630
15838
|
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
|
|
15839
|
+
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
15840
|
+
|
|
15841
|
+
const injectLocal = (...args) => {
|
|
15842
|
+
var _a;
|
|
15843
|
+
const key = args[0];
|
|
15844
|
+
const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
15845
|
+
if (instance == null && !hasInjectionContext())
|
|
15846
|
+
throw new Error("injectLocal must be called in setup");
|
|
15847
|
+
if (instance && localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
|
|
15848
|
+
return localProvidedStateMap.get(instance)[key];
|
|
15849
|
+
return inject(...args);
|
|
15850
|
+
};
|
|
15634
15851
|
|
|
15635
15852
|
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
15636
15853
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
@@ -15639,6 +15856,13 @@ const isObject = (val) => toString.call(val) === "[object Object]";
|
|
|
15639
15856
|
const noop = () => {
|
|
15640
15857
|
};
|
|
15641
15858
|
|
|
15859
|
+
function toRef(...args) {
|
|
15860
|
+
if (args.length !== 1)
|
|
15861
|
+
return toRef$1(...args);
|
|
15862
|
+
const r = args[0];
|
|
15863
|
+
return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);
|
|
15864
|
+
}
|
|
15865
|
+
|
|
15642
15866
|
function createFilterWrapper(filter, fn) {
|
|
15643
15867
|
function wrapper(...args) {
|
|
15644
15868
|
return new Promise((resolve, reject) => {
|
|
@@ -15659,6 +15883,7 @@ function debounceFilter(ms, options = {}) {
|
|
|
15659
15883
|
lastRejector();
|
|
15660
15884
|
lastRejector = noop;
|
|
15661
15885
|
};
|
|
15886
|
+
let lastInvoker;
|
|
15662
15887
|
const filter = (invoke) => {
|
|
15663
15888
|
const duration = toValue(ms);
|
|
15664
15889
|
const maxDuration = toValue(options.maxWait);
|
|
@@ -15673,12 +15898,13 @@ function debounceFilter(ms, options = {}) {
|
|
|
15673
15898
|
}
|
|
15674
15899
|
return new Promise((resolve, reject) => {
|
|
15675
15900
|
lastRejector = options.rejectOnCancel ? reject : resolve;
|
|
15901
|
+
lastInvoker = invoke;
|
|
15676
15902
|
if (maxDuration && !maxTimer) {
|
|
15677
15903
|
maxTimer = setTimeout(() => {
|
|
15678
15904
|
if (timer)
|
|
15679
15905
|
_clearTimeout(timer);
|
|
15680
15906
|
maxTimer = null;
|
|
15681
|
-
resolve(
|
|
15907
|
+
resolve(lastInvoker());
|
|
15682
15908
|
}, maxDuration);
|
|
15683
15909
|
}
|
|
15684
15910
|
timer = setTimeout(() => {
|
|
@@ -15745,8 +15971,11 @@ function throttleFilter(...args) {
|
|
|
15745
15971
|
};
|
|
15746
15972
|
return filter;
|
|
15747
15973
|
}
|
|
15748
|
-
function pausableFilter(extendFilter = bypassFilter) {
|
|
15749
|
-
const
|
|
15974
|
+
function pausableFilter(extendFilter = bypassFilter, options = {}) {
|
|
15975
|
+
const {
|
|
15976
|
+
initialState = "active"
|
|
15977
|
+
} = options;
|
|
15978
|
+
const isActive = toRef(initialState === "active");
|
|
15750
15979
|
function pause() {
|
|
15751
15980
|
isActive.value = false;
|
|
15752
15981
|
}
|
|
@@ -15759,15 +15988,15 @@ function pausableFilter(extendFilter = bypassFilter) {
|
|
|
15759
15988
|
};
|
|
15760
15989
|
return { isActive: readonly(isActive), pause, resume, eventFilter };
|
|
15761
15990
|
}
|
|
15762
|
-
function
|
|
15763
|
-
return
|
|
15991
|
+
function pxValue(px) {
|
|
15992
|
+
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
|
|
15993
|
+
}
|
|
15994
|
+
function toArray(value) {
|
|
15995
|
+
return Array.isArray(value) ? value : [value];
|
|
15764
15996
|
}
|
|
15765
15997
|
|
|
15766
|
-
function
|
|
15767
|
-
|
|
15768
|
-
return toRef$1(...args);
|
|
15769
|
-
const r = args[0];
|
|
15770
|
-
return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);
|
|
15998
|
+
function getLifeCycleTarget(target) {
|
|
15999
|
+
return getCurrentInstance();
|
|
15771
16000
|
}
|
|
15772
16001
|
|
|
15773
16002
|
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
@@ -15802,9 +16031,10 @@ function watchWithFilter(source, cb, options = {}) {
|
|
|
15802
16031
|
function watchPausable(source, cb, options = {}) {
|
|
15803
16032
|
const {
|
|
15804
16033
|
eventFilter: filter,
|
|
16034
|
+
initialState = "active",
|
|
15805
16035
|
...watchOptions
|
|
15806
16036
|
} = options;
|
|
15807
|
-
const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
|
|
16037
|
+
const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
|
|
15808
16038
|
const stop = watchWithFilter(
|
|
15809
16039
|
source,
|
|
15810
16040
|
cb,
|
|
@@ -15832,7 +16062,7 @@ function useToggle(initialValue = false, options = {}) {
|
|
|
15832
16062
|
falsyValue = false
|
|
15833
16063
|
} = options;
|
|
15834
16064
|
const valueIsRef = isRef(initialValue);
|
|
15835
|
-
const _value =
|
|
16065
|
+
const _value = shallowRef(initialValue);
|
|
15836
16066
|
function toggle(value) {
|
|
15837
16067
|
if (arguments.length) {
|
|
15838
16068
|
_value.value = value;
|
|
@@ -15849,6 +16079,17 @@ function useToggle(initialValue = false, options = {}) {
|
|
|
15849
16079
|
return [_value, toggle];
|
|
15850
16080
|
}
|
|
15851
16081
|
|
|
16082
|
+
function watchImmediate(source, cb, options) {
|
|
16083
|
+
return watch(
|
|
16084
|
+
source,
|
|
16085
|
+
cb,
|
|
16086
|
+
{
|
|
16087
|
+
...options,
|
|
16088
|
+
immediate: true
|
|
16089
|
+
}
|
|
16090
|
+
);
|
|
16091
|
+
}
|
|
16092
|
+
|
|
15852
16093
|
/* Injected with object hook! */
|
|
15853
16094
|
|
|
15854
16095
|
const defaultWindow = isClient ? window : void 0;
|
|
@@ -15858,55 +16099,54 @@ function unrefElement(elRef) {
|
|
|
15858
16099
|
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
15859
16100
|
}
|
|
15860
16101
|
function useEventListener(...args) {
|
|
15861
|
-
let target;
|
|
15862
|
-
let events2;
|
|
15863
|
-
let listeners;
|
|
15864
|
-
let options;
|
|
15865
|
-
if (typeof args[0] === "string" || Array.isArray(args[0])) {
|
|
15866
|
-
[events2, listeners, options] = args;
|
|
15867
|
-
target = defaultWindow;
|
|
15868
|
-
} else {
|
|
15869
|
-
[target, events2, listeners, options] = args;
|
|
15870
|
-
}
|
|
15871
|
-
if (!target)
|
|
15872
|
-
return noop;
|
|
15873
|
-
if (!Array.isArray(events2))
|
|
15874
|
-
events2 = [events2];
|
|
15875
|
-
if (!Array.isArray(listeners))
|
|
15876
|
-
listeners = [listeners];
|
|
15877
16102
|
const cleanups = [];
|
|
15878
16103
|
const cleanup = () => {
|
|
15879
16104
|
cleanups.forEach((fn) => fn());
|
|
15880
16105
|
cleanups.length = 0;
|
|
15881
16106
|
};
|
|
15882
|
-
const register = (el, event, listener,
|
|
15883
|
-
el.addEventListener(event, listener,
|
|
15884
|
-
return () => el.removeEventListener(event, listener,
|
|
16107
|
+
const register = (el, event, listener, options) => {
|
|
16108
|
+
el.addEventListener(event, listener, options);
|
|
16109
|
+
return () => el.removeEventListener(event, listener, options);
|
|
15885
16110
|
};
|
|
15886
|
-
const
|
|
15887
|
-
|
|
15888
|
-
(
|
|
16111
|
+
const firstParamTargets = computed(() => {
|
|
16112
|
+
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
16113
|
+
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
16114
|
+
});
|
|
16115
|
+
const stopWatch = watchImmediate(
|
|
16116
|
+
() => {
|
|
16117
|
+
var _a, _b;
|
|
16118
|
+
return [
|
|
16119
|
+
(_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
|
|
16120
|
+
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
16121
|
+
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
16122
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
16123
|
+
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
16124
|
+
];
|
|
16125
|
+
},
|
|
16126
|
+
([raw_targets, raw_events, raw_listeners, raw_options]) => {
|
|
15889
16127
|
cleanup();
|
|
15890
|
-
if (!
|
|
16128
|
+
if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length))
|
|
15891
16129
|
return;
|
|
15892
|
-
const optionsClone = isObject(
|
|
16130
|
+
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
15893
16131
|
cleanups.push(
|
|
15894
|
-
...
|
|
15895
|
-
|
|
15896
|
-
|
|
16132
|
+
...raw_targets.flatMap(
|
|
16133
|
+
(el) => raw_events.flatMap(
|
|
16134
|
+
(event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
|
|
16135
|
+
)
|
|
16136
|
+
)
|
|
15897
16137
|
);
|
|
15898
16138
|
},
|
|
15899
|
-
{
|
|
16139
|
+
{ flush: "post" }
|
|
15900
16140
|
);
|
|
15901
16141
|
const stop = () => {
|
|
15902
16142
|
stopWatch();
|
|
15903
16143
|
cleanup();
|
|
15904
16144
|
};
|
|
15905
|
-
tryOnScopeDispose(
|
|
16145
|
+
tryOnScopeDispose(cleanup);
|
|
15906
16146
|
return stop;
|
|
15907
16147
|
}
|
|
15908
16148
|
function useMounted() {
|
|
15909
|
-
const isMounted =
|
|
16149
|
+
const isMounted = shallowRef(false);
|
|
15910
16150
|
const instance = getCurrentInstance();
|
|
15911
16151
|
if (instance) {
|
|
15912
16152
|
onMounted(() => {
|
|
@@ -15922,39 +16162,46 @@ function useSupported(callback) {
|
|
|
15922
16162
|
return Boolean(callback());
|
|
15923
16163
|
});
|
|
15924
16164
|
}
|
|
16165
|
+
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
16166
|
+
function useSSRWidth() {
|
|
16167
|
+
const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
|
|
16168
|
+
return typeof ssrWidth === "number" ? ssrWidth : void 0;
|
|
16169
|
+
}
|
|
15925
16170
|
function useMediaQuery(query, options = {}) {
|
|
15926
|
-
const { window: window2 = defaultWindow } = options;
|
|
16171
|
+
const { window: window2 = defaultWindow, ssrWidth = useSSRWidth() } = options;
|
|
15927
16172
|
const isSupported = useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
|
|
15928
|
-
|
|
15929
|
-
const
|
|
16173
|
+
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
16174
|
+
const mediaQuery = shallowRef();
|
|
16175
|
+
const matches = shallowRef(false);
|
|
15930
16176
|
const handler = (event) => {
|
|
15931
16177
|
matches.value = event.matches;
|
|
15932
16178
|
};
|
|
15933
|
-
|
|
15934
|
-
if (
|
|
16179
|
+
watchEffect(() => {
|
|
16180
|
+
if (ssrSupport.value) {
|
|
16181
|
+
ssrSupport.value = !isSupported.value;
|
|
16182
|
+
const queryStrings = toValue(query).split(",");
|
|
16183
|
+
matches.value = queryStrings.some((queryString) => {
|
|
16184
|
+
const not = queryString.includes("not all");
|
|
16185
|
+
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
16186
|
+
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
16187
|
+
let res = Boolean(minWidth || maxWidth);
|
|
16188
|
+
if (minWidth && res) {
|
|
16189
|
+
res = ssrWidth >= pxValue(minWidth[1]);
|
|
16190
|
+
}
|
|
16191
|
+
if (maxWidth && res) {
|
|
16192
|
+
res = ssrWidth <= pxValue(maxWidth[1]);
|
|
16193
|
+
}
|
|
16194
|
+
return not ? !res : res;
|
|
16195
|
+
});
|
|
15935
16196
|
return;
|
|
15936
|
-
|
|
15937
|
-
mediaQuery.removeEventListener("change", handler);
|
|
15938
|
-
else
|
|
15939
|
-
mediaQuery.removeListener(handler);
|
|
15940
|
-
};
|
|
15941
|
-
const stopWatch = watchEffect(() => {
|
|
16197
|
+
}
|
|
15942
16198
|
if (!isSupported.value)
|
|
15943
16199
|
return;
|
|
15944
|
-
|
|
15945
|
-
|
|
15946
|
-
if ("addEventListener" in mediaQuery)
|
|
15947
|
-
mediaQuery.addEventListener("change", handler);
|
|
15948
|
-
else
|
|
15949
|
-
mediaQuery.addListener(handler);
|
|
15950
|
-
matches.value = mediaQuery.matches;
|
|
16200
|
+
mediaQuery.value = window2.matchMedia(toValue(query));
|
|
16201
|
+
matches.value = mediaQuery.value.matches;
|
|
15951
16202
|
});
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
cleanup();
|
|
15955
|
-
mediaQuery = void 0;
|
|
15956
|
-
});
|
|
15957
|
-
return matches;
|
|
16203
|
+
useEventListener(mediaQuery, "change", handler, { passive: true });
|
|
16204
|
+
return computed(() => matches.value);
|
|
15958
16205
|
}
|
|
15959
16206
|
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
15960
16207
|
const globalKey = "__vueuse_ssr_handlers__";
|
|
@@ -16025,6 +16272,7 @@ function useStorage(key, defaults2, storage, options = {}) {
|
|
|
16025
16272
|
initOnMounted
|
|
16026
16273
|
} = options;
|
|
16027
16274
|
const data = (shallow ? shallowRef : ref)(typeof defaults2 === "function" ? defaults2() : defaults2);
|
|
16275
|
+
const keyComputed = computed(() => toValue(key));
|
|
16028
16276
|
if (!storage) {
|
|
16029
16277
|
try {
|
|
16030
16278
|
storage = getSSRHandler("getDefaultStorage", () => {
|
|
@@ -16045,10 +16293,11 @@ function useStorage(key, defaults2, storage, options = {}) {
|
|
|
16045
16293
|
() => write(data.value),
|
|
16046
16294
|
{ flush, deep, eventFilter }
|
|
16047
16295
|
);
|
|
16296
|
+
watch(keyComputed, () => update(), { flush });
|
|
16048
16297
|
if (window2 && listenToStorageChanges) {
|
|
16049
16298
|
tryOnMounted(() => {
|
|
16050
16299
|
if (storage instanceof Storage)
|
|
16051
|
-
useEventListener(window2, "storage", update);
|
|
16300
|
+
useEventListener(window2, "storage", update, { passive: true });
|
|
16052
16301
|
else
|
|
16053
16302
|
useEventListener(window2, customStorageEventName, updateFromCustomEvent);
|
|
16054
16303
|
if (initOnMounted)
|
|
@@ -16060,7 +16309,7 @@ function useStorage(key, defaults2, storage, options = {}) {
|
|
|
16060
16309
|
function dispatchWriteEvent(oldValue, newValue) {
|
|
16061
16310
|
if (window2) {
|
|
16062
16311
|
const payload = {
|
|
16063
|
-
key,
|
|
16312
|
+
key: keyComputed.value,
|
|
16064
16313
|
oldValue,
|
|
16065
16314
|
newValue,
|
|
16066
16315
|
storageArea: storage
|
|
@@ -16072,14 +16321,14 @@ function useStorage(key, defaults2, storage, options = {}) {
|
|
|
16072
16321
|
}
|
|
16073
16322
|
function write(v) {
|
|
16074
16323
|
try {
|
|
16075
|
-
const oldValue = storage.getItem(
|
|
16324
|
+
const oldValue = storage.getItem(keyComputed.value);
|
|
16076
16325
|
if (v == null) {
|
|
16077
16326
|
dispatchWriteEvent(oldValue, null);
|
|
16078
|
-
storage.removeItem(
|
|
16327
|
+
storage.removeItem(keyComputed.value);
|
|
16079
16328
|
} else {
|
|
16080
16329
|
const serialized = serializer.write(v);
|
|
16081
16330
|
if (oldValue !== serialized) {
|
|
16082
|
-
storage.setItem(
|
|
16331
|
+
storage.setItem(keyComputed.value, serialized);
|
|
16083
16332
|
dispatchWriteEvent(oldValue, serialized);
|
|
16084
16333
|
}
|
|
16085
16334
|
}
|
|
@@ -16088,10 +16337,10 @@ function useStorage(key, defaults2, storage, options = {}) {
|
|
|
16088
16337
|
}
|
|
16089
16338
|
}
|
|
16090
16339
|
function read(event) {
|
|
16091
|
-
const rawValue = event ? event.newValue : storage.getItem(
|
|
16340
|
+
const rawValue = event ? event.newValue : storage.getItem(keyComputed.value);
|
|
16092
16341
|
if (rawValue == null) {
|
|
16093
16342
|
if (writeDefaults && rawInit != null)
|
|
16094
|
-
storage.setItem(
|
|
16343
|
+
storage.setItem(keyComputed.value, serializer.write(rawInit));
|
|
16095
16344
|
return rawInit;
|
|
16096
16345
|
} else if (!event && mergeDefaults) {
|
|
16097
16346
|
const value = serializer.read(rawValue);
|
|
@@ -16113,7 +16362,7 @@ function useStorage(key, defaults2, storage, options = {}) {
|
|
|
16113
16362
|
data.value = rawInit;
|
|
16114
16363
|
return;
|
|
16115
16364
|
}
|
|
16116
|
-
if (event && event.key !==
|
|
16365
|
+
if (event && event.key !== keyComputed.value)
|
|
16117
16366
|
return;
|
|
16118
16367
|
pauseWatch();
|
|
16119
16368
|
try {
|
|
@@ -16279,14 +16528,14 @@ function useScroll(element, options = {}) {
|
|
|
16279
16528
|
console.error(e);
|
|
16280
16529
|
}
|
|
16281
16530
|
} = options;
|
|
16282
|
-
const internalX =
|
|
16283
|
-
const internalY =
|
|
16531
|
+
const internalX = shallowRef(0);
|
|
16532
|
+
const internalY = shallowRef(0);
|
|
16284
16533
|
const x = computed({
|
|
16285
16534
|
get() {
|
|
16286
16535
|
return internalX.value;
|
|
16287
16536
|
},
|
|
16288
16537
|
set(x2) {
|
|
16289
|
-
|
|
16538
|
+
scrollTo(x2, void 0);
|
|
16290
16539
|
}
|
|
16291
16540
|
});
|
|
16292
16541
|
const y = computed({
|
|
@@ -16294,10 +16543,10 @@ function useScroll(element, options = {}) {
|
|
|
16294
16543
|
return internalY.value;
|
|
16295
16544
|
},
|
|
16296
16545
|
set(y2) {
|
|
16297
|
-
|
|
16546
|
+
scrollTo(void 0, y2);
|
|
16298
16547
|
}
|
|
16299
16548
|
});
|
|
16300
|
-
function
|
|
16549
|
+
function scrollTo(_x, _y) {
|
|
16301
16550
|
var _a, _b, _c, _d;
|
|
16302
16551
|
if (!window2)
|
|
16303
16552
|
return;
|
|
@@ -16315,7 +16564,7 @@ function useScroll(element, options = {}) {
|
|
|
16315
16564
|
if (y != null)
|
|
16316
16565
|
internalY.value = scrollContainer.scrollTop;
|
|
16317
16566
|
}
|
|
16318
|
-
const isScrolling =
|
|
16567
|
+
const isScrolling = shallowRef(false);
|
|
16319
16568
|
const arrivedState = reactive({
|
|
16320
16569
|
left: true,
|
|
16321
16570
|
right: false,
|
|
@@ -16344,12 +16593,13 @@ function useScroll(element, options = {}) {
|
|
|
16344
16593
|
if (!window2)
|
|
16345
16594
|
return;
|
|
16346
16595
|
const el = ((_a = target == null ? void 0 : target.document) == null ? void 0 : _a.documentElement) || (target == null ? void 0 : target.documentElement) || unrefElement(target);
|
|
16347
|
-
const { display, flexDirection } = getComputedStyle(el);
|
|
16596
|
+
const { display, flexDirection, direction } = getComputedStyle(el);
|
|
16597
|
+
const directionMultipler = direction === "rtl" ? -1 : 1;
|
|
16348
16598
|
const scrollLeft = el.scrollLeft;
|
|
16349
16599
|
directions.left = scrollLeft < internalX.value;
|
|
16350
16600
|
directions.right = scrollLeft > internalX.value;
|
|
16351
|
-
const left = Math.abs(scrollLeft) <= (offset.left || 0);
|
|
16352
|
-
const right = Math.abs(scrollLeft) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
16601
|
+
const left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);
|
|
16602
|
+
const right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
16353
16603
|
if (display === "flex" && flexDirection === "row-reverse") {
|
|
16354
16604
|
arrivedState.left = right;
|
|
16355
16605
|
arrivedState.right = left;
|
|
@@ -16480,7 +16730,7 @@ const i18n = createI18n({
|
|
|
16480
16730
|
messages: {}
|
|
16481
16731
|
});
|
|
16482
16732
|
const localesMap = Object.fromEntries(
|
|
16483
|
-
Object.entries(/* #__PURE__ */ Object.assign({"../locales/en.yml": () => __vitePreload(() => import('./en-Crh6PWFl.js'),true?[]:void 0,import.meta.url),"../locales/zh-CN.yml": () => __vitePreload(() => import('./zh-CN-DRUGIcOM.js'),true?[]:void 0,import.meta.url)})).map(([path, loadLocale]) => [path.match(/([\w-]*)\.yml$/)?.[1], loadLocale])
|
|
16733
|
+
Object.entries(/* #__PURE__ */ Object.assign({"../locales/en.yml": () => __vitePreload(() => import('./en-Crh6PWFl.js'),true ?[]:void 0,import.meta.url),"../locales/zh-CN.yml": () => __vitePreload(() => import('./zh-CN-DRUGIcOM.js'),true ?[]:void 0,import.meta.url)})).map(([path, loadLocale]) => [path.match(/([\w-]*)\.yml$/)?.[1], loadLocale])
|
|
16484
16734
|
);
|
|
16485
16735
|
const availableLocales = Object.keys(localesMap);
|
|
16486
16736
|
const loadedLanguages = [];
|
|
@@ -16641,162 +16891,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
16641
16891
|
|
|
16642
16892
|
/* Injected with object hook! */
|
|
16643
16893
|
|
|
16644
|
-
const TYPE_REQUEST = "q";
|
|
16645
|
-
const TYPE_RESPONSE = "s";
|
|
16646
|
-
const DEFAULT_TIMEOUT = 6e4;
|
|
16647
|
-
function defaultSerialize(i) {
|
|
16648
|
-
return i;
|
|
16649
|
-
}
|
|
16650
|
-
const defaultDeserialize = defaultSerialize;
|
|
16651
|
-
const { clearTimeout: clearTimeout$1, setTimeout: setTimeout$1 } = globalThis;
|
|
16652
|
-
const random = Math.random.bind(Math);
|
|
16653
|
-
function createBirpc(functions, options) {
|
|
16654
|
-
const {
|
|
16655
|
-
post,
|
|
16656
|
-
on,
|
|
16657
|
-
off = () => {
|
|
16658
|
-
},
|
|
16659
|
-
eventNames = [],
|
|
16660
|
-
serialize = defaultSerialize,
|
|
16661
|
-
deserialize = defaultDeserialize,
|
|
16662
|
-
resolver,
|
|
16663
|
-
bind = "rpc",
|
|
16664
|
-
timeout = DEFAULT_TIMEOUT
|
|
16665
|
-
} = options;
|
|
16666
|
-
const rpcPromiseMap = /* @__PURE__ */ new Map();
|
|
16667
|
-
let _promise;
|
|
16668
|
-
let closed = false;
|
|
16669
|
-
const rpc = new Proxy({}, {
|
|
16670
|
-
get(_, method) {
|
|
16671
|
-
if (method === "$functions")
|
|
16672
|
-
return functions;
|
|
16673
|
-
if (method === "$close")
|
|
16674
|
-
return close;
|
|
16675
|
-
if (method === "then" && !eventNames.includes("then") && !("then" in functions))
|
|
16676
|
-
return undefined;
|
|
16677
|
-
const sendEvent = (...args) => {
|
|
16678
|
-
post(serialize({ m: method, a: args, t: TYPE_REQUEST }));
|
|
16679
|
-
};
|
|
16680
|
-
if (eventNames.includes(method)) {
|
|
16681
|
-
sendEvent.asEvent = sendEvent;
|
|
16682
|
-
return sendEvent;
|
|
16683
|
-
}
|
|
16684
|
-
const sendCall = async (...args) => {
|
|
16685
|
-
if (closed)
|
|
16686
|
-
throw new Error(`[birpc] rpc is closed, cannot call "${method}"`);
|
|
16687
|
-
if (_promise) {
|
|
16688
|
-
try {
|
|
16689
|
-
await _promise;
|
|
16690
|
-
} finally {
|
|
16691
|
-
_promise = undefined;
|
|
16692
|
-
}
|
|
16693
|
-
}
|
|
16694
|
-
return new Promise((resolve, reject) => {
|
|
16695
|
-
const id = nanoid();
|
|
16696
|
-
let timeoutId;
|
|
16697
|
-
if (timeout >= 0) {
|
|
16698
|
-
timeoutId = setTimeout$1(() => {
|
|
16699
|
-
try {
|
|
16700
|
-
const handleResult = options.onTimeoutError?.(method, args);
|
|
16701
|
-
if (handleResult !== true)
|
|
16702
|
-
throw new Error(`[birpc] timeout on calling "${method}"`);
|
|
16703
|
-
} catch (e) {
|
|
16704
|
-
reject(e);
|
|
16705
|
-
}
|
|
16706
|
-
rpcPromiseMap.delete(id);
|
|
16707
|
-
}, timeout);
|
|
16708
|
-
if (typeof timeoutId === "object")
|
|
16709
|
-
timeoutId = timeoutId.unref?.();
|
|
16710
|
-
}
|
|
16711
|
-
rpcPromiseMap.set(id, { resolve, reject, timeoutId, method });
|
|
16712
|
-
post(serialize({ m: method, a: args, i: id, t: "q" }));
|
|
16713
|
-
});
|
|
16714
|
-
};
|
|
16715
|
-
sendCall.asEvent = sendEvent;
|
|
16716
|
-
return sendCall;
|
|
16717
|
-
}
|
|
16718
|
-
});
|
|
16719
|
-
function close() {
|
|
16720
|
-
closed = true;
|
|
16721
|
-
rpcPromiseMap.forEach(({ reject, method }) => {
|
|
16722
|
-
reject(new Error(`[birpc] rpc is closed, cannot call "${method}"`));
|
|
16723
|
-
});
|
|
16724
|
-
rpcPromiseMap.clear();
|
|
16725
|
-
off(onMessage);
|
|
16726
|
-
}
|
|
16727
|
-
async function onMessage(data, ...extra) {
|
|
16728
|
-
let msg;
|
|
16729
|
-
try {
|
|
16730
|
-
msg = deserialize(data);
|
|
16731
|
-
} catch (e) {
|
|
16732
|
-
if (options.onGeneralError?.(e) !== true)
|
|
16733
|
-
throw e;
|
|
16734
|
-
return;
|
|
16735
|
-
}
|
|
16736
|
-
if (msg.t === TYPE_REQUEST) {
|
|
16737
|
-
const { m: method, a: args } = msg;
|
|
16738
|
-
let result, error;
|
|
16739
|
-
const fn = resolver ? resolver(method, functions[method]) : functions[method];
|
|
16740
|
-
if (!fn) {
|
|
16741
|
-
error = new Error(`[birpc] function "${method}" not found`);
|
|
16742
|
-
} else {
|
|
16743
|
-
try {
|
|
16744
|
-
result = await fn.apply(bind === "rpc" ? rpc : functions, args);
|
|
16745
|
-
} catch (e) {
|
|
16746
|
-
error = e;
|
|
16747
|
-
}
|
|
16748
|
-
}
|
|
16749
|
-
if (msg.i) {
|
|
16750
|
-
if (error && options.onError)
|
|
16751
|
-
options.onError(error, method, args);
|
|
16752
|
-
if (error && options.onFunctionError) {
|
|
16753
|
-
if (options.onFunctionError(error, method, args) === true)
|
|
16754
|
-
return;
|
|
16755
|
-
}
|
|
16756
|
-
if (!error) {
|
|
16757
|
-
try {
|
|
16758
|
-
post(serialize({ t: TYPE_RESPONSE, i: msg.i, r: result }), ...extra);
|
|
16759
|
-
return;
|
|
16760
|
-
} catch (e) {
|
|
16761
|
-
error = e;
|
|
16762
|
-
if (options.onGeneralError?.(e, method, args) !== true)
|
|
16763
|
-
throw e;
|
|
16764
|
-
}
|
|
16765
|
-
}
|
|
16766
|
-
try {
|
|
16767
|
-
post(serialize({ t: TYPE_RESPONSE, i: msg.i, e: error }), ...extra);
|
|
16768
|
-
} catch (e) {
|
|
16769
|
-
if (options.onGeneralError?.(e, method, args) !== true)
|
|
16770
|
-
throw e;
|
|
16771
|
-
}
|
|
16772
|
-
}
|
|
16773
|
-
} else {
|
|
16774
|
-
const { i: ack, r: result, e: error } = msg;
|
|
16775
|
-
const promise = rpcPromiseMap.get(ack);
|
|
16776
|
-
if (promise) {
|
|
16777
|
-
clearTimeout$1(promise.timeoutId);
|
|
16778
|
-
if (error)
|
|
16779
|
-
promise.reject(error);
|
|
16780
|
-
else
|
|
16781
|
-
promise.resolve(result);
|
|
16782
|
-
}
|
|
16783
|
-
rpcPromiseMap.delete(ack);
|
|
16784
|
-
}
|
|
16785
|
-
}
|
|
16786
|
-
_promise = on(onMessage);
|
|
16787
|
-
return rpc;
|
|
16788
|
-
}
|
|
16789
|
-
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
16790
|
-
function nanoid(size = 21) {
|
|
16791
|
-
let id = "";
|
|
16792
|
-
let i = size;
|
|
16793
|
-
while (i--)
|
|
16794
|
-
id += urlAlphabet[random() * 64 | 0];
|
|
16795
|
-
return id;
|
|
16796
|
-
}
|
|
16797
|
-
|
|
16798
|
-
/* Injected with object hook! */
|
|
16799
|
-
|
|
16800
16894
|
function createRPCClient(name, hot, functions = {}, options = {}) {
|
|
16801
16895
|
const event = `${name}:rpc`;
|
|
16802
16896
|
const promise = Promise.resolve(hot).then((r) => {
|