@reformer/builder 3.0.0-beta.1 → 3.0.0-beta.3

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.
Files changed (57) hide show
  1. package/README.md +42 -0
  2. package/dist/assets/{App-EWxVyd71.js → App-DDHZ1u4r.js} +259 -271
  3. package/dist/assets/{BootError-8gklkOEj.js → BootError-BocATCDq.js} +1 -1
  4. package/dist/assets/ChatPanel-CLGfEFwO.js +82 -0
  5. package/dist/assets/CodeEditor-D2CN7Y0Y.js +1 -0
  6. package/dist/assets/MarkdownPreview-DeF2kLYf.js +31 -0
  7. package/dist/assets/RawJsonEditor-CAn-6k60.js +1 -0
  8. package/dist/assets/{boot-CGsYMAQp.js → boot-CGXL9DvO.js} +1 -1
  9. package/dist/assets/byok-AwgW0TGr.js +120 -0
  10. package/dist/assets/{monaco-setup-BytXwQeQ.js → editor.api-D0kmPZPG.js} +151 -162
  11. package/dist/assets/{freemarker2-BQAfMb99.js → freemarker2-KoU2HZ3i.js} +2 -2
  12. package/dist/assets/handlebars-z9wljS-d.js +1 -0
  13. package/dist/assets/html-Dm_WSorp.js +1 -0
  14. package/dist/assets/{index-CSZOipZ8.js → index-7XdLAZ8M.js} +2 -2
  15. package/dist/assets/{index-BgGwGI4q.js → index-BcXYSsF-.js} +9 -9
  16. package/dist/assets/index-Bz9Zy-iu.js +1 -0
  17. package/dist/assets/index-CQSolIG8.js +3 -0
  18. package/dist/assets/{index-Uhx9KLCG.js → index-CQzoXBah.js} +1 -1
  19. package/dist/assets/{index-BLqONGUt.js → index-CwkqyHY1.js} +2 -2
  20. package/dist/assets/index-TeGkT1-d.css +1 -0
  21. package/dist/assets/javascript-CLIFL9TE.js +1 -0
  22. package/dist/assets/{jsonMode-D3mpWOQQ.js → jsonMode-BWN-M-0M.js} +3 -3
  23. package/dist/assets/liquid-DMbcy3LU.js +1 -0
  24. package/dist/assets/{load-DQmdgTkV.js → load-DneTPRH1.js} +4 -4
  25. package/dist/assets/mdx-CYOwcijj.js +1 -0
  26. package/dist/assets/monaco-languages-ShM1TEHM.js +2 -0
  27. package/dist/assets/monaco-setup-Bf10EGeB.js +12 -0
  28. package/dist/assets/python-HPf0NxJ6.js +1 -0
  29. package/dist/assets/razor-DEx2UEDo.js +1 -0
  30. package/dist/assets/reformer-ui-kit-11-DgIIndbm.js +1 -0
  31. package/dist/assets/reformer-ui-kit-DZ57GxjM.js +1 -0
  32. package/dist/assets/{typescript-Bjd-gS8c.js → typescript-CMnYDCrh.js} +1 -1
  33. package/dist/assets/typescript-D5hvGSDM.js +1 -0
  34. package/dist/assets/useFormField-BLbvmpme-BbA23MvM.js +1 -0
  35. package/dist/assets/xml-DNgl0Df8.js +1 -0
  36. package/dist/assets/yaml-CyW3nQo2.js +1 -0
  37. package/dist/index.html +2 -2
  38. package/package.json +11 -1
  39. package/dist/assets/CodeEditor-152n3d6e.js +0 -2
  40. package/dist/assets/RawJsonEditor-CkDLPhsI.js +0 -1
  41. package/dist/assets/handlebars-Brdeuzw5.js +0 -1
  42. package/dist/assets/html-BjYaOi8p.js +0 -1
  43. package/dist/assets/index-4oDdZ-Yj.js +0 -3
  44. package/dist/assets/index-CFDCSwb2.js +0 -1
  45. package/dist/assets/index-DIgOR-JL.css +0 -1
  46. package/dist/assets/javascript-CTKhG5-q.js +0 -1
  47. package/dist/assets/liquid-CSjp0MaB.js +0 -1
  48. package/dist/assets/mdx-Bc5quPBk.js +0 -1
  49. package/dist/assets/python-DuAl67Eo.js +0 -1
  50. package/dist/assets/razor-BbXkrvwj.js +0 -1
  51. package/dist/assets/reformer-ui-kit-11-DNMUPUyd.js +0 -1
  52. package/dist/assets/reformer-ui-kit-1LAJcT8b.js +0 -1
  53. package/dist/assets/typescript-0wJoIq5V.js +0 -1
  54. package/dist/assets/useFormField-BLbvmpme-4e6SCAMU.js +0 -1
  55. package/dist/assets/xml-bMgZPd2t.js +0 -1
  56. package/dist/assets/yaml-yApvoFdI.js +0 -1
  57. /package/dist/assets/{monaco-setup-BzOv8av-.css → editor-BzOv8av-.css} +0 -0
@@ -0,0 +1 @@
1
+ import{a as ve,b as pe,r as f,W as me,j as A}from"./index-7XdLAZ8M.js";var ye=pe();const Ar=ve(ye);function ge(...e){return t=>{for(const r of e)typeof r=="function"?r(t):r!=null&&(r.current=t)}}function be(e){return Object.getOwnPropertyDescriptor(e.props,"ref")?.get?.isReactWarning?e.ref:Object.getOwnPropertyDescriptor(e,"ref")?.get?.isReactWarning?e.props.ref:e.props.ref??e.ref}function we(e,t){const r={...e};for(const i of Object.keys(t)){const s=e[i],n=t[i];i.startsWith("on")&&typeof s=="function"&&typeof n=="function"?r[i]=(...o)=>{n(...o),s(...o)}:i==="className"&&typeof s=="string"&&typeof n=="string"?r[i]=[n,s].filter(Boolean).join(" "):i==="style"&&typeof s=="object"&&typeof n=="object"?r[i]={...n,...s}:i==="disabled"?r[i]=!!s||!!n:n!==void 0&&(r[i]=n)}return r}const z=f.forwardRef(({children:e,...t},r)=>{const i=f.Children.only(e);if(!f.isValidElement(i))return null;const s=i.props,n=we(t,s),o=be(i),a=ge(r,o);return f.cloneElement(i,{...n,ref:a})});z.displayName="Slot";var Ee=Symbol.for("preact-signals");function it(){if(x>1)x--;else{var e,t=!1;for((function(){var s=Q;for(Q=void 0;s!==void 0;)s.S.v===s.v&&(s.S.i=s.i),s=s.o})();B!==void 0;){var r=B;for(B=void 0,H++;r!==void 0;){var i=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&Pt(r))try{r.c()}catch(s){t||(e=s,t=!0)}r=i}}if(H=0,x--,t)throw e}}function q(e){if(x>0)return e();ut=++ke,x++;try{return e()}finally{it()}}var p=void 0;function st(e){var t=p;p=void 0;try{return e()}finally{p=t}}var $,B=void 0,x=0,H=0,ke=0,ut=0,Q=void 0,X=0;function Mt(e){if(p!==void 0){var t=e.n;if(t===void 0||t.t!==p)return t={i:0,S:e,p:p.s,n:void 0,t:p,e:void 0,x:void 0,r:t},p.s!==void 0&&(p.s.n=t),p.s=t,e.n=t,32&p.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=p.s,t.n=void 0,p.s.n=t,p.s=t),t}}function E(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}E.prototype.brand=Ee;E.prototype.h=function(){return!0};E.prototype.S=function(e){var t=this,r=this.t;r!==e&&e.e===void 0&&(e.x=r,this.t=e,r!==void 0?r.e=e:st(function(){var i;(i=t.W)==null||i.call(t)}))};E.prototype.U=function(e){var t=this;if(this.t!==void 0){var r=e.e,i=e.x;r!==void 0&&(r.x=i,e.e=void 0),i!==void 0&&(i.e=r,e.x=void 0),e===this.t&&(this.t=i,i===void 0&&st(function(){var s;(s=t.Z)==null||s.call(t)}))}};E.prototype.subscribe=function(e){var t=this;return b(function(){var r=t.value,i=p;p=void 0;try{e(r)}finally{p=i}},{name:"sub"})};E.prototype.valueOf=function(){return this.value};E.prototype.toString=function(){return this.value+""};E.prototype.toJSON=function(){return this.value};E.prototype.peek=function(){var e=p;p=void 0;try{return this.value}finally{p=e}};Object.defineProperty(E.prototype,"value",{get:function(){var e=Mt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(H>100)throw new Error("Cycle detected");(function(r){x!==0&&H===0&&r.l!==ut&&(r.l=ut,Q={S:r,v:r.v,i:r.i,o:Q})})(this),this.v=e,this.i++,X++,x++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{it()}}}});function w(e,t){return new E(e,t)}function Pt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ot(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function jt(e){for(var t=e.s,r=void 0;t!==void 0;){var i=t.p;t.i===-1?(t.S.U(t),i!==void 0&&(i.n=t.n),t.n!==void 0&&(t.n.p=i)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=i}e.s=r}function M(e,t){E.call(this,void 0),this.x=e,this.s=void 0,this.g=X-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}M.prototype=new E;M.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===X))return!0;if(this.g=X,this.f|=1,this.i>0&&!Pt(this))return this.f&=-2,!0;var e=p;try{Ot(this),p=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return p=e,jt(this),this.f&=-2,!0};M.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}E.prototype.S.call(this,e)};M.prototype.U=function(e){if(this.t!==void 0&&(E.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};M.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(M.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Mt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function v(e,t){return new M(e,t)}function It(e){var t=e.m;if(e.m=void 0,typeof t=="function"){x++;var r=p;p=void 0;try{t()}catch(i){throw e.f&=-2,e.f|=8,vt(e),i}finally{p=r,it()}}}function vt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,It(e)}function _e(e){if(p!==this)throw new Error("Out-of-order effect");jt(this),p=e,this.f&=-2,8&this.f&&vt(this),it()}function O(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,$&&$.push(this)}O.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};O.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,It(this),Ot(this),x++;var e=p;return p=this,_e.bind(this,e)};O.prototype.N=function(){2&this.f||(this.f|=2,this.u=B,B=this)};O.prototype.d=function(){this.f|=8,1&this.f||vt(this)};O.prototype.dispose=function(){this.d()};function b(e,t){var r=new O(e,t);try{r.c()}catch(s){throw r.d(),s}var i=r.d.bind(r);return i[Symbol.dispose]=i,i}function pt(e){return function(){var t=arguments,r=this;return q(function(){return st(function(){return e.apply(r,[].slice.call(t))})})}}function Ae(){var e=$;return $=[],function(){var t=$;return $&&e&&(e=e.concat($)),$=e,t}}var Dt=function(e){for(var t in e){var r=e[t];typeof r=="function"?e[t]=pt(r):typeof r=="object"&&r!==null&&!("brand"in r)&&Dt(r)}};function Se(e){return function(){var t,r,i=Ae();try{r=e.apply(void 0,[].slice.call(arguments))}catch(s){throw $=void 0,s}finally{t=i()}return Dt(r),r[Symbol.dispose]=pt(function(){if(t)for(var s=0;s<t.length;s++)t[s].dispose();t=void 0}),r}}const Sr=Object.freeze(Object.defineProperty({__proto__:null,Computed:M,Effect:O,Signal:E,action:pt,batch:q,computed:v,createModel:Se,effect:b,signal:w,untracked:st},Symbol.toStringTag,{value:"Module"})),I=new WeakMap;function $e(e){I.set(e,(I.get(e)??0)+1)}function xe(e){const t=I.get(e);t!==void 0&&(t<=1?I.delete(e):I.set(e,t-1))}function Y(e){return I.has(e)}const tt=e=>!(e===null||typeof e!="object"||Array.isArray(e)||e instanceof Date||typeof Blob<"u"&&e instanceof Blob||typeof File<"u"&&e instanceof File),F=(e,t)=>e===""?String(t):`${e}.${t}`,ct=e=>/^\d+$/.test(e),N=e=>{if(Array.isArray(e))return e.map(N);if(tt(e)){const t={};for(const r of Object.keys(e))t[r]=N(e[r]);return t}return e},et=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,i)=>et(r,t[i]));if(tt(e)&&tt(t)){const r=Object.keys(e),i=Object.keys(t);return r.length!==i.length?!1:r.every(s=>et(e[s],t[s]))}return!1};let Fe=class{constructor(t,r){this.path=r;const i=w(t);i.__path=r,this.signal=i,this.initial=N(t)}kind="leaf";signal;initial;rebase(t){this.path=t,this.signal.__path=t}read(){return this.signal.value}peek(){return this.signal.peek()}set(t){this.signal.value=t}resetToInitial(){this.signal.value=N(this.initial)}captureInitial(){this.initial=N(this.signal.peek())}dirty(){return!et(this.signal.peek(),this.initial)}},Tt=class{constructor(t,r){this.path=r;for(const i of Object.keys(t))this.children.set(i,W(t[i],F(r,i)))}kind="group";children=new Map;rebase(t){this.path=t;for(const[r,i]of this.children)i.rebase(F(t,r))}read(){const t={};for(const[r,i]of this.children)t[r]=i.read();return t}peek(){const t={};for(const[r,i]of this.children)t[r]=i.peek();return t}set(t){if(t==null||typeof t!="object")return;const r=t;q(()=>{for(const[i,s]of this.children)i in r&&(s.kind==="leaf"&&Y(s.signal)||s.set(r[i]))})}resetToInitial(){q(()=>{for(const t of this.children.values())t.resetToInitial()})}captureInitial(){for(const t of this.children.values())t.captureInitial()}dirty(){for(const t of this.children.values())if(t.dirty())return!0;return!1}},Ce=class{constructor(t,r){this.path=r,this.items=w(t.map((i,s)=>W(i,F(r,s)))),this.initial=N(t)}kind="array";items;initial;rebase(t){this.path=t,this.items.peek().forEach((r,i)=>r.rebase(F(t,i)))}reindex(){this.items.peek().forEach((t,r)=>t.rebase(F(this.path,r)))}push(t){const r=this.items.peek();this.items.value=[...r,W(t,F(this.path,r.length))]}insertAt(t,r){const i=[...this.items.peek()];i.splice(t,0,W(r,F(this.path,t))),this.items.value=i,this.reindex()}removeAt(t){const r=[...this.items.peek()];r.splice(t,1),this.items.value=r,this.reindex()}move(t,r){const i=[...this.items.peek()],[s]=i.splice(t,1);s&&i.splice(r,0,s),this.items.value=i,this.reindex()}swap(t,r){const i=[...this.items.peek()];t<0||r<0||t>=i.length||r>=i.length||t===r||([i[t],i[r]]=[i[r],i[t]],this.items.value=i,this.reindex())}clear(){this.items.value=[]}read(){return this.items.value.map(t=>t.read())}peek(){return this.items.peek().map(t=>t.peek())}set(t){const r=Array.isArray(t)?t:[];this.items.value=r.map((i,s)=>W(i,F(this.path,s)))}resetToInitial(){this.set(N(this.initial))}captureInitial(){this.initial=N(this.peek())}dirty(){return!et(this.peek(),this.initial)}};function W(e,t){return Array.isArray(e)?new Ce(e,t):tt(e)?new Tt(e,t):new Fe(e,t)}function j(e){if(e)return e.kind==="group"?Bt(e):e.kind==="array"?Ne(e):e.read()}function Ne(e){const t={get length(){return e.items.value.length},push:r=>e.push(r),insertAt:(r,i)=>e.insertAt(r,i),removeAt:r=>e.removeAt(r),move:(r,i)=>e.move(r,i),swap:(r,i)=>e.swap(r,i),clear:()=>e.clear(),at:r=>j(e.items.value[r]),map:r=>e.items.value.map((i,s)=>r(j(i),s)),forEach:r=>e.items.value.forEach((i,s)=>r(j(i),s)),toArray:()=>e.peek(),[Symbol.iterator]:function*(){const r=e.items.value;for(let i=0;i<r.length;i++)yield j(r[i])}};return new Proxy(t,{get:(r,i,s)=>i==="__path"?e.path:typeof i=="string"&&ct(i)?j(e.items.value[Number(i)]):Reflect.get(r,i,s),has:(r,i)=>typeof i=="string"&&ct(i)?Number(i)<e.items.value.length:Reflect.has(r,i)})}const _t=new WeakMap;function Ve(e){const t=v(()=>e.read());return{get value(){return t.value},peek:()=>t.peek(),subscribe:r=>t.subscribe(r),valueOf:()=>t.value,toString:()=>String(t.value),toJSON:()=>t.value,brand:t.brand}}function Rt(e){if(e.kind==="leaf")return e.signal;const t=_t.get(e);if(t)return t;const r=Ve(e),i=e.kind==="group",s=a=>i?e.children.get(a):ct(a)?e.items.value[Number(a)]:void 0,n=i?{}:{get length(){return e.items.value.length}},o=new Proxy(n,{get:(a,l,h)=>{if(l==="__path")return e.path;if(l==="__kind")return e.kind;if(typeof l!="string")return Reflect.get(r,l,r);const c=s(l);return c?Rt(c):!i&&Reflect.has(a,l)?Reflect.get(a,l,h):Reflect.get(r,l,r)},has:(a,l)=>typeof l=="string"&&(s(l)!==void 0||!i&&Reflect.has(a,l)),ownKeys:()=>i?[...e.children.keys()]:Reflect.ownKeys(n),getOwnPropertyDescriptor:(a,l)=>typeof l=="string"&&s(l)?{enumerable:!0,configurable:!0}:i?void 0:Reflect.getOwnPropertyDescriptor(a,l)});return _t.set(e,o),o}function Me(e){if(e==null||typeof e!="object")return!1;const t=e.__kind;return t==="group"||t==="array"}function Pe(e,t){if(!t)return;let r=e;for(const i of t.split(".")){if(!r)return;if(r.kind==="group")r=r.children.get(i);else if(r.kind==="array")r=r.items.peek()[Number(i)];else return}return r&&r.kind==="leaf"?r.signal:void 0}const At=new Set(["$","get","set","patch","isDirty","reset","captureInitial","signalAt"]),St=new WeakMap,Wt=new WeakMap;function Bt(e){const t=St.get(e);if(t)return t;const r={$:Rt(e),get:()=>e.peek(),set:s=>e.set(s),patch:s=>e.set(s),isDirty:()=>e.dirty(),reset:()=>e.resetToInitial(),captureInitial:()=>e.captureInitial(),signalAt:s=>Pe(e,s)},i=new Proxy({},{get:(s,n)=>{if(n==="__path")return e.path;if(typeof n!="string")return;const o=e.children.get(n);if(o)return j(o);if(At.has(n))return r[n]},set:(s,n,o)=>{if(typeof n!="string")return!1;const a=e.children.get(n);return a?(a.set(o),!0):!1},has:(s,n)=>typeof n=="string"&&(e.children.has(n)||At.has(n)),ownKeys:()=>[...e.children.keys()],getOwnPropertyDescriptor:(s,n)=>typeof n=="string"&&e.children.has(n)?{enumerable:!0,configurable:!0}:void 0});return St.set(e,i),Wt.set(i,e),i}function dt(e,t){if(e.kind==="leaf"){t(e.signal);return}if(e.kind==="group"){for(const r of e.children.values())dt(r,t);return}for(const r of e.items.value)dt(r,t)}function Oe(e,t){const r=Wt.get(e);r&&dt(r,t)}function Ut(e){const t=new Tt(e,"");return Bt(t)}const je="runOutsideEffect";function Ie(e){return typeof e=="object"&&e!==null&&typeof e.then=="function"}function Gt(e,t){try{const r=e();Ie(r)&&r.then(void 0,i=>void 0)}catch{}}function De(e){return(...t)=>{V(()=>e(...t))}}function V(e){let t=!1;return queueMicrotask(()=>{t||Gt(e,je)}),()=>{t=!0}}function Te(e,t){return()=>{t(()=>Gt(e,"safeDebouncedCallback"))}}function Re(e,t,r,i){return b(()=>{const s=e.map(o=>o.value);if(i?.when&&!i.when(...s))return;const n=r(...s);t.peek()!==n&&(t.value=n)})}function We(e,t,r){return b(()=>{const i=e.value;if(r?.when&&!r.when())return;const s=r?.transform?r.transform(i):i;t.peek()!==s&&(t.value=s)})}function Be(e,t,r){let i=!0;return b(()=>{const s=e.value;i&&(i=!1,!r?.immediate)||t(s)})}function Ue(e,t){let r=!1;return b(()=>{const i=e.value;r||V(()=>{const s=t(i);if(e.peek()!==s){r=!0;try{e.value=s}finally{r=!1}}})})}function Ge(e,t,r){const i=r?.resetValue??null;return b(()=>{const s=t();V(()=>{s&&e.peek()!==i&&(e.value=i)})})}function Le(e,t,r){const i=r?.transform;let s=!1;const n=b(()=>{const a=e.value;s||V(()=>{s=!0;try{const l=i?i(a):a;t.peek()!==l&&(t.value=l)}finally{s=!1}})}),o=b(()=>{const a=t.value;s||V(()=>{s=!0;try{e.peek()!==a&&(e.value=a)}finally{s=!1}})});return()=>{n(),o()}}function qe(e,t){let r=!0;return b(()=>{if(e.forEach(i=>i.value),r){r=!1;return}V(()=>t())})}let nt=class{subscriptions=new Map;add(t,r){return this.subscriptions.has(t)&&this.subscriptions.get(t)?.(),this.subscriptions.set(t,r),()=>this.remove(t)}remove(t){const r=this.subscriptions.get(t);return r?(r(),this.subscriptions.delete(t),!0):!1}clear(){this.subscriptions.forEach(t=>{t()}),this.subscriptions.clear()}size(){return this.subscriptions.size}has(t){return this.subscriptions.has(t)}getKeys(){return Array.from(this.subscriptions.keys())}dispose(){this.clear()}};const Lt=new WeakMap;function qt(e,t){Lt.set(e,t)}function D(e){return Lt.get(e)}function rt(e,t,r={}){const{strategy:i="submit",debounce:s=0,liveAfterSubmit:n="change"}=r,o=w(!1);let a=0,l=!1,h,c;const u=async k=>{a++,o.value=!0;try{return await gt(e,t,{touch:k})}finally{--a===0&&(o.value=!1)}},d=()=>{u(!1)},m=()=>{if(!s){d();return}c&&clearTimeout(c),c=setTimeout(d,s)},g=(k,_)=>{let S=!0;return b(()=>{if(Oe(e,k),S){S=!1;return}i==="afterFirstSubmit"&&!l||_()})},y={async validate(){return l=!0,u(!0)},start(){if(h)return()=>y.dispose();const k=i==="afterFirstSubmit"?n:i;return k==="change"?h=g(_=>void _.value,m):k==="blur"&&(h=g(_=>void D(_)?.touched.value,d)),()=>y.dispose()},dispose(){c&&(clearTimeout(c),c=void 0),h?.(),h=void 0},get isValidating(){return o.value},get validating(){return o}};return y}let U=null;function R(e){if(!U)throw new Error(`[@reformer/core/validation] "${e}" вызван вне схемы валидации — операторы валидации можно вызывать только внутри прогона validateModel(...) (напрямую или через apply/each).`);return U}function mt(e,t){let r=e.errors.get(t);return r||e.errors.set(t,r=[]),r}const yt=e=>e.whenStack.every(t=>t());function ze(e,t){const r=R("validate"),i=mt(r,e);if(!yt(r))return;const s=e.peek();for(const n of t){const o=n(s,r.model,r.model);o&&i.push(o)}}function Ke(e,t){const r=R("validateAsync"),i=mt(r,e);if(!yt(r))return;const s=e.peek(),n=r.signal;for(const o of t)r.pending.push(o(s,{signal:n}).then(a=>{a&&!n.aborted&&i.push(a)},()=>{}))}function Je(e,t){const r=R("validateWhen");r.whenStack.push(e);try{t()}finally{r.whenStack.pop()}}function Ze(e,t){const r=R("cross"),i=mt(r,e);if(!yt(r))return;const s=t(r.model.get());s&&i.push(s)}function He(e,t){R("each");const r=e.length;for(let i=0;i<r;i++)t(e.at(i))}function zt(...e){const t=R("apply").model;for(const r of e)r({model:t})}function Qe(e){return e}const $t=new WeakMap;function Xe(e,t){let r=$t.get(e);r||$t.set(e,r=new WeakMap);let i=r.get(t);return i||r.set(t,i={fields:new Set,ac:null}),i}const Ye=e=>{for(const t of e.values())for(const r of t)if(r.severity!=="warning")return!0;return!1};function tr(e){return e.aborted?Promise.resolve():new Promise(t=>{e.addEventListener("abort",()=>t(),{once:!0})})}async function gt(e,t,r){const i=Xe(e,t);i.ac?.abort();const s=new AbortController;i.ac=s;const n={model:e,errors:new Map,pending:[],whenStack:[],signal:s.signal},o=U;U=n;try{t({model:e})}finally{U=o}if(n.pending.length&&await Promise.race([Promise.all(n.pending),tr(s.signal)]),s.signal.aborted)return!1;const a=new Set(n.errors.keys());for(const l of i.fields)a.has(l)||D(l)?.setErrors([]);for(const l of a)D(l)?.setErrors(n.errors.get(l)??[]);if(r?.touch)for(const l of a)D(l)?.markAsTouched();return i.fields=a,!Ye(n.errors)}const Nr=Object.freeze(Object.defineProperty({__proto__:null,apply:zt,createFormValidation:rt,cross:Ze,defineValidationSchema:Qe,each:He,validate:ze,validateAsync:Ke,validateModel:gt,validateWhen:Je},Symbol.toStringTag,{value:"Module"}));function Kt(e,t,r){return b(()=>{const i=t(),s=D(e);s&&V(()=>{i?s.enable():(s.disable(),r?.resetOnDisable&&s.reset())})})}function er(e,t,r){return Kt(e,()=>!t(),r)}class K{_touched=w(!1);_dirty=w(!1);_status=w("valid");touched=v(()=>this._touched.value);dirty=v(()=>this._dirty.value);status=v(()=>this._status.value);disabled=v(()=>this._status.value==="disabled");getErrors(t){const r=this.errors.value;return t?r.filter(i=>{if(t.code!==void 0&&!(Array.isArray(t.code)?t.code:[t.code]).includes(i.code)||t.message!==void 0&&!i.message.toLowerCase().includes(t.message.toLowerCase()))return!1;if(t.params!==void 0){if(!i.params)return!1;for(const[s,n]of Object.entries(t.params))if(i.params[s]!==n)return!1}return!(t.predicate!==void 0&&!t.predicate(i))}):r}markAsTouched(){this._touched.value=!0,this.onMarkAsTouched()}markAsUntouched(){this._touched.value=!1,this.onMarkAsUntouched()}markAsDirty(){this._dirty.value=!0,this.onMarkAsDirty()}markAsPristine(){this._dirty.value=!1,this.onMarkAsPristine()}touchAll(){this.markAsTouched()}disable(){this._status.value="disabled",this.onDisable()}enable(){this._status.value="valid",this.onEnable()}onMarkAsTouched(){}onMarkAsUntouched(){}onMarkAsDirty(){}onMarkAsPristine(){}onDisable(){}onEnable(){}}const G={Watch:"watch",ComputeFrom:"computeFrom",LinkFields:"linkFields",WatchField:"watchField"};let rr=0;function L(e){return`${e}-${++rr}`}var C=(e=>(e.THROW="throw",e.LOG="log",e.CONVERT="convert",e))(C||{});let P=class{static handle(t,r,i="throw"){const s=this.extractMessage(t);switch(i){case"throw":throw t;case"log":return;case"convert":return{code:"validator_error",message:s,params:{field:r}}}}static extractMessage(t){return t instanceof Error?t.message:typeof t=="string"?t:typeof t=="object"&&t!==null&&"message"in t?String(t.message):String(t)}static createValidationError(t,r,i){return{code:t,message:r,params:i?{field:i}:void 0}}static isValidationError(t){return typeof t=="object"&&t!==null&&"code"in t&&"message"in t&&typeof t.code=="string"&&typeof t.message=="string"}};class ir{_status;status;valid;invalid;pending;disabled;constructor(t="valid"){this._status=w(t),this.status=v(()=>this._status.value),this.valid=v(()=>this._status.value==="valid"),this.invalid=v(()=>this._status.value==="invalid"),this.pending=v(()=>this._status.value==="pending"),this.disabled=v(()=>this._status.value==="disabled")}startValidation(){this._status.value!=="disabled"&&(this._status.value="pending")}completeValidation(t){this._status.value!=="disabled"&&(this._status.value=t?"invalid":"valid")}setErrors(t){this._status.value!=="disabled"&&(this._status.value=t?"invalid":"valid")}disable(){this._status.value="disabled"}enable(t=!1){this._status.value=t?"invalid":"valid"}}class Jt extends K{_value;_errors;_componentProps;statusMachine;value;valid;invalid;pending;status;disabled;errors;componentProps;shouldShowError;validators;asyncValidators;updateOn;initialValue;currentAbortController;debounceMs;validateDebounceTimer;pendingValidation;disposers=new nt;component;constructor(t){super(),this.validators=t.validators||[],this.asyncValidators=t.asyncValidators||[],this.updateOn=t.updateOn||"blur",this.debounceMs=t.debounce||0,this.component=t.component,this._value=t.valueSignal??w(t.value),this.initialValue=this._value.peek(),this._errors=w([]),this._componentProps=w(t.componentProps||{}),this.statusMachine=new ir(t.disabled?"disabled":"valid"),this.value=v(()=>this._value.value),this.valid=v(()=>this.statusMachine.valid.value),this.invalid=v(()=>this.statusMachine.invalid.value),this.pending=v(()=>this.statusMachine.pending.value),this.status=v(()=>this.statusMachine.status.value),this.disabled=v(()=>this.statusMachine.disabled.value),this.errors=v(()=>this._errors.value),this.componentProps=v(()=>this._componentProps.value),this.shouldShowError=v(()=>this.statusMachine.invalid.value&&(this._touched.value||this._dirty.value))}getValue(){return this._value.peek()}setValue(t,r){if(this._value.value=t,this._dirty.value=!0,r?.emitEvent===!1)return;const i=this.validators.length>0||this.asyncValidators.length>0,s=this._errors.value.length>0;if(this.updateOn==="change"){this.validate();return}s&&i&&this.validate()}patchValue(t){this.setValue(t)}reset(t){this._value.value=t!==void 0?t:this.initialValue,this._errors.value=[],this._touched.value=!1,this._dirty.value=!1,this.statusMachine.setErrors(!1)}resetToInitial(){this.reset(this.initialValue)}cancelPendingValidation(){this.pendingValidation&&(this.pendingValidation.abortController.abort(),this.pendingValidation.resolve(!1),this.pendingValidation=void 0),this.validateDebounceTimer&&(clearTimeout(this.validateDebounceTimer),this.validateDebounceTimer=void 0),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=void 0)}async validate(t){const r=t?.debounce??this.debounceMs;if(this.cancelPendingValidation(),r<=0||this.asyncValidators.length===0)return this.validateImmediate();const i=new AbortController;return new Promise(s=>{this.pendingValidation={resolve:s,abortController:i},this.validateDebounceTimer=setTimeout(async()=>{if(this.validateDebounceTimer=void 0,i.signal.aborted){s(!1);return}this.pendingValidation=void 0;const n=await this.validateImmediate(i);s(n)},r),i.signal.addEventListener("abort",()=>{this.validateDebounceTimer&&(clearTimeout(this.validateDebounceTimer),this.validateDebounceTimer=void 0),s(!1)},{once:!0})})}async validateImmediate(t){const r=t??new AbortController;t||this.currentAbortController?.abort(),this.currentAbortController=r;const{signal:i}=r,s=[];for(const n of this.validators){const o=n(this._value.value);o&&s.push(o)}if(i.aborted)return!1;if(s.length>0){this._errors.value=s;const n=s.some(o=>o.severity!=="warning");if(this.statusMachine.setErrors(n),n)return!1}if(this.asyncValidators.length>0){if(i.aborted)return!1;this.statusMachine.startValidation();try{const n=await Promise.all(this.asyncValidators.map(async a=>{if(i.aborted)throw new DOMException("Validation aborted","AbortError");try{const l=await a(this._value.value,{signal:i});if(i.aborted)throw new DOMException("Validation aborted","AbortError");return l}catch(l){if(l instanceof DOMException&&l.name==="AbortError")throw l;return P.handle(l,"FieldNode AsyncValidator",C.CONVERT)}}));if(i.aborted)return!1;const o=n.filter(a=>a!==null);if(o.length>0){this._errors.value=o;const a=o.some(l=>l.severity!=="warning");if(this.statusMachine.completeValidation(a),a)return!1}}catch(n){if(n instanceof DOMException&&n.name==="AbortError")return!1;throw n}}return i.aborted?!1:((this.validators.length>0||this.asyncValidators.length>0)&&(this._errors.value=[],this.statusMachine.completeValidation(!1)),!this._errors.value.some(n=>n.severity!=="warning"))}setErrors(t){this._errors.value=t;const r=t.some(i=>i.severity!=="warning");this.statusMachine.setErrors(r)}clearErrors(){this._errors.value=[],this.statusMachine.setErrors(!1)}onMarkAsTouched(){this.updateOn==="blur"&&this.validate()}onDisable(){this.statusMachine.disable(),this._errors.value=[]}onEnable(){this.statusMachine.enable(this._errors.value.length>0),this.validate()}updateComponentProps(t){this._componentProps.value={...this._componentProps.value,...t}}setUpdateOn(t){this.updateOn=t}getUpdateOn(){return this.updateOn}watch(t){const r=new AbortController,i=b(()=>{const n=this.value.value;t(n,r.signal)}),s=L(G.Watch);return this.disposers.add(s,()=>{r.abort(),i()})}computeFrom(t,r){const i=b(()=>{const n=t.map(a=>a.value),o=r(...n);this.setValue(o,{emitEvent:!1})}),s=L(G.ComputeFrom);return this.disposers.add(s,i)}dispose(){try{this.disposers.dispose()}finally{this.cancelPendingValidation()}}}function bt(e){const{getChildren:t,ownErrors:r,disabled:i}=e,s=v(()=>r.value.length>0?!1:t().every(u=>u.disabled.value||u.valid.value)),n=v(()=>!s.value),o=v(()=>t().some(u=>u.pending.value)),a=v(()=>t().some(u=>u.touched.value)),l=v(()=>t().some(u=>u.dirty.value)),h=v(()=>{const u=[...r.value];for(const d of t())u.push(...d.errors.value);return u}),c=v(()=>i?.value?"disabled":o.value?"pending":n.value?"invalid":"valid");return{valid:s,invalid:n,pending:o,touched:a,dirty:l,errors:h,status:c}}function xt(e){return typeof e=="object"&&e!==null&&"getProxy"in e&&typeof e.getProxy=="function"}const Ft="$";function sr(e,t){let r;const i=()=>{if(!r){const s={};t.forEach((n,o)=>{s[o]=n&&xt(n)?n.getProxy():n}),r=s}return r};return new Proxy(e,{get:(s,n)=>{if(n===Ft)return i();if(n in s)return s[n];if(typeof n=="string"&&t.has(n)){const o=t.get(n);return o&&xt(o)?o.getProxy():o}},set:(s,n,o)=>typeof n=="string"&&t.has(n)?!1:(s[n]=o,!0),has:(s,n)=>n===Ft||typeof n=="string"&&t.has(n)?!0:n in s,ownKeys:s=>{const n=Reflect.ownKeys(s),o=Array.from(t.keys());return[...new Set([...n,...o])]},getOwnPropertyDescriptor:(s,n)=>typeof n=="string"&&t.has(n)?{enumerable:!0,configurable:!0}:Reflect.getOwnPropertyDescriptor(s,n)})}class Zt{constructor(t){this.form=t}_submitting=w(!1);submitting=v(()=>this._submitting.value);async submit(t,r){const{skipValidation:i=!1,skipTouch:s=!1}=r||{};if(s||this.form.markAsTouched(),!i&&!await this.form.validate())return null;this._submitting.value=!0;try{return await t(this.form.getValue())}finally{this._submitting.value=!1}}async submitWithResult(t,r){const{skipValidation:i=!1,skipTouch:s=!1}=r||{};if(s||this.form.markAsTouched(),!i&&!await this.form.validate())return{success:!1,data:null};this._submitting.value=!0;try{return{success:!0,data:await t(this.form.getValue())}}catch(n){return{success:!1,data:null,error:n instanceof Error?n:new Error(String(n))}}finally{this._submitting.value=!1}}}function nr(e){const t=[];for(const r of e.split(".")){const i=/^([^[\]]+)(?:\[(\d+)\])?$/.exec(r);if(!i)return[];t.push(i[2]!==void 0?{key:i[1],index:Number(i[2])}:{key:i[1]})}return t}let T=class Ht extends K{id=crypto.randomUUID();_fields=new Map;disposers=new nt;_proxyInstance;_behaviorCleanup;nodeFactory=new Qt;formSubmitter;_disabled=w(!1);_formErrors=w([]);_fieldSignals=new WeakMap;value;valid;invalid;touched;dirty;pending;errors;status;submitting;constructor(t){super(),this.formSubmitter=new Zt(this);const r=t.form,i=r!=null&&typeof r=="object"&&("valueSignal"in r||"value"in r),s="form"in t&&!i?t.form:t;for(const[o,a]of Object.entries(s)){const l=this.createNode(a);this._fields.set(o,l)}this.value=v(()=>{const o={};return this._fields.forEach((a,l)=>{o[l]=a.value.value}),o});const n=bt({getChildren:()=>Array.from(this._fields.values()),ownErrors:this._formErrors,disabled:this._disabled});this.valid=n.valid,this.invalid=n.invalid,this.pending=n.pending,this.touched=n.touched,this.dirty=n.dirty,this.errors=n.errors,this.status=n.status,this.submitting=this.formSubmitter.submitting}buildProxy(){return sr(this,this._fields)}getValue(){const t={};return this._fields.forEach((r,i)=>{t[i]=r.getValue()}),t}setValue(t,r){for(const[i,s]of Object.entries(t)){const n=this._fields.get(i);if(n){const o=this._fieldSignals.get(n)??n.value;if(Y(o))continue;n.setValue(s,r)}}}patchValue(t){q(()=>{for(const[r,i]of Object.entries(t)){const s=this._fields.get(r);if(s&&i!==void 0){const n=this._fieldSignals.get(s)??s.value;if(Y(n))continue;s.setValue(i,{emitEvent:!1})}}})}reset(t){this._formErrors.value=[],this._fields.forEach((r,i)=>{const s=t?.[i];r.reset(s)})}resetToInitial(){this._formErrors.value=[],this._fields.forEach(t=>{"resetToInitial"in t&&typeof t.resetToInitial=="function"?t.resetToInitial():t.reset()})}async validate(){return this.clearErrors(),await Promise.all(Array.from(this._fields.values()).map(t=>t.validate())),Array.from(this._fields.values()).every(t=>t.valid.value||t.disabled.value)}setErrors(t){this._formErrors.value=t}clearErrors(){this._formErrors.value=[],this._fields.forEach(t=>t.clearErrors())}getField(t){return this._fields.get(t)}get fields(){return this._fields}getProxy(){return this._proxyInstance||(this._proxyInstance=this.buildProxy()),this._proxyInstance}getAllFields(){return this._fields.values()}onMarkAsTouched(){this._fields.forEach(t=>t.markAsTouched())}onMarkAsUntouched(){this._fields.forEach(t=>t.markAsUntouched())}onMarkAsDirty(){this._fields.forEach(t=>t.markAsDirty())}onMarkAsPristine(){this._fields.forEach(t=>t.markAsPristine())}async submit(t,r){return this.formSubmitter.submit(t,r)}async submitWithResult(t,r){return this.formSubmitter.submitWithResult(t,r)}getFieldByPath(t){if(t.startsWith(".")||t.endsWith("."))return;const r=nr(t);if(r.length===0)return;let i=this;for(const s of r){if(!(i instanceof Ht)||(i=i.getField(s.key),!i))return;if(s.index!==void 0)if("at"in i&&"length"in i&&typeof i.at=="function"){const n=i.at(s.index);if(!n)return;i=n}else return}return i}createNode(t){return this.nodeFactory.createNode(t)}linkFields(t,r,i){const s=this._fields.get(t),n=this._fields.get(r);if(!s||!n){const l=s?r:t;throw new Error(`GroupNode.linkFields: field "${String(l)}" not found`)}const o=b(()=>{const l=s.value.value,h=i?i(l):l;n.setValue(h,{emitEvent:!1})}),a=L(G.LinkFields);return this.disposers.add(a,o)}watchField(t,r){const i=this.getFieldByPath(t);if(!i)throw new Error(`GroupNode.watchField: field "${t}" not found`);const s=b(()=>{r(i.value.value)}),n=L(G.WatchField);return this.disposers.add(n,s)}watchFieldByPath(t,r){const i=this.getFieldByPath(t);if(!i)throw new Error(`GroupNode.watchFieldByPath: field "${t}" not found`);const s=b(()=>{r(i.value.value)}),n=L(G.WatchField);return this.disposers.add(n,s)}onDisable(){this._disabled.value=!0,this._fields.forEach(t=>t.disable())}onEnable(){this._disabled.value=!1,this._fields.forEach(t=>t.enable())}attachBehaviorCleanup(t){this._behaviorCleanup=t}registerFieldSignal(t,r){this._fieldSignals.set(t,r)}dispose(){this._behaviorCleanup?.(),this._behaviorCleanup=void 0,this.disposers.dispose(),this._fields.forEach(t=>{"dispose"in t&&typeof t.dispose=="function"&&t.dispose()})}};class ht extends K{items;itemSchema;initialItems;disposers=new nt;_arrayErrors=w([]);value;valid;invalid;touched;dirty;pending;errors;status;length;constructor(t,r=[]){super(),this.itemSchema=t,this.initialItems=r,this.items=w([]);for(const s of r)this.push(s);this.length=v(()=>this.items.value.length),this.value=v(()=>this.items.value.map(s=>s.value.value));const i=bt({getChildren:()=>this.items.value,ownErrors:this._arrayErrors});this.valid=i.valid,this.invalid=i.invalid,this.pending=i.pending,this.touched=i.touched,this.dirty=i.dirty,this.errors=i.errors,this.status=i.status}push(t){const r=this.createItem(t);this.items.value=[...this.items.value,r]}removeAt(t){if(t<0||t>=this.items.value.length){P.handle(new Error(`ArrayNode.removeAt: index ${t} out of bounds (length: ${this.items.value.length})`),"ArrayNode.removeAt",C.LOG);return}const r=this.items.value[t];this.items.value=this.items.value.filter((i,s)=>s!==t),r&&"dispose"in r&&typeof r.dispose=="function"&&r.dispose()}insert(t,r){if(t<0||t>this.items.value.length){P.handle(new Error(`ArrayNode.insert: index ${t} out of bounds (length: ${this.items.value.length})`),"ArrayNode.insert",C.LOG);return}const i=this.createItem(r),s=[...this.items.value];s.splice(t,0,i),this.items.value=s}move(t,r){const i=this.items.value.length;if(t<0||t>=i||r<0||r>=i){P.handle(new Error(`ArrayNode.move: index out of bounds (from=${t}, to=${r}, length=${i})`),"ArrayNode.move",C.LOG);return}if(t===r)return;const s=[...this.items.value],[n]=s.splice(t,1);s.splice(r,0,n),this.items.value=s}swap(t,r){const i=this.items.value.length;if(t<0||t>=i||r<0||r>=i){P.handle(new Error(`ArrayNode.swap: index out of bounds (a=${t}, b=${r}, length=${i})`),"ArrayNode.swap",C.LOG);return}if(t===r)return;const s=[...this.items.value];[s[t],s[r]]=[s[r],s[t]],this.items.value=s}clear(){const t=[...this.items.value];this.items.value=[],t.forEach(r=>{"dispose"in r&&typeof r.dispose=="function"&&r.dispose()})}at(t){const r=this.items.value[t];if(r)return r.getProxy()}getValue(){return this.items.value.map(t=>t.getValue())}setValue(t,r){this.clear(),t.forEach(i=>this.push(i)),r?.emitEvent!==!1&&this.validate().catch(i=>{P.handle(i,"ArrayNode.setValue",C.LOG)})}patchValue(t){t.forEach((r,i)=>{this.items.value[i]&&r!==void 0&&this.items.value[i].patchValue(r)})}reset(t){this._arrayErrors.value=[],this.clear(),t&&t.forEach(r=>this.push(r))}resetToInitial(){this._arrayErrors.value=[],this.clear(),this.initialItems.forEach(t=>this.push(t))}async validate(){return(await Promise.all(this.items.value.map(t=>t.validate()))).every(Boolean)&&this._arrayErrors.value.length===0}setErrors(t){this._arrayErrors.value=t}clearErrors(){this._arrayErrors.value=[],this.items.value.forEach(t=>t.clearErrors())}onMarkAsTouched(){this.items.value.forEach(t=>t.markAsTouched())}onMarkAsUntouched(){this.items.value.forEach(t=>t.markAsUntouched())}onMarkAsDirty(){this.items.value.forEach(t=>t.markAsDirty())}onMarkAsPristine(){this.items.value.forEach(t=>t.markAsPristine())}forEach(t){this.items.value.forEach((r,i)=>{const s=r.getProxy();t(s,i)})}map(t){return this.items.value.map((r,i)=>{const s=r.getProxy();return t(s,i)})}createItem(t){if(this.isGroupSchema(this.itemSchema)){const r=new T(this.itemSchema);return t&&r.patchValue(t),r}throw new Error("ArrayNode поддерживает только GroupNode элементы. Для массива примитивов используйте обычное поле с типом массива.")}isGroupSchema(t){return typeof t=="object"&&t!==null&&!("component"in t)&&!Array.isArray(t)}dispose(){this.disposers.dispose(),this.items.value.forEach(t=>{"dispose"in t&&typeof t.dispose=="function"&&t.dispose()})}onDisable(){this.items.value.forEach(t=>{t.disable()})}onEnable(){this.items.value.forEach(t=>{t.enable()})}}class Qt{createNode(t){if(Array.isArray(t)&&t.length>=1)return this.createArrayNodeFromArray(t);if(this.isFieldConfig(t))return new Jt(t);if(this.isArrayConfig(t))return new ht(t.schema,t.initialItems);if(this.isGroupConfig(t))return new T(t);throw new Error(`NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(t)}`)}createArrayNodeFromArray(t){const[r,...i]=t,s=[];this.isGroupConfig(r)&&s.push(this.extractValues(r));for(const n of i)this.isGroupConfig(n)?s.push(this.extractValues(n)):s.push(n);return new ht(r,s)}extractValues(t){if(this.isFieldConfig(t))return t.value;if(Array.isArray(t))return t.map(r=>this.extractValues(r));if(this.isGroupConfig(t)){const r={};for(const[i,s]of Object.entries(t))r[i]=this.extractValues(s);return r}return t}isFieldConfig(t){return t==null||typeof t!="object"?!1:"valueSignal"in t?!0:"value"in t?"component"in t||"componentProps"in t||"validators"in t||"asyncValidators"in t||"updateOn"in t||"debounce"in t:!1}isArrayConfig(t){return t!=null&&typeof t=="object"&&"schema"in t&&!("value"in t)}isGroupConfig(t){return t!=null&&typeof t=="object"&&!this.isFieldConfig(t)&&!this.isArrayConfig(t)}}class Xt extends K{constructor(t,r){super(),this.control=t,this.buildItem=r,this.initial=t.toArray(),this.disposeSync=b(()=>{const s=t.length,n=[],o=[];for(let h=0;h<s;h++){const c=t.at(h);if(!c)continue;let u=this.cache.get(c);u||(u=r(c),this.cache.set(c,u)),n.push(c),o.push(u)}const a=new Set(n),l=[];for(const h of this.mountedModels){if(a.has(h))continue;const c=this.cache.get(h);this.cache.delete(h),c&&l.push(c)}this.mountedModels=n,this.itemNodes.value=o,l.forEach(h=>this.disposeItemNode(h))}),this.length=v(()=>this.itemNodes.value.length),this.value=v(()=>this.itemNodes.value.map(s=>s.value.value));const i=bt({getChildren:()=>this.itemNodes.value,ownErrors:this._arrayErrors});this.valid=i.valid,this.invalid=i.invalid,this.pending=i.pending,this.touched=i.touched,this.dirty=i.dirty,this.errors=i.errors,this.status=i.status}itemNodes=w([]);cache=new WeakMap;mountedModels=[];initial;_arrayErrors=w([]);disposeSync;get items(){return this.itemNodes}value;valid;invalid;pending;touched;dirty;errors;status;length;at(t){return this.itemNodes.value[t]}map(t){return this.itemNodes.value.map((r,i)=>t(r,i))}forEach(t){this.itemNodes.value.forEach((r,i)=>t(r,i))}push(t){this.control.push(t??{})}insert(t,r){this.control.insertAt(t,r??{})}removeAt(t){this.control.removeAt(t)}move(t,r){this.control.move(t,r)}swap(t,r){this.control.swap(t,r)}clear(){this.control.clear()}getValue(){return this.control.toArray()}setValue(t){this.control.clear(),(t??[]).forEach(r=>this.control.push(r))}patchValue(t){this.setValue(t)}reset(t){this._arrayErrors.value=[],this.setValue(t??this.initial)}resetToInitial(){this.reset(this.initial)}async validate(){return(await Promise.all(this.itemNodes.value.map(t=>t.validate()))).every(Boolean)&&this._arrayErrors.value.length===0}setErrors(t){this._arrayErrors.value=t}clearErrors(){this._arrayErrors.value=[],this.itemNodes.value.forEach(t=>t.clearErrors?.())}onMarkAsTouched(){this.itemNodes.value.forEach(t=>t.markAsTouched?.())}onMarkAsUntouched(){this.itemNodes.value.forEach(t=>t.markAsUntouched?.())}onMarkAsDirty(){this.itemNodes.value.forEach(t=>t.markAsDirty?.())}onMarkAsPristine(){this.itemNodes.value.forEach(t=>t.markAsPristine?.())}onDisable(){this.itemNodes.value.forEach(t=>t.disable?.())}onEnable(){this.itemNodes.value.forEach(t=>t.enable?.())}disposeItemNode(t){t.dispose?.()}dispose(){this.disposeSync(),this.itemNodes.value.forEach(t=>this.disposeItemNode(t)),this.mountedModels=[]}}const Yt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)&&!(typeof Blob<"u"&&e instanceof Blob)&&!(typeof File<"u"&&e instanceof File);function ft(e,t,r){if(e==null||typeof e!="object"||e instanceof E||typeof e.getProxy=="function")return;if(Array.isArray(e)){for(const n of e)ft(n,t,r);return}const i=e,s=i.array;if(s&&typeof s.__path=="string"&&typeof i.item=="function"){r.set(s.__path,i.item);return}i.value instanceof E&&t.set(i.value,{component:i.component,componentProps:i.componentProps,updateOn:i.updateOn,disabled:i.disabled,debounce:i.debounce});for(const[n,o]of Object.entries(i))n!=="value"&&ft(o,t,r)}function te(e,t,r,i){const s={};for(const[n,o]of Object.entries(t)){const a=r===""?n:`${r}.${n}`;if(Array.isArray(o))continue;if(Yt(o)){s[n]=te(e,o,a,i);continue}const l=e.signalAt(a);if(!l)throw new Error(`createForm({ model }): не найден сигнал для пути "${a}"`);const h=i.get(l)??{};s[n]={...h,valueSignal:l}}return s}function ee(e,t,r){for(const[i,s]of Object.entries(e)){const n=t===""?i:`${t}.${i}`;Array.isArray(s)||(Yt(s)?ee(s,n,r):r.push(n))}}function wt(e){const{model:t,schema:r,behavior:i}=e,s=new Map,n=new Map;r!==void 0&&ft(r,s,n);const o=te(t,t.get(),"",s),a=new T(o),l=t.get();for(const[u,d]of Object.entries(l)){if(!Array.isArray(d))continue;const m=n.get(u);if(!m)continue;const g=t[u],y=_=>wt({model:_,schema:m(_)}),k=new Xt(g,y);a.fields.set(u,k)}const h=a.getProxy(),c=[];ee(t.get(),"",c);for(const u of c){const d=t.signalAt(u),m=a.getFieldByPath(u);if(d&&m){qt(d,m);const g=u.lastIndexOf("."),y=g===-1?a:a.getFieldByPath(u.slice(0,g));y instanceof T&&y.registerFieldSignal(m,d)}}return i&&a.attachBehaviorCleanup(i.__run(t,h)),h}const or=e=>e!=null&&typeof e=="object"&&"model"in e&&typeof e.model?.signalAt=="function";function re(e){return or(e)?wt(e):new T(e).getProxy()}const ar=()=>{};function ie(e,t){if(!t)return;const r=typeof t=="function"?{schema:t}:t,i=Object.keys(r.steps??{}),s=i.map(u=>r.steps?.[u]).filter(u=>u!=null),n=r.schema??(()=>zt(...s,...r.extras?[r.extras]:[])),o=u=>{const d=typeof u=="number"?i[u-1]:u;return(d!=null?r.steps?.[d]:null)??null},{strategy:a,debounce:l,liveAfterSubmit:h}=r,c=rt(e,n,{strategy:a,debounce:l,liveAfterSubmit:h});return{schema:n,stepSelectors:i,validate:()=>c.validate(),validateAll:()=>c.validate(),validateStep:u=>gt(e,o(u)??ar,{touch:!0}),createStepController:u=>{if(!a||a==="submit")return null;const d=o(u);return d?rt(e,d,{strategy:a,debounce:l,liveAfterSubmit:h}):null},controller:c,validating:c.validating}}function lr(e){if(!e.model&&e.initial===void 0)throw new Error("createCoreForm: provide either `initial` (to create a model) or `model`.");const t=e.model??Ut(e.initial);e.seed?.(t);const r=re({model:t,...e.schema?{schema:e.schema(t)}:{},...e.behavior?{behavior:e.behavior}:{}}),i=ie(t,e.validation),s={model:t,form:r,...i?{validation:i}:{}};return e.setup?.(s),s}function ur(e){const[t]=f.useState(e),r=t.validation?.controller;return f.useEffect(()=>r?.start(),[r]),t}function J(e){return e==null?!1:typeof e=="object"&&"value"in e&&"setValue"in e&&"getValue"in e&&"validate"in e}function se(e){return J(e)&&"validators"in e&&"asyncValidators"in e&&typeof e.markAsTouched=="function"&&!("fields"in e)&&!("items"in e)}function ne(e){return J(e)&&"getFieldByPath"in e&&"fields"in e&&!("items"in e)&&!("push"in e)&&!("removeAt"in e)}function oe(e){return J(e)&&"items"in e&&"length"in e&&"push"in e&&"removeAt"in e&&"at"in e&&typeof e.push=="function"&&typeof e.removeAt=="function"}function cr(e){return se(e)?"FieldNode":ne(e)?"GroupNode":oe(e)?"ArrayNode":J(e)?"FormNode":"Unknown"}var Ct={exports:{}},lt={},Nt;function dr(){if(Nt)return lt;Nt=1;var e=me;function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,n=e.useLayoutEffect,o=e.useDebugValue;function a(u,d){var m=d(),g=i({inst:{value:m,getSnapshot:d}}),y=g[0].inst,k=g[1];return n(function(){y.value=m,y.getSnapshot=d,l(y)&&k({inst:y})},[u,m,d]),s(function(){return l(y)&&k({inst:y}),u(function(){l(y)&&k({inst:y})})},[u]),o(m),m}function l(u){var d=u.getSnapshot;u=u.value;try{var m=d();return!r(u,m)}catch{return!0}}function h(u,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:a;return lt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,lt}var Vt;function hr(){return Vt||(Vt=1,Ct.exports=dr()),Ct.exports}var ot=hr();function fr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Et(e,t,r,i){const s=f.useRef(null),n=f.useRef(e);n.current=e;const o=f.useRef(t);o.current=t;const a=f.useRef(r);if(a.current=r,s.current===null){const c={};for(const u in e)c[u]=e[u].value;s.current={...c,__snapshot:null}}const l=f.useCallback(c=>{let u=!0;return b(()=>{const d=n.current;for(const m in d)d[m].value;if(u){u=!1;return}c()})},[i]),h=f.useCallback(()=>{const c=s.current,u=n.current,d={};for(const g in u)d[g]=u[g].value;let m=!1;for(const g of o.current){const{key:y,useShallowArrayEqual:k}=g,_=d[y],S=c[y];if(k){if(!fr(S,_)){m=!0;break}}else if(S!==_){m=!0;break}}if(!m&&c.__snapshot)return c.__snapshot;for(const g in u)c[g]=d[g];return c.__snapshot=a.current(d),c.__snapshot},[i]);return ot.useSyncExternalStore(l,h,h)}function vr(e){const t={value:e.value,disabled:e.disabled,errors:e.errors,pending:e.pending,valid:e.valid,invalid:e.invalid,touched:e.touched,dirty:e.dirty,shouldShowError:e.shouldShowError,componentProps:e.componentProps},r=[{key:"value"},{key:"disabled"},{key:"errors",useShallowArrayEqual:!0},{key:"pending"},{key:"valid"},{key:"invalid"},{key:"touched"},{key:"dirty"},{key:"shouldShowError"},{key:"componentProps"}],i=f.useCallback(s=>({value:s.value,pending:s.pending,disabled:s.disabled,errors:s.errors,valid:s.valid,invalid:s.invalid,touched:s.touched,dirty:s.dirty,shouldShowError:s.shouldShowError,componentProps:s.componentProps}),[]);return Et(t,r,i,e)}function pr(e){const t={value:e.value,length:e.length,errors:e.errors,pending:e.pending,valid:e.valid,invalid:e.invalid,touched:e.touched,dirty:e.dirty,disabled:e.disabled},r=[{key:"value"},{key:"length"},{key:"errors",useShallowArrayEqual:!0},{key:"pending"},{key:"valid"},{key:"invalid"},{key:"touched"},{key:"dirty"},{key:"disabled"}],i=f.useCallback(s=>({value:s.value,length:s.length,pending:s.pending,errors:s.errors,valid:s.valid,invalid:s.invalid,touched:s.touched,dirty:s.dirty,disabled:s.disabled}),[]);return Et(t,r,i,e)}function mr(){const e=f.useCallback(()=>({value:[],length:0,pending:!1,errors:[],valid:!0,invalid:!1,touched:!1,dirty:!1,disabled:!1}),[]);return Et({},[],e)}function ae(e){const t=e&&"length"in e&&"map"in e;return e?t?pr(e):vr(e):mr()}function yr(e){const t=f.useRef({value:e.value.value}),r=f.useCallback(s=>{let n=!0;return b(()=>{if(e.value.value,n){n=!1;return}s()})},[e]),i=f.useCallback(()=>{const s=e.value.value;return t.current.value===s?t.current.value:(t.current.value=s,s)},[e]);return ot.useSyncExternalStore(r,i,i)}function gr(e){const t=f.useRef({length:e.length.value}),r=f.useCallback(s=>{let n=!0;return b(()=>{if(e.length.value,n){n=!1;return}s()})},[e]),i=f.useCallback(()=>{const s=e.length.value;return t.current.length===s?t.current.length:(t.current.length=s,s)},[e]);return ot.useSyncExternalStore(r,i,i)}function br(e){const{model:t,schema:r,strategy:i,debounce:s,liveAfterSubmit:n}=e,o=f.useMemo(()=>rt(t,r,{strategy:i,debounce:s,liveAfterSubmit:n}),[t,r,i,s,n]);f.useEffect(()=>o.start(),[o]);const a=ot.useSyncExternalStore(f.useCallback(h=>o.validating.subscribe(h),[o]),()=>o.validating.peek(),()=>!1),l=f.useCallback(()=>o.validate(),[o]);return{submit:l,validate:l,isValidating:a}}const wr=Object.freeze({runtime:"reformer-core",v:1}),Mr=Object.freeze(Object.defineProperty({__proto__:null,ArrayNode:ht,CORE_RUNTIME_TOKEN:wr,ErrorStrategy:C,FieldNode:Jt,FormErrorHandler:P,FormNode:K,FormSubmitter:Zt,GroupNode:T,ModelArrayNode:Xt,NodeFactory:Qt,SubscriptionManager:nt,buildValidation:ie,computeFrom:Re,copyFrom:We,createCoreForm:lr,createForm:re,createFormFromModel:wt,createModel:Ut,disableWhen:er,enableWhen:Kt,getNodeForSignal:D,getNodeType:cr,isArrayNode:oe,isDerived:Y,isFieldNode:se,isFormNode:J,isGroupNode:ne,isModelContainerSignal:Me,markDerived:$e,registerSignalNode:qt,resetWhen:Ge,revalidateWhen:qe,runOutsideEffect:V,safeCallback:De,safeDebouncedCallback:Te,syncFields:Le,transformValue:Ue,unmarkDerived:xe,useArrayLength:gr,useFormBundle:ur,useFormControl:ae,useFormControlValue:yr,useFormValidation:br,watchField:Be},Symbol.toStringTag,{value:"Module"})),Er=e=>e.message||e.code,kr=f.createContext(Er);function le(){return f.useContext(kr)}const ue=f.createContext(null);function at(){const e=f.useContext(ue);if(!e)throw new Error("FormField.* components must be used within <FormField.Root>. Wrap your field with <FormField.Root control={control}>.");return e}function kt({control:e,children:t,id:r,hasDescription:i=!1}){const s=f.useId(),n=r??s,o=f.useMemo(()=>({controlId:`control-${n}`,labelId:`label-${n}`,descriptionId:`desc-${n}`,errorId:`error-${n}`}),[n]),a=ae(e),l=le(),h=f.useMemo(()=>{const{value:c,errors:u,pending:d,disabled:m,valid:g,invalid:y,touched:k,shouldShowError:_,componentProps:S}=a;return{value:c,errors:u,pending:d,disabled:m,valid:g,invalid:y,touched:k,shouldShowError:_,error:_&&u[0]?l(u[0]):void 0,label:S.label,required:!!S.required,componentProps:S,control:e,ids:o,hasDescription:i}},[a,e,o,i,l]);return A.jsx(ue.Provider,{value:h,children:t})}kt.displayName="FormField.Root";const ce=f.forwardRef(({asChild:e=!1,children:t,forceRender:r=!1,...i},s)=>{const{label:n,required:o,ids:a}=at(),l=t??n;return!l&&!r?null:A.jsxs(e?z:"label",{ref:s,id:a.labelId,htmlFor:e?void 0:a.controlId,...i,children:[l,o&&A.jsx("span",{"aria-hidden":"true",children:" *"})]})});ce.displayName="FormField.Label";const de=f.forwardRef(({asChild:e=!1,children:t,...r},i)=>{const{control:s,value:n,disabled:o,shouldShowError:a,errors:l,required:h,ids:c,hasDescription:u,componentProps:d}=at(),m=[u?c.descriptionId:null,a&&l.length>0?c.errorId:null].filter(Boolean).join(" ")||void 0,g={id:c.controlId,"aria-labelledby":c.labelId,"aria-invalid":a?!0:void 0,"aria-describedby":m,"aria-errormessage":a&&l.length>0?c.errorId:void 0,"aria-required":h?!0:void 0};if(t||e)return A.jsx(z,{ref:i,...g,...r,value:n,disabled:o,onChange:S=>s.setValue(S),onBlur:()=>s.markAsTouched(),children:t});const y=s.component,{testId:k,..._}=d??{};return A.jsx(y,{ref:i,..._,...g,...r,value:n,disabled:o,onChange:S=>s.setValue(S),onBlur:()=>s.markAsTouched()})});de.displayName="FormField.Control";const he=f.forwardRef(({asChild:e=!1,multi:t=!1,render:r,children:i,...s},n)=>{const{shouldShowError:o,errors:a,ids:l}=at(),h=le();if(!o||a.length===0)return null;const c=e?z:"p";return r?A.jsx(A.Fragment,{children:a.map((u,d)=>A.jsx(c,{ref:d===0?n:void 0,id:d===0?l.errorId:void 0,role:"alert",...s,children:r(u,d)},u.code??d))}):t?A.jsx(A.Fragment,{children:a.map((u,d)=>{const m=h(u);return A.jsx(c,{ref:d===0?n:void 0,id:d===0?l.errorId:void 0,role:"alert",...s,children:e?A.jsx("span",{children:m}):m},u.code??d)})}):A.jsx(c,{ref:n,id:l.errorId,role:"alert",...s,children:i??h(a[0])})});he.displayName="FormField.Error";const fe=f.forwardRef(({asChild:e=!1,children:t,...r},i)=>{const{ids:s}=at();return A.jsx(e?z:"p",{ref:i,id:s.descriptionId,...r,children:t})});fe.displayName="FormField.Description";const Z=kt;Z.Root=kt;Z.Label=ce;Z.Control=de;Z.Error=he;Z.Description=fe;export{ae as $,le as A,rt as B,Ut as C,Ge as D,We as E,$e as F,xe as K,ur as L,Y as P,Ar as R,Me as W,w as a,ie as b,v as c,V as d,Kt as e,Le as f,D as g,Ue as h,De as i,b as j,Re as k,E as l,Te as m,q as n,st as o,Nr as p,Mr as q,Z as r,Sr as s,nt as t,at as u,ye as v,Be as w,qe as x,re as y,z};
@@ -0,0 +1 @@
1
+ import{l as e}from"./editor.api-D0kmPZPG.js";import"./index-7XdLAZ8M.js";const o={comments:{blockComment:["<!--","-->"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:e.IndentAction.Indent}}]},i={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]]}};export{o as conf,i as language};
@@ -0,0 +1 @@
1
+ import{l as e}from"./editor.api-D0kmPZPG.js";import"./index-7XdLAZ8M.js";const o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},r={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{o as conf,r as language};
package/dist/index.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>reformer-builder</title>
8
- <script type="module" crossorigin src="/assets/index-CSZOipZ8.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-DIgOR-JL.css">
8
+ <script type="module" crossorigin src="/assets/index-7XdLAZ8M.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-TeGkT1-d.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reformer/builder",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "Visual form-schema builder for the @reformer ecosystem — a bundled offline SPA you run via npx to build ReFormer JSON form schemas in the browser",
5
5
  "type": "module",
6
6
  "bin": {
@@ -53,6 +53,9 @@
53
53
  "access": "public"
54
54
  },
55
55
  "devDependencies": {
56
+ "@ai-sdk/anthropic": "^4.0.38",
57
+ "@ai-sdk/openai": "^4.0.41",
58
+ "@ai-sdk/openai-compatible": "^3.0.30",
56
59
  "@eslint/js": "^9.39.1",
57
60
  "@monaco-editor/react": "^4.7.0",
58
61
  "@preact/signals-core": "^1.8.0",
@@ -66,11 +69,13 @@
66
69
  "@reformer/ui-kit": "*",
67
70
  "@reformer/ui-kit-v11": "npm:@reformer/ui-kit@^11.0.0",
68
71
  "@reformer/ui-kit-v12": "npm:@reformer/ui-kit@^12.2.0",
72
+ "@tailwindcss/typography": "^0.5.20",
69
73
  "@tailwindcss/vite": "^4.1.17",
70
74
  "@types/node": "^24.10.1",
71
75
  "@types/react": "^19.2.7",
72
76
  "@types/react-dom": "^19.2.3",
73
77
  "@vitejs/plugin-react": "^5.1.0",
78
+ "ai": "^7.0.63",
74
79
  "ajv": "^8.17.1",
75
80
  "class-variance-authority": "^0.7.1",
76
81
  "clsx": "^2.1.1",
@@ -82,8 +87,13 @@
82
87
  "monaco-editor": "^0.56.0",
83
88
  "react": "^19.2.1",
84
89
  "react-dom": "^19.2.1",
90
+ "react-markdown": "^10.1.0",
85
91
  "react-resizable-panels": "^4.12.2",
86
92
  "react-router-dom": "^6.30.2",
93
+ "rehype-raw": "^7.0.0",
94
+ "rehype-sanitize": "^6.0.0",
95
+ "rehype-slug": "^6.0.0",
96
+ "remark-gfm": "^4.0.1",
87
97
  "tailwind-merge": "^3.4.0",
88
98
  "tailwindcss": "^4.1.17",
89
99
  "tw-animate-css": "^1.4.0",
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-BQAfMb99.js","assets/monaco-setup-BytXwQeQ.js","assets/index-CSZOipZ8.js","assets/index-DIgOR-JL.css","assets/App-EWxVyd71.js","assets/reformer-ui-kit-1LAJcT8b.js","assets/index-BLqONGUt.js","assets/useFormField-BLbvmpme-4e6SCAMU.js","assets/index-CFDCSwb2.js","assets/load-DQmdgTkV.js","assets/boot-CGsYMAQp.js","assets/monaco-setup-BzOv8av-.css","assets/handlebars-Brdeuzw5.js","assets/html-BjYaOi8p.js","assets/javascript-CTKhG5-q.js","assets/typescript-0wJoIq5V.js","assets/liquid-CSjp0MaB.js","assets/mdx-Bc5quPBk.js","assets/python-DuAl67Eo.js","assets/razor-BbXkrvwj.js","assets/xml-bMgZPd2t.js","assets/yaml-yApvoFdI.js"])))=>i.map(i=>d[i]);
2
- import{_ as e,j as p}from"./index-CSZOipZ8.js";import{l as o,F as m}from"./monaco-setup-BytXwQeQ.js";import"./App-EWxVyd71.js";import"./reformer-ui-kit-1LAJcT8b.js";import"./index-BLqONGUt.js";import"./useFormField-BLbvmpme-4e6SCAMU.js";import"./index-CFDCSwb2.js";import"./load-DQmdgTkV.js";import"./boot-CGsYMAQp.js";const d={},l={};class _{static getOrCreate(s){return l[s]||(l[s]=new _(s)),l[s]}constructor(s){this._languageId=s,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((a,r)=>{this._lazyLoadPromiseResolve=a,this._lazyLoadPromiseReject=r})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,d[this._languageId].loader().then(s=>this._lazyLoadPromiseResolve(s),s=>this._lazyLoadPromiseReject(s))),this._lazyLoadPromise}}function i(t){const s=t.id;d[s]=t,o.register(t);const a=_.getOrCreate(s);o.registerTokensProviderFactory(s,{create:async()=>(await a.load()).language}),o.onLanguageEncountered(s,async()=>{const r=await a.load();o.setLanguageConfiguration(s,r.conf)})}i({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>e(()=>import("./abap-DLDM7-KI.js"),[])});i({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>e(()=>import("./apex-DNDY2TF8.js"),[])});i({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>e(()=>import("./azcli-Y6nb8tq_.js"),[])});i({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>e(()=>import("./bat-BwHxbl9M.js"),[])});i({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>e(()=>import("./bicep-CFznDFnq.js"),[])});i({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>e(()=>import("./cameligo-Bf6VGUru.js"),[])});i({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>e(()=>import("./clojure-Dnu-v4kV.js"),[])});i({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>e(()=>import("./coffee-Bd8akH9Z.js"),[])});i({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>e(()=>import("./cpp-BbWJElDN.js"),[])});i({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>e(()=>import("./cpp-BbWJElDN.js"),[])});i({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>e(()=>import("./csharp-Co3qMtFm.js"),[])});i({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>e(()=>import("./csp-D-4FJmMZ.js"),[])});i({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>e(()=>import("./css-DdJfP1eB.js"),[])});i({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>e(()=>import("./cypher-cTPe9QuQ.js"),[])});i({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>e(()=>import("./dart-BOtBlQCF.js"),[])});i({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>e(()=>import("./dockerfile-BG73LgW2.js"),[])});i({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>e(()=>import("./ecl-BEgZUVRK.js"),[])});i({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>e(()=>import("./elixir-BkW5O-1t.js"),[])});i({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>e(()=>import("./flow9-BeJ5waoc.js"),[])});i({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>e(()=>import("./fsharp-PahG7c26.js"),[])});i({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagAutoInterpolationDollar)});i({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagAngleInterpolationDollar)});i({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagBracketInterpolationDollar)});i({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagAngleInterpolationBracket)});i({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagBracketInterpolationBracket)});i({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagAutoInterpolationDollar)});i({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>e(()=>import("./freemarker2-BQAfMb99.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(t=>t.TagAutoInterpolationBracket)});i({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>e(()=>import("./go-acbASCJo.js"),[])});i({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>e(()=>import("./graphql-BxJiqAUM.js"),[])});i({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>e(()=>import("./handlebars-Brdeuzw5.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>e(()=>import("./hcl-DtV1sZF8.js"),[])});i({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>e(()=>import("./html-BjYaOi8p.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>e(()=>import("./ini-Kd9XrMLS.js"),[])});i({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>e(()=>import("./java-CXBNlu9o.js"),[])});i({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>e(()=>import("./javascript-CTKhG5-q.js"),__vite__mapDeps([14,15,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>e(()=>import("./julia-cl7-CwDS.js"),[])});i({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>e(()=>import("./kotlin-s7OhZKlX.js"),[])});i({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>e(()=>import("./less-9HpZscsL.js"),[])});i({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>e(()=>import("./lexon-OrD6JF1K.js"),[])});i({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>e(()=>import("./lua-Cyyb5UIc.js"),[])});i({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>e(()=>import("./liquid-CSjp0MaB.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>e(()=>import("./m3-B8OfTtLu.js"),[])});i({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>e(()=>import("./markdown-BFxVWTOG.js"),[])});i({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>e(()=>import("./mdx-Bc5quPBk.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>e(()=>import("./mips-CiqrrVzr.js"),[])});i({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>e(()=>import("./msdax-DmeGPVcC.js"),[])});i({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>e(()=>import("./mysql-C_tMU-Nz.js"),[])});i({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>e(()=>import("./objective-c-BDtDVThU.js"),[])});i({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>e(()=>import("./pascal-vHIfCaH5.js"),[])});i({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>e(()=>import("./pascaligo-DtZ0uQbO.js"),[])});i({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>e(()=>import("./perl-Ub6l9XKa.js"),[])});i({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>e(()=>import("./pgsql-BlNEE0v7.js"),[])});i({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>e(()=>import("./php-BBUBE1dy.js"),[])});i({id:"pla",extensions:[".pla"],loader:()=>e(()=>import("./pla-DSh2-awV.js"),[])});i({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>e(()=>import("./postiats-CocnycG-.js"),[])});i({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>e(()=>import("./powerquery-tScXyioY.js"),[])});i({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>e(()=>import("./powershell-COWaemsV.js"),[])});i({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>e(()=>import("./protobuf-Brw8urJB.js"),[])});i({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>e(()=>import("./pug-8SOpv6rk.js"),[])});i({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>e(()=>import("./python-DuAl67Eo.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>e(()=>import("./qsharp-Bw9ernYp.js"),[])});i({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>e(()=>import("./r-j7ic8hl3.js"),[])});i({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>e(()=>import("./razor-BbXkrvwj.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>e(()=>import("./redis-Bu5POkcn.js"),[])});i({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>e(()=>import("./redshift-Bs9aos_-.js"),[])});i({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>e(()=>import("./restructuredtext-CqXO7rUv.js"),[])});i({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>e(()=>import("./ruby-zBfavPgS.js"),[])});i({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>e(()=>import("./rust-BzKRNQWT.js"),[])});i({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>e(()=>import("./sb-BBc9UKZt.js"),[])});i({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>e(()=>import("./scala-D9hQfWCl.js"),[])});i({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>e(()=>import("./scheme-BPhDTwHR.js"),[])});i({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>e(()=>import("./scss-CBJaRo0y.js"),[])});i({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>e(()=>import("./shell-DiJ1NA_G.js"),[])});i({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>e(()=>import("./solidity-Db0IVjzk.js"),[])});i({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>e(()=>import("./sophia-CnS9iZB_.js"),[])});i({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>e(()=>import("./sparql-CJmd_6j2.js"),[])});i({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>e(()=>import("./sql-ClhHkBeG.js"),[])});i({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>e(()=>import("./st-CHwy0fLd.js"),[])});i({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>e(()=>import("./swift-CnmFD0ga.js"),[])});i({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>e(()=>import("./systemverilog-Bs9z6M-B.js"),[])});i({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>e(()=>import("./systemverilog-Bs9z6M-B.js"),[])});i({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>e(()=>import("./tcl-Dm6ycUr_.js"),[])});i({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>e(()=>import("./twig-Csy3S7wG.js"),[])});i({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>e(()=>import("./typescript-0wJoIq5V.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>e(()=>import("./typespec-Btyra-wh.js"),[])});i({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>e(()=>import("./vb-Db0cS2oM.js"),[])});i({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>e(()=>import("./wgsl-BTesnYfV.js"),[])});i({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>e(()=>import("./xml-bMgZPd2t.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11]))});i({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>e(()=>import("./yaml-yApvoFdI.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11]))});function g({value:t,language:s,theme:a,onChange:r}){return p.jsx(m,{height:"100%",language:s,theme:a==="dark"?"vs-dark":"light",value:t,onChange:n=>r(n??""),options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",folding:!0,scrollBeyondLastLine:!1,tabSize:2,wordWrap:"off",automaticLayout:!0,renderLineHighlight:"line",scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},padding:{top:8,bottom:8}}})}export{g as default};
@@ -1 +0,0 @@
1
- import{r,j as h}from"./index-CSZOipZ8.js";import{F as x}from"./monaco-setup-BytXwQeQ.js";import"./App-EWxVyd71.js";import"./reformer-ui-kit-1LAJcT8b.js";import"./index-BLqONGUt.js";import"./useFormField-BLbvmpme-4e6SCAMU.js";import"./index-CFDCSwb2.js";import"./load-DQmdgTkV.js";import"./boot-CGsYMAQp.js";function y({value:c,theme:m,onChange:f,onFocusChange:a,revealLine:n,revealNonce:d}){const s=r.useRef(null),l=r.useRef(null),[u,p]=r.useState(!1),g=(t,e)=>{s.current=t,l.current=e,t.onDidFocusEditorText(()=>a(!0)),t.onDidBlurEditorText(()=>a(!1)),p(!0)};return r.useEffect(()=>{const t=s.current,e=l.current;if(!u||!t||!e||!n)return;const i=t.getModel();if(!i)return;const o=Math.min(Math.max(n,1),i.getLineCount());t.revealLineInCenter(o),t.setSelection(new e.Range(o,1,o,i.getLineMaxColumn(o))),t.focus()},[d,u,n]),h.jsx(x,{height:"100%",language:"json",theme:m==="dark"?"vs-dark":"light",value:c,onChange:t=>f(t??""),onMount:g,options:{minimap:{enabled:!1},fontSize:11,lineNumbers:"on",folding:!0,scrollBeyondLastLine:!1,tabSize:2,wordWrap:"off",automaticLayout:!0,renderLineHighlight:"line",overviewRulerLanes:0,scrollbar:{verticalScrollbarSize:9,horizontalScrollbarSize:9},padding:{top:8,bottom:8}}})}export{y as default};
@@ -1 +0,0 @@
1
- import{l as t}from"./monaco-setup-BytXwQeQ.js";import"./index-CSZOipZ8.js";import"./App-EWxVyd71.js";import"./reformer-ui-kit-1LAJcT8b.js";import"./index-BLqONGUt.js";import"./useFormField-BLbvmpme-4e6SCAMU.js";import"./index-CFDCSwb2.js";import"./load-DQmdgTkV.js";import"./boot-CGsYMAQp.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],c={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}]},p={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{c as conf,p as language};
@@ -1 +0,0 @@
1
- import{l as e}from"./monaco-setup-BytXwQeQ.js";import"./index-CSZOipZ8.js";import"./App-EWxVyd71.js";import"./reformer-ui-kit-1LAJcT8b.js";import"./index-BLqONGUt.js";import"./useFormField-BLbvmpme-4e6SCAMU.js";import"./index-CFDCSwb2.js";import"./load-DQmdgTkV.js";import"./boot-CGsYMAQp.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],l={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*<!--\\s*#region\\b.*-->"),end:new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")}}},c={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,"metatag","@doctype"],[/<!--/,"comment","@comment"],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/</,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{l as conf,c as language};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/typescript-Bjd-gS8c.js","assets/index-CSZOipZ8.js","assets/index-DIgOR-JL.css"])))=>i.map(i=>d[i]);
2
- import{l as me,n as pe,c as he,j as z,y as ve,o as ge,O as U,N as ye,G as be,d as P,E as H,e as C,f as _e,w as k,D as X,h as Y,F as G,i as K,k as M,t as xe,m as Ee,p as Se,q as we,s as je,v as Fe,z as Oe,A as $e}from"./useFormField-BLbvmpme-4e6SCAMU.js";import{i as O,Q as Re,p as A,X as ke,d as Ae,b as De,V as Te,R as Pe,r as Ce,s as Q,a as Me,l as Be,c as Ie,e as Ve}from"./App-EWxVyd71.js";import{g as Le,f as We,a as Ne,_ as Je}from"./index-CSZOipZ8.js";import{ak as Z}from"./reformer-ui-kit-1LAJcT8b.js";import{r as qe}from"./index-CFDCSwb2.js";import{g as ze}from"./boot-CGsYMAQp.js";import"./load-DQmdgTkV.js";import"./index-BLqONGUt.js";function Ue(e,t){for(var r=0;r<t.length;r++){const o=t[r];if(typeof o!="string"&&!Array.isArray(o)){for(const n in o)if(n!=="default"&&!(n in e)){const i=Object.getOwnPropertyDescriptor(o,n);i&&Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>o[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const He=Object.freeze(Object.defineProperty({__proto__:null,Signal:me,batch:pe,computed:he,effect:z,signal:ve,untracked:ge},Symbol.toStringTag,{value:"Module"}));function Xe(e){const t=A(e.component)?.arg;if(t==="FileUpload"||t==="FileUploadAvatar"||t==="Attachment")return null;if(t==="Checkbox"||t==="Switch"||t==="Toggle")return!1;if(t==="Slider"){const r=e.componentProps?.min;return typeof r=="number"?r:0}return e.componentProps?.type==="number"?null:""}function Ye(e){const t=[],r=o=>{if(Re(o)){const n=A(o.array);n?.op==="model"&&t.push({path:n.arg,value:[]});return}if(ke(o)){const n=A(o.value);n?.op==="model"&&t.push({path:n.arg,value:Xe(o)});return}if(Ae(o)){const n=o;n.children?.forEach(a=>O(a)&&r(a));const i=n.componentProps?.steps;Array.isArray(i)&&i.forEach(a=>O(a)&&r(a))}};return O(e.root)&&r(e.root),t}function Ge(e){const t={};for(const{path:r,value:o}of e)Ke(t,r.split("."),o);return t}function Ke(e,t,r){let o=e;for(let i=0;i<t.length-1;i++){const a=t[i];(typeof o[a]!="object"||o[a]===null)&&(o[a]={}),o=o[a]}const n=t[t.length-1];n in o||(o[n]=r)}function v(e,t,r){for(const o of t){const n=e[o]?.[r];if(n!==void 0)return n}}const Qe=["model.ts","model.tsx"],$=["validation.ts"],Ze=["form.behavior.ts","form-behavior.ts","behavior.ts"],V=["renderer.behavior.ts","render-behavior.ts","ui.ts"],et=["registry.ts","registry.tsx"],S=e=>typeof e=="function";function tt(e){const t={},r=v(e,Qe,"initialFormModel");r&&typeof r=="object"&&(t.initial=r);const o=v(e,$,"formValidation");o&&(t.validation=o);const n=v(e,$,"validationOptions");n&&typeof n=="object"&&(t.validationOptions=n);const i=v(e,$,"makeValidationConfig");!t.validation&&S(i)&&(t.makeValidationConfig=i);const a=v(e,Ze,"formBehavior");a&&(t.behavior=a);const f=v(e,V,"formRenderBehavior");S(f)&&(t.renderBehavior=f);const s=v(e,V,"createRenderBehavior");S(s)&&(t.renderBehaviorFactory=s);const c=v(e,et,"createRegistry");return S(c)&&(t.createRegistry=c),t}function rt(e){const t=[];return e.initial&&t.push("model"),(e.validation||e.makeValidationConfig)&&t.push("validation"),e.behavior&&t.push("behavior"),(e.renderBehavior||e.renderBehaviorFactory)&&t.push("renderBehavior"),e.createRegistry&&t.push("registry"),t}function L(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function D(e,t){const r={...e};for(const[o,n]of Object.entries(t)){const i=r[o];r[o]=L(i)&&L(n)?D(i,n):n}return r}function Nt(e){const{schema:t,compiled:r,dataSources:o,modelOverride:n}=e,i=tt(r.modules),a=[...r.errors];let f=Ge(Ye(t));i.initial&&(f=D(f,i.initial)),n&&(f=D(f,n));const s=U(f);let c=De(t,o);if(i.createRegistry)try{c=Te(c,i.createRegistry())}catch(d){a.push({file:"registry.ts",phase:"evaluate",message:d instanceof Error?d.message:String(d)})}const l=ye({model:s,schema:Pe(t,c,s),behavior:i.behavior});let u=null,p=null,h=null;if(i.validation)try{u=be(s,i.validation,i.validationOptions),p=i.validationOptions?.strategy??"submit",h=()=>u.validate()}catch(d){a.push({file:"validation.ts",phase:"evaluate",message:d instanceof Error?d.message:String(d)})}else if(i.makeValidationConfig)try{const d=i.makeValidationConfig(s);h=()=>d.validateAll?.()??Promise.resolve(!0),a.push({file:"validation.ts",phase:"evaluate",message:"Экспортирован makeValidationConfig вместо formValidation — реактивная стратегия недоступна, валидацию можно запустить только вручную."})}catch(d){a.push({file:"validation.ts",phase:"evaluate",message:d instanceof Error?d.message:String(d)})}let F=i.renderBehavior;if(!F&&i.renderBehaviorFactory)try{F=i.renderBehaviorFactory(l,s)}catch(d){a.push({file:"renderer.behavior.ts",phase:"evaluate",message:d instanceof Error?d.message:String(d)})}return{registry:c,model:s,form:l,validation:u,strategy:p,validateAll:h,renderBehavior:F,applied:rt(i),errors:a}}function ot(e,t,r){const o={exports:{}},n=`${e}
3
- //# sourceURL=reformer-builder:///${r}`;return new Function("exports","require","module","__filename",n)(o.exports,t,o,r),o.exports}var R={exports:{}},w={};var W;function nt(){if(W)return w;W=1;var e=Symbol.for("react.fragment");return w.Fragment=e,w.jsxDEV=void 0,w}var N;function it(){return N||(N=1,R.exports=nt()),R.exports}var ee=it();const at=Le(ee),st=Ue({__proto__:null,default:at},[ee]);let x=null;function te(e){if(!x)throw new Error(`[@reformer/core/behaviors] "${e}" вызван вне defineFormBehavior(...) — операторы поведения можно вызывать только внутри схемы.`);return x}function m(e){te("onDispose").cleanups.push(e)}function _(){const e=te("getScope");return{model:e.model,form:e.form}}function re(e){return{__run(t,r){const o={cleanups:[],model:t,form:r},n=x;x=o;try{e({model:t,form:r})}finally{x=n}return()=>{for(const i of o.cleanups)i()}}}}function g(e){m(z(e))}function j(e){C(e)}const b=e=>typeof e=="object"&&e!==null&&typeof e.peek=="function",oe=e=>Array.isArray(e)?e:[e];function ne(e){const t={};for(const r of Object.keys(e)){const o=e[r];t[r]=b(o)?o.value:ne(o)}return t}function ie(e,t){for(const r of Object.keys(e)){const o=e[r];b(o)?o.value=t?.[r]:ie(o,t?.[r]??{})}}function ct(e){if(!e)return;const{form:t}=_();return t.getFieldByPath(e)}function ae(e){return new Proxy({},{get:(t,r)=>{if(r==="$")return e;if(typeof r!="string")return;const o=e[r];if(o!=null)return b(o)?o.value:ae(o)}})}function se(e){return t=>{try{t()}catch(r){if(r instanceof Error&&/cycle detected/i.test(r.message)){const o=e.__path??"?";throw new Error(`[@reformer/core/behaviors] compute("${o}"): расходящийся цикл пересчёта — взаимные compute/computeFrom без стабилизации. Проверьте зависимости или добавьте стабилизирующее условие (when) / разорвите цикл через peek.`)}throw r}}}function ft(e,t,r){P(e),m(()=>M(e));const o=se(e);g(()=>{if(r?.when&&!r.when())return;const n=t();e.peek()!==n&&o(()=>{e.value=n})})}function lt(e,t,r,o){P(t),m(()=>M(t));const n=se(t);g(()=>{const i=e.map(f=>f.value);if(o?.when&&!o.when(...i))return;const a=r(...i);t.peek()!==a&&n(()=>{t.value=a})})}function ut(e,t,r){if(b(e)&&b(t)){m(H(e,t,r));return}const o=e,n=t;g(()=>{const i=ne(o);r?.when&&!r.when()||j(()=>ie(n,i))})}function ce(e,t,r){let o;const n=i=>{o?.abort(),o=new AbortController;const{signal:a}=o;C(()=>t(i,{signal:a}))};if(!r?.debounce)m(k(e,n,{immediate:r?.immediate}));else{let i;const a=k(e,f=>{i&&clearTimeout(i),i=setTimeout(()=>n(f),r.debounce)},{immediate:r?.immediate});m(()=>{i&&clearTimeout(i),a()})}m(()=>o?.abort())}function fe(e,t,r){for(const o of oe(e))b(o)?m(_e(o,t,r)):mt(o,t,r)}function dt(e,t,r){fe(e,()=>!t(),r)}function mt(e,t,r){const o=ct(e.__path);o&&g(()=>{const n=t();j(()=>{n?o.enable():(o.disable(),r?.resetOnDisable&&o.reset())})})}function pt(e,t){m(K(e,t))}function ht(e,t,r){m(X(e,t,r))}function vt(e,t,r){m(G(e,t,r))}function gt(e,t){m(Y(e,t))}function B(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function yt(e){return new Proxy({},{get(t,r){if(!(typeof r=="symbol"||r==="then"))throw new Error(`[@reformer/core/behaviors] applyEach: форма строки массива "${e}" недоступна (form.${String(r)}) — массив не материализован в схеме формы. Per-row node-операции (enableWhen/updateComponentProps/reset) требуют узла { array, item } в схеме; value-операции (row.$.*: compute/copyFrom/transformValue) работают и без материализации.`)}})}function le(e,t){const{model:r,form:o}=_(),n=e.__path;if(!n)return;const i=B(r,n);if(!i)return;const a=o.getFieldByPath(n),f=a?.length,s=new Map;g(()=>{const c=f?f.value:i.length,l=new Set;for(let u=0;u<c;u++){const p=i.at(u);if(p!=null&&(l.add(p),!s.has(p))){const h=a?.at?.(u)??yt(n);s.set(p,t.__run(p,h))}}for(const[u,p]of s)l.has(u)||(p(),s.delete(u))}),m(()=>{for(const c of s.values())c();s.clear()})}function T(e){if(e==null||typeof e!="object")return;const t=e;if(typeof t.at=="function"&&typeof t.length=="number"){const r=t.length;for(let o=0;o<r;o++)T(t.at(o));return}for(const r of Object.keys(e))T(e[r])}function bt(e,t){const{model:r}=_(),o=e.__path;if(!o)return;const n=B(r,o);n&&le(e,re(({model:i})=>{ce(t(i),a=>{if(a)for(let f=0;f<n.length;f++){const s=n.at(f);if(s&&s!==i){const c=t(s);c.peek()&&(c.value=!1)}}})}))}function _t(e,t){const{model:r}=_(),o=e.__path;if(!o)return;const n=B(r,o);if(!n)return;let i=!1,a=0;g(()=>{T(n),!i&&(i=!0,j(()=>{i=!1;const f=t(n.toArray());let s=!1;for(const{index:c,patch:l}of f){const u=n.at(c);if(u)for(const[p,h]of Object.entries(l))u[p]!==h&&(u[p]=h,s=!0)}if(a=s?a+1:0,a>50)throw a=0,new Error(`[@reformer/core/behaviors] aggregateInto("${o}"): запись не сходится (>50 проходов) — derive должна быть идемпотентной на фикспоинте.`)}))})}function xt(e,t){const{form:r}=_();for(const o of oe(e)){const n=o,i=n.__path;if(!i)continue;const a=r?r.getFieldByPath(i):void 0,f=a?a.getProxy?.()??a:void 0;m(t.__run(ae(n),f))}}const Et=Object.freeze(Object.defineProperty({__proto__:null,aggregateInto:_t,apply:xt,applyEach:le,compute:ft,computeFrom:lt,copyFrom:ut,defer:j,defineFormBehavior:re,disableWhen:dt,effect:g,enableWhen:fe,exclusiveFlag:bt,getScope:_,onChange:ce,onDispose:m,resetWhen:ht,revalidateWhen:gt,syncFields:vt,transformValue:pt},Symbol.toStringTag,{value:"Module"})),St=Object.freeze(Object.defineProperty({__proto__:null,SubscriptionManager:xe,computeFrom:Ee,copyFrom:H,createModel:U,isDerived:Se,markDerived:P,resetWhen:X,revalidateWhen:Y,runOutsideEffect:C,safeCallback:we,safeDebouncedCallback:je,syncFields:G,transformValue:K,unmarkDerived:M,watchField:k},Symbol.toStringTag,{value:"Module"})),I={react:Ne,"react/jsx-runtime":We,"react/jsx-dev-runtime":st,"@preact/signals-core":$e,"@reformer/core":Oe,"@reformer/core/behaviors":Et,"@reformer/core/signals":He,"@reformer/core/state":St,"@reformer/core/validation":Fe,"@reformer/core/validators":Z,"@reformer/renderer-json":Ce,"@reformer/renderer-react":qe},E="@reformer/ui-kit",ue="@reformer/core/validators/";function wt(e){const t=I[e];if(t)return t;if(e.startsWith(ue))return Z;if(e===E||e.startsWith(`${E}/`))return ze();throw new Error(`Импорт «${e}» недоступен в превью. Разрешены react, @preact/signals-core, @reformer/core (+ /behaviors, /validation, /validators, /signals, /state), @reformer/renderer-json, @reformer/renderer-react, @reformer/ui-kit и файлы каталога формы.`)}function Jt(e){return e in I||e.startsWith(ue)?!0:e===E||e.startsWith(`${E}/`)}function qt(){return[...Object.keys(I),E]}let J=null;async function jt(){return J??=Je(()=>import("./typescript-Bjd-gS8c.js").then(e=>e.t),__vite__mapDeps([0,1,2])).then(e=>e.default??e),J}const y=new Map,Ft=64;function Ot(e,t){return`${e}\0${t}`}function $t(e,t){if(y.size>=Ft){const r=y.keys().next().value;r!==void 0&&y.delete(r)}return y.set(e,t),t}async function Rt(e,t){const r=Ot(t,e),o=y.get(r);if(o!==void 0)return o;const n=await jt(),i=n.transpileModule(e,{fileName:t,reportDiagnostics:!0,compilerOptions:{module:n.ModuleKind.CommonJS,target:n.ScriptTarget.ES2022,jsx:n.JsxEmit.ReactJSX,esModuleInterop:!0,allowJs:!0,isolatedModules:!0,useDefineForClassFields:!0}}),a=i.diagnostics?.[0];if(a){const f=n.flattenDiagnosticMessageText(a.messageText," "),s=a.file&&a.start!==void 0?(()=>{const{line:c,character:l}=a.file.getLineAndCharacterOfPosition(a.start);return`:${c+1}:${l+1}`})():"";throw new Error(`${t}${s} — ${f}`)}return $t(r,i.outputText)}function zt(){y.clear()}const kt=[".ts",".tsx",""],At=["model.ts","validation.ts","form.behavior.ts","renderer.behavior.ts","registry.ts","form-behavior.ts","render-behavior.ts","behavior.ts","ui.ts"],q=e=>e instanceof Error?e.message:String(e);function Dt(e,t){const r=e.replace(/^\.\//,"");if(r.includes("/"))return null;for(const o of kt){const n=`${r}${o}`;if(t.has(n))return n}return null}async function Ut(e){const t=[],r={};for(const[s,c]of Object.entries(e.files))try{r[s]=await Rt(c,s)}catch(l){t.push({file:s,phase:"transpile",message:q(l)})}const o=new Set(Object.keys(r)),n={},i=new Set,a=(s,c)=>{if(!c.startsWith("."))return wt(c);const l=Dt(c,o);if(!l)throw new Error(`${s}: импорт «${c}» не найден среди файлов каталога формы`+(Object.keys(e.files).length?` (есть: ${Object.keys(e.files).join(", ")})`:""));return f(l)},f=s=>{const c=n[s];if(c)return c;if(i.has(s))throw new Error(`Циклический импорт: ${[...i,s].join(" → ")}`);i.add(s);try{const l=ot(r[s],u=>a(s,u),s);return n[s]=l,l}finally{i.delete(s)}};for(const s of At)if(!(!o.has(s)||n[s]))try{f(s)}catch(c){t.push({file:s,phase:"evaluate",message:q(c)})}return{modules:n,errors:t}}function de(e){return!/\.tsx?$/.test(e)||e==="index.ts"||e==="index.tsx"?!1:!/\.(test|spec)\.tsx?$/.test(e)}function Tt(e){const t={};for(const r of Object.values(Ve.getState().tabs)){const o=r.source.path;if(r.kind!=="code"||typeof r.text!="string"||!o)continue;const{dirPath:n,base:i}=Q(o);n!==e||!de(i)||(t[i]=r.text)}return t}async function Ht(e){const t=Q(e).dirPath,r=Me.getState().dirHandle,o={};if(r){const i=(await Be(r,t)).filter(a=>!a.includes("/")&&de(a));for(const a of i)try{o[a]=await Ie(r,t?`${t}/${a}`:a)}catch{}}const n=Tt(t);return Object.assign(o,n),{dir:t,files:o,fromEditor:Object.keys(n)}}export{rt as appliedArtifacts,Nt as buildLivePreview,Jt as canResolveModule,Ut as compileForm,ot as evalCjsModule,tt as extractContract,qt as knownModuleSpecifiers,Ht as readFormSources,zt as resetTranspileCache,wt as resolveModule,Rt as transpileTs};
@@ -1 +0,0 @@
1
- import{j as p,r as o}from"./index-CSZOipZ8.js";import{g as Z,y as W,l as C,j as M,c as ee}from"./useFormField-BLbvmpme-4e6SCAMU.js";function I(e){return e.value instanceof C}function U(e){const n=e;return n.array!=null&&typeof n.array=="object"&&typeof n.item=="function"}function B(e){const n=e.component;return typeof n=="function"?!0:typeof n=="string"?n.length>0:n!==null&&typeof n=="object"&&n.$$typeof!==void 0}function ne(e){return typeof e.component=="string"}const H=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),V=o.createContext(null);function z({value:e,children:n}){return p.jsx(V.Provider,{value:e,children:n})}function G(){const e=o.useContext(V);if(!e)throw new Error("useRenderContext must be used within RenderContextProvider (FormRenderer)");return e}const K=Symbol("RenderSchemaProxy"),w=o.createContext(null);function F(e){return typeof e=="function"&&K in e}function te(e){const n=new Map,t=new Map,r=new Map,u=new Map,c=[],i=new Map,l=new Map,s=W(0),d=new Map,m=a=>{let f=d.get(a);return f||(f=W(0),d.set(a,f)),f},y=a=>{s.value++,m(a).value++},_={hiddenOverrides:n,propsOverrides:t,refRegistry:r,conditionRegistry:u,effectRegistry:c,callbackRegistry:i,lifecycleRegistry:l,version:s,versionFor:m},b=e;return Object.assign(b,{[K]:!0,__overrideMaps:_}),b.node=a=>({setHidden(f){return n.set(a,f),y(a),this},resetHidden(){return n.delete(a),y(a),this},patchProps(f){return t.set(a,{...t.get(a)??{},...f}),y(a),this},resetProps(){return t.delete(a),y(a),this},getRef(){return r.has(a)||r.set(a,o.createRef()),r.get(a)},__selector:a,__overrideMaps:_}),b}function re(e){const n=o.useContext(w);return o.useSyncExternalStore(o.useCallback(t=>n&&e?n.versionFor(e).subscribe(t):()=>{},[n,e]),()=>e&&n?n.hiddenOverrides.get(e)??null:null,()=>e&&n?n.hiddenOverrides.get(e)??null:null)}function oe(e){const n=o.useContext(w);return o.useSyncExternalStore(o.useCallback(t=>n&&e?n.versionFor(e).subscribe(t):()=>{},[n,e]),()=>e&&n?n.propsOverrides.get(e)??null:null,()=>e&&n?n.propsOverrides.get(e)??null:null)}function se(e,n){e.__overrideMaps.conditionRegistry.set(e.__selector,n)}function ue(e,n,t){const{callbackRegistry:r}=e.__overrideMaps;r.has(e.__selector)||r.set(e.__selector,new Map),r.get(e.__selector).set(n,t)}function ce(e,n){e.__overrideMaps.effectRegistry.push(n)}function q(e,n,t){const{lifecycleRegistry:r}=e.__overrideMaps,u=r.get(e.__selector)??{};r.set(e.__selector,{...u,[n]:t})}function ie(e,n){n()}function le(e,n){q(e,"onMount",n)}function ae(e,n){q(e,"onUnmount",n)}function de(e){const n=o.useCallback(()=>e?.()??!1,[e]),t=o.useCallback(r=>e?ee(e).subscribe(r):()=>{},[e]);return o.useSyncExternalStore(t,n,n)}function fe({effectRegistry:e}){return o.useEffect(()=>{const n=e.map(t=>M(()=>{const r=t();return typeof r=="function"?r:void 0}));return()=>n.forEach(t=>t())},[]),null}function pe(e){o.useEffect(()=>{if(!e)return;const n=e.onMount?.();return()=>{typeof n=="function"&&n(),e.onUnmount?.()}},[e])}const A=e=>e;function me(e,n,t,r,u){const c=e.strip?.length?Object.fromEntries(Object.entries(u).filter(([i])=>!e.strip.includes(i))):u;return{...c,[e.valueProp??"value"]:(e.toValue??A)(n),[e.changeProp??"onChange"]:i=>t((e.fromEmit??A)(i,c)),...e.bindBlur?e.bindBlur(r):{onBlur:r}}}function ve(e){const n=o.useRef({value:e.value.value,disabled:e.disabled.value,componentProps:e.componentProps.value}),t=o.useCallback(u=>{let c=!0;return M(()=>{if(e.value.value,e.disabled.value,e.componentProps.value,c){c=!1;return}u()})},[e]),r=o.useCallback(()=>{const u=e.value.value,c=e.disabled.value,i=e.componentProps.value,l=n.current;if(l.value===u&&l.disabled===c&&l.componentProps===i)return l;const s={value:u,disabled:c,componentProps:i};return n.current=s,s},[e]);return o.useSyncExternalStore(t,r,r)}const ye=o.memo(function({node:e,fieldNode:n,fieldWrapper:t,nodeRef:r,resolveFieldAdapter:u}){const{value:c,disabled:i,componentProps:l}=ve(n),s=o.useCallback(v=>n.setValue(v),[n]),d=o.useCallback(()=>n.markAsTouched(),[n]),m=e.component;if(!m)return typeof console<"u"&&console.warn("[RenderSchema] Model field has no component — nothing to render."),null;const{className:y,wrapper:_="div",fieldWrapper:b,testId:a,...f}={...e.componentProps,...l},g=e.value.__path,h=typeof a=="string"?a:g?g.replace(/\./g,"-"):void 0,R=u?.(m),j=R?.passControl===!0||m.reformerNeedsControl===!0?{control:n}:{};let x;if(R){const v=me(R,c,s,d,f);h&&v["data-testid"]===void 0&&(v["data-testid"]=`input-${h}`),x=p.jsx(m,{disabled:i,...v,...j,...r!==void 0?{ref:r}:{}})}else{const v={value:c,disabled:i,...f};h&&v["data-testid"]===void 0&&(v["data-testid"]=`input-${h}`),x=p.jsx(m,{...j,...v,...r!==void 0?{ref:r}:{},onChange:s,onBlur:d})}const S=b??t;return S?p.jsx(S,{control:n,className:y,testId:h,children:x}):p.jsx(_,{className:y,children:x})});function ge(e){const n=o.useRef(0),t=o.useCallback(r=>M(()=>{e.length,n.current+=1,r()}),[e]);return o.useSyncExternalStore(t,()=>n.current,()=>n.current)}const N=new WeakMap;let $=0;function he(e){if(e==null||typeof e!="object")return $++;let n=N.get(e);return n===void 0&&(n=$++,N.set(e,n)),n}const be=e=>typeof e=="function"?e():e;function D(e,n,t){ge(e);const r=e.length,u=o.useRef(null);(!u.current||u.current.itemFn!==n)&&(u.current={itemFn:n,map:new WeakMap});const c=i=>{if(i==null||typeof i!="object")return n(i);const l=u.current.map;let s=l.get(i);return s===void 0&&(s=n(i),l.set(i,s)),s};return Array.from({length:r},(i,l)=>{const s=e.at(l),d=he(s);return{key:d,index:l,model:s,element:p.jsx(P,{node:c(s),fieldWrapper:t},d)}})}const T=new WeakSet;function Re(e){if(typeof console>"u")return;const n=e.array;if(T.has(n))return;T.add(n);const t=e.array.__path;console.warn(`[RenderSchema] Array node${t?` "${t}"`:""} has no \`component\` — items are rendered without add/remove/reorder UI. Register an array component (e.g. \`FormArray\` from @reformer/ui-kit) and set \`component\` on the node.`)}const _e=o.memo(function({node:e,fieldWrapper:n}){const t=D(e.array,e.item,n);return Re(e),p.jsx(p.Fragment,{children:t.map(r=>r.element)})}),xe=o.memo(function({node:e,fieldWrapper:n}){const t=e.component,r=e.array,u=D(r,e.item,n),{initialValue:c}=e,i=o.useCallback(()=>r.push(be(c)),[r,c]),l=o.useCallback(m=>r.removeAt(m),[r]),s=o.useCallback((m,y)=>r.move(m,y),[r]),d=u.map(({key:m,index:y,model:_,element:b})=>({key:m,index:y,model:_,children:b}));return p.jsx(t,{items:d,onAdd:i,onRemove:l,onMove:s,...e.componentProps??{}})});function J(e){return typeof e=="string"||typeof e=="number"||e instanceof C}function ke(e){const n=[];let t=null;return e.forEach((r,u)=>{if(J(r)){t||(t={key:u,parts:[]},n.push(t)),t.parts.push(r);return}t=null,n.push({key:u,node:r})}),n}function je(e){const n=[];let t=0;for(const r of e)J(r)?t+=1:n.push(r);return n}function Ce(e){const n=[];for(const t of e)t instanceof C&&n.push(t);return n}function Me(e){let n="";for(const t of e){const r=t instanceof C?t.value:t;r!=null&&(n+=String(r))}return n}function L(e){const n=o.useRef({signals:e,key:0}),t=n.current;return(t.signals.length!==e.length||e.some((r,u)=>r!==t.signals[u]))&&(n.current={signals:e,key:t.key+1}),n.current.key}function Se(e){const n=[];if(e)for(const s of Object.keys(e))e[s]instanceof C&&n.push(s);const t=n.map(s=>e[s]),r=L(t),u=o.useRef(t);u.current=t;const c=o.useRef(0),i=o.useCallback(s=>{if(u.current.length===0)return()=>{};let d=!0;return M(()=>{for(const m of u.current)m.value;if(d){d=!1;return}c.current+=1,s()})},[r]);if(o.useSyncExternalStore(i,()=>c.current,()=>c.current),!e||n.length===0)return e;const l={...e};for(const s of n)l[s]=e[s].value;return l}const we=o.memo(function({parts:e}){const n=Ce(e),t=L(n),r=o.useRef(e);r.current=e;const u=o.useRef(n);u.current=n;const c=o.useCallback(l=>{if(u.current.length===0)return()=>{};let s=!0;return M(()=>{for(const d of u.current)d.value;if(s){s=!1;return}l()})},[t]),i=o.useCallback(()=>Me(r.current),[]);return o.useSyncExternalStore(c,i,i)});function P({node:e,form:n,fieldWrapper:t}){const{settings:r}=G(),u=t??r?.fieldWrapper,{selector:c}=e,i=re(c),l=oe(c),s=o.useContext(w),d=c&&s?.refRegistry.has(c)?s.refRegistry.get(c):void 0,m=c?s?.conditionRegistry.get(c):void 0,y=de(m),_=i??y,b=c?s?.lifecycleRegistry.get(c):void 0;pe(b);const a=Se(e.componentProps);if(_)return null;if(I(e)){const f=Z(e.value);if(!f){if(typeof console<"u"){const R=e.value.__path;console.warn(`[RenderSchema] No form node for signal${R?` "${R}"`:""} — render value-leaf after createForm.`)}return null}const g=c??e.value.__path,h=g&&s?.refRegistry.has(g)?s.refRegistry.get(g):void 0;return p.jsx(ye,{node:e,fieldNode:f,fieldWrapper:u,nodeRef:h,resolveFieldAdapter:r?.resolveFieldAdapter})}if(U(e))return e.component?p.jsx(xe,{node:e,fieldWrapper:u}):p.jsx(_e,{node:e,fieldWrapper:u});if(B(e)){const{selector:f,component:g,children:h}=e,R=a||{},j=l!=null?{...R,...l}:R,x=f?s?.callbackRegistry.get(f):void 0,S=x?Object.fromEntries(x):{},v=x?{...j,...S}:j,E=typeof g=="string",Q=!E&&f!==void 0?{selector:f}:{},O=g;if(!E&&g.__selfManagedChildren===!0){const k=g,X=v.form===void 0&&n!==void 0?{form:n}:{},Y=h!==void 0?{children:je(h)}:{};return p.jsx(k,{...f!==void 0?{selector:f}:{},...v,...X,...d!==void 0?{ref:d}:{},...Y})}return E&&H.has(g)?p.jsx(O,{...v,...d!==void 0?{ref:d}:{}}):p.jsx(O,{...Q,...v,...d!==void 0?{ref:d}:{},children:h&&ke(h).map(k=>"parts"in k?p.jsx(we,{parts:k.parts},k.key):p.jsx(P,{node:k.node,form:n},k.key))})}return null}function Pe({render:e,settings:n}){const t=e(),r=p.jsxs(z,{value:{settings:n},children:[F(e)&&e.__overrideMaps.effectRegistry.length>0&&p.jsx(fe,{effectRegistry:e.__overrideMaps.effectRegistry}),p.jsx(P,{node:t})]});return F(e)?p.jsx(w.Provider,{value:e.__overrideMaps,children:r}):r}const Oe=Object.freeze(Object.defineProperty({__proto__:null,FormRenderer:Pe,RenderContextProvider:z,RenderNodeComponent:P,VOID_HTML_TAGS:H,createRenderSchema:te,hideWhen:se,isArrayRenderNode:U,isContainerRenderNode:B,isHtmlTagRenderNode:ne,isModelFieldRenderNode:I,isRenderSchemaProxy:F,onComponentEvent:ue,onInit:ie,onMount:le,onUnmount:ae,renderEffect:ce,useRenderContext:G},Symbol.toStringTag,{value:"Module"}));export{te as T,Pe as U,P as a,Oe as r};