bitwrench 2.0.18 → 2.0.20

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 (58) hide show
  1. package/README.md +86 -81
  2. package/dist/bitwrench-bccl.cjs.js +221 -48
  3. package/dist/bitwrench-bccl.cjs.min.js +3 -3
  4. package/dist/bitwrench-bccl.esm.js +221 -48
  5. package/dist/bitwrench-bccl.esm.min.js +3 -3
  6. package/dist/bitwrench-bccl.umd.js +221 -48
  7. package/dist/bitwrench-bccl.umd.min.js +3 -3
  8. package/dist/bitwrench-code-edit.cjs.js +7 -9
  9. package/dist/bitwrench-code-edit.cjs.min.js +5 -7
  10. package/dist/bitwrench-code-edit.es5.js +6 -8
  11. package/dist/bitwrench-code-edit.es5.min.js +5 -7
  12. package/dist/bitwrench-code-edit.esm.js +7 -9
  13. package/dist/bitwrench-code-edit.esm.min.js +5 -7
  14. package/dist/bitwrench-code-edit.umd.js +7 -9
  15. package/dist/bitwrench-code-edit.umd.min.js +5 -7
  16. package/dist/bitwrench-debug.js +268 -0
  17. package/dist/bitwrench-debug.min.js +3 -0
  18. package/dist/bitwrench-lean.cjs.js +250 -1574
  19. package/dist/bitwrench-lean.cjs.min.js +6 -6
  20. package/dist/bitwrench-lean.es5.js +344 -1661
  21. package/dist/bitwrench-lean.es5.min.js +4 -4
  22. package/dist/bitwrench-lean.esm.js +250 -1574
  23. package/dist/bitwrench-lean.esm.min.js +6 -6
  24. package/dist/bitwrench-lean.umd.js +250 -1574
  25. package/dist/bitwrench-lean.umd.min.js +6 -6
  26. package/dist/bitwrench-util-css.cjs.js +1 -1
  27. package/dist/bitwrench-util-css.cjs.min.js +1 -1
  28. package/dist/bitwrench-util-css.es5.js +1 -1
  29. package/dist/bitwrench-util-css.es5.min.js +1 -1
  30. package/dist/bitwrench-util-css.esm.js +1 -1
  31. package/dist/bitwrench-util-css.esm.min.js +1 -1
  32. package/dist/bitwrench-util-css.umd.js +1 -1
  33. package/dist/bitwrench-util-css.umd.min.js +1 -1
  34. package/dist/bitwrench.cjs.js +510 -1660
  35. package/dist/bitwrench.cjs.min.js +7 -7
  36. package/dist/bitwrench.css +80 -33
  37. package/dist/bitwrench.es5.js +569 -1694
  38. package/dist/bitwrench.es5.min.js +5 -5
  39. package/dist/bitwrench.esm.js +510 -1660
  40. package/dist/bitwrench.esm.min.js +7 -7
  41. package/dist/bitwrench.min.css +1 -1
  42. package/dist/bitwrench.umd.js +510 -1660
  43. package/dist/bitwrench.umd.min.js +7 -7
  44. package/dist/builds.json +133 -111
  45. package/dist/bwserve.cjs.js +2 -2
  46. package/dist/bwserve.esm.js +2 -2
  47. package/dist/sri.json +46 -44
  48. package/package.json +5 -3
  49. package/readme.html +86 -75
  50. package/src/bitwrench-bccl-entry.js +3 -4
  51. package/src/bitwrench-bccl.js +217 -43
  52. package/src/bitwrench-code-edit.js +6 -8
  53. package/src/bitwrench-debug.js +245 -0
  54. package/src/bitwrench-styles.js +35 -8
  55. package/src/bitwrench.js +212 -1563
  56. package/src/cli/attach.js +53 -21
  57. package/src/cli/serve.js +179 -3
  58. package/src/version.js +3 -3
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.18 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bwBCCL={})}(this,function(e){"use strict";
3
3
  /**
4
4
  * Bitwrench v2 Components
@@ -17,7 +17,7 @@
17
17
  * @module bitwrench-bccl
18
18
  * @license BSD-2-Clause
19
19
  * @author M A Chatterjee <deftio [at] deftio [dot] com>
20
- */function t(e){return e?0===e.indexOf("outline")?"bw_btn_outline bw_"+e.replace(/^outline[_-]/,""):"bw_"+e:""}function a(e={}){const{title:a,subtitle:s,content:n,footer:c,header:o,image:i,imagePosition:r="top",variant:l,bordered:d=!0,shadow:_,hoverable:b=!1,className:u="",style:m,headerClass:p="",bodyClass:w="",footerClass:v=""}=e,f=["bw_card",t(l),_&&{none:"",sm:"bw_shadow_sm",md:"bw_shadow",lg:"bw_shadow_lg"}[_]||"",d?"":"bw_border_0",b?"bw_card_hoverable":"",u].filter(Boolean).join(" ").trim(),h=[o&&{t:"div",a:{class:`bw_card_header ${p}`.trim()},c:o},i&&("top"===r||"left"===r)&&{t:"img",a:{class:`bw_card_img_${r}`,src:i.src,alt:i.alt||""}},{t:"div",a:{class:`bw_card_body ${w}`.trim()},c:[a&&{t:"h5",a:{class:"bw_card_title"},c:a},s&&{t:"h6",a:{class:"bw_card_subtitle bw_mb_2 bw_text_muted"},c:s},n&&(Array.isArray(n)?n:[n])].flat().filter(Boolean)},i&&("bottom"===r||"right"===r)&&{t:"img",a:{class:`bw_card_img_${r}`,src:i.src,alt:i.alt||""}},c&&{t:"div",a:{class:`bw_card_footer ${v}`.trim()},c:c}].filter(Boolean);return!i||"left"!==r&&"right"!==r?{t:"div",a:{class:f,style:m},c:h,o:{type:"card",state:e.state||{}}}:{t:"div",a:{class:f,style:m},c:{t:"div",a:{class:"bw_row bw_g_0"},c:h},o:{type:"card",state:e.state||{}}}}function s(e={}){"string"==typeof e&&(e={text:e});const{text:a,variant:s="primary",size:n,disabled:c=!1,onclick:o,type:i="button",className:r="",style:l}=e;return{t:"button",a:{type:i,class:["bw_btn",t(s),n&&`bw_btn_${n}`,r].filter(Boolean).join(" "),disabled:c,onclick:o,style:l},c:a,o:{type:"button"}}}function n(e={}){const{fluid:t=!1,children:a,className:s=""}=e;return{t:"div",a:{class:`bw_container${t?"-fluid":""} ${s}`.trim()},c:a}}function c(e={}){const{children:t,className:a="",gap:s}=e;return{t:"div",a:{class:`bw_row ${s?`bw_g_${s}`:""} ${a}`.trim()},c:t}}function o(e={}){const{size:t,offset:a,push:s,pull:n,content:c,children:o,className:i=""}=e,r=[];return"object"==typeof t?Object.entries(t).forEach(([e,t])=>{"xs"===e?r.push(`bw_col_${t}`):r.push(`bw_col_${e}_${t}`)}):t?r.push(`bw_col_${t}`):r.push("bw_col"),a&&r.push(`bw_offset_${a}`),s&&r.push(`bw_push_${s}`),n&&r.push(`bw_pull_${n}`),{t:"div",a:{class:`${r.join(" ")} ${i}`.trim()},c:c||o}}function i(e={}){const{items:t=[],pills:a=!1,vertical:s=!1,className:n=""}=e;return{t:"ul",a:{class:`bw_nav ${a?"bw_nav_pills":"bw_nav_tabs"} ${s?"bw_nav_vertical":""} ${n}`.trim()},c:t.map(e=>({t:"li",a:{class:"bw_nav_item"},c:{t:"a",a:{href:e.href||"#",class:`bw_nav_link ${e.active?"active":""} ${e.disabled?"disabled":""}`.trim()},c:e.text}}))}}function r(e={}){const{brand:t,brandHref:a="#",items:s=[],dark:n=!0,className:c=""}=e;return{t:"nav",a:{class:`bw_navbar ${n?"bw_navbar_dark":"bw_navbar_light"} ${c}`.trim()},c:{t:"div",a:{class:"bw_container"},c:[t&&{t:"a",a:{href:a,class:"bw_navbar_brand"},c:t},s.length>0&&{t:"div",a:{class:"bw_navbar_nav"},c:s.map(e=>({t:"a",a:{href:e.href||"#",class:"bw_nav_link "+(e.active?"active":"")},c:e.text}))}].filter(Boolean)},o:{type:"navbar",state:{activeItem:s.findIndex(e=>e.active)}}}}function l(e={}){const{tabs:t=[],activeIndex:a=0}=e;let s=a;return t.forEach((e,t)=>{e.active&&(s=t)}),{t:"div",a:{class:"bw_tabs"},c:[{t:"ul",a:{class:"bw_nav bw_nav_tabs",role:"tablist"},c:t.map((e,t)=>({t:"li",a:{class:"bw_nav_item",role:"presentation"},c:{t:"button",a:{class:"bw_nav_link "+(t===s?"active":""),type:"button",role:"tab",tabindex:t===s?"0":"-1","aria-selected":t===s?"true":"false","data-tab-index":t,onclick:e=>{const t=e.target.closest(".bw_tabs"),a=t.querySelectorAll(".bw_nav_link"),s=t.querySelectorAll(".bw_tab_pane");a.forEach(e=>{e.classList.remove("active"),e.setAttribute("aria-selected","false"),e.setAttribute("tabindex","-1")}),s.forEach(e=>e.classList.remove("active")),e.target.classList.add("active"),e.target.setAttribute("aria-selected","true"),e.target.setAttribute("tabindex","0");s[parseInt(e.target.getAttribute("data-tab-index"))].classList.add("active")}},c:e.label}}))},{t:"div",a:{class:"bw_tab_content"},c:t.map((e,t)=>({t:"div",a:{class:"bw_tab_pane "+(t===s?"active":""),role:"tabpanel"},c:e.content}))}],o:{type:"tabs",state:{activeIndex:s},mounted:function(e){var t=e.querySelector('[role="tablist"]');t&&t.addEventListener("keydown",function(e){for(var a=t.querySelectorAll('[role="tab"]'),s=-1,n=0;n<a.length;n++)if(a[n]===e.target){s=n;break}if(-1!==s){var c=-1;"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),c=s>0?s-1:a.length-1):"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),c=s<a.length-1?s+1:0):"Home"===e.key?(e.preventDefault(),c=0):"End"===e.key&&(e.preventDefault(),c=a.length-1),c>=0&&(a[c].focus(),a[c].click())}})}}}}function d(e={}){"string"==typeof e&&(e={content:e});const{content:a,variant:s="info",dismissible:n=!1,className:c=""}=e;return{t:"div",a:{class:`bw_alert ${t(s)} ${n?"bw_alert_dismissible":""} ${c}`.trim(),role:"alert"},c:[a,n&&{t:"button",a:{type:"button",class:"bw_close","aria-label":"Close",onclick:function(e){var t=e.target.closest(".bw_alert");t&&t.remove()}},c:"×"}].filter(Boolean)}}function _(e={}){"string"==typeof e&&(e={text:e});const{text:a,variant:s="primary",size:n,pill:c=!1,className:o=""}=e,i="sm"===n?" bw_badge_sm":"lg"===n?" bw_badge_lg":"";return{t:"span",a:{class:`bw_badge ${t(s)}${i} ${c?"bw_badge_pill":""} ${o}`.trim()},c:a}}function b(e={}){const{value:a=0,max:s=100,variant:n="primary",striped:c=!1,animated:o=!1,label:i,height:r}=e,l=Math.round(a/s*100);return{t:"div",a:{class:"bw_progress",style:r?{height:`${r}px`}:void 0},c:{t:"div",a:{class:["bw_progress_bar",t(n),c&&"bw_progress_bar_striped",o&&"bw_progress_bar_animated"].filter(Boolean).join(" "),role:"progressbar",style:{width:`${l}%`},"aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":s},c:i||`${l}%`}}}function u(e={}){const{items:t=[],flush:a=!1,interactive:s=!1}=e;return{t:"div",a:{class:("bw_list_group "+(a?"bw_list_group_flush":"")).trim()},c:t.map(e=>{const t="object"==typeof e,a=t?e.text:e,n=!!t&&e.active,c=!!t&&e.disabled,o=t?e.href:null,i=t?e.onclick:null;return s||o||i?{t:"a",a:{class:["bw_list_group_item",n&&"active",c&&"disabled"].filter(Boolean).join(" "),href:o||"#",onclick:i||(e=>{o||e.preventDefault()}),style:c?"pointer-events: none; opacity: 0.65;":""},c:a}:{t:"div",a:{class:["bw_list_group_item",n&&"active",c&&"disabled"].filter(Boolean).join(" ")},c:a}})}}function m(e={}){const{items:t=[]}=e;return{t:"nav",a:{"aria-label":"breadcrumb"},c:{t:"ol",a:{class:"bw_breadcrumb"},c:t.map((e,t)=>({t:"li",a:{class:"bw_breadcrumb_item "+(e.active?"active":""),"aria-current":e.active?"page":void 0},c:e.active?e.text:{t:"a",a:{href:e.href||"#"},c:e.text}}))}}}function p(e={}){const{children:t,onsubmit:a,className:s=""}=e;return{t:"form",a:{class:s,onsubmit:a||(e=>e.preventDefault())},c:t}}function w(e={}){var{label:t,input:a,help:s,id:n,validation:c,feedback:o,required:i}=e,r=a;if(c&&a&&a.a){r={t:a.t,a:Object.assign({},a.a),c:a.c,o:a.o};var l="valid"===c?"bw_is_valid":"invalid"===c?"bw_is_invalid":"";l&&(r.a.class=((r.a.class||"")+" "+l).trim())}return{t:"div",a:{class:"bw_form_group"},c:[t&&{t:"label",a:{for:n,class:"bw_form_label"},c:i?[t,{t:"span",a:{class:"bw_text_danger bw_ms_1"},c:"*"}]:t},r,o&&c&&{t:"div",a:{class:"valid"===c?"bw_valid_feedback":"bw_invalid_feedback"},c:o},s&&{t:"small",a:{class:"bw_form_text bw_text_muted"},c:s}].filter(Boolean)}}function v(e={}){const{type:t="text",placeholder:a,value:s,id:n,name:c,disabled:o=!1,readonly:i=!1,required:r=!1,className:l="",style:d,..._}=e;return{t:"input",a:{type:t,class:`bw_form_control ${l}`.trim(),placeholder:a,value:s,id:n,name:c,style:d,disabled:o,readonly:i,required:r,..._}}}function f(e={}){const{placeholder:t,value:a,rows:s=3,id:n,name:c,disabled:o=!1,readonly:i=!1,required:r=!1,className:l="",...d}=e;return{t:"textarea",a:{class:`bw_form_control ${l}`.trim(),placeholder:t,rows:s,id:n,name:c,disabled:o,readonly:i,required:r,...d},c:a}}function h(e={}){const{options:t=[],value:a,id:s,name:n,disabled:c=!1,required:o=!1,className:i="",...r}=e;return{t:"select",a:{class:`bw_form_control ${i}`.trim(),id:s,name:n,disabled:c,required:o,...r},c:t.map(e=>({t:"option",a:{value:e.value,selected:e.value===a},c:e.text||e.value}))}}function g(e={}){const{label:t,checked:a=!1,id:s,name:n,disabled:c=!1,value:o,className:i="",...r}=e;return{t:"div",a:{class:`bw_form_check ${i}`.trim()},c:[{t:"input",a:{type:"checkbox",class:"bw_form_check_input",checked:a,id:s,name:n,disabled:c,value:o,...r}},t&&{t:"label",a:{class:"bw_form_check_label",for:s},c:t}].filter(Boolean)}}function k(e={}){const{children:t,direction:a="vertical",gap:s=3,className:n=""}=e;return{t:"div",a:{class:`bw_${"vertical"===a?"vstack":"hstack"} bw_gap_${s} ${n}`.trim()},c:t}}function y(e={}){const{variant:a="primary",size:s="md",type:n="border"}=e;return{t:"div",a:{class:`bw_spinner_${n} bw_spinner_${n}-${s} ${t(a)}`,role:"status"},c:{t:"span",a:{class:"bw_visually_hidden"},c:"Loading..."}}}function x(e={}){const{title:a,subtitle:s,content:n,variant:c="primary",size:o="lg",centered:i=!0,overlay:r=!1,backgroundImage:l,actions:d,className:_=""}=e,b={sm:"bw_py_3",md:"bw_py_4",lg:"bw_py_5",xl:"bw_py_6"};return{t:"section",a:{class:`bw_hero ${t(c)} ${b[o]||b.lg} ${i?"bw_text_center":""} ${_}`.trim(),style:l?`background-image: url('${l}'); background-size: cover; background-position: center;`:void 0},c:[r&&{t:"div",a:{class:"bw_hero_overlay"}},{t:"div",a:{class:"bw_container"},c:{t:"div",a:{class:"bw_hero_content"},c:[a&&{t:"h1",a:{class:"bw_hero_title bw_display_4 bw_mb_3"},c:a},s&&{t:"p",a:{class:"bw_hero_subtitle bw_lead bw_mb_4"},c:s},n,d&&{t:"div",a:{class:"bw_hero_actions bw_mt_4"},c:d}].filter(Boolean)}}].filter(Boolean)}}function $(e={}){const{features:t=[],columns:a=3,centered:s=!0,iconSize:n="3rem",className:c=""}=e,o="bw_col_md_"+12/a;return{t:"div",a:{class:`bw_feature_grid ${c}`.trim()},c:{t:"div",a:{class:"bw_row bw_g_4"},c:t.map(e=>({t:"div",a:{class:o},c:{t:"div",a:{class:"bw_feature "+(s?"bw_text_center":"")},c:[e.icon&&{t:"div",a:{class:"bw_feature_icon bw_mb_3 bw_text_primary",style:`font-size: ${n};`},c:e.icon},e.title&&{t:"h3",a:{class:"bw_feature_title bw_h5 bw_mb_2"},c:e.title},e.description&&{t:"p",a:{class:"bw_feature_description bw_text_muted"},c:e.description}].filter(Boolean)}}))}}}function L(e={}){const{title:t,description:a,actions:s,variant:n="light",centered:c=!0,className:o=""}=e;return{t:"section",a:{class:`bw_cta bw_bg_${n} bw_py_5 ${o}`.trim()},c:{t:"div",a:{class:"bw_container"},c:{t:"div",a:{class:"bw_cta_content "+(c?"bw_text_center":"")},c:[t&&{t:"h2",a:{class:"bw_cta_title bw_mb_3"},c:t},a&&{t:"p",a:{class:"bw_cta_description bw_lead bw_mb_4"},c:a},s&&{t:"div",a:{class:"bw_cta_actions"},c:s}].filter(Boolean)}}}}function N(e={}){const{title:t,subtitle:a,content:s,variant:n="default",spacing:c="md",className:o=""}=e,i={sm:"bw_py_3",md:"bw_py_4",lg:"bw_py_5",xl:"bw_py_6"};return{t:"section",a:{class:`bw_section ${i[c]||i.md} ${"default"!==n?`bw_bg_${n}`:""} ${o}`.trim()},c:{t:"div",a:{class:"bw_container"},c:[(t||a)&&{t:"div",a:{class:"bw_section_header bw_text_center bw_mb_5"},c:[t&&{t:"h2",a:{class:"bw_section_title"},c:t},a&&{t:"p",a:{class:"bw_section_subtitle bw_text_muted"},c:a}].filter(Boolean)},s].filter(Boolean)}}}function C(e={}){const{title:t,description:a,code:s,result:n,language:c="javascript"}=e;Math.random().toString(36).substr(2,9);const o=[{label:"Result",active:!0,content:n}];s&&o.push({label:"Code",content:{t:"div",a:{style:"position: relative;"},c:[{t:"button",a:{class:"bw_copy_btn bw_code_copy_btn",onclick:function(e){navigator.clipboard.writeText(s).then(function(){var t=e.target,a=t.textContent;t.textContent="Copied!",t.classList.add("bw_code_copy_btn_copied"),setTimeout(function(){t.textContent=a,t.classList.remove("bw_code_copy_btn_copied")},2e3)})}},c:"Copy"},"undefined"!=typeof globalThis&&void 0!==globalThis.bw&&"function"==typeof globalThis.bw.codeEditor?globalThis.bw.codeEditor({code:s,lang:"javascript"===c?"js":c,readOnly:!0,height:"auto"}):{t:"pre",a:{class:"bw_code_pre"},c:{t:"code",a:{class:`bw_code_block language-${c}`},c:s}}]}});return{t:"div",a:{class:"bw_code_demo"},c:[t&&{t:"h3",c:t},a&&{t:"p",a:{class:"bw_text_muted bw_mb_3"},c:a},l({tabs:o})].filter(Boolean)}}function B(e={}){const{pages:t=1,currentPage:a=1,onPageChange:s,size:n,className:c=""}=e;function o(e){return function(n){n.preventDefault(),e<1||e>t||e===a||s&&s(e)}}const i=[];i.push({t:"li",a:{class:("bw_page_item "+(a<=1?"bw_disabled":"")).trim()},c:{t:"button",a:{class:"bw_page_link",type:"button",onclick:o(a-1),"aria-label":"Previous",disabled:a<=1||void 0},c:"‹"}});for(var r=1;r<=t;r++)(function(e){i.push({t:"li",a:{class:("bw_page_item "+(e===a?"bw_active":"")).trim()},c:{t:"button",a:{class:"bw_page_link",type:"button",onclick:o(e),"aria-current":e===a?"page":void 0},c:""+e}})})(r);return i.push({t:"li",a:{class:("bw_page_item "+(a>=t?"bw_disabled":"")).trim()},c:{t:"button",a:{class:"bw_page_link",type:"button",onclick:o(a+1),"aria-label":"Next",disabled:a>=t||void 0},c:"›"}}),{t:"nav",a:{"aria-label":"Pagination"},c:{t:"ul",a:{class:`bw_pagination ${n?"bw_pagination_"+n:""} ${c}`.trim()},c:i}}}function A(e={}){const{label:t,name:a,value:s,checked:n=!1,id:c,disabled:o=!1,className:i="",...r}=e;return{t:"div",a:{class:`bw_form_check ${i}`.trim()},c:[{t:"input",a:{type:"radio",class:"bw_form_check_input",name:a,value:s,checked:n,id:c,disabled:o,...r}},t&&{t:"label",a:{class:"bw_form_check_label",for:c},c:t}].filter(Boolean)}}function S(e={}){const{children:t,size:a,vertical:s=!1,className:n=""}=e;return{t:"div",a:{class:`${s?"bw_btn_group_vertical":"bw_btn_group"} ${a?"bw_btn_group_"+a:""} ${n}`.trim(),role:"group"},c:t}}function E(e={}){const{items:t=[],multiOpen:a=!1,className:s=""}=e;return{t:"div",a:{class:`bw_accordion ${s}`.trim()},c:t.map(function(e,t){return{t:"div",a:{class:"bw_accordion_item"},c:[{t:"h2",a:{class:"bw_accordion_header"},c:{t:"button",a:{class:("bw_accordion_button "+(e.open?"":"bw_collapsed")).trim(),type:"button","aria-expanded":e.open?"true":"false","data-accordion-index":t,onclick:function(e){var t=e.target.closest(".bw_accordion_button"),s=t.closest(".bw_accordion"),n=t.closest(".bw_accordion_item"),c=n.querySelector(".bw_accordion_collapse"),o=c.classList.contains("bw_collapse_show");if(!a)for(var i=s.querySelectorAll(".bw_accordion_item"),r=0;r<i.length;r++)if(i[r]!==n){var l=i[r].querySelector(".bw_accordion_collapse"),d=i[r].querySelector(".bw_accordion_button");l.classList.contains("bw_collapse_show")&&(l.style.maxHeight=l.scrollHeight+"px",l.offsetHeight,l.style.maxHeight="0px",l.classList.remove("bw_collapse_show"),d.classList.add("bw_collapsed"),d.setAttribute("aria-expanded","false"))}if(o)c.style.maxHeight=c.scrollHeight+"px",c.offsetHeight,c.style.maxHeight="0px",c.classList.remove("bw_collapse_show"),t.classList.add("bw_collapsed"),t.setAttribute("aria-expanded","false");else{c.classList.add("bw_collapse_show"),c.style.maxHeight="0px",c.offsetHeight,c.style.maxHeight=c.scrollHeight+"px",t.classList.remove("bw_collapsed"),t.setAttribute("aria-expanded","true");var _=function(e){"max-height"===e.propertyName&&c.classList.contains("bw_collapse_show")&&(c.style.maxHeight="none"),c.removeEventListener("transitionend",_)};c.addEventListener("transitionend",_)}}},c:e.title}},{t:"div",a:{class:("bw_accordion_collapse "+(e.open?"bw_collapse_show":"")).trim()},c:{t:"div",a:{class:"bw_accordion_body"},c:e.content},o:e.open?{mounted:function(e){e.style.maxHeight="none"}}:void 0}]}}),o:{type:"accordion",state:{multiOpen:a}}}}function I(e={}){const{title:t,content:a,footer:s,size:n,closeButton:c=!0,onClose:o,className:i=""}=e;function r(e){var t=e.closest(".bw_modal");t&&(t.classList.remove("bw_modal_show"),document.body.style.overflow=""),o&&o()}return{t:"div",a:{class:`bw_modal ${i}`.trim()},c:{t:"div",a:{class:("bw_modal_dialog "+(n?"bw_modal_"+n:"")).trim()},c:{t:"div",a:{class:"bw_modal_content"},c:[(t||c)&&{t:"div",a:{class:"bw_modal_header"},c:[t&&{t:"h5",a:{class:"bw_modal_title"},c:t},c&&{t:"button",a:{type:"button",class:"bw_close","aria-label":"Close",onclick:function(e){r(e.target)}},c:"×"}].filter(Boolean)},a&&{t:"div",a:{class:"bw_modal_body"},c:a},s&&{t:"div",a:{class:"bw_modal_footer"},c:s}].filter(Boolean)}},o:{type:"modal",mounted:function(e){e.addEventListener("click",function(t){t.target===e&&r(e)});var t=function(t){"Escape"===t.key&&e.classList.contains("bw_modal_show")&&r(e)};document.addEventListener("keydown",t),e._bw_escHandler=t},unmount:function(e){e._bw_escHandler&&document.removeEventListener("keydown",e._bw_escHandler),document.body.style.overflow=""}}}}function q(e={}){const{title:a,content:s,variant:n="info",autoDismiss:c=!0,delay:o=5e3,position:i="top-right",className:r=""}=e;return{t:"div",a:{class:`bw_toast ${t(n)} ${r}`.trim(),role:"alert","data-position":i},c:[a&&{t:"div",a:{class:"bw_toast_header"},c:[{t:"strong",c:a},{t:"button",a:{type:"button",class:"bw_close","aria-label":"Close",onclick:function(e){var t=e.target.closest(".bw_toast");t&&(t.classList.add("bw_toast_hiding"),setTimeout(function(){t.parentNode&&t.parentNode.removeChild(t)},300))}},c:"×"}]},s&&{t:"div",a:{class:"bw_toast_body"},c:s}].filter(Boolean),o:{type:"toast",mounted:function(e){requestAnimationFrame(function(){e.classList.add("bw_toast_show")}),c&&setTimeout(function(){e.classList.add("bw_toast_hiding"),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},300)},o)}}}}function H(e={}){const{trigger:a,items:s=[],align:n="start",variant:c="primary",className:o=""}=e;var i;return i="string"==typeof a||void 0===a?{t:"button",a:{class:`bw_btn ${t(c)} bw_dropdown_toggle`,type:"button",onclick:function(e){e.target.closest(".bw_dropdown").querySelector(".bw_dropdown_menu").classList.toggle("bw_dropdown_show")}},c:a||"Dropdown"}:a,{t:"div",a:{class:`bw_dropdown ${o}`.trim()},c:[i,{t:"div",a:{class:("bw_dropdown_menu "+("end"===n?"bw_dropdown_menu_end":"")).trim()},c:s.map(function(e){return e.divider?{t:"hr",a:{class:"bw_dropdown_divider"}}:{t:"a",a:{class:("bw_dropdown_item "+(e.disabled?"disabled":"")).trim(),href:e.href||"#",onclick:e.disabled?void 0:function(t){e.href||t.preventDefault(),t.target.closest(".bw_dropdown").querySelector(".bw_dropdown_menu").classList.remove("bw_dropdown_show"),e.onclick&&e.onclick(t)}},c:e.text}})}],o:{type:"dropdown",mounted:function(e){var t=function(t){if(!e.contains(t.target)){var a=e.querySelector(".bw_dropdown_menu");a&&a.classList.remove("bw_dropdown_show")}};document.addEventListener("click",t),e._bw_outsideHandler=t},unmount:function(e){e._bw_outsideHandler&&document.removeEventListener("click",e._bw_outsideHandler)}}}}function j(e={}){const{label:t,checked:a=!1,id:s,name:n,disabled:c=!1,className:o="",...i}=e;return{t:"div",a:{class:`bw_form_check bw_form_switch ${o}`.trim()},c:[{t:"input",a:{type:"checkbox",class:"bw_form_check_input bw_switch_input",role:"switch",checked:a,id:s,name:n,disabled:c,...i}},t&&{t:"label",a:{class:"bw_form_check_label",for:s},c:t}].filter(Boolean)}}function T(e={}){const{variant:t="text",width:a,height:s,count:n=1,className:c=""}=e;if("circle"===t){var o=a||s||"3rem";return{t:"div",a:{class:`bw_skeleton bw_skeleton_circle ${c}`.trim(),style:{width:o,height:o}}}}if("rect"===t)return{t:"div",a:{class:`bw_skeleton bw_skeleton_rect ${c}`.trim(),style:{width:a||"100%",height:s||"120px"}}};if(1===n)return{t:"div",a:{class:`bw_skeleton bw_skeleton_text ${c}`.trim(),style:{width:a||"100%",height:s||"1em"}}};for(var i=[],r=0;r<n;r++)i.push({t:"div",a:{class:"bw_skeleton bw_skeleton_text",style:{width:r===n-1?"75%":a||"100%",height:s||"1em"}}});return{t:"div",a:{class:`bw_skeleton_group ${c}`.trim()},c:i}}function D(e={}){const{src:a,alt:s="",initials:n,size:c="md",variant:o="primary",className:i=""}=e;return a?{t:"img",a:{class:`bw_avatar bw_avatar_${c} ${i}`.trim(),src:a,alt:s}}:{t:"div",a:{class:`bw_avatar bw_avatar_${c} ${t(o)} ${i}`.trim()},c:n||""}}function z(e={}){const{items:t=[],showControls:a=!0,showIndicators:s=!0,autoPlay:n=!1,interval:c=5e3,height:o="300px",startIndex:i=0,className:r=""}=e;function l(e,t){var a=e.querySelectorAll(".bw_carousel_slide").length;t<0&&(t=a-1),t>=a&&(t=0),e.setAttribute("data-carousel-index",t),e.querySelector(".bw_carousel_track").style.transform="translateX(-"+100*t+"%)";for(var s=e.querySelectorAll(".bw_carousel_indicator"),n=0;n<s.length;n++)n===t?s[n].classList.add("active"):s[n].classList.remove("active")}var d=t.map(function(e){var t=[e.content,e.caption&&{t:"div",a:{class:"bw_carousel_caption"},c:e.caption}].filter(Boolean);return{t:"div",a:{class:"bw_carousel_slide"},c:1===t.length?t[0]:t}}),_=[{t:"div",a:{class:"bw_carousel_track",style:"transform: translateX(-"+100*i+"%)"},c:d}];return a&&t.length>1&&(_.push({t:"button",a:{class:"bw_carousel_control bw_carousel_control_prev",type:"button","aria-label":"Previous slide",onclick:function(e){var t=e.target.closest(".bw_carousel"),a=parseInt(t.getAttribute("data-carousel-index")||"0");l(t,a-1)}},c:{t:"img",a:{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e",alt:"",role:"presentation"}}}),_.push({t:"button",a:{class:"bw_carousel_control bw_carousel_control_next",type:"button","aria-label":"Next slide",onclick:function(e){var t=e.target.closest(".bw_carousel"),a=parseInt(t.getAttribute("data-carousel-index")||"0");l(t,a+1)}},c:{t:"img",a:{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e",alt:"",role:"presentation"}}})),s&&t.length>1&&_.push({t:"div",a:{class:"bw_carousel_indicators"},c:t.map(function(e,t){return{t:"button",a:{class:"bw_carousel_indicator"+(t===i?" active":""),type:"button","aria-label":"Go to slide "+(t+1),"data-slide-index":t,onclick:function(e){l(e.target.closest(".bw_carousel"),parseInt(e.target.getAttribute("data-slide-index")))}}}})}),{t:"div",a:{class:("bw_carousel "+r).trim(),style:"height: "+o,tabindex:"0","aria-roledescription":"carousel","data-carousel-index":i},c:_,o:{type:"carousel",state:{activeIndex:i,autoPlay:n,interval:c},mounted:function(e){if(e.addEventListener("keydown",function(t){var a=parseInt(e.getAttribute("data-carousel-index")||"0");"ArrowLeft"===t.key?(t.preventDefault(),l(e,a-1)):"ArrowRight"===t.key&&(t.preventDefault(),l(e,a+1))}),n){var t=setInterval(function(){var t=parseInt(e.getAttribute("data-carousel-index")||"0");l(e,t+1)},c);e._bw_carouselInterval=t,e.addEventListener("mouseenter",function(){e._bw_carouselInterval&&clearInterval(e._bw_carouselInterval)}),e.addEventListener("mouseleave",function(){e._bw_carouselInterval=setInterval(function(){var t=parseInt(e.getAttribute("data-carousel-index")||"0");l(e,t+1)},c)})}},unmount:function(e){e._bw_carouselInterval&&clearInterval(e._bw_carouselInterval)}}}}function O(e={}){"string"==typeof e&&(e={label:e});var{value:a=0,label:s,change:n,format:c,prefix:o,suffix:i,icon:r,variant:l,className:d="",style:_}=e;var b=["bw_stat_card",t(l),d].filter(Boolean).join(" ").trim(),u=[];return r&&u.push({t:"div",a:{class:"bw_stat_icon"},c:r}),u.push({t:"div",a:{class:"bw_stat_value"},c:function(e,t){if(o||i)return(o||"")+e+(i||"");switch(t){case"currency":return"$"+Number(e).toLocaleString();case"percent":return e+"%";case"number":return Number(e).toLocaleString();default:return""+e}}(a,c)}),s&&u.push({t:"div",a:{class:"bw_stat_label"},c:s}),null!=n&&u.push({t:"div",a:{class:"bw_stat_change "+(n>=0?"bw_stat_change_up":"bw_stat_change_down")},c:(n>=0?"↑ +":"↓ ")+n+"%"}),{t:"div",a:{class:b,style:_},c:u,o:{type:"stat-card"}}}function P(e={}){var{content:t,text:a="",placement:s="top",className:n=""}=e;return{t:"span",a:{class:("bw_tooltip_wrapper "+n).trim()},c:[t,{t:"span",a:{class:"bw_tooltip bw_tooltip_"+s,role:"tooltip"},c:a}],o:{type:"tooltip",mounted:function(e){var t=e.querySelector(".bw_tooltip");e.addEventListener("mouseenter",function(){t.classList.add("bw_tooltip_show")}),e.addEventListener("mouseleave",function(){t.classList.remove("bw_tooltip_show")}),e.addEventListener("focusin",function(){t.classList.add("bw_tooltip_show")}),e.addEventListener("focusout",function(){t.classList.remove("bw_tooltip_show")})}}}}function G(e={}){var{trigger:t,title:a,content:s,placement:n="top",className:c=""}=e,o=[a&&{t:"div",a:{class:"bw_popover_header"},c:a},s&&{t:"div",a:{class:"bw_popover_body"},c:s}].filter(Boolean);return{t:"span",a:{class:("bw_popover_wrapper "+c).trim()},c:[{t:"span",a:{class:"bw_popover_trigger",onclick:function(e){e.target.closest(".bw_popover_wrapper").querySelector(".bw_popover").classList.toggle("bw_popover_show")}},c:t},{t:"div",a:{class:"bw_popover bw_popover_"+n},c:o}],o:{type:"popover",mounted:function(e){var t=function(t){if(!e.contains(t.target)){var a=e.querySelector(".bw_popover");a&&a.classList.remove("bw_popover_show")}};document.addEventListener("click",t),e._bw_outsideHandler=t},unmount:function(e){e._bw_outsideHandler&&document.removeEventListener("click",e._bw_outsideHandler)}}}}function R(e={}){"string"==typeof e&&(e={placeholder:e});var{placeholder:t="Search...",value:a,onSearch:s,onInput:n,id:c,name:o,className:i=""}=e;return{t:"div",a:{class:("bw_search_input "+i).trim()},c:[{t:"input",a:{type:"search",class:"bw_form_control bw_search_field",placeholder:t,value:a,id:c,name:o,onkeydown:function(e){"Enter"===e.key&&s&&(e.preventDefault(),s(e.target.value))},oninput:function(e){var t=e.target.closest(".bw_search_input").querySelector(".bw_search_clear");t&&(t.style.display=e.target.value?"flex":"none"),n&&n(e.target.value)}}},{t:"button",a:{type:"button",class:"bw_search_clear","aria-label":"Clear search",style:a?void 0:"display: none",onclick:function(e){var t=e.target.closest(".bw_search_input").querySelector(".bw_search_field");t.value="",e.target.style.display="none",t.focus(),n&&n(""),s&&s("")}},c:"×"}],o:{type:"search-input"}}}function F(e={}){var{min:t=0,max:a=100,step:s=1,value:n=50,label:c,showValue:o=!1,id:i,name:r,disabled:l=!1,className:d="",..._}=e,b=[];if(c||o){var u=[];c&&u.push({t:"span",c:c}),o&&u.push({t:"span",a:{class:"bw_range_value"},c:""+n}),b.push({t:"div",a:{class:"bw_range_label"},c:u})}var m=_.oninput;return o&&(_.oninput=function(e){var t=e.target.closest(".bw_range_wrapper").querySelector(".bw_range_value");t&&(t.textContent=e.target.value),m&&m(e)}),b.push({t:"input",a:{type:"range",class:"bw_range",min:t,max:a,step:s,value:n,id:i,name:r,disabled:l,..._}}),{t:"div",a:{class:("bw_range_wrapper "+d).trim()},c:b,o:{type:"range"}}}function M(e={}){var{src:t,alt:a="",title:s,content:n,reverse:c=!1,imageSize:o="3rem",className:i=""}=e,r=t?{t:"img",a:{class:"bw_media_img",src:t,alt:a,style:"width:"+o+";height:"+o}}:null,l={t:"div",a:{class:"bw_media_body"},c:[s&&{t:"h5",a:{class:"bw_media_title"},c:s},n].filter(Boolean)};return{t:"div",a:{class:("bw_media "+(c?"bw_media_reverse ":"")+i).trim()},c:c?[l,r].filter(Boolean):[r,l].filter(Boolean),o:{type:"media-object"}}}function U(e={}){var{accept:t,multiple:a=!1,onFiles:s,text:n="Drop files here or click to browse",id:c,className:o=""}=e;return{t:"div",a:{class:("bw_file_upload "+o).trim(),tabindex:"0",role:"button","aria-label":n},c:[{t:"div",a:{class:"bw_file_upload_icon"},c:"📁"},{t:"div",a:{class:"bw_file_upload_text"},c:n},{t:"input",a:{type:"file",class:"bw_file_upload_input",accept:t,multiple:a,id:c,onchange:function(e){s&&e.target.files.length&&s(e.target.files)}}}],o:{type:"file-upload",mounted:function(e){var t=e.querySelector(".bw_file_upload_input");e.addEventListener("click",function(e){e.target!==t&&t.click()}),e.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.click())}),e.addEventListener("dragover",function(t){t.preventDefault(),e.classList.add("bw_file_upload_active")}),e.addEventListener("dragleave",function(){e.classList.remove("bw_file_upload_active")}),e.addEventListener("drop",function(t){t.preventDefault(),e.classList.remove("bw_file_upload_active"),s&&t.dataTransfer.files.length&&s(t.dataTransfer.files)})}}}}function X(e={}){var{items:a=[],className:s=""}=e;return{t:"div",a:{class:("bw_timeline "+s).trim()},c:a.map(function(e){return{t:"div",a:{class:"bw_timeline_item"},c:[{t:"div",a:{class:"bw_timeline_marker "+t(e.variant||"primary")}},{t:"div",a:{class:"bw_timeline_content"},c:[e.date&&{t:"div",a:{class:"bw_timeline_date"},c:e.date},e.title&&{t:"h5",a:{class:"bw_timeline_title"},c:e.title},e.content&&("string"==typeof e.content?{t:"p",a:{class:"bw_timeline_text"},c:e.content}:e.content)].filter(Boolean)}]}}),o:{type:"timeline"}}}function V(e={}){var{steps:t=[],currentStep:a=0,className:s=""}=e;return{t:"div",a:{class:("bw_stepper "+s).trim(),role:"list"},c:t.map(function(e,t){var s=t<a?"completed":t===a?"active":"pending";return{t:"div",a:{class:"bw_step bw_step_"+s,role:"listitem","aria-current":"active"===s?"step":void 0},c:[{t:"div",a:{class:"bw_step_indicator"},c:"completed"===s?"✓":""+(t+1)},{t:"div",a:{class:"bw_step_body"},c:[{t:"div",a:{class:"bw_step_label"},c:e.label},e.description&&{t:"div",a:{class:"bw_step_description"},c:e.description}].filter(Boolean)}]}}),o:{type:"stepper"}}}function J(e={}){var{chips:t=[],placeholder:a="Add...",onAdd:s,onRemove:n,className:c=""}=e;return{t:"div",a:{class:("bw_chip_input "+c).trim()},c:[...t.map(function(e){return{t:"span",a:{class:"bw_chip","data-chip-value":e},c:[e,{t:"button",a:{type:"button",class:"bw_chip_remove","aria-label":"Remove "+e,onclick:function(e){var t=e.target.closest(".bw_chip"),a=t.getAttribute("data-chip-value");t.parentNode.removeChild(t),n&&n(a)}},c:"×"}]}}),{t:"input",a:{type:"text",class:"bw_chip_field",placeholder:a,onkeydown:function(e){if("Enter"===e.key&&e.target.value.trim()){e.preventDefault();var t=e.target.value.trim(),a=e.target.closest(".bw_chip_input"),c=document.createElement("span");c.className="bw_chip",c.setAttribute("data-chip-value",t),c.innerHTML="",c.textContent=t;var o=document.createElement("button");o.type="button",o.className="bw_chip_remove",o.setAttribute("aria-label","Remove "+t),o.textContent="×",o.onclick=function(){c.parentNode.removeChild(c),n&&n(t)},c.appendChild(o),a.insertBefore(c,e.target),e.target.value="",s&&s(t)}if("Backspace"===e.key&&!e.target.value){var i=(a=e.target.closest(".bw_chip_input")).querySelectorAll(".bw_chip");if(i.length){var r=i[i.length-1],l=r.getAttribute("data-chip-value");r.parentNode.removeChild(r),n&&n(l)}}}}}],o:{type:"chip-input"}}}var K={card:{make:a},button:{make:s},container:{make:n},row:{make:c},col:{make:o},nav:{make:i},navbar:{make:r},tabs:{make:l},alert:{make:d},badge:{make:_},progress:{make:b},listGroup:{make:u},breadcrumb:{make:m},form:{make:p},formGroup:{make:w},input:{make:v},textarea:{make:f},select:{make:h},checkbox:{make:g},stack:{make:k},spinner:{make:y},hero:{make:x},featureGrid:{make:$},cta:{make:L},section:{make:N},codeDemo:{make:C},pagination:{make:B},radio:{make:A},buttonGroup:{make:S},accordion:{make:E},modal:{make:I},toast:{make:q},dropdown:{make:H},switch:{make:j},skeleton:{make:T},avatar:{make:D},carousel:{make:z},statCard:{make:O},tooltip:{make:P},popover:{make:G},searchInput:{make:R},range:{make:F},mediaObject:{make:M},fileUpload:{make:U},timeline:{make:X},stepper:{make:V},chipInput:{make:J}};function Q(e,t){var a=K[e];if(!a)throw new Error('bw.make: unknown component type "'+e+'". Available: '+Object.keys(K).join(", "));var s=a.make(t||{});return s&&"object"==typeof s&&(s._bwFactory={type:e,props:t||{}}),s}var W=Object.freeze({__proto__:null,BCCL:K,make:Q,makeAccordion:E,makeAlert:d,makeAvatar:D,makeBadge:_,makeBreadcrumb:m,makeButton:s,makeButtonGroup:S,makeCTA:L,makeCard:a,makeCarousel:z,makeCheckbox:g,makeChipInput:J,makeCodeDemo:C,makeCol:o,makeContainer:n,makeDropdown:H,makeFeatureGrid:$,makeFileUpload:U,makeForm:p,makeFormGroup:w,makeHero:x,makeInput:v,makeListGroup:u,makeMediaObject:M,makeModal:I,makeNav:i,makeNavbar:r,makePagination:B,makePopover:G,makeProgress:b,makeRadio:A,makeRange:F,makeRow:c,makeSearchInput:R,makeSection:N,makeSelect:h,makeSkeleton:T,makeSpinner:y,makeStack:k,makeStatCard:O,makeStepper:V,makeSwitch:j,makeTabs:l,makeTextarea:f,makeTimeline:X,makeToast:q,makeTooltip:P,variantClass:t});
20
+ */function t(e){return e?0===e.indexOf("outline")?"bw_btn_outline bw_"+e.replace(/^outline[_-]/,""):"bw_"+e:""}function a(e={}){const{title:a,subtitle:n,content:o,footer:s,header:c,image:r,imagePosition:i="top",variant:l,bordered:_=!0,shadow:d,hoverable:b=!1,className:u="",style:w,headerClass:p="",bodyClass:m="",footerClass:v=""}=e,f=["bw_card",t(l),d&&{none:"",sm:"bw_shadow_sm",md:"bw_shadow",lg:"bw_shadow_lg"}[d]||"",_?"":"bw_border_0",b?"bw_card_hoverable":"",u].filter(Boolean).join(" ").trim(),h=[c&&{t:"div",a:{class:`bw_card_header ${p}`.trim()},c:c},r&&("top"===i||"left"===i)&&{t:"img",a:{class:`bw_card_img_${i}`,src:r.src,alt:r.alt||""}},{t:"div",a:{class:`bw_card_body ${m}`.trim()},c:[a&&{t:"h5",a:{class:"bw_card_title"},c:a},n&&{t:"h6",a:{class:"bw_card_subtitle bw_mb_2 bw_text_muted"},c:n},o&&(Array.isArray(o)?o:[o])].flat().filter(Boolean)},r&&("bottom"===i||"right"===i)&&{t:"img",a:{class:`bw_card_img_${i}`,src:r.src,alt:r.alt||""}},s&&{t:"div",a:{class:`bw_card_footer ${v}`.trim()},c:s}].filter(Boolean);return!r||"left"!==i&&"right"!==i?{t:"div",a:{class:f,style:w},c:h,o:{type:"card",state:e.state||{},slots:{title:".bw_card_title",content:".bw_card_body",footer:".bw_card_footer"}}}:{t:"div",a:{class:f,style:w},c:{t:"div",a:{class:"bw_row bw_g_0"},c:h},o:{type:"card",state:e.state||{},slots:{title:".bw_card_title",content:".bw_card_body",footer:".bw_card_footer"}}}}function n(e={}){"string"==typeof e&&(e={text:e});const{text:a,variant:n="primary",size:o,disabled:s=!1,onclick:c,type:r="button",className:i="",style:l}=e;return{t:"button",a:{type:r,class:["bw_btn",t(n),o&&`bw_btn_${o}`,i].filter(Boolean).join(" "),disabled:s,onclick:c,style:l},c:a,o:{type:"button"}}}function o(e={}){const{fluid:t=!1,children:a,className:n=""}=e;return{t:"div",a:{class:`bw_container${t?"-fluid":""} ${n}`.trim()},c:a}}function s(e={}){const{children:t,className:a="",gap:n}=e;return{t:"div",a:{class:`bw_row ${n?`bw_g_${n}`:""} ${a}`.trim()},c:t}}function c(e={}){const{size:t,offset:a,push:n,pull:o,content:s,children:c,className:r=""}=e,i=[];return"object"==typeof t?Object.entries(t).forEach(([e,t])=>{"xs"===e?i.push(`bw_col_${t}`):i.push(`bw_col_${e}_${t}`)}):t?i.push(`bw_col_${t}`):i.push("bw_col"),a&&i.push(`bw_offset_${a}`),n&&i.push(`bw_push_${n}`),o&&i.push(`bw_pull_${o}`),{t:"div",a:{class:`${i.join(" ")} ${r}`.trim()},c:s||c}}function r(e={}){const{items:t=[],pills:a=!1,vertical:n=!1,className:o=""}=e;return{t:"ul",a:{class:`bw_nav ${a?"bw_nav_pills":"bw_nav_tabs"} ${n?"bw_nav_vertical":""} ${o}`.trim()},c:t.map(e=>({t:"li",a:{class:"bw_nav_item"},c:{t:"a",a:{href:e.href||"#",class:`bw_nav_link ${e.active?"active":""} ${e.disabled?"disabled":""}`.trim()},c:e.text}}))}}function i(e={}){const{brand:t,brandHref:a="#",items:n=[],dark:o=!0,className:s=""}=e;return{t:"nav",a:{class:`bw_navbar ${o?"bw_navbar_dark":"bw_navbar_light"} ${s}`.trim()},c:{t:"div",a:{class:"bw_container"},c:[t&&{t:"a",a:{href:a,class:"bw_navbar_brand"},c:t},n.length>0&&{t:"div",a:{class:"bw_navbar_nav"},c:n.map(e=>({t:"a",a:{href:e.href||"#",class:"bw_nav_link "+(e.active?"active":"")},c:e.text}))}].filter(Boolean)},o:{type:"navbar",state:{activeItem:n.findIndex(e=>e.active)}}}}function l(e={}){const{tabs:t=[],activeIndex:a=0}=e;let n=a;function o(e,t){var a=e.querySelectorAll(".bw_nav_link"),n=e.querySelectorAll(".bw_tab_pane");t<0||t>=a.length||(a.forEach(function(e){e.classList.remove("active"),e.setAttribute("aria-selected","false"),e.setAttribute("tabindex","-1")}),n.forEach(function(e){e.classList.remove("active")}),a[t].classList.add("active"),a[t].setAttribute("aria-selected","true"),a[t].setAttribute("tabindex","0"),n[t].classList.add("active"),e._bw_state&&(e._bw_state.activeIndex=t))}return t.forEach((e,t)=>{e.active&&(n=t)}),{t:"div",a:{class:"bw_tabs"},c:[{t:"ul",a:{class:"bw_nav bw_nav_tabs",role:"tablist"},c:t.map((e,t)=>({t:"li",a:{class:"bw_nav_item",role:"presentation"},c:{t:"button",a:{class:"bw_nav_link "+(t===n?"active":""),type:"button",role:"tab",tabindex:t===n?"0":"-1","aria-selected":t===n?"true":"false",onclick:e=>{o(e.target.closest(".bw_tabs"),t)}},c:e.label}}))},{t:"div",a:{class:"bw_tab_content"},c:t.map((e,t)=>({t:"div",a:{class:"bw_tab_pane "+(t===n?"active":""),role:"tabpanel"},c:e.content}))}],o:{type:"tabs",state:{activeIndex:n},handle:{setActiveTab:o,getActiveTab:function(e){return e._bw_state&&e._bw_state.activeIndex||0}},mounted:function(e){var t=e.querySelector('[role="tablist"]');t&&t.addEventListener("keydown",function(e){for(var a=t.querySelectorAll('[role="tab"]'),n=-1,o=0;o<a.length;o++)if(a[o]===e.target){n=o;break}if(-1!==n){var s=-1;"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),s=n>0?n-1:a.length-1):"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),s=n<a.length-1?n+1:0):"Home"===e.key?(e.preventDefault(),s=0):"End"===e.key&&(e.preventDefault(),s=a.length-1),s>=0&&(a[s].focus(),a[s].click())}})}}}}function _(e={}){"string"==typeof e&&(e={content:e});const{content:a,variant:n="info",dismissible:o=!1,className:s=""}=e;return{t:"div",a:{class:`bw_alert ${t(n)} ${o?"bw_alert_dismissible":""} ${s}`.trim(),role:"alert"},c:[a,o&&{t:"button",a:{type:"button",class:"bw_close","aria-label":"Close",onclick:function(e){var t=e.target.closest(".bw_alert");t&&t.remove()}},c:"×"}].filter(Boolean),o:{type:"alert",handle:{dismiss:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}}}}}function d(e={}){"string"==typeof e&&(e={text:e});const{text:a,variant:n="primary",size:o,pill:s=!1,className:c=""}=e,r="sm"===o?" bw_badge_sm":"lg"===o?" bw_badge_lg":"";return{t:"span",a:{class:`bw_badge ${t(n)}${r} ${s?"bw_badge_pill":""} ${c}`.trim()},c:a}}function b(e={}){const{value:a=0,max:n=100,variant:o="primary",striped:s=!1,animated:c=!1,label:r,height:i}=e,l=Math.round(a/n*100);return{t:"div",a:{class:"bw_progress",style:i?{height:`${i}px`}:void 0},c:{t:"div",a:{class:["bw_progress_bar",t(o),s&&"bw_progress_bar_striped",c&&"bw_progress_bar_animated"].filter(Boolean).join(" "),role:"progressbar",style:{width:`${l}%`},"aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":n},c:r||`${l}%`},o:{type:"progress",handle:{setValue:function(e,t){var a=e.querySelector(".bw_progress_bar");if(a){var n=parseInt(a.getAttribute("aria-valuemax"))||100,o=Math.round(t/n*100);a.style.width=o+"%",a.setAttribute("aria-valuenow",t),a.textContent=o+"%"}},getValue:function(e){var t=e.querySelector(".bw_progress_bar");return t&&parseInt(t.getAttribute("aria-valuenow"))||0}}}}}function u(e={}){const{items:t=[],flush:a=!1,interactive:n=!1}=e;return{t:"div",a:{class:("bw_list_group "+(a?"bw_list_group_flush":"")).trim()},c:t.map(e=>{const t="object"==typeof e,a=t?e.text:e,o=!!t&&e.active,s=!!t&&e.disabled,c=t?e.href:null,r=t?e.onclick:null;return n||c||r?{t:"a",a:{class:["bw_list_group_item",o&&"active",s&&"disabled"].filter(Boolean).join(" "),href:c||"#",onclick:r||(e=>{c||e.preventDefault()}),style:s?"pointer-events: none; opacity: 0.65;":""},c:a}:{t:"div",a:{class:["bw_list_group_item",o&&"active",s&&"disabled"].filter(Boolean).join(" ")},c:a}})}}function w(e={}){const{items:t=[]}=e;return{t:"nav",a:{"aria-label":"breadcrumb"},c:{t:"ol",a:{class:"bw_breadcrumb"},c:t.map((e,t)=>({t:"li",a:{class:"bw_breadcrumb_item "+(e.active?"active":""),"aria-current":e.active?"page":void 0},c:e.active?e.text:{t:"a",a:{href:e.href||"#"},c:e.text}}))}}}function p(e={}){const{children:t,onsubmit:a,className:n=""}=e;return{t:"form",a:{class:n,onsubmit:a||(e=>e.preventDefault())},c:t}}function m(e={}){var{label:t,input:a,help:n,id:o,validation:s,feedback:c,required:r}=e,i=a;if(s&&a&&a.a){i={t:a.t,a:Object.assign({},a.a),c:a.c,o:a.o};var l="valid"===s?"bw_is_valid":"invalid"===s?"bw_is_invalid":"";l&&(i.a.class=((i.a.class||"")+" "+l).trim())}return{t:"div",a:{class:"bw_form_group"},c:[t&&{t:"label",a:{for:o,class:"bw_form_label"},c:r?[t,{t:"span",a:{class:"bw_text_danger bw_ms_1"},c:"*"}]:t},i,c&&s&&{t:"div",a:{class:"valid"===s?"bw_valid_feedback":"bw_invalid_feedback"},c:c},n&&{t:"small",a:{class:"bw_form_text bw_text_muted"},c:n}].filter(Boolean)}}function v(e={}){const{type:t="text",placeholder:a,value:n,id:o,name:s,disabled:c=!1,readonly:r=!1,required:i=!1,className:l="",style:_,...d}=e;return{t:"input",a:{type:t,class:`bw_form_control ${l}`.trim(),placeholder:a,value:n,id:o,name:s,style:_,disabled:c,readonly:r,required:i,...d}}}function f(e={}){const{placeholder:t,value:a,rows:n=3,id:o,name:s,disabled:c=!1,readonly:r=!1,required:i=!1,className:l="",..._}=e;return{t:"textarea",a:{class:`bw_form_control ${l}`.trim(),placeholder:t,rows:n,id:o,name:s,disabled:c,readonly:r,required:i,..._},c:a}}function h(e={}){const{options:t=[],value:a,id:n,name:o,disabled:s=!1,required:c=!1,className:r="",...i}=e;return{t:"select",a:{class:`bw_form_control ${r}`.trim(),id:n,name:o,disabled:s,required:c,...i},c:t.map(e=>({t:"option",a:{value:e.value,selected:e.value===a},c:e.text||e.value}))}}function g(e={}){const{label:t,checked:a=!1,id:n,name:o,disabled:s=!1,value:c,className:r="",...i}=e;return{t:"div",a:{class:`bw_form_check ${r}`.trim()},c:[{t:"input",a:{type:"checkbox",class:"bw_form_check_input",checked:a,id:n,name:o,disabled:s,value:c,...i}},t&&{t:"label",a:{class:"bw_form_check_label",for:n},c:t}].filter(Boolean)}}function y(e={}){const{children:t,direction:a="vertical",gap:n=3,className:o=""}=e;return{t:"div",a:{class:`bw_${"vertical"===a?"vstack":"hstack"} bw_gap_${n} ${o}`.trim()},c:t}}function k(e={}){const{variant:a="primary",size:n="md",type:o="border"}=e;return{t:"div",a:{class:`bw_spinner_${o} bw_spinner_${o}-${n} ${t(a)}`,role:"status"},c:{t:"span",a:{class:"bw_visually_hidden"},c:"Loading..."}}}function x(e={}){const{title:a,subtitle:n,content:o,variant:s="primary",size:c="lg",centered:r=!0,overlay:i=!1,backgroundImage:l,actions:_,className:d=""}=e,b={sm:"bw_py_3",md:"bw_py_4",lg:"bw_py_5",xl:"bw_py_6"};return{t:"section",a:{class:`bw_hero ${t(s)} ${b[c]||b.lg} ${r?"bw_text_center":""} ${d}`.trim(),style:l?`background-image: url('${l}'); background-size: cover; background-position: center;`:void 0},c:[i&&{t:"div",a:{class:"bw_hero_overlay"}},{t:"div",a:{class:"bw_container"},c:{t:"div",a:{class:"bw_hero_content"},c:[a&&{t:"h1",a:{class:"bw_hero_title bw_display_4 bw_mb_3"},c:a},n&&{t:"p",a:{class:"bw_hero_subtitle bw_lead bw_mb_4"},c:n},o,_&&{t:"div",a:{class:"bw_hero_actions bw_mt_4"},c:_}].filter(Boolean)}}].filter(Boolean)}}function $(e={}){const{features:t=[],columns:a=3,centered:n=!0,iconSize:o="3rem",className:s=""}=e,c="bw_col_md_"+12/a;return{t:"div",a:{class:`bw_feature_grid ${s}`.trim()},c:{t:"div",a:{class:"bw_row bw_g_4"},c:t.map(e=>({t:"div",a:{class:c},c:{t:"div",a:{class:"bw_feature "+(n?"bw_text_center":"")},c:[e.icon&&{t:"div",a:{class:"bw_feature_icon bw_mb_3 bw_text_primary",style:`font-size: ${o};`},c:e.icon},e.title&&{t:"h3",a:{class:"bw_feature_title bw_h5 bw_mb_2"},c:e.title},e.description&&{t:"p",a:{class:"bw_feature_description bw_text_muted"},c:e.description}].filter(Boolean)}}))}}}function L(e={}){const{title:t,description:a,actions:n,variant:o="light",centered:s=!0,className:c=""}=e;return{t:"section",a:{class:`bw_cta bw_bg_${o} bw_py_5 ${c}`.trim()},c:{t:"div",a:{class:"bw_container"},c:{t:"div",a:{class:"bw_cta_content "+(s?"bw_text_center":"")},c:[t&&{t:"h2",a:{class:"bw_cta_title bw_mb_3"},c:t},a&&{t:"p",a:{class:"bw_cta_description bw_lead bw_mb_4"},c:a},n&&{t:"div",a:{class:"bw_cta_actions"},c:n}].filter(Boolean)}}}}function C(e={}){const{title:t,subtitle:a,content:n,variant:o="default",spacing:s="md",className:c=""}=e,r={sm:"bw_py_3",md:"bw_py_4",lg:"bw_py_5",xl:"bw_py_6"};return{t:"section",a:{class:`bw_section ${r[s]||r.md} ${"default"!==o?`bw_bg_${o}`:""} ${c}`.trim()},c:{t:"div",a:{class:"bw_container"},c:[(t||a)&&{t:"div",a:{class:"bw_section_header bw_text_center bw_mb_5"},c:[t&&{t:"h2",a:{class:"bw_section_title"},c:t},a&&{t:"p",a:{class:"bw_section_subtitle bw_text_muted"},c:a}].filter(Boolean)},n].filter(Boolean)}}}function N(e={}){const{title:t,description:a,code:n,result:o,language:s="javascript"}=e;Math.random().toString(36).substr(2,9);const c=[{label:"Result",active:!0,content:o}];n&&c.push({label:"Code",content:{t:"div",a:{style:"position: relative;"},c:[{t:"button",a:{class:"bw_copy_btn bw_code_copy_btn",onclick:function(e){navigator.clipboard.writeText(n).then(function(){var t=e.target,a=t.textContent;t.textContent="Copied!",t.classList.add("bw_code_copy_btn_copied"),setTimeout(function(){t.textContent=a,t.classList.remove("bw_code_copy_btn_copied")},2e3)})}},c:"Copy"},"undefined"!=typeof globalThis&&void 0!==globalThis.bw&&"function"==typeof globalThis.bw.codeEditor?globalThis.bw.codeEditor({code:n,lang:"javascript"===s?"js":s,readOnly:!0,height:"auto"}):{t:"pre",a:{class:"bw_code_pre"},c:{t:"code",a:{class:`bw_code_block language-${s}`},c:n}}]}});return{t:"div",a:{class:"bw_code_demo"},c:[t&&{t:"h3",c:t},a&&{t:"p",a:{class:"bw_text_muted bw_mb_3"},c:a},l({tabs:c})].filter(Boolean)}}function S(e={}){const{pages:t=1,currentPage:a=1,onPageChange:n,size:o,className:s=""}=e;function c(e){return function(o){o.preventDefault(),e<1||e>t||e===a||n&&n(e)}}const r=[];r.push({t:"li",a:{class:("bw_page_item "+(a<=1?"bw_disabled":"")).trim()},c:{t:"button",a:{class:"bw_page_link",type:"button",onclick:c(a-1),"aria-label":"Previous",disabled:a<=1||void 0},c:"‹"}});for(var i=1;i<=t;i++)(function(e){r.push({t:"li",a:{class:("bw_page_item "+(e===a?"bw_active":"")).trim()},c:{t:"button",a:{class:"bw_page_link",type:"button",onclick:c(e),"aria-current":e===a?"page":void 0},c:""+e}})})(i);return r.push({t:"li",a:{class:("bw_page_item "+(a>=t?"bw_disabled":"")).trim()},c:{t:"button",a:{class:"bw_page_link",type:"button",onclick:c(a+1),"aria-label":"Next",disabled:a>=t||void 0},c:"›"}}),{t:"nav",a:{"aria-label":"Pagination"},c:{t:"ul",a:{class:`bw_pagination ${o?"bw_pagination_"+o:""} ${s}`.trim()},c:r},o:{type:"pagination",state:{currentPage:a,pages:t},handle:{setPage:function(e,a){if(!(a<1||a>t)){for(var o=e.querySelectorAll(".bw_page_item"),s=0;s<o.length;s++)o[s].classList.remove("bw_active");o[a]&&o[a].classList.add("bw_active"),e._bw_state&&(e._bw_state.currentPage=a),n&&n(a)}},getPage:function(e){return e._bw_state&&e._bw_state.currentPage||1}}}}}function A(e={}){const{label:t,name:a,value:n,checked:o=!1,id:s,disabled:c=!1,className:r="",...i}=e;return{t:"div",a:{class:`bw_form_check ${r}`.trim()},c:[{t:"input",a:{type:"radio",class:"bw_form_check_input",name:a,value:n,checked:o,id:s,disabled:c,...i}},t&&{t:"label",a:{class:"bw_form_check_label",for:s},c:t}].filter(Boolean)}}function I(e={}){const{children:t,size:a,vertical:n=!1,className:o=""}=e;return{t:"div",a:{class:`${n?"bw_btn_group_vertical":"bw_btn_group"} ${a?"bw_btn_group_"+a:""} ${o}`.trim(),role:"group"},c:t}}function B(e={}){const{items:t=[],multiOpen:a=!1,className:n=""}=e;return{t:"div",a:{class:`bw_accordion ${n}`.trim()},c:t.map(function(e,t){return{t:"div",a:{class:"bw_accordion_item"},c:[{t:"h2",a:{class:"bw_accordion_header"},c:{t:"button",a:{class:("bw_accordion_button "+(e.open?"":"bw_collapsed")).trim(),type:"button","aria-expanded":e.open?"true":"false",onclick:function(e){var t=e.target.closest(".bw_accordion_button"),n=t.closest(".bw_accordion"),o=t.closest(".bw_accordion_item"),s=o.querySelector(".bw_accordion_collapse"),c=s.classList.contains("bw_collapse_show");if(!a)for(var r=n.querySelectorAll(".bw_accordion_item"),i=0;i<r.length;i++)if(r[i]!==o){var l=r[i].querySelector(".bw_accordion_collapse"),_=r[i].querySelector(".bw_accordion_button");l.classList.contains("bw_collapse_show")&&(l.style.maxHeight=l.scrollHeight+"px",l.offsetHeight,l.style.maxHeight="0px",l.classList.remove("bw_collapse_show"),_.classList.add("bw_collapsed"),_.setAttribute("aria-expanded","false"))}if(c)s.style.maxHeight=s.scrollHeight+"px",s.offsetHeight,s.style.maxHeight="0px",s.classList.remove("bw_collapse_show"),t.classList.add("bw_collapsed"),t.setAttribute("aria-expanded","false");else{s.classList.add("bw_collapse_show"),s.style.maxHeight="0px",s.offsetHeight,s.style.maxHeight=s.scrollHeight+"px",t.classList.remove("bw_collapsed"),t.setAttribute("aria-expanded","true");var d=function(e){"max-height"===e.propertyName&&s.classList.contains("bw_collapse_show")&&(s.style.maxHeight="none"),s.removeEventListener("transitionend",d)};s.addEventListener("transitionend",d)}}},c:e.title}},{t:"div",a:{class:("bw_accordion_collapse "+(e.open?"bw_collapse_show":"")).trim()},c:{t:"div",a:{class:"bw_accordion_body"},c:e.content},o:e.open?{mounted:function(e){e.style.maxHeight="none"}}:void 0}]}}),o:{type:"accordion",state:{multiOpen:a},handle:{toggle:function(e,t){var a=e.querySelectorAll(".bw_accordion_item");if(!(t<0||t>=a.length)){var n=a[t].querySelector(".bw_accordion_button");n&&n.click()}},openAll:function(e){for(var t=e.querySelectorAll(".bw_accordion_item"),a=0;a<t.length;a++){var n=t[a].querySelector(".bw_accordion_collapse"),o=t[a].querySelector(".bw_accordion_button");n.classList.contains("bw_collapse_show")||(n.classList.add("bw_collapse_show"),n.style.maxHeight="none",o.classList.remove("bw_collapsed"),o.setAttribute("aria-expanded","true"))}},closeAll:function(e){for(var t=e.querySelectorAll(".bw_accordion_item"),a=0;a<t.length;a++){var n=t[a].querySelector(".bw_accordion_collapse"),o=t[a].querySelector(".bw_accordion_button");n.classList.contains("bw_collapse_show")&&(n.style.maxHeight=n.scrollHeight+"px",n.offsetHeight,n.style.maxHeight="0px",n.classList.remove("bw_collapse_show"),o.classList.add("bw_collapsed"),o.setAttribute("aria-expanded","false"))}}}}}}function q(e={}){const{title:t,content:a,footer:n,size:o,closeButton:s=!0,onClose:c,className:r=""}=e;function i(e){var t=e.closest(".bw_modal");t&&(t.classList.remove("bw_modal_show"),document.body.style.overflow=""),c&&c()}return{t:"div",a:{class:`bw_modal ${r}`.trim()},c:{t:"div",a:{class:("bw_modal_dialog "+(o?"bw_modal_"+o:"")).trim()},c:{t:"div",a:{class:"bw_modal_content"},c:[(t||s)&&{t:"div",a:{class:"bw_modal_header"},c:[t&&{t:"h5",a:{class:"bw_modal_title"},c:t},s&&{t:"button",a:{type:"button",class:"bw_close","aria-label":"Close",onclick:function(e){i(e.target)}},c:"×"}].filter(Boolean)},a&&{t:"div",a:{class:"bw_modal_body"},c:a},n&&{t:"div",a:{class:"bw_modal_footer"},c:n}].filter(Boolean)}},o:{type:"modal",handle:{open:function(e){e.classList.add("bw_modal_show"),e.style.display="flex",document.body.style.overflow="hidden"},close:function(e){i(e)}},mounted:function(e){e.addEventListener("click",function(t){t.target===e&&i(e)});var t=function(t){"Escape"===t.key&&e.classList.contains("bw_modal_show")&&i(e)};document.addEventListener("keydown",t),e._bw_escHandler=t},unmount:function(e){e._bw_escHandler&&document.removeEventListener("keydown",e._bw_escHandler),document.body.style.overflow=""}}}}function E(e={}){const{title:a,content:n,variant:o="info",autoDismiss:s=!0,delay:c=5e3,position:r="top-right",className:i=""}=e;return{t:"div",a:{class:`bw_toast ${t(o)} bw_toast_${r.replace(/-/g,"_")} ${i}`.trim(),role:"alert"},c:[a&&{t:"div",a:{class:"bw_toast_header"},c:[{t:"strong",c:a},{t:"button",a:{type:"button",class:"bw_close","aria-label":"Close",onclick:function(e){var t=e.target.closest(".bw_toast");t&&(t.classList.add("bw_toast_hiding"),setTimeout(function(){t.parentNode&&t.parentNode.removeChild(t)},300))}},c:"×"}]},n&&{t:"div",a:{class:"bw_toast_body"},c:n}].filter(Boolean),o:{type:"toast",handle:{dismiss:function(e){e.classList.add("bw_toast_hiding"),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},300)}},mounted:function(e){requestAnimationFrame(function(){e.classList.add("bw_toast_show")}),s&&setTimeout(function(){e.classList.add("bw_toast_hiding"),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},300)},c)}}}}function H(e={}){const{trigger:a,items:n=[],align:o="start",variant:s="primary",className:c=""}=e;var r;return r="string"==typeof a||void 0===a?{t:"button",a:{class:`bw_btn ${t(s)} bw_dropdown_toggle`,type:"button",onclick:function(e){e.target.closest(".bw_dropdown").querySelector(".bw_dropdown_menu").classList.toggle("bw_dropdown_show")}},c:a||"Dropdown"}:a,{t:"div",a:{class:`bw_dropdown ${c}`.trim()},c:[r,{t:"div",a:{class:("bw_dropdown_menu "+("end"===o?"bw_dropdown_menu_end":"")).trim()},c:n.map(function(e){return e.divider?{t:"hr",a:{class:"bw_dropdown_divider"}}:{t:"a",a:{class:("bw_dropdown_item "+(e.disabled?"disabled":"")).trim(),href:e.href||"#",onclick:e.disabled?void 0:function(t){e.href||t.preventDefault(),t.target.closest(".bw_dropdown").querySelector(".bw_dropdown_menu").classList.remove("bw_dropdown_show"),e.onclick&&e.onclick(t)}},c:e.text}})}],o:{type:"dropdown",mounted:function(e){var t=function(t){if(!e.contains(t.target)){var a=e.querySelector(".bw_dropdown_menu");a&&a.classList.remove("bw_dropdown_show")}};document.addEventListener("click",t),e._bw_outsideHandler=t},unmount:function(e){e._bw_outsideHandler&&document.removeEventListener("click",e._bw_outsideHandler)}}}}function T(e={}){const{label:t,checked:a=!1,id:n,name:o,disabled:s=!1,className:c="",...r}=e;return{t:"div",a:{class:`bw_form_check bw_form_switch ${c}`.trim()},c:[{t:"input",a:{type:"checkbox",class:"bw_form_check_input bw_switch_input",role:"switch",checked:a,id:n,name:o,disabled:s,...r}},t&&{t:"label",a:{class:"bw_form_check_label",for:n},c:t}].filter(Boolean)}}function j(e={}){const{variant:t="text",width:a,height:n,count:o=1,className:s=""}=e;if("circle"===t){var c=a||n||"3rem";return{t:"div",a:{class:`bw_skeleton bw_skeleton_circle ${s}`.trim(),style:{width:c,height:c}}}}if("rect"===t)return{t:"div",a:{class:`bw_skeleton bw_skeleton_rect ${s}`.trim(),style:{width:a||"100%",height:n||"120px"}}};if(1===o)return{t:"div",a:{class:`bw_skeleton bw_skeleton_text ${s}`.trim(),style:{width:a||"100%",height:n||"1em"}}};for(var r=[],i=0;i<o;i++)r.push({t:"div",a:{class:"bw_skeleton bw_skeleton_text",style:{width:i===o-1?"75%":a||"100%",height:n||"1em"}}});return{t:"div",a:{class:`bw_skeleton_group ${s}`.trim()},c:r}}function D(e={}){const{src:a,alt:n="",initials:o,size:s="md",variant:c="primary",className:r=""}=e;return a?{t:"img",a:{class:`bw_avatar bw_avatar_${s} ${r}`.trim(),src:a,alt:n}}:{t:"div",a:{class:`bw_avatar bw_avatar_${s} ${t(c)} ${r}`.trim()},c:o||""}}function z(e={}){const{items:t=[],showControls:a=!0,showIndicators:n=!0,autoPlay:o=!1,interval:s=5e3,height:c="300px",startIndex:r=0,className:i=""}=e;function l(e,t){var a=e.querySelectorAll(".bw_carousel_slide").length;t<0&&(t=a-1),t>=a&&(t=0),e._bw_carouselIndex=t,e.querySelector(".bw_carousel_track").style.transform="translateX(-"+100*t+"%)";for(var n=e.querySelectorAll(".bw_carousel_indicator"),o=0;o<n.length;o++)o===t?n[o].classList.add("active"):n[o].classList.remove("active")}var _=t.map(function(e){var t=[e.content,e.caption&&{t:"div",a:{class:"bw_carousel_caption"},c:e.caption}].filter(Boolean);return{t:"div",a:{class:"bw_carousel_slide"},c:1===t.length?t[0]:t}}),d=[{t:"div",a:{class:"bw_carousel_track",style:"transform: translateX(-"+100*r+"%)"},c:_}];return a&&t.length>1&&(d.push({t:"button",a:{class:"bw_carousel_control bw_carousel_control_prev",type:"button","aria-label":"Previous slide",onclick:function(e){var t=e.target.closest(".bw_carousel");l(t,(t._bw_carouselIndex||0)-1)}},c:{t:"img",a:{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e",alt:"",role:"presentation"}}}),d.push({t:"button",a:{class:"bw_carousel_control bw_carousel_control_next",type:"button","aria-label":"Next slide",onclick:function(e){var t=e.target.closest(".bw_carousel");l(t,(t._bw_carouselIndex||0)+1)}},c:{t:"img",a:{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e",alt:"",role:"presentation"}}})),n&&t.length>1&&d.push({t:"div",a:{class:"bw_carousel_indicators"},c:t.map(function(e,t){return{t:"button",a:{class:"bw_carousel_indicator"+(t===r?" active":""),type:"button","aria-label":"Go to slide "+(t+1),onclick:function(e){l(e.target.closest(".bw_carousel"),t)}}}})}),{t:"div",a:{class:("bw_carousel "+i).trim(),style:"height: "+c,tabindex:"0","aria-roledescription":"carousel"},c:d,o:{type:"carousel",state:{activeIndex:r,autoPlay:o,interval:s},handle:{goToSlide:function(e,t){l(e,t)},next:function(e){l(e,(e._bw_carouselIndex||0)+1)},prev:function(e){l(e,(e._bw_carouselIndex||0)-1)},getActiveIndex:function(e){return e._bw_carouselIndex||0},pause:function(e){e._bw_carouselInterval&&(clearInterval(e._bw_carouselInterval),e._bw_carouselInterval=null)},play:function(e){if(!e._bw_carouselInterval&&e._bw_state){var t=e._bw_state.interval||5e3;e._bw_carouselInterval=setInterval(function(){l(e,(e._bw_carouselIndex||0)+1)},t)}}},mounted:function(e){if(e._bw_carouselIndex=r,e.addEventListener("keydown",function(t){var a=e._bw_carouselIndex||0;"ArrowLeft"===t.key?(t.preventDefault(),l(e,a-1)):"ArrowRight"===t.key&&(t.preventDefault(),l(e,a+1))}),o){var t=setInterval(function(){var t=e._bw_carouselIndex||0;l(e,t+1)},s);e._bw_carouselInterval=t,e.addEventListener("mouseenter",function(){e._bw_carouselInterval&&clearInterval(e._bw_carouselInterval)}),e.addEventListener("mouseleave",function(){e._bw_carouselInterval=setInterval(function(){var t=e._bw_carouselIndex||0;l(e,t+1)},s)})}},unmount:function(e){e._bw_carouselInterval&&clearInterval(e._bw_carouselInterval)}}}}function O(e={}){"string"==typeof e&&(e={label:e});var{value:a=0,label:n,change:o,format:s,prefix:c,suffix:r,icon:i,variant:l,className:_="",style:d}=e;var b=["bw_stat_card",t(l),_].filter(Boolean).join(" ").trim(),u=[];return i&&u.push({t:"div",a:{class:"bw_stat_icon"},c:i}),u.push({t:"div",a:{class:"bw_stat_value"},c:function(e,t){if(c||r)return(c||"")+e+(r||"");switch(t){case"currency":return"$"+Number(e).toLocaleString();case"percent":return e+"%";case"number":return Number(e).toLocaleString();default:return""+e}}(a,s)}),n&&u.push({t:"div",a:{class:"bw_stat_label"},c:n}),null!=o&&u.push({t:"div",a:{class:"bw_stat_change "+(o>=0?"bw_stat_change_up":"bw_stat_change_down")},c:(o>=0?"↑ +":"↓ ")+o+"%"}),{t:"div",a:{class:b,style:d},c:u,o:{type:"stat-card",slots:{value:".bw_stat_value",label:".bw_stat_label"}}}}function P(e={}){var{content:t,text:a="",placement:n="top",className:o=""}=e;return{t:"span",a:{class:("bw_tooltip_wrapper "+o).trim()},c:[t,{t:"span",a:{class:"bw_tooltip bw_tooltip_"+n,role:"tooltip"},c:a}],o:{type:"tooltip",mounted:function(e){var t=e.querySelector(".bw_tooltip");e.addEventListener("mouseenter",function(){t.classList.add("bw_tooltip_show")}),e.addEventListener("mouseleave",function(){t.classList.remove("bw_tooltip_show")}),e.addEventListener("focusin",function(){t.classList.add("bw_tooltip_show")}),e.addEventListener("focusout",function(){t.classList.remove("bw_tooltip_show")})}}}}function M(e={}){var{trigger:t,title:a,content:n,placement:o="top",className:s=""}=e,c=[a&&{t:"div",a:{class:"bw_popover_header"},c:a},n&&{t:"div",a:{class:"bw_popover_body"},c:n}].filter(Boolean);return{t:"span",a:{class:("bw_popover_wrapper "+s).trim()},c:[{t:"span",a:{class:"bw_popover_trigger",onclick:function(e){e.target.closest(".bw_popover_wrapper").querySelector(".bw_popover").classList.toggle("bw_popover_show")}},c:t},{t:"div",a:{class:"bw_popover bw_popover_"+o},c:c}],o:{type:"popover",mounted:function(e){var t=function(t){if(!e.contains(t.target)){var a=e.querySelector(".bw_popover");a&&a.classList.remove("bw_popover_show")}};document.addEventListener("click",t),e._bw_outsideHandler=t},unmount:function(e){e._bw_outsideHandler&&document.removeEventListener("click",e._bw_outsideHandler)}}}}function R(e={}){"string"==typeof e&&(e={placeholder:e});var{placeholder:t="Search...",value:a,onSearch:n,onInput:o,id:s,name:c,className:r=""}=e;return{t:"div",a:{class:("bw_search_input "+r).trim()},c:[{t:"input",a:{type:"search",class:"bw_form_control bw_search_field",placeholder:t,value:a,id:s,name:c,onkeydown:function(e){"Enter"===e.key&&n&&(e.preventDefault(),n(e.target.value))},oninput:function(e){var t=e.target.closest(".bw_search_input").querySelector(".bw_search_clear");t&&(t.style.display=e.target.value?"flex":"none"),o&&o(e.target.value)}}},{t:"button",a:{type:"button",class:"bw_search_clear","aria-label":"Clear search",style:a?void 0:"display: none",onclick:function(e){var t=e.target.closest(".bw_search_input").querySelector(".bw_search_field");t.value="",e.target.style.display="none",t.focus(),o&&o(""),n&&n("")}},c:"×"}],o:{type:"search-input"}}}function G(e={}){var{min:t=0,max:a=100,step:n=1,value:o=50,label:s,showValue:c=!1,id:r,name:i,disabled:l=!1,className:_="",...d}=e,b=[];if(s||c){var u=[];s&&u.push({t:"span",c:s}),c&&u.push({t:"span",a:{class:"bw_range_value"},c:""+o}),b.push({t:"div",a:{class:"bw_range_label"},c:u})}var w=d.oninput;return c&&(d.oninput=function(e){var t=e.target.closest(".bw_range_wrapper").querySelector(".bw_range_value");t&&(t.textContent=e.target.value),w&&w(e)}),b.push({t:"input",a:{type:"range",class:"bw_range",min:t,max:a,step:n,value:o,id:r,name:i,disabled:l,...d}}),{t:"div",a:{class:("bw_range_wrapper "+_).trim()},c:b,o:{type:"range"}}}function V(e={}){var{src:t,alt:a="",title:n,content:o,reverse:s=!1,imageSize:c="3rem",className:r=""}=e,i=t?{t:"img",a:{class:"bw_media_img",src:t,alt:a,style:"width:"+c+";height:"+c}}:null,l={t:"div",a:{class:"bw_media_body"},c:[n&&{t:"h5",a:{class:"bw_media_title"},c:n},o].filter(Boolean)};return{t:"div",a:{class:("bw_media "+(s?"bw_media_reverse ":"")+r).trim()},c:s?[l,i].filter(Boolean):[i,l].filter(Boolean),o:{type:"media-object"}}}function F(e={}){var{accept:t,multiple:a=!1,onFiles:n,text:o="Drop files here or click to browse",id:s,className:c=""}=e;return{t:"div",a:{class:("bw_file_upload "+c).trim(),tabindex:"0",role:"button","aria-label":o},c:[{t:"div",a:{class:"bw_file_upload_icon"},c:"📁"},{t:"div",a:{class:"bw_file_upload_text"},c:o},{t:"input",a:{type:"file",class:"bw_file_upload_input",accept:t,multiple:a,id:s,onchange:function(e){n&&e.target.files.length&&n(e.target.files)}}}],o:{type:"file-upload",mounted:function(e){var t=e.querySelector(".bw_file_upload_input");e.addEventListener("click",function(e){e.target!==t&&t.click()}),e.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.click())}),e.addEventListener("dragover",function(t){t.preventDefault(),e.classList.add("bw_file_upload_active")}),e.addEventListener("dragleave",function(){e.classList.remove("bw_file_upload_active")}),e.addEventListener("drop",function(t){t.preventDefault(),e.classList.remove("bw_file_upload_active"),n&&t.dataTransfer.files.length&&n(t.dataTransfer.files)})}}}}function U(e={}){var{items:a=[],className:n=""}=e;return{t:"div",a:{class:("bw_timeline "+n).trim()},c:a.map(function(e){return{t:"div",a:{class:"bw_timeline_item"},c:[{t:"div",a:{class:"bw_timeline_marker "+t(e.variant||"primary")}},{t:"div",a:{class:"bw_timeline_content"},c:[e.date&&{t:"div",a:{class:"bw_timeline_date"},c:e.date},e.title&&{t:"h5",a:{class:"bw_timeline_title"},c:e.title},e.content&&("string"==typeof e.content?{t:"p",a:{class:"bw_timeline_text"},c:e.content}:e.content)].filter(Boolean)}]}}),o:{type:"timeline"}}}function X(e={}){var{steps:t=[],currentStep:a=0,className:n=""}=e;return{t:"div",a:{class:("bw_stepper "+n).trim(),role:"list"},c:t.map(function(e,t){var n=t<a?"completed":t===a?"active":"pending";return{t:"div",a:{class:"bw_step bw_step_"+n,role:"listitem","aria-current":"active"===n?"step":void 0},c:[{t:"div",a:{class:"bw_step_indicator"},c:"completed"===n?"✓":""+(t+1)},{t:"div",a:{class:"bw_step_body"},c:[{t:"div",a:{class:"bw_step_label"},c:e.label},e.description&&{t:"div",a:{class:"bw_step_description"},c:e.description}].filter(Boolean)}]}}),o:{type:"stepper"}}}function J(e={}){var{chips:t=[],placeholder:a="Add...",onAdd:n,onRemove:o,className:s=""}=e;return{t:"div",a:{class:("bw_chip_input "+s).trim()},c:[...t.map(function(e){return{t:"span",a:{class:"bw_chip"},c:[e,{t:"button",a:{type:"button",class:"bw_chip_remove","aria-label":"Remove "+e,onclick:function(t){var a=t.target.closest(".bw_chip");a.parentNode.removeChild(a),o&&o(e)}},c:"×"}]}}),{t:"input",a:{type:"text",class:"bw_chip_field",placeholder:a,onkeydown:function(e){if("Enter"===e.key&&e.target.value.trim()){e.preventDefault();var t=e.target.value.trim(),a=e.target.closest(".bw_chip_input"),s=document.createElement("span");s.className="bw_chip",s._bw_chipValue=t,s.innerHTML="",s.textContent=t;var c=document.createElement("button");c.type="button",c.className="bw_chip_remove",c.setAttribute("aria-label","Remove "+t),c.textContent="×",c.onclick=function(){s.parentNode.removeChild(s),o&&o(t)},s.appendChild(c),a.insertBefore(s,e.target),e.target.value="",n&&n(t)}if("Backspace"===e.key&&!e.target.value){var r=(a=e.target.closest(".bw_chip_input")).querySelectorAll(".bw_chip");if(r.length){var i=r[r.length-1],l=i._bw_chipValue||i.firstChild.textContent;i.parentNode.removeChild(i),o&&o(l)}}}}}],o:{type:"chip-input",handle:{addChip:function(e,t){if(t){var a=e.querySelector(".bw_chip_field"),n=document.createElement("span");n.className="bw_chip",n._bw_chipValue=t,n.textContent=t;var o=document.createElement("button");o.type="button",o.className="bw_chip_remove",o.setAttribute("aria-label","Remove "+t),o.textContent="×",o.onclick=function(){n.parentNode.removeChild(n)},n.appendChild(o),e.insertBefore(n,a)}},removeChip:function(e,t){for(var a=e.querySelectorAll(".bw_chip"),n=0;n<a.length;n++)if((a[n]._bw_chipValue||a[n].firstChild.textContent)===t)return void a[n].parentNode.removeChild(a[n])},getChips:function(e){for(var t=e.querySelectorAll(".bw_chip"),a=[],n=0;n<t.length;n++)a.push(t[n]._bw_chipValue||t[n].firstChild.textContent);return a},clear:function(e){for(var t=e.querySelectorAll(".bw_chip"),a=t.length-1;a>=0;a--)t[a].parentNode.removeChild(t[a])}}}}}var K={card:{make:a},button:{make:n},container:{make:o},row:{make:s},col:{make:c},nav:{make:r},navbar:{make:i},tabs:{make:l},alert:{make:_},badge:{make:d},progress:{make:b},listGroup:{make:u},breadcrumb:{make:w},form:{make:p},formGroup:{make:m},input:{make:v},textarea:{make:f},select:{make:h},checkbox:{make:g},stack:{make:y},spinner:{make:k},hero:{make:x},featureGrid:{make:$},cta:{make:L},section:{make:C},codeDemo:{make:N},pagination:{make:S},radio:{make:A},buttonGroup:{make:I},accordion:{make:B},modal:{make:q},toast:{make:E},dropdown:{make:H},switch:{make:T},skeleton:{make:j},avatar:{make:D},carousel:{make:z},statCard:{make:O},tooltip:{make:P},popover:{make:M},searchInput:{make:R},range:{make:G},mediaObject:{make:V},fileUpload:{make:F},timeline:{make:U},stepper:{make:X},chipInput:{make:J}};function Q(e,t){var a=K[e];if(!a)throw new Error('bw.make: unknown component type "'+e+'". Available: '+Object.keys(K).join(", "));var n=a.make(t||{});return n&&"object"==typeof n&&(n._bwFactory={type:e,props:t||{}}),n}var W=Object.freeze({__proto__:null,BCCL:K,make:Q,makeAccordion:B,makeAlert:_,makeAvatar:D,makeBadge:d,makeBreadcrumb:w,makeButton:n,makeButtonGroup:I,makeCTA:L,makeCard:a,makeCarousel:z,makeCheckbox:g,makeChipInput:J,makeCodeDemo:N,makeCol:c,makeContainer:o,makeDropdown:H,makeFeatureGrid:$,makeFileUpload:F,makeForm:p,makeFormGroup:m,makeHero:x,makeInput:v,makeListGroup:u,makeMediaObject:V,makeModal:q,makeNav:r,makeNavbar:i,makePagination:S,makePopover:M,makeProgress:b,makeRadio:A,makeRange:G,makeRow:s,makeSearchInput:R,makeSection:C,makeSelect:h,makeSkeleton:j,makeSpinner:k,makeStack:y,makeStatCard:O,makeStepper:X,makeSwitch:T,makeTabs:l,makeTextarea:f,makeTimeline:U,makeToast:E,makeTooltip:P,variantClass:t});
21
21
  /**
22
22
  * bitwrench-bccl-entry.js — Standalone entry point for BCCL component library.
23
23
  *
@@ -36,5 +36,5 @@
36
36
  *
37
37
  * @module bitwrench-bccl
38
38
  * @license BSD-2-Clause
39
- */function Y(e){e&&(Object.entries(W).forEach(function(t){var a=t[0],s=t[1];0===a.indexOf("make")&&(e[a]=s)}),e.make=Q,e.BCCL=K,e.variantClass=t,"function"==typeof e.renderComponent&&Object.entries(W).forEach(function(t){var a=t[0],s=t[1];if(0===a.indexOf("make")){var n="create"+a.substring(4);e[n]=function(t){var a=s(t);return e.renderComponent(a)}}}))}"undefined"!=typeof window&&void 0!==window.bw?Y(window.bw):"undefined"!=typeof globalThis&&void 0!==globalThis.bw&&Y(globalThis.bw),e.BCCL=K,e.make=Q,e.registerBCCL=Y,e.variantClass=t});
39
+ */function Y(e){e&&(Object.entries(W).forEach(function(t){var a=t[0],n=t[1];0===a.indexOf("make")&&(e[a]=n)}),e.make=Q,e.BCCL=K,e.variantClass=t,"function"==typeof e.createDOM&&Object.entries(W).forEach(function(t){var a=t[0],n=t[1];if(0===a.indexOf("make")){var o="create"+a.substring(4);e[o]=function(t){return e.createDOM(n(t))}}}))}"undefined"!=typeof window&&void 0!==window.bw?Y(window.bw):"undefined"!=typeof globalThis&&void 0!==globalThis.bw&&Y(globalThis.bw),e.BCCL=K,e.make=Q,e.registerBCCL=Y,e.variantClass=t});
40
40
  //# sourceMappingURL=bitwrench-bccl.umd.min.js.map
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.18 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -9,11 +9,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
9
9
  * Provides bw.highlight() for tokenizing JS/CSS/HTML into TACO spans,
10
10
  * and bw.codeEditor() for a live editable code block with syntax coloring.
11
11
  *
12
- * Theme integration: The editor chrome (background, text color, font) reads
13
- * from CSS custom properties --bw_code_bg, --bw_code_text, --bw_font_mono,
14
- * falling back to built-in dark values when no theme is active. Syntax
15
- * highlighting colors are intentionally fixed (they are a code color scheme,
16
- * not brand colors). The bw_ce_light class is still supported for manual
12
+ * Theme integration: The editor chrome uses self-contained dark defaults.
13
+ * Syntax highlighting colors are intentionally fixed (they are a code color
14
+ * scheme, not brand colors). The bw_ce_light class is supported for manual
17
15
  * light-mode override.
18
16
  *
19
17
  * Can be loaded standalone (browser script tag after bitwrench.umd.js),
@@ -26,9 +24,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
26
24
  // -- CSS (injected once) ----------------------------------------------
27
25
  var _cssInjected = false;
28
26
  var CSS_TEXT =
29
- '.bw_ce{background:var(--bw_code_bg,#1e293b);border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}' +
27
+ '.bw_ce{background:#1e293b;border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}' +
30
28
  '.bw_ce pre{margin:0;padding:0}' +
31
- '.bw_ce code{font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;color:var(--bw_code_text,#e2e8f0);outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}' +
29
+ '.bw_ce code{font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}' +
32
30
  '.bw_ce code:empty::before{content:"\\200b"}' +
33
31
  '.bw_ce .bw_ce_keyword{color:#c792ea}' +
34
32
  '.bw_ce .bw_ce_string{color:#c3e88d}' +
@@ -69,7 +67,7 @@ var CSS_TEXT =
69
67
  '.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}' +
70
68
  // Line number gutter (opt-in via lineNumbers option)
71
69
  '.bw_ce_wrap{display:flex;flex-direction:row}' +
72
- '.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}' +
70
+ '.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}' +
73
71
  '.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}' +
74
72
  '.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';
75
73
 
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.18 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
3
3
  /**
4
4
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
@@ -6,11 +6,9 @@
6
6
  * Provides bw.highlight() for tokenizing JS/CSS/HTML into TACO spans,
7
7
  * and bw.codeEditor() for a live editable code block with syntax coloring.
8
8
  *
9
- * Theme integration: The editor chrome (background, text color, font) reads
10
- * from CSS custom properties --bw_code_bg, --bw_code_text, --bw_font_mono,
11
- * falling back to built-in dark values when no theme is active. Syntax
12
- * highlighting colors are intentionally fixed (they are a code color scheme,
13
- * not brand colors). The bw_ce_light class is still supported for manual
9
+ * Theme integration: The editor chrome uses self-contained dark defaults.
10
+ * Syntax highlighting colors are intentionally fixed (they are a code color
11
+ * scheme, not brand colors). The bw_ce_light class is supported for manual
14
12
  * light-mode override.
15
13
  *
16
14
  * Can be loaded standalone (browser script tag after bitwrench.umd.js),
@@ -19,5 +17,5 @@
19
17
  * @module bitwrench-code-edit
20
18
  * @license BSD-2-Clause
21
19
  */
22
- var e=!1,t='.bw_ce{background:var(--bw_code_bg,#1e293b);border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}.bw_ce pre{margin:0;padding:0}.bw_ce code{font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;color:var(--bw_code_text,#e2e8f0);outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}.bw_ce code:empty::before{content:"\\200b"}.bw_ce .bw_ce_keyword{color:#c792ea}.bw_ce .bw_ce_string{color:#c3e88d}.bw_ce .bw_ce_comment{color:#546e7a;font-style:italic}.bw_ce .bw_ce_number{color:#f78c6c}.bw_ce .bw_ce_operator{color:#89ddff}.bw_ce .bw_ce_punctuation{color:#89ddff}.bw_ce .bw_ce_property{color:#82aaff}.bw_ce .bw_ce_function{color:#82aaff}.bw_ce .bw_ce_tag{color:#f07178}.bw_ce .bw_ce_attr_name{color:#ffcb6b}.bw_ce .bw_ce_attr_value{color:#c3e88d}.bw_ce .bw_ce_selector{color:#c792ea}.bw_ce .bw_ce_css_prop{color:#82aaff}.bw_ce .bw_ce_css_value{color:#f78c6c}.bw_ce .bw_ce_at_rule{color:#c792ea;font-style:italic}.bw_ce .bw_ce_color{color:#f78c6c}.bw_ce .bw_ce_template_interp{color:#89ddff}.bw_ce_light.bw_ce{background:#fafafa;border-color:#d8d8d8}.bw_ce_light.bw_ce code{color:#1a1a1a}.bw_ce_light.bw_ce .bw_ce_keyword{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_string{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_comment{color:#9ca3af;font-style:italic}.bw_ce_light.bw_ce .bw_ce_number{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_operator{color:#0891b2}.bw_ce_light.bw_ce .bw_ce_punctuation{color:#6b7280}.bw_ce_light.bw_ce .bw_ce_property{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_function{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_tag{color:#dc2626}.bw_ce_light.bw_ce .bw_ce_attr_name{color:#d97706}.bw_ce_light.bw_ce .bw_ce_attr_value{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_selector{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_css_prop{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_css_value{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_at_rule{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_color{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}.bw_ce_wrap{display:flex;flex-direction:row}.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';var o={};function r(e){var t=[],c=0,n=e.length,a="";function l(e){a.length&&(t.push({type:e,text:a}),a="")}for(;c<n;){var s=e[c],i=e[c+1];if("/"!==s||"/"!==i)if("/"!==s||"*"!==i){if("/"===s&&"/"!==i&&"*"!==i){var p=t.length?t[t.length-1]:null,_=!1;if(a.trim().length||p&&"operator"!==p.type&&"punctuation"!==p.type&&"keyword"!==p.type||(_=!0),_){l("plain");for(var u="/",f=c+1,b=!1,w=!1;f<n;){var d=e[f];if(b)u+=d,b=!1,f++;else if("\\"!==d)if("["!==d)if("]"!==d){if("/"===d&&!w){u+=d,f++;break}if("\n"===d)break;u+=d,f++}else w=!1,u+=d,f++;else w=!0,u+=d,f++;else b=!0,u+=d,f++}for(;f<n&&/[gimsuvy]/.test(e[f]);)u+=e[f],f++;t.push({type:"string",text:u}),c=f;continue}}if('"'!==s&&"'"!==s&&"`"!==s)if(/[0-9]/.test(s)||"."===s&&i&&/[0-9]/.test(i)){l("plain");var h="";if("0"===s&&i&&/[xXbBoO]/.test(i))for(h=s+i,c+=2;c<n&&/[0-9a-fA-F_]/.test(e[c]);)h+=e[c],c++;else for(;c<n&&/[0-9._eE]/.test(e[c]);)"e"!==e[c]&&"E"!==e[c]||!e[c+1]||!/[+\-0-9]/.test(e[c+1])?(h+=e[c],c++):(h+=e[c]+e[c+1],c+=2);t.push({type:"number",text:h})}else if(/[a-zA-Z_$]/.test(s)){l("plain");for(var g="";c<n&&/[a-zA-Z0-9_$]/.test(e[c]);)g+=e[c],c++;for(var v=c;v<n&&(" "===e[v]||"\t"===e[v]);)v++;var x=t.length?t[t.length-1]:null,y=x&&"punctuation"===x.type&&"."===x.text;o[g]?t.push({type:"keyword",text:g}):y?v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"property",text:g}):v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"plain",text:g})}else if(-1==="=+-*/%!<>&|^~?:".indexOf(s))-1==="(){}[];,.".indexOf(s)?(a+=s,c++):(l("plain"),t.push({type:"punctuation",text:s}),c++);else{l("plain");var m=s;++c<n&&-1!=="=+-*/%!<>&|^~?:".indexOf(e[c])&&(m+=e[c],++c<n&&-1!=="=>&|".indexOf(e[c])&&(m+=e[c],c++)),t.push({type:"operator",text:m})}else{l("plain");var k=s,C=s,S=c+1;if("`"===k){for(;S<n;){var T=e[S];if("\\"!==T)if("$"!==T||"{"!==e[S+1]){if("`"===T){C+=T,S++;break}C+=T,S++}else{C.length&&t.push({type:"string",text:C}),C="",t.push({type:"template-interp",text:"${"}),S+=2;for(var A=1,E="";S<n&&A>0;){if("{"===e[S])A++;else if("}"===e[S]&&0===--A)break;E+=e[S],S++}var z=r(E);(t=t.concat(z)).push({type:"template-interp",text:"}"}),S++}else C+=T+(e[S+1]||""),S+=2}C.length&&t.push({type:"string",text:C})}else{for(;S<n;){var O=e[S];if("\\"!==O){if(O===k){C+=O,S++;break}if("\n"===O)break;C+=O,S++}else C+=O+(e[S+1]||""),S+=2}t.push({type:"string",text:C})}c=S}}else{l("plain");var M=e.indexOf("*/",c+2);-1===M&&(M=n-2),t.push({type:"comment",text:e.substring(c,M+2)}),c=M+2}else{l("plain");var R=e.indexOf("\n",c);-1===R&&(R=n),t.push({type:"comment",text:e.substring(c,R)}),c=R}}return l("plain"),t}function c(e){var t=[],o=0,r=e.length,c="selector",n="";function a(e){n.length&&(t.push({type:e||"plain",text:n}),n="")}for(;o<r;){var l=e[o],s=e[o+1];if("/"!==l||"*"!==s)if('"'!==l&&"'"!==l||"value"!==c&&"selector"!==c)if("@"!==l||"selector"!==c)if("#"!==l||"value"!==c)if("value"===c&&/[0-9]/.test(l)){a("css-value");for(var i="";o<r&&/[0-9.]/.test(e[o]);)i+=e[o],o++;for(var p="";o<r&&/[a-zA-Z%]/.test(e[o]);)p+=e[o],o++;t.push({type:"number",text:i+p})}else"{"!==l?"}"!==l?":"!==l||"prop"!==c?";"!==l?","!==l?(n+=l,o++):(a("selector"===c?"selector":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),o++):(a("value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++):(a("css-prop"),t.push({type:"punctuation",text:l}),c="value",o++):(a("prop"===c?"css-prop":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="selector",o++):(a("selector"===c?"selector":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++);else{a("css-value");var _="#";for(o++;o<r&&/[0-9a-fA-F]/.test(e[o]);)_+=e[o],o++;t.push({type:"color",text:_})}else{a("selector");var u="@";for(o++;o<r&&/[a-zA-Z\-]/.test(e[o]);)u+=e[o],o++;t.push({type:"at-rule",text:u})}else{a("selector"===c?"selector":"css-value");var f=l,b=l;for(o++;o<r;)if("\\"!==e[o]){if(e[o]===f){b+=e[o],o++;break}b+=e[o],o++}else b+=e[o]+(e[o+1]||""),o+=2;t.push({type:"string",text:b})}else{a("selector"===c?"selector":"prop"===c?"css-prop":"css-value");var w=e.indexOf("*/",o+2);-1===w&&(w=r-2),t.push({type:"comment",text:e.substring(o,w+2)}),o=w+2}}return a("selector"===c?"selector":"prop"===c?"css-prop":"css-value"),t}function n(e){var t=[],o=0,r=e.length,c="";function n(e){c.length&&(t.push({type:e,text:c}),c="")}for(;o<r;){var a=e[o];if("<"!==a||"\x3c!--"!==e.substring(o,o+4))if("<"!==a)if("&"!==a)c+=a,o++;else{n("plain");var l="&";for(o++;o<r&&";"!==e[o]&&/[a-zA-Z0-9#]/.test(e[o]);)l+=e[o],o++;o<r&&";"===e[o]&&(l+=";",o++),t.push({type:"string",text:l})}else{n("plain");var s="<";for(++o<r&&"/"===e[o]&&(s+="/",o++);o<r&&/[a-zA-Z0-9\-]/.test(e[o]);)s+=e[o],o++;for(t.push({type:"tag",text:s});o<r&&">"!==e[o]&&("/"!==e[o]||">"!==e[o+1]);)if(/\s/.test(e[o])){for(var i="";o<r&&/\s/.test(e[o]);)i+=e[o],o++;t.push({type:"plain",text:i})}else if(/[a-zA-Z_\-@:]/.test(e[o])){for(var p="";o<r&&/[a-zA-Z0-9_\-@:]/.test(e[o]);)p+=e[o],o++;if(t.push({type:"attr-name",text:p}),o<r&&"="===e[o])if(t.push({type:"punctuation",text:"="}),++o<r&&('"'===e[o]||"'"===e[o])){var _=e[o],u=_;for(o++;o<r&&e[o]!==_;)u+=e[o],o++;o<r&&(u+=e[o],o++),t.push({type:"attr-value",text:u})}else{for(var f="";o<r&&!/[\s>]/.test(e[o]);)f+=e[o],o++;t.push({type:"attr-value",text:f})}}else c+=e[o],o++,n("plain");var b="";o<r&&"/"===e[o]&&(b+="/",o++),o<r&&">"===e[o]&&(b+=">",o++),b&&t.push({type:"tag",text:b})}else{n("plain");var w=e.indexOf("--\x3e",o+4);-1===w&&(w=r-3),t.push({type:"comment",text:e.substring(o,w+3)}),o=w+3}}return n("plain"),t}"var,const,let,function,return,if,else,for,while,do,switch,case,break,continue,new,typeof,instanceof,this,class,extends,import,export,default,from,true,false,null,undefined,try,catch,throw,finally,async,await,yield,of,in,delete,void,with,super,static,get,set,debugger".split(",").forEach(function(e){o[e]=!0});var a={js:r,javascript:r,css:c,html:n};function l(e,t){return function(e){for(var t=[],o=0;o<e.length;o++){var r=e[o];"plain"===r.type?t.push(r.text):t.push({t:"span",a:{class:"bw_ce_"+r.type},c:r.text})}return t}((a[t]||r)(e))}function s(e){var t=(e=e||{}).code||"",o=e.lang||"js",r=e.height||"180px",c=!!e.readOnly,n=!!e.lineNumbers,a="bw_ce"+(e.className?" "+e.className:""),s=l(t,o),i={spellcheck:"false",class:"bw_ce_code"};c||(i.contenteditable="true");var p=null;if(n){for(var _=(t.match(/\n/g)||[]).length+1,u=[],f=1;f<=_;f++)u.push({t:"span",c:String(f)});p={t:"div",a:{class:"bw_ce_gutter"},c:u}}var b={t:"pre",a:{style:"flex:1;min-width:0;margin:0"},c:{t:"code",a:i,c:s}};return{t:"div",a:{class:a,style:"max-height:"+r+";overflow:auto"},c:[n?{t:"div",a:{class:"bw_ce_wrap"},c:[p,b]}:b],o:{mounted:function(r){var a=r.querySelector(".bw_ce_code");if(a){var s=t,i=null,p=n?r.querySelector(".bw_ce_gutter"):null,_="undefined"!=typeof window&&window.bw||{};if(r._bwCodeEdit={getValue:f,setValue:function(e){s=e;var t=l(e,o);_.html&&(a.innerHTML=_.html({t:"span",c:t})),b(e)}},p){var u=a.closest(".bw_ce")||r;u.addEventListener("scroll",function(){p.style.transform="translateY("+-u.scrollTop+"px)"}),r.addEventListener("scroll",function(){p.style.transform="translateY("+-r.scrollTop+"px)"})}c||(a.addEventListener("input",function(){clearTimeout(i),i=setTimeout(w,50)}),a.addEventListener("keydown",function(e){"Tab"===e.key&&(e.preventDefault(),document.execCommand("insertText",!1," "))}))}function f(){return a.textContent||""}function b(e){if(p){for(var t=(e.match(/\n/g)||[]).length+1,o="",r=1;r<=t;r++)o+="<span>"+r+"</span>";p.innerHTML=o}}function w(){var t=f();if(t!==s){s=t;var r=function(e){var t=window.getSelection();if(!t.rangeCount)return 0;var o=t.getRangeAt(0).cloneRange();return o.selectNodeContents(e),o.setEnd(t.getRangeAt(0).startContainer,t.getRangeAt(0).startOffset),o.toString().length}(a),c=l(t,o);_.html&&(a.innerHTML=_.html({t:"span",c:c})),function(e,t){for(var o,r=window.getSelection(),c=document.createRange(),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),a=0;o=n.nextNode();){var l=o.textContent.length;if(a+l>=t)return c.setStart(o,t-a),c.collapse(!0),r.removeAllRanges(),void r.addRange(c);a+=l}c.selectNodeContents(e),c.collapse(!1),r.removeAllRanges(),r.addRange(c)}(a,r),b(t),e.onChange&&e.onChange(t)}}}}}}function i(o){o&&(o.highlight=l,o.codeEditor=function(r){return function(o){e||(e=!0,o&&o.injectCSS&&o.injectCSS(t,{id:"bw_code_edit_styles"}))}(o),s(r)})}"undefined"!=typeof window&&window.bw&&i(window.bw);var p={highlight:l,codeEditor:s,install:i,CSS_TEXT:t};exports.CSS_TEXT=t,exports.codeEditor=s,exports.default=p,exports.highlight=l,exports.install=i,exports.tokenizeCSS=c,exports.tokenizeHTML=n,exports.tokenizeJS=r;
20
+ var e=!1,t='.bw_ce{background:#1e293b;border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}.bw_ce pre{margin:0;padding:0}.bw_ce code{font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}.bw_ce code:empty::before{content:"\\200b"}.bw_ce .bw_ce_keyword{color:#c792ea}.bw_ce .bw_ce_string{color:#c3e88d}.bw_ce .bw_ce_comment{color:#546e7a;font-style:italic}.bw_ce .bw_ce_number{color:#f78c6c}.bw_ce .bw_ce_operator{color:#89ddff}.bw_ce .bw_ce_punctuation{color:#89ddff}.bw_ce .bw_ce_property{color:#82aaff}.bw_ce .bw_ce_function{color:#82aaff}.bw_ce .bw_ce_tag{color:#f07178}.bw_ce .bw_ce_attr_name{color:#ffcb6b}.bw_ce .bw_ce_attr_value{color:#c3e88d}.bw_ce .bw_ce_selector{color:#c792ea}.bw_ce .bw_ce_css_prop{color:#82aaff}.bw_ce .bw_ce_css_value{color:#f78c6c}.bw_ce .bw_ce_at_rule{color:#c792ea;font-style:italic}.bw_ce .bw_ce_color{color:#f78c6c}.bw_ce .bw_ce_template_interp{color:#89ddff}.bw_ce_light.bw_ce{background:#fafafa;border-color:#d8d8d8}.bw_ce_light.bw_ce code{color:#1a1a1a}.bw_ce_light.bw_ce .bw_ce_keyword{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_string{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_comment{color:#9ca3af;font-style:italic}.bw_ce_light.bw_ce .bw_ce_number{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_operator{color:#0891b2}.bw_ce_light.bw_ce .bw_ce_punctuation{color:#6b7280}.bw_ce_light.bw_ce .bw_ce_property{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_function{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_tag{color:#dc2626}.bw_ce_light.bw_ce .bw_ce_attr_name{color:#d97706}.bw_ce_light.bw_ce .bw_ce_attr_value{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_selector{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_css_prop{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_css_value{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_at_rule{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_color{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}.bw_ce_wrap{display:flex;flex-direction:row}.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';var o={};function r(e){var t=[],c=0,n=e.length,a="";function l(e){a.length&&(t.push({type:e,text:a}),a="")}for(;c<n;){var s=e[c],i=e[c+1];if("/"!==s||"/"!==i)if("/"!==s||"*"!==i){if("/"===s&&"/"!==i&&"*"!==i){var p=t.length?t[t.length-1]:null,_=!1;if(a.trim().length||p&&"operator"!==p.type&&"punctuation"!==p.type&&"keyword"!==p.type||(_=!0),_){l("plain");for(var u="/",f=c+1,b=!1,w=!1;f<n;){var d=e[f];if(b)u+=d,b=!1,f++;else if("\\"!==d)if("["!==d)if("]"!==d){if("/"===d&&!w){u+=d,f++;break}if("\n"===d)break;u+=d,f++}else w=!1,u+=d,f++;else w=!0,u+=d,f++;else b=!0,u+=d,f++}for(;f<n&&/[gimsuvy]/.test(e[f]);)u+=e[f],f++;t.push({type:"string",text:u}),c=f;continue}}if('"'!==s&&"'"!==s&&"`"!==s)if(/[0-9]/.test(s)||"."===s&&i&&/[0-9]/.test(i)){l("plain");var h="";if("0"===s&&i&&/[xXbBoO]/.test(i))for(h=s+i,c+=2;c<n&&/[0-9a-fA-F_]/.test(e[c]);)h+=e[c],c++;else for(;c<n&&/[0-9._eE]/.test(e[c]);)"e"!==e[c]&&"E"!==e[c]||!e[c+1]||!/[+\-0-9]/.test(e[c+1])?(h+=e[c],c++):(h+=e[c]+e[c+1],c+=2);t.push({type:"number",text:h})}else if(/[a-zA-Z_$]/.test(s)){l("plain");for(var g="";c<n&&/[a-zA-Z0-9_$]/.test(e[c]);)g+=e[c],c++;for(var v=c;v<n&&(" "===e[v]||"\t"===e[v]);)v++;var x=t.length?t[t.length-1]:null,y=x&&"punctuation"===x.type&&"."===x.text;o[g]?t.push({type:"keyword",text:g}):y?v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"property",text:g}):v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"plain",text:g})}else if(-1==="=+-*/%!<>&|^~?:".indexOf(s))-1==="(){}[];,.".indexOf(s)?(a+=s,c++):(l("plain"),t.push({type:"punctuation",text:s}),c++);else{l("plain");var m=s;++c<n&&-1!=="=+-*/%!<>&|^~?:".indexOf(e[c])&&(m+=e[c],++c<n&&-1!=="=>&|".indexOf(e[c])&&(m+=e[c],c++)),t.push({type:"operator",text:m})}else{l("plain");var k=s,C=s,S=c+1;if("`"===k){for(;S<n;){var T=e[S];if("\\"!==T)if("$"!==T||"{"!==e[S+1]){if("`"===T){C+=T,S++;break}C+=T,S++}else{C.length&&t.push({type:"string",text:C}),C="",t.push({type:"template-interp",text:"${"}),S+=2;for(var A=1,E="";S<n&&A>0;){if("{"===e[S])A++;else if("}"===e[S]&&0===--A)break;E+=e[S],S++}var z=r(E);(t=t.concat(z)).push({type:"template-interp",text:"}"}),S++}else C+=T+(e[S+1]||""),S+=2}C.length&&t.push({type:"string",text:C})}else{for(;S<n;){var O=e[S];if("\\"!==O){if(O===k){C+=O,S++;break}if("\n"===O)break;C+=O,S++}else C+=O+(e[S+1]||""),S+=2}t.push({type:"string",text:C})}c=S}}else{l("plain");var M=e.indexOf("*/",c+2);-1===M&&(M=n-2),t.push({type:"comment",text:e.substring(c,M+2)}),c=M+2}else{l("plain");var R=e.indexOf("\n",c);-1===R&&(R=n),t.push({type:"comment",text:e.substring(c,R)}),c=R}}return l("plain"),t}function c(e){var t=[],o=0,r=e.length,c="selector",n="";function a(e){n.length&&(t.push({type:e||"plain",text:n}),n="")}for(;o<r;){var l=e[o],s=e[o+1];if("/"!==l||"*"!==s)if('"'!==l&&"'"!==l||"value"!==c&&"selector"!==c)if("@"!==l||"selector"!==c)if("#"!==l||"value"!==c)if("value"===c&&/[0-9]/.test(l)){a("css-value");for(var i="";o<r&&/[0-9.]/.test(e[o]);)i+=e[o],o++;for(var p="";o<r&&/[a-zA-Z%]/.test(e[o]);)p+=e[o],o++;t.push({type:"number",text:i+p})}else"{"!==l?"}"!==l?":"!==l||"prop"!==c?";"!==l?","!==l?(n+=l,o++):(a("selector"===c?"selector":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),o++):(a("value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++):(a("css-prop"),t.push({type:"punctuation",text:l}),c="value",o++):(a("prop"===c?"css-prop":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="selector",o++):(a("selector"===c?"selector":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++);else{a("css-value");var _="#";for(o++;o<r&&/[0-9a-fA-F]/.test(e[o]);)_+=e[o],o++;t.push({type:"color",text:_})}else{a("selector");var u="@";for(o++;o<r&&/[a-zA-Z\-]/.test(e[o]);)u+=e[o],o++;t.push({type:"at-rule",text:u})}else{a("selector"===c?"selector":"css-value");var f=l,b=l;for(o++;o<r;)if("\\"!==e[o]){if(e[o]===f){b+=e[o],o++;break}b+=e[o],o++}else b+=e[o]+(e[o+1]||""),o+=2;t.push({type:"string",text:b})}else{a("selector"===c?"selector":"prop"===c?"css-prop":"css-value");var w=e.indexOf("*/",o+2);-1===w&&(w=r-2),t.push({type:"comment",text:e.substring(o,w+2)}),o=w+2}}return a("selector"===c?"selector":"prop"===c?"css-prop":"css-value"),t}function n(e){var t=[],o=0,r=e.length,c="";function n(e){c.length&&(t.push({type:e,text:c}),c="")}for(;o<r;){var a=e[o];if("<"!==a||"\x3c!--"!==e.substring(o,o+4))if("<"!==a)if("&"!==a)c+=a,o++;else{n("plain");var l="&";for(o++;o<r&&";"!==e[o]&&/[a-zA-Z0-9#]/.test(e[o]);)l+=e[o],o++;o<r&&";"===e[o]&&(l+=";",o++),t.push({type:"string",text:l})}else{n("plain");var s="<";for(++o<r&&"/"===e[o]&&(s+="/",o++);o<r&&/[a-zA-Z0-9\-]/.test(e[o]);)s+=e[o],o++;for(t.push({type:"tag",text:s});o<r&&">"!==e[o]&&("/"!==e[o]||">"!==e[o+1]);)if(/\s/.test(e[o])){for(var i="";o<r&&/\s/.test(e[o]);)i+=e[o],o++;t.push({type:"plain",text:i})}else if(/[a-zA-Z_\-@:]/.test(e[o])){for(var p="";o<r&&/[a-zA-Z0-9_\-@:]/.test(e[o]);)p+=e[o],o++;if(t.push({type:"attr-name",text:p}),o<r&&"="===e[o])if(t.push({type:"punctuation",text:"="}),++o<r&&('"'===e[o]||"'"===e[o])){var _=e[o],u=_;for(o++;o<r&&e[o]!==_;)u+=e[o],o++;o<r&&(u+=e[o],o++),t.push({type:"attr-value",text:u})}else{for(var f="";o<r&&!/[\s>]/.test(e[o]);)f+=e[o],o++;t.push({type:"attr-value",text:f})}}else c+=e[o],o++,n("plain");var b="";o<r&&"/"===e[o]&&(b+="/",o++),o<r&&">"===e[o]&&(b+=">",o++),b&&t.push({type:"tag",text:b})}else{n("plain");var w=e.indexOf("--\x3e",o+4);-1===w&&(w=r-3),t.push({type:"comment",text:e.substring(o,w+3)}),o=w+3}}return n("plain"),t}"var,const,let,function,return,if,else,for,while,do,switch,case,break,continue,new,typeof,instanceof,this,class,extends,import,export,default,from,true,false,null,undefined,try,catch,throw,finally,async,await,yield,of,in,delete,void,with,super,static,get,set,debugger".split(",").forEach(function(e){o[e]=!0});var a={js:r,javascript:r,css:c,html:n};function l(e,t){return function(e){for(var t=[],o=0;o<e.length;o++){var r=e[o];"plain"===r.type?t.push(r.text):t.push({t:"span",a:{class:"bw_ce_"+r.type},c:r.text})}return t}((a[t]||r)(e))}function s(e){var t=(e=e||{}).code||"",o=e.lang||"js",r=e.height||"180px",c=!!e.readOnly,n=!!e.lineNumbers,a="bw_ce"+(e.className?" "+e.className:""),s=l(t,o),i={spellcheck:"false",class:"bw_ce_code"};c||(i.contenteditable="true");var p=null;if(n){for(var _=(t.match(/\n/g)||[]).length+1,u=[],f=1;f<=_;f++)u.push({t:"span",c:String(f)});p={t:"div",a:{class:"bw_ce_gutter"},c:u}}var b={t:"pre",a:{style:"flex:1;min-width:0;margin:0"},c:{t:"code",a:i,c:s}};return{t:"div",a:{class:a,style:"max-height:"+r+";overflow:auto"},c:[n?{t:"div",a:{class:"bw_ce_wrap"},c:[p,b]}:b],o:{mounted:function(r){var a=r.querySelector(".bw_ce_code");if(a){var s=t,i=null,p=n?r.querySelector(".bw_ce_gutter"):null,_="undefined"!=typeof window&&window.bw||{};if(r._bwCodeEdit={getValue:f,setValue:function(e){s=e;var t=l(e,o);_.html&&(a.innerHTML=_.html({t:"span",c:t})),b(e)}},p){var u=a.closest(".bw_ce")||r;u.addEventListener("scroll",function(){p.style.transform="translateY("+-u.scrollTop+"px)"}),r.addEventListener("scroll",function(){p.style.transform="translateY("+-r.scrollTop+"px)"})}c||(a.addEventListener("input",function(){clearTimeout(i),i=setTimeout(w,50)}),a.addEventListener("keydown",function(e){"Tab"===e.key&&(e.preventDefault(),document.execCommand("insertText",!1," "))}))}function f(){return a.textContent||""}function b(e){if(p){for(var t=(e.match(/\n/g)||[]).length+1,o="",r=1;r<=t;r++)o+="<span>"+r+"</span>";p.innerHTML=o}}function w(){var t=f();if(t!==s){s=t;var r=function(e){var t=window.getSelection();if(!t.rangeCount)return 0;var o=t.getRangeAt(0).cloneRange();return o.selectNodeContents(e),o.setEnd(t.getRangeAt(0).startContainer,t.getRangeAt(0).startOffset),o.toString().length}(a),c=l(t,o);_.html&&(a.innerHTML=_.html({t:"span",c:c})),function(e,t){for(var o,r=window.getSelection(),c=document.createRange(),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),a=0;o=n.nextNode();){var l=o.textContent.length;if(a+l>=t)return c.setStart(o,t-a),c.collapse(!0),r.removeAllRanges(),void r.addRange(c);a+=l}c.selectNodeContents(e),c.collapse(!1),r.removeAllRanges(),r.addRange(c)}(a,r),b(t),e.onChange&&e.onChange(t)}}}}}}function i(o){o&&(o.highlight=l,o.codeEditor=function(r){return function(o){e||(e=!0,o&&o.injectCSS&&o.injectCSS(t,{id:"bw_code_edit_styles"}))}(o),s(r)})}"undefined"!=typeof window&&window.bw&&i(window.bw);var p={highlight:l,codeEditor:s,install:i,CSS_TEXT:t};exports.CSS_TEXT=t,exports.codeEditor=s,exports.default=p,exports.highlight=l,exports.install=i,exports.tokenizeCSS=c,exports.tokenizeHTML=n,exports.tokenizeJS=r;
23
21
  //# sourceMappingURL=bitwrench-code-edit.cjs.min.js.map
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.18 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -11,11 +11,9 @@
11
11
  * Provides bw.highlight() for tokenizing JS/CSS/HTML into TACO spans,
12
12
  * and bw.codeEditor() for a live editable code block with syntax coloring.
13
13
  *
14
- * Theme integration: The editor chrome (background, text color, font) reads
15
- * from CSS custom properties --bw_code_bg, --bw_code_text, --bw_font_mono,
16
- * falling back to built-in dark values when no theme is active. Syntax
17
- * highlighting colors are intentionally fixed (they are a code color scheme,
18
- * not brand colors). The bw_ce_light class is still supported for manual
14
+ * Theme integration: The editor chrome uses self-contained dark defaults.
15
+ * Syntax highlighting colors are intentionally fixed (they are a code color
16
+ * scheme, not brand colors). The bw_ce_light class is supported for manual
19
17
  * light-mode override.
20
18
  *
21
19
  * Can be loaded standalone (browser script tag after bitwrench.umd.js),
@@ -27,11 +25,11 @@
27
25
 
28
26
  // -- CSS (injected once) ----------------------------------------------
29
27
  var _cssInjected = false;
30
- var CSS_TEXT = '.bw_ce{background:var(--bw_code_bg,#1e293b);border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}' + '.bw_ce pre{margin:0;padding:0}' + '.bw_ce code{font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;color:var(--bw_code_text,#e2e8f0);outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}' + '.bw_ce code:empty::before{content:"\\200b"}' + '.bw_ce .bw_ce_keyword{color:#c792ea}' + '.bw_ce .bw_ce_string{color:#c3e88d}' + '.bw_ce .bw_ce_comment{color:#546e7a;font-style:italic}' + '.bw_ce .bw_ce_number{color:#f78c6c}' + '.bw_ce .bw_ce_operator{color:#89ddff}' + '.bw_ce .bw_ce_punctuation{color:#89ddff}' + '.bw_ce .bw_ce_property{color:#82aaff}' + '.bw_ce .bw_ce_function{color:#82aaff}' + '.bw_ce .bw_ce_tag{color:#f07178}' + '.bw_ce .bw_ce_attr_name{color:#ffcb6b}' + '.bw_ce .bw_ce_attr_value{color:#c3e88d}' + '.bw_ce .bw_ce_selector{color:#c792ea}' + '.bw_ce .bw_ce_css_prop{color:#82aaff}' + '.bw_ce .bw_ce_css_value{color:#f78c6c}' + '.bw_ce .bw_ce_at_rule{color:#c792ea;font-style:italic}' + '.bw_ce .bw_ce_color{color:#f78c6c}' + '.bw_ce .bw_ce_template_interp{color:#89ddff}' +
28
+ var CSS_TEXT = '.bw_ce{background:#1e293b;border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}' + '.bw_ce pre{margin:0;padding:0}' + '.bw_ce code{font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}' + '.bw_ce code:empty::before{content:"\\200b"}' + '.bw_ce .bw_ce_keyword{color:#c792ea}' + '.bw_ce .bw_ce_string{color:#c3e88d}' + '.bw_ce .bw_ce_comment{color:#546e7a;font-style:italic}' + '.bw_ce .bw_ce_number{color:#f78c6c}' + '.bw_ce .bw_ce_operator{color:#89ddff}' + '.bw_ce .bw_ce_punctuation{color:#89ddff}' + '.bw_ce .bw_ce_property{color:#82aaff}' + '.bw_ce .bw_ce_function{color:#82aaff}' + '.bw_ce .bw_ce_tag{color:#f07178}' + '.bw_ce .bw_ce_attr_name{color:#ffcb6b}' + '.bw_ce .bw_ce_attr_value{color:#c3e88d}' + '.bw_ce .bw_ce_selector{color:#c792ea}' + '.bw_ce .bw_ce_css_prop{color:#82aaff}' + '.bw_ce .bw_ce_css_value{color:#f78c6c}' + '.bw_ce .bw_ce_at_rule{color:#c792ea;font-style:italic}' + '.bw_ce .bw_ce_color{color:#f78c6c}' + '.bw_ce .bw_ce_template_interp{color:#89ddff}' +
31
29
  // Light theme
32
30
  '.bw_ce_light.bw_ce{background:#fafafa;border-color:#d8d8d8}' + '.bw_ce_light.bw_ce code{color:#1a1a1a}' + '.bw_ce_light.bw_ce .bw_ce_keyword{color:#7c3aed}' + '.bw_ce_light.bw_ce .bw_ce_string{color:#16a34a}' + '.bw_ce_light.bw_ce .bw_ce_comment{color:#9ca3af;font-style:italic}' + '.bw_ce_light.bw_ce .bw_ce_number{color:#ea580c}' + '.bw_ce_light.bw_ce .bw_ce_operator{color:#0891b2}' + '.bw_ce_light.bw_ce .bw_ce_punctuation{color:#6b7280}' + '.bw_ce_light.bw_ce .bw_ce_property{color:#2563eb}' + '.bw_ce_light.bw_ce .bw_ce_function{color:#2563eb}' + '.bw_ce_light.bw_ce .bw_ce_tag{color:#dc2626}' + '.bw_ce_light.bw_ce .bw_ce_attr_name{color:#d97706}' + '.bw_ce_light.bw_ce .bw_ce_attr_value{color:#16a34a}' + '.bw_ce_light.bw_ce .bw_ce_selector{color:#7c3aed}' + '.bw_ce_light.bw_ce .bw_ce_css_prop{color:#2563eb}' + '.bw_ce_light.bw_ce .bw_ce_css_value{color:#ea580c}' + '.bw_ce_light.bw_ce .bw_ce_at_rule{color:#7c3aed}' + '.bw_ce_light.bw_ce .bw_ce_color{color:#ea580c}' + '.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}' +
33
31
  // Line number gutter (opt-in via lineNumbers option)
34
- '.bw_ce_wrap{display:flex;flex-direction:row}' + '.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}' + '.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}' + '.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';
32
+ '.bw_ce_wrap{display:flex;flex-direction:row}' + '.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}' + '.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}' + '.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';
35
33
  function ensureCSS(bw) {
36
34
  if (_cssInjected) return;
37
35
  _cssInjected = true;
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.18 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bwCodeEdit={})}(this,function(e){"use strict";
3
3
  /**
4
4
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
@@ -6,11 +6,9 @@
6
6
  * Provides bw.highlight() for tokenizing JS/CSS/HTML into TACO spans,
7
7
  * and bw.codeEditor() for a live editable code block with syntax coloring.
8
8
  *
9
- * Theme integration: The editor chrome (background, text color, font) reads
10
- * from CSS custom properties --bw_code_bg, --bw_code_text, --bw_font_mono,
11
- * falling back to built-in dark values when no theme is active. Syntax
12
- * highlighting colors are intentionally fixed (they are a code color scheme,
13
- * not brand colors). The bw_ce_light class is still supported for manual
9
+ * Theme integration: The editor chrome uses self-contained dark defaults.
10
+ * Syntax highlighting colors are intentionally fixed (they are a code color
11
+ * scheme, not brand colors). The bw_ce_light class is supported for manual
14
12
  * light-mode override.
15
13
  *
16
14
  * Can be loaded standalone (browser script tag after bitwrench.umd.js),
@@ -18,5 +16,5 @@
18
16
  *
19
17
  * @module bitwrench-code-edit
20
18
  * @license BSD-2-Clause
21
- */var t=!1,o='.bw_ce{background:var(--bw_code_bg,#1e293b);border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}.bw_ce pre{margin:0;padding:0}.bw_ce code{font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;color:var(--bw_code_text,#e2e8f0);outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}.bw_ce code:empty::before{content:"\\200b"}.bw_ce .bw_ce_keyword{color:#c792ea}.bw_ce .bw_ce_string{color:#c3e88d}.bw_ce .bw_ce_comment{color:#546e7a;font-style:italic}.bw_ce .bw_ce_number{color:#f78c6c}.bw_ce .bw_ce_operator{color:#89ddff}.bw_ce .bw_ce_punctuation{color:#89ddff}.bw_ce .bw_ce_property{color:#82aaff}.bw_ce .bw_ce_function{color:#82aaff}.bw_ce .bw_ce_tag{color:#f07178}.bw_ce .bw_ce_attr_name{color:#ffcb6b}.bw_ce .bw_ce_attr_value{color:#c3e88d}.bw_ce .bw_ce_selector{color:#c792ea}.bw_ce .bw_ce_css_prop{color:#82aaff}.bw_ce .bw_ce_css_value{color:#f78c6c}.bw_ce .bw_ce_at_rule{color:#c792ea;font-style:italic}.bw_ce .bw_ce_color{color:#f78c6c}.bw_ce .bw_ce_template_interp{color:#89ddff}.bw_ce_light.bw_ce{background:#fafafa;border-color:#d8d8d8}.bw_ce_light.bw_ce code{color:#1a1a1a}.bw_ce_light.bw_ce .bw_ce_keyword{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_string{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_comment{color:#9ca3af;font-style:italic}.bw_ce_light.bw_ce .bw_ce_number{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_operator{color:#0891b2}.bw_ce_light.bw_ce .bw_ce_punctuation{color:#6b7280}.bw_ce_light.bw_ce .bw_ce_property{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_function{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_tag{color:#dc2626}.bw_ce_light.bw_ce .bw_ce_attr_name{color:#d97706}.bw_ce_light.bw_ce .bw_ce_attr_value{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_selector{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_css_prop{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_css_value{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_at_rule{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_color{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}.bw_ce_wrap{display:flex;flex-direction:row}.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';var r={};function c(e){var t=[],o=0,n=e.length,a="";function l(e){a.length&&(t.push({type:e,text:a}),a="")}for(;o<n;){var i=e[o],s=e[o+1];if("/"!==i||"/"!==s)if("/"!==i||"*"!==s){if("/"===i&&"/"!==s&&"*"!==s){var p=t.length?t[t.length-1]:null,_=!1;if(a.trim().length||p&&"operator"!==p.type&&"punctuation"!==p.type&&"keyword"!==p.type||(_=!0),_){l("plain");for(var u="/",f=o+1,b=!1,w=!1;f<n;){var d=e[f];if(b)u+=d,b=!1,f++;else if("\\"!==d)if("["!==d)if("]"!==d){if("/"===d&&!w){u+=d,f++;break}if("\n"===d)break;u+=d,f++}else w=!1,u+=d,f++;else w=!0,u+=d,f++;else b=!0,u+=d,f++}for(;f<n&&/[gimsuvy]/.test(e[f]);)u+=e[f],f++;t.push({type:"string",text:u}),o=f;continue}}if('"'!==i&&"'"!==i&&"`"!==i)if(/[0-9]/.test(i)||"."===i&&s&&/[0-9]/.test(s)){l("plain");var h="";if("0"===i&&s&&/[xXbBoO]/.test(s))for(h=i+s,o+=2;o<n&&/[0-9a-fA-F_]/.test(e[o]);)h+=e[o],o++;else for(;o<n&&/[0-9._eE]/.test(e[o]);)"e"!==e[o]&&"E"!==e[o]||!e[o+1]||!/[+\-0-9]/.test(e[o+1])?(h+=e[o],o++):(h+=e[o]+e[o+1],o+=2);t.push({type:"number",text:h})}else if(/[a-zA-Z_$]/.test(i)){l("plain");for(var g="";o<n&&/[a-zA-Z0-9_$]/.test(e[o]);)g+=e[o],o++;for(var v=o;v<n&&(" "===e[v]||"\t"===e[v]);)v++;var y=t.length?t[t.length-1]:null,x=y&&"punctuation"===y.type&&"."===y.text;r[g]?t.push({type:"keyword",text:g}):x?v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"property",text:g}):v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"plain",text:g})}else if(-1==="=+-*/%!<>&|^~?:".indexOf(i))-1==="(){}[];,.".indexOf(i)?(a+=i,o++):(l("plain"),t.push({type:"punctuation",text:i}),o++);else{l("plain");var m=i;++o<n&&-1!=="=+-*/%!<>&|^~?:".indexOf(e[o])&&(m+=e[o],++o<n&&-1!=="=>&|".indexOf(e[o])&&(m+=e[o],o++)),t.push({type:"operator",text:m})}else{l("plain");var k=i,C=i,S=o+1;if("`"===k){for(;S<n;){var T=e[S];if("\\"!==T)if("$"!==T||"{"!==e[S+1]){if("`"===T){C+=T,S++;break}C+=T,S++}else{C.length&&t.push({type:"string",text:C}),C="",t.push({type:"template-interp",text:"${"}),S+=2;for(var E=1,A="";S<n&&E>0;){if("{"===e[S])E++;else if("}"===e[S]&&0===--E)break;A+=e[S],S++}var z=c(A);(t=t.concat(z)).push({type:"template-interp",text:"}"}),S++}else C+=T+(e[S+1]||""),S+=2}C.length&&t.push({type:"string",text:C})}else{for(;S<n;){var O=e[S];if("\\"!==O){if(O===k){C+=O,S++;break}if("\n"===O)break;C+=O,S++}else C+=O+(e[S+1]||""),S+=2}t.push({type:"string",text:C})}o=S}}else{l("plain");var M=e.indexOf("*/",o+2);-1===M&&(M=n-2),t.push({type:"comment",text:e.substring(o,M+2)}),o=M+2}else{l("plain");var R=e.indexOf("\n",o);-1===R&&(R=n),t.push({type:"comment",text:e.substring(o,R)}),o=R}}return l("plain"),t}function n(e){var t=[],o=0,r=e.length,c="selector",n="";function a(e){n.length&&(t.push({type:e||"plain",text:n}),n="")}for(;o<r;){var l=e[o],i=e[o+1];if("/"!==l||"*"!==i)if('"'!==l&&"'"!==l||"value"!==c&&"selector"!==c)if("@"!==l||"selector"!==c)if("#"!==l||"value"!==c)if("value"===c&&/[0-9]/.test(l)){a("css-value");for(var s="";o<r&&/[0-9.]/.test(e[o]);)s+=e[o],o++;for(var p="";o<r&&/[a-zA-Z%]/.test(e[o]);)p+=e[o],o++;t.push({type:"number",text:s+p})}else"{"!==l?"}"!==l?":"!==l||"prop"!==c?";"!==l?","!==l?(n+=l,o++):(a("selector"===c?"selector":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),o++):(a("value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++):(a("css-prop"),t.push({type:"punctuation",text:l}),c="value",o++):(a("prop"===c?"css-prop":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="selector",o++):(a("selector"===c?"selector":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++);else{a("css-value");var _="#";for(o++;o<r&&/[0-9a-fA-F]/.test(e[o]);)_+=e[o],o++;t.push({type:"color",text:_})}else{a("selector");var u="@";for(o++;o<r&&/[a-zA-Z\-]/.test(e[o]);)u+=e[o],o++;t.push({type:"at-rule",text:u})}else{a("selector"===c?"selector":"css-value");var f=l,b=l;for(o++;o<r;)if("\\"!==e[o]){if(e[o]===f){b+=e[o],o++;break}b+=e[o],o++}else b+=e[o]+(e[o+1]||""),o+=2;t.push({type:"string",text:b})}else{a("selector"===c?"selector":"prop"===c?"css-prop":"css-value");var w=e.indexOf("*/",o+2);-1===w&&(w=r-2),t.push({type:"comment",text:e.substring(o,w+2)}),o=w+2}}return a("selector"===c?"selector":"prop"===c?"css-prop":"css-value"),t}function a(e){var t=[],o=0,r=e.length,c="";function n(e){c.length&&(t.push({type:e,text:c}),c="")}for(;o<r;){var a=e[o];if("<"!==a||"\x3c!--"!==e.substring(o,o+4))if("<"!==a)if("&"!==a)c+=a,o++;else{n("plain");var l="&";for(o++;o<r&&";"!==e[o]&&/[a-zA-Z0-9#]/.test(e[o]);)l+=e[o],o++;o<r&&";"===e[o]&&(l+=";",o++),t.push({type:"string",text:l})}else{n("plain");var i="<";for(++o<r&&"/"===e[o]&&(i+="/",o++);o<r&&/[a-zA-Z0-9\-]/.test(e[o]);)i+=e[o],o++;for(t.push({type:"tag",text:i});o<r&&">"!==e[o]&&("/"!==e[o]||">"!==e[o+1]);)if(/\s/.test(e[o])){for(var s="";o<r&&/\s/.test(e[o]);)s+=e[o],o++;t.push({type:"plain",text:s})}else if(/[a-zA-Z_\-@:]/.test(e[o])){for(var p="";o<r&&/[a-zA-Z0-9_\-@:]/.test(e[o]);)p+=e[o],o++;if(t.push({type:"attr-name",text:p}),o<r&&"="===e[o])if(t.push({type:"punctuation",text:"="}),++o<r&&('"'===e[o]||"'"===e[o])){var _=e[o],u=_;for(o++;o<r&&e[o]!==_;)u+=e[o],o++;o<r&&(u+=e[o],o++),t.push({type:"attr-value",text:u})}else{for(var f="";o<r&&!/[\s>]/.test(e[o]);)f+=e[o],o++;t.push({type:"attr-value",text:f})}}else c+=e[o],o++,n("plain");var b="";o<r&&"/"===e[o]&&(b+="/",o++),o<r&&">"===e[o]&&(b+=">",o++),b&&t.push({type:"tag",text:b})}else{n("plain");var w=e.indexOf("--\x3e",o+4);-1===w&&(w=r-3),t.push({type:"comment",text:e.substring(o,w+3)}),o=w+3}}return n("plain"),t}"var,const,let,function,return,if,else,for,while,do,switch,case,break,continue,new,typeof,instanceof,this,class,extends,import,export,default,from,true,false,null,undefined,try,catch,throw,finally,async,await,yield,of,in,delete,void,with,super,static,get,set,debugger".split(",").forEach(function(e){r[e]=!0});var l={js:c,javascript:c,css:n,html:a};function i(e,t){return function(e){for(var t=[],o=0;o<e.length;o++){var r=e[o];"plain"===r.type?t.push(r.text):t.push({t:"span",a:{class:"bw_ce_"+r.type},c:r.text})}return t}((l[t]||c)(e))}function s(e){var t=(e=e||{}).code||"",o=e.lang||"js",r=e.height||"180px",c=!!e.readOnly,n=!!e.lineNumbers,a="bw_ce"+(e.className?" "+e.className:""),l=i(t,o),s={spellcheck:"false",class:"bw_ce_code"};c||(s.contenteditable="true");var p=null;if(n){for(var _=(t.match(/\n/g)||[]).length+1,u=[],f=1;f<=_;f++)u.push({t:"span",c:String(f)});p={t:"div",a:{class:"bw_ce_gutter"},c:u}}var b={t:"pre",a:{style:"flex:1;min-width:0;margin:0"},c:{t:"code",a:s,c:l}};return{t:"div",a:{class:a,style:"max-height:"+r+";overflow:auto"},c:[n?{t:"div",a:{class:"bw_ce_wrap"},c:[p,b]}:b],o:{mounted:function(r){var a=r.querySelector(".bw_ce_code");if(a){var l=t,s=null,p=n?r.querySelector(".bw_ce_gutter"):null,_="undefined"!=typeof window&&window.bw||{};if(r._bwCodeEdit={getValue:f,setValue:function(e){l=e;var t=i(e,o);_.html&&(a.innerHTML=_.html({t:"span",c:t})),b(e)}},p){var u=a.closest(".bw_ce")||r;u.addEventListener("scroll",function(){p.style.transform="translateY("+-u.scrollTop+"px)"}),r.addEventListener("scroll",function(){p.style.transform="translateY("+-r.scrollTop+"px)"})}c||(a.addEventListener("input",function(){clearTimeout(s),s=setTimeout(w,50)}),a.addEventListener("keydown",function(e){"Tab"===e.key&&(e.preventDefault(),document.execCommand("insertText",!1," "))}))}function f(){return a.textContent||""}function b(e){if(p){for(var t=(e.match(/\n/g)||[]).length+1,o="",r=1;r<=t;r++)o+="<span>"+r+"</span>";p.innerHTML=o}}function w(){var t=f();if(t!==l){l=t;var r=function(e){var t=window.getSelection();if(!t.rangeCount)return 0;var o=t.getRangeAt(0).cloneRange();return o.selectNodeContents(e),o.setEnd(t.getRangeAt(0).startContainer,t.getRangeAt(0).startOffset),o.toString().length}(a),c=i(t,o);_.html&&(a.innerHTML=_.html({t:"span",c:c})),function(e,t){for(var o,r=window.getSelection(),c=document.createRange(),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),a=0;o=n.nextNode();){var l=o.textContent.length;if(a+l>=t)return c.setStart(o,t-a),c.collapse(!0),r.removeAllRanges(),void r.addRange(c);a+=l}c.selectNodeContents(e),c.collapse(!1),r.removeAllRanges(),r.addRange(c)}(a,r),b(t),e.onChange&&e.onChange(t)}}}}}}function p(e){e&&(e.highlight=i,e.codeEditor=function(r){return function(e){t||(t=!0,e&&e.injectCSS&&e.injectCSS(o,{id:"bw_code_edit_styles"}))}(e),s(r)})}"undefined"!=typeof window&&window.bw&&p(window.bw);var _={highlight:i,codeEditor:s,install:p,CSS_TEXT:o};e.CSS_TEXT=o,e.codeEditor=s,e.default=_,e.highlight=i,e.install=p,e.tokenizeCSS=n,e.tokenizeHTML=a,e.tokenizeJS=c,Object.defineProperty(e,"__esModule",{value:!0})});
19
+ */var t=!1,o='.bw_ce{background:#1e293b;border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}.bw_ce pre{margin:0;padding:0}.bw_ce code{font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}.bw_ce code:empty::before{content:"\\200b"}.bw_ce .bw_ce_keyword{color:#c792ea}.bw_ce .bw_ce_string{color:#c3e88d}.bw_ce .bw_ce_comment{color:#546e7a;font-style:italic}.bw_ce .bw_ce_number{color:#f78c6c}.bw_ce .bw_ce_operator{color:#89ddff}.bw_ce .bw_ce_punctuation{color:#89ddff}.bw_ce .bw_ce_property{color:#82aaff}.bw_ce .bw_ce_function{color:#82aaff}.bw_ce .bw_ce_tag{color:#f07178}.bw_ce .bw_ce_attr_name{color:#ffcb6b}.bw_ce .bw_ce_attr_value{color:#c3e88d}.bw_ce .bw_ce_selector{color:#c792ea}.bw_ce .bw_ce_css_prop{color:#82aaff}.bw_ce .bw_ce_css_value{color:#f78c6c}.bw_ce .bw_ce_at_rule{color:#c792ea;font-style:italic}.bw_ce .bw_ce_color{color:#f78c6c}.bw_ce .bw_ce_template_interp{color:#89ddff}.bw_ce_light.bw_ce{background:#fafafa;border-color:#d8d8d8}.bw_ce_light.bw_ce code{color:#1a1a1a}.bw_ce_light.bw_ce .bw_ce_keyword{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_string{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_comment{color:#9ca3af;font-style:italic}.bw_ce_light.bw_ce .bw_ce_number{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_operator{color:#0891b2}.bw_ce_light.bw_ce .bw_ce_punctuation{color:#6b7280}.bw_ce_light.bw_ce .bw_ce_property{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_function{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_tag{color:#dc2626}.bw_ce_light.bw_ce .bw_ce_attr_name{color:#d97706}.bw_ce_light.bw_ce .bw_ce_attr_value{color:#16a34a}.bw_ce_light.bw_ce .bw_ce_selector{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_css_prop{color:#2563eb}.bw_ce_light.bw_ce .bw_ce_css_value{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_at_rule{color:#7c3aed}.bw_ce_light.bw_ce .bw_ce_color{color:#ea580c}.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}.bw_ce_wrap{display:flex;flex-direction:row}.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';var r={};function c(e){var t=[],o=0,n=e.length,a="";function l(e){a.length&&(t.push({type:e,text:a}),a="")}for(;o<n;){var i=e[o],s=e[o+1];if("/"!==i||"/"!==s)if("/"!==i||"*"!==s){if("/"===i&&"/"!==s&&"*"!==s){var p=t.length?t[t.length-1]:null,_=!1;if(a.trim().length||p&&"operator"!==p.type&&"punctuation"!==p.type&&"keyword"!==p.type||(_=!0),_){l("plain");for(var u="/",f=o+1,b=!1,w=!1;f<n;){var d=e[f];if(b)u+=d,b=!1,f++;else if("\\"!==d)if("["!==d)if("]"!==d){if("/"===d&&!w){u+=d,f++;break}if("\n"===d)break;u+=d,f++}else w=!1,u+=d,f++;else w=!0,u+=d,f++;else b=!0,u+=d,f++}for(;f<n&&/[gimsuvy]/.test(e[f]);)u+=e[f],f++;t.push({type:"string",text:u}),o=f;continue}}if('"'!==i&&"'"!==i&&"`"!==i)if(/[0-9]/.test(i)||"."===i&&s&&/[0-9]/.test(s)){l("plain");var h="";if("0"===i&&s&&/[xXbBoO]/.test(s))for(h=i+s,o+=2;o<n&&/[0-9a-fA-F_]/.test(e[o]);)h+=e[o],o++;else for(;o<n&&/[0-9._eE]/.test(e[o]);)"e"!==e[o]&&"E"!==e[o]||!e[o+1]||!/[+\-0-9]/.test(e[o+1])?(h+=e[o],o++):(h+=e[o]+e[o+1],o+=2);t.push({type:"number",text:h})}else if(/[a-zA-Z_$]/.test(i)){l("plain");for(var g="";o<n&&/[a-zA-Z0-9_$]/.test(e[o]);)g+=e[o],o++;for(var v=o;v<n&&(" "===e[v]||"\t"===e[v]);)v++;var y=t.length?t[t.length-1]:null,x=y&&"punctuation"===y.type&&"."===y.text;r[g]?t.push({type:"keyword",text:g}):x?v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"property",text:g}):v<n&&"("===e[v]?t.push({type:"function",text:g}):t.push({type:"plain",text:g})}else if(-1==="=+-*/%!<>&|^~?:".indexOf(i))-1==="(){}[];,.".indexOf(i)?(a+=i,o++):(l("plain"),t.push({type:"punctuation",text:i}),o++);else{l("plain");var m=i;++o<n&&-1!=="=+-*/%!<>&|^~?:".indexOf(e[o])&&(m+=e[o],++o<n&&-1!=="=>&|".indexOf(e[o])&&(m+=e[o],o++)),t.push({type:"operator",text:m})}else{l("plain");var k=i,C=i,S=o+1;if("`"===k){for(;S<n;){var T=e[S];if("\\"!==T)if("$"!==T||"{"!==e[S+1]){if("`"===T){C+=T,S++;break}C+=T,S++}else{C.length&&t.push({type:"string",text:C}),C="",t.push({type:"template-interp",text:"${"}),S+=2;for(var E=1,A="";S<n&&E>0;){if("{"===e[S])E++;else if("}"===e[S]&&0===--E)break;A+=e[S],S++}var z=c(A);(t=t.concat(z)).push({type:"template-interp",text:"}"}),S++}else C+=T+(e[S+1]||""),S+=2}C.length&&t.push({type:"string",text:C})}else{for(;S<n;){var O=e[S];if("\\"!==O){if(O===k){C+=O,S++;break}if("\n"===O)break;C+=O,S++}else C+=O+(e[S+1]||""),S+=2}t.push({type:"string",text:C})}o=S}}else{l("plain");var M=e.indexOf("*/",o+2);-1===M&&(M=n-2),t.push({type:"comment",text:e.substring(o,M+2)}),o=M+2}else{l("plain");var R=e.indexOf("\n",o);-1===R&&(R=n),t.push({type:"comment",text:e.substring(o,R)}),o=R}}return l("plain"),t}function n(e){var t=[],o=0,r=e.length,c="selector",n="";function a(e){n.length&&(t.push({type:e||"plain",text:n}),n="")}for(;o<r;){var l=e[o],i=e[o+1];if("/"!==l||"*"!==i)if('"'!==l&&"'"!==l||"value"!==c&&"selector"!==c)if("@"!==l||"selector"!==c)if("#"!==l||"value"!==c)if("value"===c&&/[0-9]/.test(l)){a("css-value");for(var s="";o<r&&/[0-9.]/.test(e[o]);)s+=e[o],o++;for(var p="";o<r&&/[a-zA-Z%]/.test(e[o]);)p+=e[o],o++;t.push({type:"number",text:s+p})}else"{"!==l?"}"!==l?":"!==l||"prop"!==c?";"!==l?","!==l?(n+=l,o++):(a("selector"===c?"selector":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),o++):(a("value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++):(a("css-prop"),t.push({type:"punctuation",text:l}),c="value",o++):(a("prop"===c?"css-prop":"value"===c?"css-value":"plain"),t.push({type:"punctuation",text:l}),c="selector",o++):(a("selector"===c?"selector":"plain"),t.push({type:"punctuation",text:l}),c="prop",o++);else{a("css-value");var _="#";for(o++;o<r&&/[0-9a-fA-F]/.test(e[o]);)_+=e[o],o++;t.push({type:"color",text:_})}else{a("selector");var u="@";for(o++;o<r&&/[a-zA-Z\-]/.test(e[o]);)u+=e[o],o++;t.push({type:"at-rule",text:u})}else{a("selector"===c?"selector":"css-value");var f=l,b=l;for(o++;o<r;)if("\\"!==e[o]){if(e[o]===f){b+=e[o],o++;break}b+=e[o],o++}else b+=e[o]+(e[o+1]||""),o+=2;t.push({type:"string",text:b})}else{a("selector"===c?"selector":"prop"===c?"css-prop":"css-value");var w=e.indexOf("*/",o+2);-1===w&&(w=r-2),t.push({type:"comment",text:e.substring(o,w+2)}),o=w+2}}return a("selector"===c?"selector":"prop"===c?"css-prop":"css-value"),t}function a(e){var t=[],o=0,r=e.length,c="";function n(e){c.length&&(t.push({type:e,text:c}),c="")}for(;o<r;){var a=e[o];if("<"!==a||"\x3c!--"!==e.substring(o,o+4))if("<"!==a)if("&"!==a)c+=a,o++;else{n("plain");var l="&";for(o++;o<r&&";"!==e[o]&&/[a-zA-Z0-9#]/.test(e[o]);)l+=e[o],o++;o<r&&";"===e[o]&&(l+=";",o++),t.push({type:"string",text:l})}else{n("plain");var i="<";for(++o<r&&"/"===e[o]&&(i+="/",o++);o<r&&/[a-zA-Z0-9\-]/.test(e[o]);)i+=e[o],o++;for(t.push({type:"tag",text:i});o<r&&">"!==e[o]&&("/"!==e[o]||">"!==e[o+1]);)if(/\s/.test(e[o])){for(var s="";o<r&&/\s/.test(e[o]);)s+=e[o],o++;t.push({type:"plain",text:s})}else if(/[a-zA-Z_\-@:]/.test(e[o])){for(var p="";o<r&&/[a-zA-Z0-9_\-@:]/.test(e[o]);)p+=e[o],o++;if(t.push({type:"attr-name",text:p}),o<r&&"="===e[o])if(t.push({type:"punctuation",text:"="}),++o<r&&('"'===e[o]||"'"===e[o])){var _=e[o],u=_;for(o++;o<r&&e[o]!==_;)u+=e[o],o++;o<r&&(u+=e[o],o++),t.push({type:"attr-value",text:u})}else{for(var f="";o<r&&!/[\s>]/.test(e[o]);)f+=e[o],o++;t.push({type:"attr-value",text:f})}}else c+=e[o],o++,n("plain");var b="";o<r&&"/"===e[o]&&(b+="/",o++),o<r&&">"===e[o]&&(b+=">",o++),b&&t.push({type:"tag",text:b})}else{n("plain");var w=e.indexOf("--\x3e",o+4);-1===w&&(w=r-3),t.push({type:"comment",text:e.substring(o,w+3)}),o=w+3}}return n("plain"),t}"var,const,let,function,return,if,else,for,while,do,switch,case,break,continue,new,typeof,instanceof,this,class,extends,import,export,default,from,true,false,null,undefined,try,catch,throw,finally,async,await,yield,of,in,delete,void,with,super,static,get,set,debugger".split(",").forEach(function(e){r[e]=!0});var l={js:c,javascript:c,css:n,html:a};function i(e,t){return function(e){for(var t=[],o=0;o<e.length;o++){var r=e[o];"plain"===r.type?t.push(r.text):t.push({t:"span",a:{class:"bw_ce_"+r.type},c:r.text})}return t}((l[t]||c)(e))}function s(e){var t=(e=e||{}).code||"",o=e.lang||"js",r=e.height||"180px",c=!!e.readOnly,n=!!e.lineNumbers,a="bw_ce"+(e.className?" "+e.className:""),l=i(t,o),s={spellcheck:"false",class:"bw_ce_code"};c||(s.contenteditable="true");var p=null;if(n){for(var _=(t.match(/\n/g)||[]).length+1,u=[],f=1;f<=_;f++)u.push({t:"span",c:String(f)});p={t:"div",a:{class:"bw_ce_gutter"},c:u}}var b={t:"pre",a:{style:"flex:1;min-width:0;margin:0"},c:{t:"code",a:s,c:l}};return{t:"div",a:{class:a,style:"max-height:"+r+";overflow:auto"},c:[n?{t:"div",a:{class:"bw_ce_wrap"},c:[p,b]}:b],o:{mounted:function(r){var a=r.querySelector(".bw_ce_code");if(a){var l=t,s=null,p=n?r.querySelector(".bw_ce_gutter"):null,_="undefined"!=typeof window&&window.bw||{};if(r._bwCodeEdit={getValue:f,setValue:function(e){l=e;var t=i(e,o);_.html&&(a.innerHTML=_.html({t:"span",c:t})),b(e)}},p){var u=a.closest(".bw_ce")||r;u.addEventListener("scroll",function(){p.style.transform="translateY("+-u.scrollTop+"px)"}),r.addEventListener("scroll",function(){p.style.transform="translateY("+-r.scrollTop+"px)"})}c||(a.addEventListener("input",function(){clearTimeout(s),s=setTimeout(w,50)}),a.addEventListener("keydown",function(e){"Tab"===e.key&&(e.preventDefault(),document.execCommand("insertText",!1," "))}))}function f(){return a.textContent||""}function b(e){if(p){for(var t=(e.match(/\n/g)||[]).length+1,o="",r=1;r<=t;r++)o+="<span>"+r+"</span>";p.innerHTML=o}}function w(){var t=f();if(t!==l){l=t;var r=function(e){var t=window.getSelection();if(!t.rangeCount)return 0;var o=t.getRangeAt(0).cloneRange();return o.selectNodeContents(e),o.setEnd(t.getRangeAt(0).startContainer,t.getRangeAt(0).startOffset),o.toString().length}(a),c=i(t,o);_.html&&(a.innerHTML=_.html({t:"span",c:c})),function(e,t){for(var o,r=window.getSelection(),c=document.createRange(),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),a=0;o=n.nextNode();){var l=o.textContent.length;if(a+l>=t)return c.setStart(o,t-a),c.collapse(!0),r.removeAllRanges(),void r.addRange(c);a+=l}c.selectNodeContents(e),c.collapse(!1),r.removeAllRanges(),r.addRange(c)}(a,r),b(t),e.onChange&&e.onChange(t)}}}}}}function p(e){e&&(e.highlight=i,e.codeEditor=function(r){return function(e){t||(t=!0,e&&e.injectCSS&&e.injectCSS(o,{id:"bw_code_edit_styles"}))}(e),s(r)})}"undefined"!=typeof window&&window.bw&&p(window.bw);var _={highlight:i,codeEditor:s,install:p,CSS_TEXT:o};e.CSS_TEXT=o,e.codeEditor=s,e.default=_,e.highlight=i,e.install=p,e.tokenizeCSS=n,e.tokenizeHTML=a,e.tokenizeJS=c,Object.defineProperty(e,"__esModule",{value:!0})});
22
20
  //# sourceMappingURL=bitwrench-code-edit.es5.min.js.map
@@ -1,15 +1,13 @@
1
- /*! bitwrench v2.0.18 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  /**
3
3
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
4
4
  *
5
5
  * Provides bw.highlight() for tokenizing JS/CSS/HTML into TACO spans,
6
6
  * and bw.codeEditor() for a live editable code block with syntax coloring.
7
7
  *
8
- * Theme integration: The editor chrome (background, text color, font) reads
9
- * from CSS custom properties --bw_code_bg, --bw_code_text, --bw_font_mono,
10
- * falling back to built-in dark values when no theme is active. Syntax
11
- * highlighting colors are intentionally fixed (they are a code color scheme,
12
- * not brand colors). The bw_ce_light class is still supported for manual
8
+ * Theme integration: The editor chrome uses self-contained dark defaults.
9
+ * Syntax highlighting colors are intentionally fixed (they are a code color
10
+ * scheme, not brand colors). The bw_ce_light class is supported for manual
13
11
  * light-mode override.
14
12
  *
15
13
  * Can be loaded standalone (browser script tag after bitwrench.umd.js),
@@ -22,9 +20,9 @@
22
20
  // -- CSS (injected once) ----------------------------------------------
23
21
  var _cssInjected = false;
24
22
  var CSS_TEXT =
25
- '.bw_ce{background:var(--bw_code_bg,#1e293b);border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}' +
23
+ '.bw_ce{background:#1e293b;border-radius:6px;border:1px solid rgba(255,255,255,0.08);overflow:auto}' +
26
24
  '.bw_ce pre{margin:0;padding:0}' +
27
- '.bw_ce code{font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;color:var(--bw_code_text,#e2e8f0);outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}' +
25
+ '.bw_ce code{font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;outline:none;white-space:pre-wrap;display:block;padding:0.75rem 1rem}' +
28
26
  '.bw_ce code:empty::before{content:"\\200b"}' +
29
27
  '.bw_ce .bw_ce_keyword{color:#c792ea}' +
30
28
  '.bw_ce .bw_ce_string{color:#c3e88d}' +
@@ -65,7 +63,7 @@ var CSS_TEXT =
65
63
  '.bw_ce_light.bw_ce .bw_ce_template_interp{color:#0891b2}' +
66
64
  // Line number gutter (opt-in via lineNumbers option)
67
65
  '.bw_ce_wrap{display:flex;flex-direction:row}' +
68
- '.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:var(--bw_font_mono,"SF Mono",Monaco,"Cascadia Code",Consolas,monospace);font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}' +
66
+ '.bw_ce_gutter{flex:0 0 auto;padding:0.75rem 0;text-align:right;user-select:none;-webkit-user-select:none;color:#546e7a;font-family:"SF Mono",Monaco,"Cascadia Code",Consolas,monospace;font-size:0.875rem;line-height:1.6;border-right:1px solid rgba(255,255,255,0.08);overflow:hidden}' +
69
67
  '.bw_ce_gutter span{display:block;padding:0 0.5rem 0 0.75rem}' +
70
68
  '.bw_ce_light .bw_ce_gutter{color:#9ca3af;border-right-color:#d8d8d8}';
71
69