@tempots/beatui 0.80.0 → 0.82.0

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 (112) hide show
  1. package/dist/{ar-DwHLVgKj.cjs → ar-D7CXDmVZ.cjs} +1 -1
  2. package/dist/{ar-Bo_FZZi7.js → ar-nOSKXpIW.js} +1 -1
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +101 -99
  5. package/dist/beatui.css +393 -0
  6. package/dist/beatui.tailwind.css +393 -0
  7. package/dist/{de-zI5mdV4M.cjs → de-WzsOu9Gn.cjs} +1 -1
  8. package/dist/{de-CCqwOkqN.js → de-f2xcEb34.js} +1 -1
  9. package/dist/{deep-merge-1uN6CG6K.js → deep-merge-CiOwVWn8.js} +269 -284
  10. package/dist/deep-merge-DxZqCkE5.cjs +1 -0
  11. package/dist/{duration-input-C9kpsw-t.js → duration-input-B3vnnwBZ.js} +30 -29
  12. package/dist/duration-input-Dg5SX3lM.cjs +1 -0
  13. package/dist/{es-BF02UrPL.js → es-CDqqzpCw.js} +1 -1
  14. package/dist/{es-Cw90CAbu.cjs → es-Ds2Xf3wV.cjs} +1 -1
  15. package/dist/{fa-DPQV4YB8.js → fa-C7tE_hR3.js} +1 -1
  16. package/dist/{fa-B4lssnzR.cjs → fa-Ct1UtDB7.cjs} +1 -1
  17. package/dist/{fr-1Kd6z1F-.cjs → fr-CzAkRFed.cjs} +1 -1
  18. package/dist/{fr-dmxPhwkD.js → fr-yOW_68YY.js} +1 -1
  19. package/dist/{he-BtQbrVt3.js → he-D2oUloCJ.js} +1 -1
  20. package/dist/{he-CJ3XnuPm.cjs → he-DlXALrK7.cjs} +1 -1
  21. package/dist/{hi-BpfnFKHp.cjs → hi-3dBhLwDs.cjs} +1 -1
  22. package/dist/{hi-D_Le4Yka.js → hi-D5ZlZoQq.js} +1 -1
  23. package/dist/{index-CfaWytS2.cjs → index-C5YCCgnn.cjs} +1 -1
  24. package/dist/{index-K6u33-GC.cjs → index-ChsRjiIp.cjs} +17 -17
  25. package/dist/{index-CGEzILlC.js → index-CiAVfKIZ.js} +1 -1
  26. package/dist/{index-YtW7SCWB.js → index-DT6-HMMz.js} +8 -7
  27. package/dist/index.cjs.js +4 -4
  28. package/dist/index.es.js +296 -291
  29. package/dist/{it-DyHjSuHN.js → it-6e6X-4BB.js} +1 -1
  30. package/dist/{it-COCZ9NyB.cjs → it-DohtcWi9.cjs} +1 -1
  31. package/dist/{ja-X43lABza.js → ja-BxNuNo2H.js} +1 -1
  32. package/dist/{ja--NdggLU9.cjs → ja-eyTArrgS.cjs} +1 -1
  33. package/dist/json-schema/index.cjs.js +1 -8
  34. package/dist/json-schema/index.es.js +1391 -7471
  35. package/dist/json-schema-display/index.cjs.js +1 -0
  36. package/dist/json-schema-display/index.es.js +846 -0
  37. package/dist/json-structure/index.cjs.js +1 -1
  38. package/dist/json-structure/index.es.js +89 -87
  39. package/dist/{ko-BUvb0ggK.cjs → ko-BFLCDMMs.cjs} +1 -1
  40. package/dist/{ko-B9g9iw99.js → ko-Ch0jFsBV.js} +1 -1
  41. package/dist/modal-D2xE47kr.cjs +1 -0
  42. package/dist/{modal-CSHIhHvI.js → modal-hkQD1bqZ.js} +22 -21
  43. package/dist/{nl-0S25Gsld.cjs → nl-Bx2ACvr4.cjs} +1 -1
  44. package/dist/{nl-Ew5jnSsT.js → nl-NuTdZO1s.js} +1 -1
  45. package/dist/notice-C0SmlheE.cjs +1 -0
  46. package/dist/{notice-C-964yaY.js → notice-CZHWWwOQ.js} +52 -51
  47. package/dist/oneof-branch-detection-BVNoKU9d.js +6281 -0
  48. package/dist/oneof-branch-detection-C8g3eWnx.cjs +8 -0
  49. package/dist/{pl-C9f6UBSe.js → pl-Bs4nLJ__.js} +1 -1
  50. package/dist/{pl-B3k-K3S4.cjs → pl-QHl6sl8f.cjs} +1 -1
  51. package/dist/prosemirror/index.cjs.js +1 -1
  52. package/dist/prosemirror/index.es.js +1 -1
  53. package/dist/{pt-DYtAvbrw.js → pt-BETjHZrL.js} +1 -1
  54. package/dist/{pt-CKoikRO5.cjs → pt-DZGw2Z-1.cjs} +1 -1
  55. package/dist/{ru-ZexN-b8V.js → ru-Bi1_DEKM.js} +1 -1
  56. package/dist/{ru-COb7RSDt.cjs → ru-D03IuLqh.cjs} +1 -1
  57. package/dist/stack-BJgsPJ9A.js +873 -0
  58. package/dist/stack-DcZ_u50f.cjs +1 -0
  59. package/dist/string-B9vVyfq3.cjs +1 -0
  60. package/dist/string-DYyMxBl-.js +19 -0
  61. package/dist/text-input-CByq5OIo.cjs +1 -0
  62. package/dist/text-input-CFJntP7G.js +287 -0
  63. package/dist/{toolbar-DNpBIoJo.js → toolbar-DR2Zd4Oo.js} +1 -1
  64. package/dist/toolbar-TPWYzoiF.cjs +1 -0
  65. package/dist/{tr-tO_EH-Y2.cjs → tr-B_-_1wua.cjs} +1 -1
  66. package/dist/{tr-BDvn05-H.js → tr-DiYB-FwX.js} +1 -1
  67. package/dist/translations-B4-Zd2LM.cjs +1 -0
  68. package/dist/translations-Cq8bUKJP.js +584 -0
  69. package/dist/{translations-DwGC_94w.cjs → translations-D62qqNV9.cjs} +1 -1
  70. package/dist/{translations-CfWR4loD.js → translations-DPr6c05Z.js} +1 -1
  71. package/dist/types/components/json-schema/schema-conditionals.d.ts +11 -0
  72. package/dist/types/components/json-schema/schema-context.d.ts +1 -1
  73. package/dist/types/components/json-schema-display/display-widget-customization.d.ts +61 -0
  74. package/dist/types/components/json-schema-display/display-wrapper.d.ts +14 -0
  75. package/dist/types/components/json-schema-display/displays/any-display.d.ts +14 -0
  76. package/dist/types/components/json-schema-display/displays/array-display.d.ts +13 -0
  77. package/dist/types/components/json-schema-display/displays/boolean-display.d.ts +13 -0
  78. package/dist/types/components/json-schema-display/displays/composition-display.d.ts +14 -0
  79. package/dist/types/components/json-schema-display/displays/enum-const-display.d.ts +13 -0
  80. package/dist/types/components/json-schema-display/displays/generic-display.d.ts +18 -0
  81. package/dist/types/components/json-schema-display/displays/null-display.d.ts +13 -0
  82. package/dist/types/components/json-schema-display/displays/number-display.d.ts +13 -0
  83. package/dist/types/components/json-schema-display/displays/object-display.d.ts +13 -0
  84. package/dist/types/components/json-schema-display/displays/string-display.d.ts +14 -0
  85. package/dist/types/components/json-schema-display/index.d.ts +14 -0
  86. package/dist/types/components/json-schema-display/json-schema-display.d.ts +25 -0
  87. package/dist/types/components/json-schema-display/mismatch.d.ts +14 -0
  88. package/dist/types/json-schema-display/index.d.ts +1 -0
  89. package/dist/{ur-DbEqQgS6.js → ur-B69X-xNs.js} +1 -1
  90. package/dist/{ur-BbnYJ3HS.cjs → ur-DyUSmIbo.cjs} +1 -1
  91. package/dist/use-form-CgZyrACX.js +864 -0
  92. package/dist/use-form-JjeKCINk.cjs +2 -0
  93. package/dist/utils-DEbsp9Q9.js +129 -0
  94. package/dist/utils-DIUEhA-Z.cjs +1 -0
  95. package/dist/{vi-CpZUeuSj.js → vi-BdzxA60L.js} +1 -1
  96. package/dist/{vi-ByBwvGQY.cjs → vi-CBmPaHxg.cjs} +1 -1
  97. package/dist/widget-customization-DRA7E9Zf.js +1072 -0
  98. package/dist/widget-customization-G-QLB1rw.cjs +1 -0
  99. package/dist/{zh-DnxK0ieB.cjs → zh-Cb1b8uik.cjs} +1 -1
  100. package/dist/{zh-DJyhKO0I.js → zh-Dn1UJiZa.js} +1 -1
  101. package/package.json +13 -7
  102. package/dist/deep-merge-CBIkQM4E.cjs +0 -1
  103. package/dist/duration-input-DHWhQJnn.cjs +0 -1
  104. package/dist/modal-cc8Ehngz.cjs +0 -1
  105. package/dist/notice-C_BWqu2K.cjs +0 -1
  106. package/dist/toolbar-D5FcnRju.cjs +0 -1
  107. package/dist/translations-0tLX4x7M.js +0 -866
  108. package/dist/translations-WPN3ibDg.cjs +0 -1
  109. package/dist/use-form-D4JFOcjo.cjs +0 -2
  110. package/dist/use-form-D4rqJkvG.js +0 -1731
  111. package/dist/widget-customization-BSjJz3_Y.js +0 -1195
  112. package/dist/widget-customization-CrFVrt4V.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../oneof-branch-detection-C8g3eWnx.cjs"),e=require("@tempots/dom"),P=require("../utils-DIUEhA-Z.cjs");function U(t){return t===null?"null":Array.isArray(t)?"array":typeof t=="object"?"object":typeof t=="string"?"string":typeof t=="number"?Number.isInteger(t)?"integer":"number":typeof t=="boolean"?"boolean":"unknown"}function X(t,a){return t===a||a==="number"&&t==="integer"}function b(t,a,i=[]){if(typeof a=="boolean")return a===!1?[{kind:"type-mismatch",path:i,message:"Schema disallows any value",actual:String(t)}]:[];const r=[],n=a;if(n.type!=null&&t!==void 0){const s=Array.isArray(n.type)?n.type:[n.type],c=U(t);if(c!=="unknown"&&!s.some(o=>X(c,o)))return r.push({kind:"type-mismatch",path:i,message:`Expected ${s.join(" | ")}, got ${c}`,expected:s.join(" | "),actual:c}),r}if(n.enum!=null&&t!==void 0&&(n.enum.some(c=>JSON.stringify(c)===JSON.stringify(t))||r.push({kind:"enum-mismatch",path:i,message:`Value not in enum: ${JSON.stringify(n.enum)}`,expected:n.enum.map(String).join(", "),actual:String(t)})),n.const!==void 0&&t!==void 0&&JSON.stringify(n.const)!==JSON.stringify(t)&&r.push({kind:"const-mismatch",path:i,message:`Expected const ${JSON.stringify(n.const)}, got ${JSON.stringify(t)}`,expected:JSON.stringify(n.const),actual:JSON.stringify(t)}),typeof t=="string"&&(n.minLength!=null&&t.length<n.minLength&&r.push({kind:"constraint-violation",path:i,message:`String length ${t.length} < minLength ${n.minLength}`,expected:`>= ${n.minLength} chars`,actual:`${t.length} chars`}),n.maxLength!=null&&t.length>n.maxLength&&r.push({kind:"constraint-violation",path:i,message:`String length ${t.length} > maxLength ${n.maxLength}`,expected:`<= ${n.maxLength} chars`,actual:`${t.length} chars`}),n.pattern!=null))try{new RegExp(n.pattern).test(t)||r.push({kind:"constraint-violation",path:i,message:`String does not match pattern /${n.pattern}/`,expected:`/${n.pattern}/`,actual:t})}catch{}if(typeof t=="number"&&(n.minimum!=null&&t<n.minimum&&r.push({kind:"constraint-violation",path:i,message:`Value ${t} < minimum ${n.minimum}`,expected:`>= ${n.minimum}`,actual:String(t)}),n.maximum!=null&&t>n.maximum&&r.push({kind:"constraint-violation",path:i,message:`Value ${t} > maximum ${n.maximum}`,expected:`<= ${n.maximum}`,actual:String(t)}),n.exclusiveMinimum!=null&&t<=n.exclusiveMinimum&&r.push({kind:"constraint-violation",path:i,message:`Value ${t} <= exclusiveMinimum ${n.exclusiveMinimum}`,expected:`> ${n.exclusiveMinimum}`,actual:String(t)}),n.exclusiveMaximum!=null&&t>=n.exclusiveMaximum&&r.push({kind:"constraint-violation",path:i,message:`Value ${t} >= exclusiveMaximum ${n.exclusiveMaximum}`,expected:`< ${n.exclusiveMaximum}`,actual:String(t)}),n.multipleOf!=null&&t%n.multipleOf!==0&&r.push({kind:"constraint-violation",path:i,message:`Value ${t} is not a multiple of ${n.multipleOf}`,expected:`multiple of ${n.multipleOf}`,actual:String(t)})),typeof t=="object"&&t!==null&&!Array.isArray(t)){const s=t,c=Object.keys(s);if(n.required!=null)for(const o of n.required)o in s||r.push({kind:"missing-required",path:[...i,o],message:`Missing required property "${o}"`,expected:o});if(n.additionalProperties===!1&&n.properties!=null){const o=new Set(Object.keys(n.properties));if(n.patternProperties!=null){const l=Object.keys(n.patternProperties).map(m=>new RegExp(m));for(const m of c)!o.has(m)&&!l.some(p=>p.test(m))&&r.push({kind:"extra-property",path:[...i,m],message:`Extra property "${m}" not allowed`,actual:m})}else for(const l of c)o.has(l)||r.push({kind:"extra-property",path:[...i,l],message:`Extra property "${l}" not allowed`,actual:l})}if(n.properties!=null)for(const[o,l]of Object.entries(n.properties))o in s&&r.push(...b(s[o],l,[...i,o]))}if(Array.isArray(t)){if(n.minItems!=null&&t.length<n.minItems&&r.push({kind:"constraint-violation",path:i,message:`Array length ${t.length} < minItems ${n.minItems}`,expected:`>= ${n.minItems} items`,actual:`${t.length} items`}),n.maxItems!=null&&t.length>n.maxItems&&r.push({kind:"constraint-violation",path:i,message:`Array length ${t.length} > maxItems ${n.maxItems}`,expected:`<= ${n.maxItems} items`,actual:`${t.length} items`}),n.prefixItems!=null){for(let s=0;s<t.length&&s<n.prefixItems.length;s++)r.push(...b(t[s],n.prefixItems[s],[...i,s]));if(n.items!=null&&!Array.isArray(n.items))for(let s=n.prefixItems.length;s<t.length;s++)r.push(...b(t[s],n.items,[...i,s]))}else if(Array.isArray(n.items)){for(let s=0;s<t.length&&s<n.items.length;s++)r.push(...b(t[s],n.items[s],[...i,s]));if(n.additionalItems!=null)for(let s=n.items.length;s<t.length;s++)r.push(...b(t[s],n.additionalItems,[...i,s]))}else if(n.items!=null)for(let s=0;s<t.length;s++)r.push(...b(t[s],n.items,[...i,s]))}return r}class L{widgets=[];register(a){this.widgets.push(a),this.widgets.sort((i,r)=>(r.priority??50)-(i.priority??50))}findBestWidget(a){const i=P.resolveWidget(a.definition,a.name);if(i?.widget){const r=this.widgets.find(n=>n.displayName===i.widget&&n.matcher(a));if(r)return{factory:r.factory,resolved:i}}for(const r of this.widgets)try{if(r.matcher(a))return{factory:r.factory,resolved:i}}catch(n){console.warn(`Error in display widget matcher "${r.displayName??"unknown"}":`,n)}}}function W(t,a,i){return{factory:a,matcher:r=>{const s=r.definition["x:ui"];return s===t||typeof s=="object"&&s!==null&&s.widget===t},displayName:i?.displayName??t,priority:i?.priority??100,...i}}function z(t,a,i){return{factory:a,matcher:r=>r.definition.format===t,displayName:i?.displayName??`${t} display`,priority:i?.priority??75,...i}}function H(t,a,i,r){return{factory:i,matcher:n=>{const s=n.definition;return s.type===t&&s.format===a},displayName:r?.displayName??`${t}:${a} display`,priority:r?.priority??80,...r}}function Q(t){return t.length===0?e.Empty:e.html.div(e.attr.class("bc-json-schema-display__mismatches"),...t.map(a=>e.html.span(e.attr.class(`bc-json-schema-display__mismatch bc-json-schema-display__mismatch--${a.kind}`),e.attr.title(a.expected?`Expected: ${a.expected}${a.actual?`, got: ${a.actual}`:""}`:a.message),a.message)))}function d({ctx:t,mismatches:a,children:i}){const r=t.widgetLabel,n=t.isPropertyRequired,s=t.isDeprecated,c=t.description;if(t.isRoot&&!a?.length)return e.Fragment(i);const o=a?a.filter(l=>{const m=l.path.map(String).join("."),p=t.path.map(String).join(".");return m===p}):[];return e.html.div(e.attr.class("bc-json-schema-display__field"),r||n||s?e.html.div(e.attr.class("bc-json-schema-display__label-row"),r?e.html.span(e.attr.class("bc-json-schema-display__label"),r):null,n?e.html.span(e.attr.class("bc-json-schema-display__required"),"*"):null,s?e.html.span(e.attr.class("bc-json-schema-display__deprecated"),"deprecated"):null):null,i,c?e.html.div(e.attr.class("bc-json-schema-display__description"),c):null,Q(o))}function Y(t,a){switch(a){case"email":return t?e.html.a(e.attr.class("bc-json-schema-display__link"),e.attr.href(`mailto:${t}`),t):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");case"uri":case"uri-reference":case"url":return t?e.html.a(e.attr.class("bc-json-schema-display__link"),e.attr.href(t),e.attr.target("_blank"),e.attr.rel("noopener noreferrer"),t):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");case"color":return t?e.html.span(e.attr.class("bc-json-schema-display__color-display"),e.html.span(e.attr.class("bc-json-schema-display__color-swatch"),e.attr.style(`background-color: ${t}`)),e.html.span(e.attr.class("bc-json-schema-display__monospace"),t)):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");case"date-time":case"date":case"time":if(!t)return e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");try{if(a==="time")return e.html.span(t);const i=new Date(t);return isNaN(i.getTime())?e.html.span(t):e.html.span(a==="date"?i.toLocaleDateString():i.toLocaleString())}catch{return e.html.span(t)}case"password":return t?e.html.span(e.attr.class("bc-json-schema-display__value"),"•".repeat(Math.min(t.length,12))):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");case"uuid":return t?e.html.span(e.attr.class("bc-json-schema-display__monospace"),t):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");case"textarea":case"markdown":return t?e.html.pre(e.attr.class("bc-json-schema-display__pre"),t):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");default:return t!==""?e.html.span(e.attr.class("bc-json-schema-display__value"),t):e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—")}}function C({ctx:t,value:a,mismatches:i}){const r=t.definition,s=P.resolveWidget(r,t.name)?.widget,c=e.Value.map(a,l=>l!=null?String(l):""),o=e.MapSignal(c,l=>Y(l,s));return d({ctx:t,mismatches:i,children:o})}function Z(t){if(t==null)return"—";const a=Number(t);return isNaN(a)?String(t):a.toLocaleString()}function v(t){return t==null?"bc-json-schema-display__value--null":"bc-json-schema-display__value"}function q({ctx:t,value:a,mismatches:i}){return d({ctx:t,mismatches:i,children:e.html.span(e.attr.class(e.Value.map(a,v)),e.Value.map(a,Z))})}function tt(t){return t==null?"bc-json-schema-display__value--null":`bc-json-schema-display__boolean bc-json-schema-display__boolean--${!!t?"true":"false"}`}function et(t){return t==null?"—":t?"true":"false"}function R({ctx:t,value:a,mismatches:i}){return d({ctx:t,mismatches:i,children:e.html.span(e.attr.class(e.Value.map(a,tt)),e.Value.map(a,et))})}function B({ctx:t,mismatches:a}){return d({ctx:t,mismatches:a,children:e.html.span(e.attr.class("bc-json-schema-display__value--null"),"null")})}function nt(t,a){if(t.prefixItems!=null&&a<t.prefixItems.length)return t.prefixItems[a];if(Array.isArray(t.items)&&a<t.items.length)return t.items[a];if(t.prefixItems!=null&&a>=t.prefixItems.length)return t.items!=null&&!Array.isArray(t.items)?t.items:void 0;if(t.items!=null&&!Array.isArray(t.items))return t.items}function E({ctx:t,value:a,mismatches:i,displayWidgetRegistry:r}){const n=t.definition,s=e.Value.toSignal(a),c=e.MapSignal(s,o=>Array.isArray(o)?o.length===0?e.html.span(e.attr.class("bc-json-schema-display__empty"),"(empty array)"):e.html.div(e.attr.class("bc-json-schema-display__array"),...o.map((l,m)=>{const p=nt(n,m),h=t.with({definition:p??!0}).append(m),g=i?.filter(_=>{const y=_.path.map(String),S=[...t.path.map(String),String(m)];return y.length>=S.length&&S.every(($,x)=>y[x]===$)});return e.html.div(e.attr.class("bc-json-schema-display__array-item"),e.html.span(e.attr.class("bc-json-schema-display__array-index"),`[${m}]`),j({ctx:h,value:l,mismatches:g,displayWidgetRegistry:r}))})):o==null?e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—"):e.html.span(e.attr.class("bc-json-schema-display__value"),String(o)));return d({ctx:t,mismatches:i,children:c})}function T({ctx:t,value:a,mismatches:i,displayWidgetRegistry:r}){const n=t.definition,s=e.Value.toSignal(a),c=e.MapSignal(s,o=>{if(o==null)return e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");if(typeof o!="object"||Array.isArray(o))return e.html.span(e.attr.class("bc-json-schema-display__value"),JSON.stringify(o));const l=o,m=n.properties??{},p=Object.keys(m),h=Object.keys(l),g=p.map(u=>{const I=m[u],D=t.with({definition:I,isPropertyRequired:t.hasRequiredProperty(u)}).append(u),V=i?.filter(A=>{const w=A.path.map(String),M=[...t.path.map(String),u];return w.length>=M.length&&M.every((K,G)=>w[G]===K)}),N=u in l?l[u]:void 0;return!(u in l)&&t.hasRequiredProperty(u)?e.html.div(e.attr.class("bc-json-schema-display__field"),e.html.div(e.attr.class("bc-json-schema-display__label-row"),e.html.span(e.attr.class("bc-json-schema-display__label"),D.widgetLabel??u),e.html.span(e.attr.class("bc-json-schema-display__required"),"*")),e.html.span(e.attr.class("bc-json-schema-display__value--missing"),"(missing)")):u in l?j({ctx:D,value:N,mismatches:V,displayWidgetRegistry:r}):e.Empty}),_=new Set(p),y=h.filter(u=>!_.has(u)),S=y.map(u=>{const I=t.with({definition:!0}).append(u),D=i?.filter(V=>{const N=V.path.map(String),A=[...t.path.map(String),u];return N.length>=A.length&&A.every((w,M)=>N[M]===w)});return e.html.div(e.attr.class("bc-json-schema-display__extra-property"),j({ctx:I,value:l[u],mismatches:D,displayWidgetRegistry:r}))}),$=[...g,...S],x=f.getContainerLayout(t);return x?f.applyContainerLayout(x,t,$,[...p,...y]):t.isRoot?e.html.div(e.attr.class("bc-json-schema-display__fields"),...$):e.html.div(e.attr.class("bc-json-schema-display__object"),...$)});return t.isRoot?c:e.html.div(e.attr.class("bc-json-schema-display__field"),t.widgetLabel?e.html.div(e.attr.class("bc-json-schema-display__label-row"),e.html.span(e.attr.class("bc-json-schema-display__label"),t.widgetLabel),t.isPropertyRequired?e.html.span(e.attr.class("bc-json-schema-display__required"),"*"):null,t.isDeprecated?e.html.span(e.attr.class("bc-json-schema-display__deprecated"),"deprecated"):null):null,c,t.description?e.html.div(e.attr.class("bc-json-schema-display__description"),t.description):null)}function k({ctx:t,value:a,mismatches:i}){const r=t.definition,n=e.Value.toSignal(a),s=e.MapSignal(n,c=>{if(c==null)return e.html.span(e.attr.class("bc-json-schema-display__value--null"),"—");const o=typeof c=="string"?c:JSON.stringify(c);let l=!0;return r.enum!=null?l=r.enum.some(m=>JSON.stringify(m)===JSON.stringify(c)):r.const!==void 0&&(l=JSON.stringify(r.const)===JSON.stringify(c)),e.html.span(e.attr.class(`bc-json-schema-display__value${l?"":" bc-json-schema-display__mismatch--enum-mismatch"}`),o,l?null:e.html.span(e.attr.class("bc-json-schema-display__mismatch-indicator"),r.enum!=null?` (not in enum: ${r.enum.map(m=>JSON.stringify(m)).join(", ")})`:` (expected: ${JSON.stringify(r.const)})`))});return d({ctx:t,mismatches:i,children:s})}function F({ctx:t,value:a,mismatches:i,displayWidgetRegistry:r}){const n=t.definition;if(n.allOf!=null){const l=n.allOf.filter(m=>typeof m=="object"&&m!==null);if(l.length>0){const m=l.map(S=>f.resolveAnyRef(S,t.schema,t.ajv)),{mergedSchema:p}=f.mergeAllOf(m,t.path),{allOf:h,...g}=n,_={...g,...p},y=t.with({definition:_});return j({ctx:y,value:a,mismatches:i,displayWidgetRegistry:r})}}const s=n.oneOf??n.anyOf;if(!Array.isArray(s)||s.length===0){const l=e.Value.toSignal(a);return d({ctx:t,mismatches:i,children:e.MapSignal(l,m=>e.html.span(e.attr.class("bc-json-schema-display__value"),JSON.stringify(m)))})}const c=e.Value.toSignal(a),o=e.MapSignal(c,l=>{const m=f.detectOneOfBranch(t,l,t.ajv);if(m.matchingBranch>=0){const p=s[m.matchingBranch],h=typeof p=="object"&&p!==null&&p.$ref?f.resolveRef(p,t.schema):p;if((typeof h=="object"?h?.type:void 0)==="object"){const y=t.with({definition:h});return j({ctx:y,value:l,mismatches:i,displayWidgetRegistry:r})}const _=typeof l=="string"?l:JSON.stringify(l);return e.html.span(e.attr.class("bc-json-schema-display__value"),_)}return m.isAmbiguous?e.html.div(e.html.span(e.attr.class("bc-json-schema-display__branch-label bc-json-schema-display__branch-label--ambiguous"),`Ambiguous (${m.validBranches.length} branches match)`),e.html.pre(e.attr.class("bc-json-schema-display__pre"),JSON.stringify(l,null,2))):e.html.div(e.html.span(e.attr.class("bc-json-schema-display__branch-label bc-json-schema-display__branch-label--no-match"),"No matching branch"),e.html.pre(e.attr.class("bc-json-schema-display__pre"),JSON.stringify(l,null,2)))});return d({ctx:t,mismatches:i,children:o})}function O({ctx:t,value:a,mismatches:i}){const r=e.Value.toSignal(a),n=e.MapSignal(r,s=>{if(s==null)return e.html.span(e.attr.class("bc-json-schema-display__value--null"),s===null?"null":"—");if(typeof s=="boolean")return e.html.span(e.attr.class(`bc-json-schema-display__boolean bc-json-schema-display__boolean--${s?"true":"false"}`),String(s));if(typeof s=="number")return e.html.span(e.attr.class("bc-json-schema-display__value"),s.toLocaleString());if(typeof s=="string")return e.html.span(e.attr.class("bc-json-schema-display__value"),s);try{return e.html.pre(e.attr.class("bc-json-schema-display__pre"),JSON.stringify(s,null,2))}catch{return e.html.span(e.attr.class("bc-json-schema-display__value"),String(s))}});return d({ctx:t,mismatches:i,children:n})}function j({ctx:t,value:a,mismatches:i,displayWidgetRegistry:r}){const n=typeof t.definition=="boolean"?{}:t.definition;let s=n?.$ref?f.resolveRef(n,t.schema):n,c=t.with({definition:s});if(s?.allOf!=null){const o=s.allOf.filter(l=>typeof l=="object"&&l!==null);if(o.length>0){const l=o.map(g=>f.resolveAnyRef(g,t.schema,t.ajv)),{mergedSchema:m}=f.mergeAllOf(l,t.path),{allOf:p,...h}=s;s={...h,...m},c=t.with({definition:s})}}if(r){const o=r.findBestWidget(c);if(o)return o.factory({value:a,ctx:c,mismatches:i})}if(s==null)return O({ctx:c,value:a,mismatches:i});if(s.enum!=null)return k({ctx:c,value:a,mismatches:i});if(s.const!==void 0)return k({ctx:c,value:a,mismatches:i});if(s.anyOf!=null||s.oneOf!=null)return F({ctx:c,value:a,mismatches:i,displayWidgetRegistry:r});if(s.type==null)return O({ctx:c,value:a,mismatches:i});if(Array.isArray(s.type)){const l=s.type.filter(m=>m!=="null");return l.length===1&&["string","number","integer","boolean"].includes(l[0])?J(l[0],{ctx:c,value:a,mismatches:i,displayWidgetRegistry:r}):O({ctx:c,value:a,mismatches:i})}return J(s.type,{ctx:c,value:a,mismatches:i,displayWidgetRegistry:r})}function J(t,a){switch(t){case"string":return C(a);case"number":case"integer":return q(a);case"boolean":return R(a);case"array":return E(a);case"object":return T(a);case"null":return B(a);default:return O(a)}}function st({schema:t,value:a,showMismatches:i=!0,customWidgets:r,horizontal:n=!1}){const s=new f.SchemaContext({schema:t,definition:t,horizontal:n,isPropertyRequired:!1,path:[]});let c;if(r&&r.length>0){c=new L;for(const l of r)c.register(l)}const o=e.Value.toSignal(a);return e.MapSignal(o,l=>{const m=i?b(l,t):void 0;return j({ctx:s,value:l,mismatches:m,displayWidgetRegistry:c})})}exports.AnyDisplay=O;exports.ArrayDisplay=E;exports.BooleanDisplay=R;exports.CompositionDisplay=F;exports.DisplayWidgetRegistry=L;exports.DisplayWrapper=d;exports.EnumConstDisplay=k;exports.GenericDisplay=j;exports.JSONSchemaDisplay=st;exports.NullDisplay=B;exports.NumberDisplay=q;exports.ObjectDisplay=T;exports.StringDisplay=C;exports.detectMismatches=b;exports.forDisplayFormat=z;exports.forDisplayTypeAndFormat=H;exports.forDisplayXUI=W;