(function () {
"use strict";
function escHtml(s) {
if (s == null) return "";
return String(s)
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">");
}
function escAttr(s) {
if (s == null) return "";
return String(s)
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """);
}
function base64EncodeUtf8(text) {
if (typeof btoa !== "undefined") {
return btoa(unescape(encodeURIComponent(text)));
}
if (typeof Buffer !== "undefined") {
return Buffer.from(text, "utf-8").toString("base64");
}
var encodedText = encodeURIComponent(String(text || ""));
var bytes = [];
for (var j = 0; j < encodedText.length; j++) {
var ch = encodedText.charAt(j);
if (ch === "%") {
bytes.push(parseInt(encodedText.slice(j + 1, j + 3), 16));
j += 2;
} else {
bytes.push(encodedText.charCodeAt(j));
}
}
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var out = "";
for (var i = 0; i < bytes.length; i += 3) {
var b1 = bytes[i];
var b2 = i + 1 < bytes.length ? bytes[i + 1] : 0;
var b3 = i + 2 < bytes.length ? bytes[i + 2] : 0;
var triplet = (b1 << 16) | (b2 << 8) | b3;
out += chars[(triplet >> 18) & 63];
out += chars[(triplet >> 12) & 63];
out += i + 1 < bytes.length ? chars[(triplet >> 6) & 63] : "=";
out += i + 2 < bytes.length ? chars[triplet & 63] : "=";
}
return out;
}
var { h, Fragment, renderToString, createContext, useState, useEffect,
useLayoutEffect, useRef, useMemo, useCallback, useContext, useReducer,
useId, useImperativeHandle, useSyncExternalStore, forwardRef, memo,
createPortal } = globalThis.__zebReact;
function useInsertionEffect() {}
var PageStateContext = createContext(null);
function createUsePageState() {
return function usePageState(keyOrInitial, defaultValue) {
var isKeyed = typeof keyOrInitial === "string";
var ctx = useContext(PageStateContext);
if (isKeyed) {
var key = keyOrInitial;
if (ctx && typeof ctx === "object") {
var value = key in ctx ? ctx[key] : defaultValue;
var setter = function (v) { if (ctx.setPageState) ctx.setPageState(function (p) { var o = {}; o[key] = v; return o; }); };
return [value, setter];
}
return [defaultValue, function () {}];
}
if (ctx && typeof ctx === "object") return ctx;
return Object.assign({}, keyOrInitial || {}, { setPageState: function () {} });
};
}
function usePathname() {
var ctx = globalThis.ctx || {};
return typeof ctx.route === "string" && ctx.route ? ctx.route : "/";
}
function useSearchParams() {
var ctx = globalThis.ctx || {};
var entries = [];
var query = ctx.query;
if (query && typeof query === "object") {
for (var key in query) {
if (Object.prototype.hasOwnProperty.call(query, key)) {
entries.push([key, String(query[key])]);
}
}
}
var snapshot = Deno.core.ops.op_rwe_search_params_snapshot(
typeof ctx.search === "string" ? ctx.search : null,
entries
);
var pairs = snapshot.entries;
var scalarString = function(value) {
if (typeof value === "symbol") throw new TypeError("Cannot convert a Symbol value to a string");
return String(value).toWellFormed();
};
var readonly = function() { throw new TypeError("Search params are read-only; use router.push or router.replace."); };
var view = {
get: function(name) {
name = scalarString(name);
for (var pair of pairs) if (pair[0] === name) return pair[1];
return null;
},
getAll: function(name) {
name = scalarString(name);
return pairs.filter(function(pair) { return pair[0] === name; }).map(function(pair) { return pair[1]; });
},
has: function(name, value) {
name = scalarString(name);
var matchValue = value !== undefined;
if (matchValue) value = scalarString(value);
return pairs.some(function(pair) { return pair[0] === name && (!matchValue || pair[1] === value); });
},
entries: function() { return pairs.map(function(pair) { return pair.slice(); })[Symbol.iterator](); },
keys: function() { return pairs.map(function(pair) { return pair[0]; })[Symbol.iterator](); },
values: function() { return pairs.map(function(pair) { return pair[1]; })[Symbol.iterator](); },
forEach: function(callback, thisArg) {
if (typeof callback !== "function") throw new TypeError("Search params callback must be a function");
pairs.forEach(function(pair) { callback.call(thisArg, pair[1], pair[0], view); });
},
toString: function() { return snapshot.encoded; },
size: pairs.length,
append: readonly,
delete: readonly,
set: readonly,
sort: readonly,
};
view[Symbol.iterator] = view.entries;
return Object.freeze(view);
}
function useRouter() {
return {
push: function (_href) {},
replace: function (_href) {},
back: function () {},
forward: function () {},
refresh: function () {},
prefetch: function (_href) {},
};
}
function Link(props) {
var href = props.href;
var children = props.children;
var rest = {};
for (var k in props) {
if (k !== "href" && k !== "children") rest[k] = props[k];
}
return h("a", Object.assign({ href: href }, rest), children);
}
function wrapWithPageState(Page, input) {
input = input || {};
var ctxValue = Object.assign({}, input, { setPageState: function () {} });
return h(PageStateContext.Provider, { value: ctxValue }, h(Page, input));
}
globalThis.h = h;
globalThis.Fragment = Fragment;
globalThis.React = { createElement: h, Fragment: Fragment };
globalThis.createElement = h;
globalThis.useState = useState;
globalThis.useEffect = useEffect;
globalThis.useLayoutEffect = useLayoutEffect;
globalThis.useInsertionEffect = useInsertionEffect;
globalThis.useRef = useRef;
globalThis.useMemo = useMemo;
globalThis.useCallback = useCallback;
globalThis.useContext = useContext;
globalThis.useReducer = useReducer;
globalThis.useId = useId;
globalThis.useImperativeHandle = useImperativeHandle;
globalThis.useSyncExternalStore = useSyncExternalStore;
globalThis.forwardRef = forwardRef;
globalThis.memo = memo;
globalThis.createPortal = createPortal;
globalThis.createContext = createContext;
globalThis.usePageState = createUsePageState();
globalThis.useRouter = useRouter;
globalThis.usePathname = usePathname;
globalThis.useSearchParams = useSearchParams;
globalThis.Link = Link;
globalThis.cx = function cx() {
var out = [];
for (var i = 0; i < arguments.length; i++) {
if (arguments[i]) out.push(arguments[i]);
}
return out.join(" ");
};
globalThis.useDebounce = function(value) { return value; };
globalThis.useThrottle = function(value) { return value; };
globalThis.useLocalStorage = function(key, init) { return [init, function() {}]; };
globalThis.useClipboard = function() { return { copied: false, copy: function() {} }; };
globalThis.useTemporaryState = function(init) { return [init, function() {}]; };
globalThis.useWindowEvent = function() {};
globalThis.useLazyModule = function() { return [null, true, null]; };
globalThis.useSplitPane = function() { return { current: null }; };
globalThis.useClickAway = function() { return { current: null }; };
globalThis.useInterval = function() {};
globalThis.useGeolocation = function() { return { loading: true, error: null, coords: null }; };
globalThis.useTree = function() {
return { expanded: new Set(), isExpanded: function() { return false; }, toggle: function() {}, expand: function() {}, collapse: function() {}, expandAll: function() {}, collapseAll: function() {} };
};
globalThis.ensureDevicons = function() {};
globalThis.dbKindIconClass = function() { return ""; };
globalThis.dbObjectIconClass = function() { return ""; };
globalThis.Canvas = function(props) {
return h('div', { className: (props && props.className) || 'w-full h-full' });
};
globalThis.ThreeCanvas = globalThis.Canvas;
globalThis.ThreeContext = createContext(null);
globalThis.ThreeScene = function(props) {
return h('div', {
'data-zeb-lib': 'threejs',
'data-zeb-wrapper': 'ThreeScene',
'data-config': JSON.stringify((props && props.config) || {}),
id: props && props.id,
className: (props && props.className) || 'w-full h-full',
});
};
globalThis.useThree = function() { return {}; };
globalThis.useFrame = function() {};
globalThis.OrbitControls = function() { return null; };
globalThis.createSceneRuntime = function() { return {}; };
globalThis.mountThreeScene = function() {};
globalThis.ensureThree = function() { return {}; };
globalThis.MathUtils = {};
globalThis.REVISION = '183';
(function() {
var _cls = function() {};
var _names = [
'Scene','PerspectiveCamera','OrthographicCamera','WebGLRenderer',
'Mesh','Group','Object3D','InstancedMesh','Points','Line',
'BoxGeometry','SphereGeometry','PlaneGeometry','CylinderGeometry',
'TorusGeometry','TorusKnotGeometry','ConeGeometry','RingGeometry','CircleGeometry','BufferGeometry',
'MeshStandardMaterial','MeshBasicMaterial','MeshPhongMaterial','MeshLambertMaterial',
'MeshNormalMaterial','MeshToonMaterial','MeshPhysicalMaterial','ShaderMaterial',
'DirectionalLight','PointLight','SpotLight','AmbientLight','HemisphereLight',
'Vector2','Vector3','Vector4','Quaternion','Euler','Matrix4','Color',
'Raycaster','Clock','AnimationMixer','TextureLoader','CubeTextureLoader','Texture'
];
for (var i = 0; i < _names.length; i++) { globalThis[_names[i]] = _cls; }
})();
globalThis.VrmViewer = function(props) {
var cfg = JSON.stringify({
modelUrl: (props && (props.modelUrl || props.model_url)) || '',
height: (props && props.height) || '400px',
background: (props && props.background) || 'transparent',
autoRotate: !!(props && props.autoRotate),
cameraZ: (props && props.cameraZ) || 1.5,
});
return h('div', {
'data-zeb-lib': 'threejs-vrm',
'data-zeb-wrapper': 'VrmViewer',
'data-config': cfg,
id: props && props.id,
className: (props && props.className) || 'w-full h-full',
style: { width: '100%', height: (props && props.height) || '400px' },
});
};
globalThis.mountVrmViewer = function() {};
globalThis.DeckMap = function(props) {
var cfg = JSON.stringify({
initialViewState: props && props.initialViewState,
controller: !props || props.controller !== false,
layers: (props && props.layers) || [],
stateKey: (props && props.stateKey) || null,
layerKey: (props && props.layerKey) || null,
background: (props && props.background) || 'transparent',
});
return h('div', {
'data-zeb-lib': 'deckgl',
'data-zeb-wrapper': 'DeckMap',
'data-config': cfg,
id: props && props.id,
className: props && props.className,
style: { width: '100%', height: (props && props.height) || '400px' },
});
};
globalThis.deckgl = {};
globalThis.buildLayer = function() { return null; };
globalThis.buildLayers = function() { return []; };
globalThis.mountDeckMap = function() {};
globalThis.ensureDeck = function() {};
globalThis.createDeckMapRuntime = function() { return {}; };
globalThis.d3 = {};
globalThis.useD3 = function(callback, deps) {
var ref = useRef(null);
useEffect(function() {
if (!ref.current) return;
return callback(ref.current, {});
}, deps || []);
return ref;
};
globalThis.D3Bars = function(props) {
var cfg = JSON.stringify({
type: (props && props.type) || 'bar',
data: (props && props.data) || [],
xKey: props && props.xKey,
yKey: props && props.yKey,
stateKey: props && props.stateKey,
height: (props && props.height) || '260px',
colorScheme: props && props.colorScheme,
area: !!(props && props.area),
});
return h('div', {
'data-zeb-lib': 'd3',
'data-zeb-wrapper': 'D3Bars',
'data-config': cfg,
id: props && props.id,
className: props && props.className,
style: { width: '100%', height: (props && props.height) || '260px' },
});
};
globalThis.GraphCanvas = function(props) {
return h('div', {
'data-zeb-lib': 'graphui',
'data-zeb-wrapper': 'GraphCanvas',
id: props && props.id,
className: (props && props.className) || 'w-full h-full',
});
};
globalThis.PipelineGraph = function PipelineGraph(props) {
return h('div', {
'data-zeb-lib': 'graphui',
'data-zeb-wrapper': 'PipelineGraph',
id: props && props.id,
className: (props && props.className) || 'w-full h-full',
});
};
globalThis.CodeEditor = function(props) {
return h('div', {
'data-zeb-lib': 'codemirror',
'data-zeb-wrapper': 'CodeEditor',
id: props && props.id,
className: (props && props.className) || 'w-full h-full',
});
};
globalThis.Markdown = function(props) {
var text = (props && props.content) || (typeof (props && props.children) === 'string' ? props.children : '') || '';
var encoded = base64EncodeUtf8(text);
return h('div', {
'data-zeb-lib': 'markdown',
'data-rwe-md': encoded,
className: 'rwe-md-placeholder' + ((props && props.className) ? (' ' + props.className) : ''),
});
};
globalThis.__rweSetPageState = function() {};
globalThis.__rwePageState = {};
globalThis.__rweRenderToString = function (node) {
return renderToString(node, { onError: function (error) {
return '<!-- RWE component error: ' + escHtml(String(error)).replace(/--/g, '--') + ' -->';
} });
};
globalThis.__rweWrapWithPageState = wrapWithPageState;
globalThis.__islandCounter = 0;
var __origSSRh = globalThis.h;
function __IslandOff(p) { return p.children; }
function __IslandOnView(p) {
return __origSSRh('div', { 'data-island-id': p.id, 'data-hydrate': 'onview' }, p.children);
}
function __IslandOnInteract(p) {
return __origSSRh('div', { 'data-island-id': p.id, 'data-hydrate': 'oninteract' }, p.children);
}
globalThis.h = function(type, props) {
var args = Array.prototype.slice.call(arguments, 2);
if (props && props.hydrate && props.hydrate !== 'onload') {
var mode = props.hydrate;
var id = 'island-' + (globalThis.__islandCounter++);
var newProps = Object.assign({}, props);
delete newProps.hydrate;
newProps['data-island-id'] = id;
var el = __origSSRh.apply(null, [type, newProps].concat(args));
if (mode === 'off') return __IslandOff({ children: el });
if (mode === 'onview') return __IslandOnView({ id: id, children: el });
if (mode === 'oninteract') return __IslandOnInteract({ id: id, children: el });
}
return __origSSRh.apply(null, [type, props].concat(args));
};
})();