var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
import { c as create_ssr_component, b as subscribe, g as getContext, v as validate_component } from "../../../../../chunks/index-0e008fb3.js";
import { p as page } from "../../../../../chunks/stores-9eb273d1.js";
import { E as Editor } from "../../../../../chunks/editor-8f7742a9.js";
import { E as Error2 } from "../../../../../chunks/error-b3674f8e.js";
import "lodash/get.js";
const Raw = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let $$unsubscribe_datastore;
  let $page, $$unsubscribe_page;
  let $models, $$unsubscribe_models;
  $$unsubscribe_page = subscribe(page, (value2) => $page = value2);
  const models = getContext("stores").models;
  $$unsubscribe_models = subscribe(models, (value2) => $models = value2);
  getContext("stores").activeConfig;
  const datastore = getContext("stores").activeClient;
  $$unsubscribe_datastore = subscribe(datastore, (value2) => value2);
  getContext("services");
  let model;
  let value = JSON.stringify(JSON.parse($page.url.searchParams.get("json") || "{}"), null, 2);
  let error;
  let $$settled;
  let $$rendered;
  do {
    $$settled = true;
    model = $models[$page.params.model];
    $$rendered = `${!!model ? `<div class="${"flex flex-column h-screen"}" style="${"background-color: #272822;"}"><div class="${"w-8/12 border-r-2"}" style="${"border-color: #171812;"}"><div class="${"w-full h-4/6"}">${validate_component(Editor, "Editor").$$render($$result, {
      language: "json",
      schema: __spreadValues({ type: "object" }, model.schema.model),
      value
    }, {
      value: ($$value) => {
        value = $$value;
        $$settled = false;
      }
    }, {})}</div>

			<div class="${"w-full h-2/6 border-t-2"}" style="${"border-color: #171812;"}">${validate_component(Error2, "Error").$$render($$result, { error }, {}, {})}</div></div>

		<div class="${"w-4/12"}">${validate_component(Editor, "Editor").$$render($$result, {
      language: "json",
      isReadonly: true,
      value: JSON.stringify([], null, 2)
    }, {}, {})}</div></div>` : ``}`;
  } while (!$$settled);
  $$unsubscribe_datastore();
  $$unsubscribe_page();
  $$unsubscribe_models();
  return $$rendered;
});
export { Raw as default };
