@shwfed/config 2.7.6 → 2.7.7

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 (99) hide show
  1. package/dist/mcp.mjs +73 -21
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/badge-B0tiCpa_.js +1 -0
  4. package/dist/preview/assets/config-BG9TRQcv.js +1 -0
  5. package/dist/preview/assets/{config-B7hXY5FF.js → config-Bfb2sH6S.js} +1 -1
  6. package/dist/preview/assets/config-C-XJ-8Rs.js +1 -0
  7. package/dist/preview/assets/{config-C947O8za.js → config-CGvnv-5x.js} +1 -1
  8. package/dist/preview/assets/config-DDPihojt.js +1 -0
  9. package/dist/preview/assets/config-Dafqx9xC.js +1 -0
  10. package/dist/preview/assets/{config-DppExb4h.js → config-DqMRy1WL.js} +1 -1
  11. package/dist/preview/assets/{config-Bl8L6943.js → config-GCvXe12z.js} +1 -1
  12. package/dist/preview/assets/{config-DhAntnE5.js → config-jDPbLgBr.js} +1 -1
  13. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js +1 -0
  14. package/dist/preview/assets/index-CHzOsSTW.js +680 -0
  15. package/dist/preview/assets/index-CSfKAdi7.js +1 -0
  16. package/dist/preview/assets/{index-DiC1rvCq.js → index-D7jDE3kp.js} +1 -1
  17. package/dist/preview/assets/item-DV-Garrg.js +1 -0
  18. package/dist/preview/assets/runtime-BovPWken.js +1 -0
  19. package/dist/preview/assets/runtime-BxBBFFHA.js +1 -0
  20. package/dist/preview/assets/{runtime-BQnHKogz.js → runtime-CwmJ9MLQ.js} +1 -1
  21. package/dist/preview/assets/runtime-Cyjx6haa.js +1 -0
  22. package/dist/preview/assets/runtime-D-LBi56N.js +1 -0
  23. package/dist/preview/assets/{runtime-kLWO8JbC.js → runtime-DA77AmOP.js} +1 -1
  24. package/dist/preview/assets/{runtime-DmV_M4B_.js → runtime-DHTqFEQI.js} +1 -1
  25. package/dist/preview/assets/runtime-DKtlQWwc.js +1 -0
  26. package/dist/preview/assets/runtime-UmLaEUGf.js +1 -0
  27. package/dist/preview/index.html +1 -1
  28. package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +16 -2
  29. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/runtime.vue +2 -2
  30. package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/item.vue +2 -2
  31. package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.js +2 -2
  32. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.vue +3 -2
  33. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +2 -2
  34. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +6 -5
  35. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +2 -2
  36. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +3 -4
  37. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +3 -4
  38. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +3 -4
  39. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +6 -5
  40. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +2 -2
  41. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +6 -5
  42. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +2 -2
  43. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +3 -4
  44. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +3 -4
  45. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +3 -4
  46. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +3 -4
  47. package/dist/runtime/components/form/schema.js +2 -2
  48. package/dist/runtime/components/form/utils/initial.d.ts +5 -4
  49. package/dist/runtime/components/form/utils/initial.js +2 -2
  50. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +7 -6
  51. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +2 -2
  52. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +7 -6
  53. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +2 -2
  54. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +7 -6
  55. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +2 -2
  56. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +7 -6
  57. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +2 -2
  58. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +7 -6
  59. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.js +2 -2
  60. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +7 -6
  61. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.js +2 -2
  62. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue +3 -4
  63. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -2
  64. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue +3 -4
  65. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +2 -2
  66. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +7 -6
  67. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +2 -2
  68. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +7 -6
  69. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +2 -2
  70. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +3 -4
  71. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -2
  72. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +3 -4
  73. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +2 -2
  74. package/dist/runtime/components/table/index.vue +3 -4
  75. package/dist/runtime/components/table/schema.js +3 -3
  76. package/dist/runtime/share/expression.d.ts +13 -0
  77. package/dist/runtime/share/expression.js +1 -0
  78. package/dist/runtime/share/request.d.ts +29 -0
  79. package/dist/runtime/share/request.js +11 -0
  80. package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -2
  81. package/dist/runtime/vendor/cel-js/PROMPT.md +35 -3
  82. package/dist/runtime/vendor/cel-js/lib/functions.js +2 -2
  83. package/dist/runtime/vendor/cel-js/lib/optional.js +52 -1
  84. package/package.json +1 -1
  85. package/dist/preview/assets/badge-C-IvPZBx.js +0 -1
  86. package/dist/preview/assets/config-DXlCQMVi.js +0 -1
  87. package/dist/preview/assets/config-Dj0rEZRq.js +0 -1
  88. package/dist/preview/assets/config-_aVQvlhc.js +0 -1
  89. package/dist/preview/assets/config-l01zamcS.js +0 -1
  90. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-BbuC0qEM.js +0 -1
  91. package/dist/preview/assets/index-BNaI1T0H.js +0 -680
  92. package/dist/preview/assets/index-BwoBmSxu.js +0 -1
  93. package/dist/preview/assets/item-GFiAkFW6.js +0 -1
  94. package/dist/preview/assets/runtime-5h5U6Ozr.js +0 -1
  95. package/dist/preview/assets/runtime-B6dXW6zW.js +0 -1
  96. package/dist/preview/assets/runtime-BEOIc4zU.js +0 -1
  97. package/dist/preview/assets/runtime-Bx7G-5dR.js +0 -1
  98. package/dist/preview/assets/runtime-TNDFpOlo.js +0 -1
  99. package/dist/preview/assets/runtime-g9hb36Vh.js +0 -1
@@ -0,0 +1 @@
1
+ import{b2 as e}from"./index-CHzOsSTW.js";import{b3 as f,b4 as r,b5 as s}from"./index-CHzOsSTW.js";export{f as TableConfig,r as createTableConfig,e as default,s as getColumnTechnicalKey};
@@ -1 +1 @@
1
- import{d as H,v as et,x as it,a as nt,y as st,z as at,b as D,r as P,e as j,o as rt,A as ot,B as z,C as lt,w as ct,D as W,E as ht}from"./index-BNaI1T0H.js";const dt=String.raw,pt=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),ut=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),k=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,C="--_number-flow-d-opacity",L="--_number-flow-d-width",S="--_number-flow-dx",V="--_number-flow-d",mt=(()=>{try{return CSS.registerProperty({name:C,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:S,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:L,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:V,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),U="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",v=`calc(${U} * 2)`,M="var(--number-flow-mask-width, 0.5em)",y=`calc(${M} / var(--scale-x))`,$="#000 0, transparent 71%",ft=dt`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${L}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${M});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${$}),radial-gradient(at bottom left,${$}),radial-gradient(at top left,${$}),radial-gradient(at top right,${$});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${y} * 2) 100%,${y} ${v},${y} ${v},${y} ${v},${y} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${U} ${M};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${S})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${V})}.digit__num,.number .section::after{padding:${U} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`,gt=HTMLElement,vt=(s,t)=>s==null?t:t==null?s:Math.max(s,t),T=new WeakMap,jt={onUpdate(s,t,e){if(T.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),n=s.integer.concat(s.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!n.find(c=>c.pos===o.pos&&c.value===o.value)),a=n.find(o=>!i.find(c=>o.pos===c.pos&&o.value===c.value));T.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=T.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},g=(s,t,e)=>{const i=document.createElement(s),[n,r]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),r?.forEach(a=>i.appendChild(a)),i},yt=(s,t)=>{var e;return t==="left"?s.offsetLeft:(((e=s.offsetParent instanceof HTMLElement?s.offsetParent:null)==null?void 0:e.offsetWidth)??0)-s.offsetWidth-s.offsetLeft},wt=s=>s.offsetWidth>0&&s.offsetHeight>0,_t=(s,t)=>{!customElements.get(s)&&customElements.define(s,t)};function bt(s,t,{reverse:e=!1}={}){const i=s.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(s[n],n)}function $t(s,t,e,i){const n=t.formatToParts(s);e&&n.unshift({type:"prefix",value:e}),i&&n.push({type:"suffix",value:i});const r=[],a=[],o=[],c=[],l={},d=p=>`${p}:${l[p]=(l[p]??-1)+1}`;let m="",_=!1,b=!1;for(const p of n){m+=p.value;const h=p.type==="minusSign"||p.type==="plusSign"?"sign":p.type;h==="integer"?(_=!0,a.push(...p.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:p.value}):h==="decimal"?(b=!0,o.push({type:h,value:p.value,key:d(h)})):h==="fraction"?o.push(...p.value.split("").map(A=>({type:h,value:parseInt(A),key:d(h),pos:-1-l[h]}))):(_||b?c:r).push({type:h,value:p.value,key:d(h)})}const F=[];for(let p=a.length-1;p>=0;p--){const h=a[p];F.unshift(h.type==="integer"?{...h,key:d(h.type),pos:l[h.type]}:{...h,key:d(h.type)})}return{pre:r,integer:F,fraction:o,post:c,valueAsString:m,value:typeof s=="string"?parseFloat(s):s}}const Y=ut&&pt&&mt;let u=class extends gt{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e,i;if(t==null)return;const{pre:n,integer:r,fraction:a,post:o,value:c}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,c):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!((e=k)!=null&&e.matches))&&wt(this)&&this.ownerDocument.visibilityState==="visible",(i=this.plugins)==null||i.forEach(d=>{var m;return(m=d.onUpdate)==null?void 0:m.call(d,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:r,fraction:a}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}const l=document.createElement("style");this.nonce&&(l.nonce=this.nonce),l.textContent=ft,this.shadowRoot.appendChild(l),this._pre=new O(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new xt(this,r,a),this.shadowRoot.appendChild(this._num.el),this._post=new O(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};u.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(s,t)=>Math.sign(t-s),respectMotionPreference:!0,plugins:void 0,digits:void 0};class xt{constructor(t,e,i,{className:n,...r}={}){this.flow=t,this._integer=new I(t,e,{justify:"right",part:"integer"}),this._fraction=new I(t,i,{justify:"left",part:"fraction"}),this._inner=g("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=g("span",{...r,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[S]:[`${e}px`,"0px"],[L]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}let G=class{constructor(t,e,{justify:i,className:n,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=i;const o=e.map(c=>this.addChar(c).el);this.el=g("span",{...r,className:`section section--justify-${i} ${n??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new q(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new kt(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,n),n}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${yt(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,n=this.justify==="left",r=n?"prepend":"append";if(bt(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:n}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(n=>n.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};class I extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof q&&i.update(0)}),this.pop(e)}}class O extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class R{constructor(t,e,{onRemove:i,animateIn:n=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[C]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[C]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class Z extends R{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class q extends Z{constructor(t,e,i,n,r){var a,o;const c=(((o=(a=t.flow.digits)==null?void 0:a[n])==null?void 0:o.max)??9)+1,l=Array.from({length:c}).map((m,_)=>{const b=g("span",{className:"digit__num"},[document.createTextNode(String(_))]);return _!==i&&b.setAttribute("inert",""),b.style.setProperty("--n",String(_)),b}),d=g("span",{part:`digit ${e}-digit`,className:"digit"},l);d.style.setProperty("--current",String(i)),d.style.setProperty("--length",String(c)),super(t,i,d,r),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=c}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],n=e.width/2;this._prevCenter=this.section.justify==="left"?i+n:i-n}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],n=e.width/2,r=this.section.justify==="left"?i+n:i-n,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[V]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const n of this.flow.plugins){const r=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class kt extends Z{constructor(t,e,i,n){const r=g("span",{className:"symbol__value",textContent:i});super(t,i,g("span",{part:`symbol ${e}`,className:"symbol"},[r]),n),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new R(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const n=g("span",{className:"symbol__value",textContent:t});this.el.appendChild(n),this._children.set(t,new R(this.flow,n,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const X=String.raw;(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})();typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)");typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)");const J="--_number-flow-d-opacity",K="--_number-flow-d-width",N="--_number-flow-dx",Q="--_number-flow-d";(()=>{try{return CSS.registerProperty({name:J,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:N,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:K,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Q,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})();const E="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",f=`calc(${E} * 2)`,B="var(--number-flow-mask-width, 0.5em)",w=`calc(${B} / var(--scale-x))`,x="#000 0, transparent 71%",Ct=X`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${K}) / var(--width));transform:translateX(var(${N})) scaleX(var(--scale-x));margin:0 calc(-1 * ${B});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${w},#000 calc(100% - ${w}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${f},#000 calc(100% - ${f}),transparent 100% ),radial-gradient(at bottom right,${x}),radial-gradient(at bottom left,${x}),radial-gradient(at top left,${x}),radial-gradient(at top right,${x});-webkit-mask-size:100% calc(100% - ${f} * 2),calc(100% - ${w} * 2) 100%,${w} ${f},${w} ${f},${w} ${f},${w} ${f};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${E} ${B};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${N})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${Q})}.digit__num,.number .section::after{padding:${E} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${J}))}`,St=X`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:1}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${E} 0}.symbol{white-space:pre}`,Et=(s="")=>X`:where(number-flow${s}){line-height:1}number-flow${s} > span{font-kerning:none;display:inline-block;padding:${f} 0}`,At=s=>[St,Et(s),Ct],tt=Symbol(),Rt=H({__name:"NumberFlowGroup",setup(s){const t=new Set;let e=!1;return lt(tt,(i,n)=>{t.add(i),ct(n,async()=>{e||(e=!0,t.forEach(async r=>{var a;!r.value||!r.value.created||(r.value.willUpdate(),await W(),(a=r.value)==null||a.didUpdate())}),await W(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),Tt=["batched","trend","plugins","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","nonce","data-will-change","digits","innerHTML","data"],Nt=H({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>u.defaultProps.transformTiming},spinTiming:{default:()=>u.defaultProps.spinTiming},opacityTiming:{default:()=>u.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>u.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>u.defaultProps.respectMotionPreference},trend:{type:[Number,Function],default:()=>u.defaultProps.trend},plugins:{default:()=>u.defaultProps.plugins},digits:{default:()=>u.defaultProps.digits},locales:{},format:{},value:{},prefix:{},suffix:{},nonce:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(s,{expose:t,emit:e}){const i=P();t({el:i});const n=e,r=j(()=>new Intl.NumberFormat(s.locales,s.format)),a=j(()=>$t(s.value,r.value,s.prefix,s.suffix)),o=void 0,c=it(tt,void 0);return c?.(i,a),(l,d)=>(nt(),st("number-flow-vue",at({ref_key:"el",ref:i},l.$attrs,{batched:!!D(c),trend:l.trend,plugins:l.plugins,animated:l.animated,transformTiming:l.transformTiming,spinTiming:l.spinTiming,opacityTiming:l.opacityTiming,respectMotionPreference:l.respectMotionPreference,nonce:l.nonce,"data-will-change":l.willChange?"":void 0,digits:l.digits,innerHTML:D(o),"data-allow-mismatch":"",onAnimationsstart:d[0]||(d[0]=m=>n("animationsstart")),onAnimationsfinish:d[1]||(d[1]=m=>n("animationsfinish")),data:a.value}),null,16,Tt))}}),Bt=At("-vue");_t("number-flow-vue",u);function Lt({respectMotionPreference:s=!0}={}){const t=P(!1),e=P(!1);return rt(()=>{var i;t.value=Y,e.value=((i=k)==null?void 0:i.matches)??!1}),ot(i=>{var n;if(!z(s))return;const r=({matches:a})=>{e.value=a};(n=k)==null||n.addEventListener("change",r),i(()=>{var a;(a=k)==null||a.removeEventListener("change",r)})}),j(()=>t.value&&(!z(s)||!e.value))}export{u as NumberFlowElement,Rt as NumberFlowGroup,jt as continuous,Nt as default,Bt as styles,Lt as useCanAnimate};
1
+ import{d as H,x as et,y as it,a as nt,z as st,A as at,b as D,r as P,e as j,o as rt,B as ot,C as z,D as lt,w as ct,E as W,F as ht}from"./index-CHzOsSTW.js";const dt=String.raw,pt=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),ut=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),k=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,C="--_number-flow-d-opacity",L="--_number-flow-d-width",S="--_number-flow-dx",V="--_number-flow-d",mt=(()=>{try{return CSS.registerProperty({name:C,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:S,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:L,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:V,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),U="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",v=`calc(${U} * 2)`,M="var(--number-flow-mask-width, 0.5em)",y=`calc(${M} / var(--scale-x))`,$="#000 0, transparent 71%",ft=dt`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${L}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${M});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${$}),radial-gradient(at bottom left,${$}),radial-gradient(at top left,${$}),radial-gradient(at top right,${$});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${y} * 2) 100%,${y} ${v},${y} ${v},${y} ${v},${y} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${U} ${M};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${S})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${V})}.digit__num,.number .section::after{padding:${U} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`,gt=HTMLElement,vt=(s,t)=>s==null?t:t==null?s:Math.max(s,t),T=new WeakMap,jt={onUpdate(s,t,e){if(T.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),n=s.integer.concat(s.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!n.find(c=>c.pos===o.pos&&c.value===o.value)),a=n.find(o=>!i.find(c=>o.pos===c.pos&&o.value===c.value));T.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=T.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},g=(s,t,e)=>{const i=document.createElement(s),[n,r]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),r?.forEach(a=>i.appendChild(a)),i},yt=(s,t)=>{var e;return t==="left"?s.offsetLeft:(((e=s.offsetParent instanceof HTMLElement?s.offsetParent:null)==null?void 0:e.offsetWidth)??0)-s.offsetWidth-s.offsetLeft},wt=s=>s.offsetWidth>0&&s.offsetHeight>0,_t=(s,t)=>{!customElements.get(s)&&customElements.define(s,t)};function bt(s,t,{reverse:e=!1}={}){const i=s.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(s[n],n)}function $t(s,t,e,i){const n=t.formatToParts(s);e&&n.unshift({type:"prefix",value:e}),i&&n.push({type:"suffix",value:i});const r=[],a=[],o=[],c=[],l={},d=p=>`${p}:${l[p]=(l[p]??-1)+1}`;let m="",_=!1,b=!1;for(const p of n){m+=p.value;const h=p.type==="minusSign"||p.type==="plusSign"?"sign":p.type;h==="integer"?(_=!0,a.push(...p.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:p.value}):h==="decimal"?(b=!0,o.push({type:h,value:p.value,key:d(h)})):h==="fraction"?o.push(...p.value.split("").map(A=>({type:h,value:parseInt(A),key:d(h),pos:-1-l[h]}))):(_||b?c:r).push({type:h,value:p.value,key:d(h)})}const X=[];for(let p=a.length-1;p>=0;p--){const h=a[p];X.unshift(h.type==="integer"?{...h,key:d(h.type),pos:l[h.type]}:{...h,key:d(h.type)})}return{pre:r,integer:X,fraction:o,post:c,valueAsString:m,value:typeof s=="string"?parseFloat(s):s}}const Y=ut&&pt&&mt;let u=class extends gt{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e,i;if(t==null)return;const{pre:n,integer:r,fraction:a,post:o,value:c}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,c):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!((e=k)!=null&&e.matches))&&wt(this)&&this.ownerDocument.visibilityState==="visible",(i=this.plugins)==null||i.forEach(d=>{var m;return(m=d.onUpdate)==null?void 0:m.call(d,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:r,fraction:a}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}const l=document.createElement("style");this.nonce&&(l.nonce=this.nonce),l.textContent=ft,this.shadowRoot.appendChild(l),this._pre=new O(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new xt(this,r,a),this.shadowRoot.appendChild(this._num.el),this._post=new O(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};u.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(s,t)=>Math.sign(t-s),respectMotionPreference:!0,plugins:void 0,digits:void 0};class xt{constructor(t,e,i,{className:n,...r}={}){this.flow=t,this._integer=new I(t,e,{justify:"right",part:"integer"}),this._fraction=new I(t,i,{justify:"left",part:"fraction"}),this._inner=g("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=g("span",{...r,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[S]:[`${e}px`,"0px"],[L]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}let G=class{constructor(t,e,{justify:i,className:n,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=i;const o=e.map(c=>this.addChar(c).el);this.el=g("span",{...r,className:`section section--justify-${i} ${n??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new q(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new kt(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,n),n}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${yt(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,n=this.justify==="left",r=n?"prepend":"append";if(bt(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:n}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(n=>n.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};class I extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof q&&i.update(0)}),this.pop(e)}}class O extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class R{constructor(t,e,{onRemove:i,animateIn:n=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[C]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[C]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class Z extends R{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class q extends Z{constructor(t,e,i,n,r){var a,o;const c=(((o=(a=t.flow.digits)==null?void 0:a[n])==null?void 0:o.max)??9)+1,l=Array.from({length:c}).map((m,_)=>{const b=g("span",{className:"digit__num"},[document.createTextNode(String(_))]);return _!==i&&b.setAttribute("inert",""),b.style.setProperty("--n",String(_)),b}),d=g("span",{part:`digit ${e}-digit`,className:"digit"},l);d.style.setProperty("--current",String(i)),d.style.setProperty("--length",String(c)),super(t,i,d,r),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=c}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],n=e.width/2;this._prevCenter=this.section.justify==="left"?i+n:i-n}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],n=e.width/2,r=this.section.justify==="left"?i+n:i-n,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[V]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const n of this.flow.plugins){const r=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class kt extends Z{constructor(t,e,i,n){const r=g("span",{className:"symbol__value",textContent:i});super(t,i,g("span",{part:`symbol ${e}`,className:"symbol"},[r]),n),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new R(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const n=g("span",{className:"symbol__value",textContent:t});this.el.appendChild(n),this._children.set(t,new R(this.flow,n,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const F=String.raw;(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})();typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)");typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)");const J="--_number-flow-d-opacity",K="--_number-flow-d-width",N="--_number-flow-dx",Q="--_number-flow-d";(()=>{try{return CSS.registerProperty({name:J,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:N,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:K,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Q,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})();const E="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",f=`calc(${E} * 2)`,B="var(--number-flow-mask-width, 0.5em)",w=`calc(${B} / var(--scale-x))`,x="#000 0, transparent 71%",Ct=F`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${K}) / var(--width));transform:translateX(var(${N})) scaleX(var(--scale-x));margin:0 calc(-1 * ${B});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${w},#000 calc(100% - ${w}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${f},#000 calc(100% - ${f}),transparent 100% ),radial-gradient(at bottom right,${x}),radial-gradient(at bottom left,${x}),radial-gradient(at top left,${x}),radial-gradient(at top right,${x});-webkit-mask-size:100% calc(100% - ${f} * 2),calc(100% - ${w} * 2) 100%,${w} ${f},${w} ${f},${w} ${f},${w} ${f};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${E} ${B};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${N})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${Q})}.digit__num,.number .section::after{padding:${E} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${J}))}`,St=F`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:1}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${E} 0}.symbol{white-space:pre}`,Et=(s="")=>F`:where(number-flow${s}){line-height:1}number-flow${s} > span{font-kerning:none;display:inline-block;padding:${f} 0}`,At=s=>[St,Et(s),Ct],tt=Symbol(),Rt=H({__name:"NumberFlowGroup",setup(s){const t=new Set;let e=!1;return lt(tt,(i,n)=>{t.add(i),ct(n,async()=>{e||(e=!0,t.forEach(async r=>{var a;!r.value||!r.value.created||(r.value.willUpdate(),await W(),(a=r.value)==null||a.didUpdate())}),await W(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),Tt=["batched","trend","plugins","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","nonce","data-will-change","digits","innerHTML","data"],Nt=H({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>u.defaultProps.transformTiming},spinTiming:{default:()=>u.defaultProps.spinTiming},opacityTiming:{default:()=>u.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>u.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>u.defaultProps.respectMotionPreference},trend:{type:[Number,Function],default:()=>u.defaultProps.trend},plugins:{default:()=>u.defaultProps.plugins},digits:{default:()=>u.defaultProps.digits},locales:{},format:{},value:{},prefix:{},suffix:{},nonce:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(s,{expose:t,emit:e}){const i=P();t({el:i});const n=e,r=j(()=>new Intl.NumberFormat(s.locales,s.format)),a=j(()=>$t(s.value,r.value,s.prefix,s.suffix)),o=void 0,c=it(tt,void 0);return c?.(i,a),(l,d)=>(nt(),st("number-flow-vue",at({ref_key:"el",ref:i},l.$attrs,{batched:!!D(c),trend:l.trend,plugins:l.plugins,animated:l.animated,transformTiming:l.transformTiming,spinTiming:l.spinTiming,opacityTiming:l.opacityTiming,respectMotionPreference:l.respectMotionPreference,nonce:l.nonce,"data-will-change":l.willChange?"":void 0,digits:l.digits,innerHTML:D(o),"data-allow-mismatch":"",onAnimationsstart:d[0]||(d[0]=m=>n("animationsstart")),onAnimationsfinish:d[1]||(d[1]=m=>n("animationsfinish")),data:a.value}),null,16,Tt))}}),Bt=At("-vue");_t("number-flow-vue",u);function Lt({respectMotionPreference:s=!0}={}){const t=P(!1),e=P(!1);return rt(()=>{var i;t.value=Y,e.value=((i=k)==null?void 0:i.matches)??!1}),ot(i=>{var n;if(!z(s))return;const r=({matches:a})=>{e.value=a};(n=k)==null||n.addEventListener("change",r),i(()=>{var a;(a=k)==null||a.removeEventListener("change",r)})}),j(()=>t.value&&(!z(s)||!e.value))}export{u as NumberFlowElement,Rt as NumberFlowGroup,jt as continuous,Nt as default,Bt as styles,Lt as useCanAnimate};
@@ -0,0 +1 @@
1
+ import{d as q,u as B,o as O,w as y,a as M,c as E,n as T,b as V,r as x,e as o,g as z,f as A,h as s,i as J,j as L,p as P,l as U,k as W,m as D,q as g,s as G,t as h,v as H}from"./index-CHzOsSTW.js";import K from"./index-D7jDE3kp.js";const X=q({name:"ShwfedBlockAnimatedNumberItem",__name:"item",props:{item:{}},setup(b){const n=b,j=G(),a=x(void 0),m=x(0);function u(){return D(j)}function S(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){const t=Number(e);return Number.isFinite(t)?t:0}return 0}const d=o(()=>a.value===void 0?g():H(a.value));function v(e){if(!e)return"";try{const t=h(s(e,{...u(),json:d.value}));return t==null?"":String(t)}catch{return""}}const w=o(()=>v(n.item.prefix)),_=o(()=>v(n.item.suffix));function C(e){if(e)try{const t=h(s(e,{...u(),json:d.value}));return t==null?void 0:typeof t=="string"||typeof t=="object"?t:String(t)}catch{return}}const F=o(()=>C(n.item.style));async function r(){const e=n.item.dataSource,t=u(),N=z(function*(){let i=g();e.request&&(i=yield*A(yield*s(e.request,t)));const k=yield*s(e.value,{...t,json:i});return{json:J(i),value:k}});try{const i=await L(P(N,U));a.value=i.json,m.value=S(i.value)}catch(i){console.warn("[shwfed-animated-number] fetch failed",i)}}const l=o(()=>(n.item.pollingInterval??0)>0),I=o(()=>Math.max(1,n.item.pollingInterval??1)*1e3),c=W(),{pause:p,resume:f}=B(()=>{r()},I,{immediate:!1});return O(()=>{r(),l.value&&c.value&&f()}),y(c,e=>{l.value&&(e?(r(),f()):p())}),y(()=>[n.item.dataSource.request??"",n.item.dataSource.value,n.item.pollingInterval??0].join("|"),()=>{r(),l.value&&c.value?f():p()}),(e,t)=>(M(),E(V(K),{value:m.value,prefix:w.value,suffix:_.value,style:T(F.value)},null,8,["value","prefix","suffix","style"]))}});export{X as default};
@@ -0,0 +1 @@
1
+ import{d as u,aK as p,aE as m,aL as a,aM as g,aH as d,c as l,b as x,h as E,m as _,aI as h,s as C,aJ as I,a as b}from"./index-CHzOsSTW.js";import{_ as v}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";const R=u({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(t){const e=t,c=C(),i=(n,s)=>E(n,{..._(c),...s}),r=I(),o=h(),f=p(()=>{const n=o?m(()=>o()):a(!0);return g(n,s=>s?d(e.config.expression,i,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:r,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}):a(void 0))});return(n,s)=>(b(),l(v,{"action-id":t.buttonId,effect:x(f)},null,8,["action-id","effect"]))}});export{R as default};
@@ -0,0 +1 @@
1
+ import{d as l,aY as g,aK as A,aM as y,aV as h,c as _,b,h as S,m as j,aJ as k,aZ as C,a as B,s as O}from"./index-CHzOsSTW.js";import{_ as x}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";const I=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=O(),f=(e,t)=>S(e,{...j(i),...t}),n=g(),c=n.kind==="form"&&n.parent?n.parent:n,u=k(),m=C((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return o(e)&&o(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(c.getAt(t),e[t]);c.setAt(t,a)}return h(u,s.config.onSuccess)}));return(e,t)=>(B(),_(x,{"action-id":r.buttonId,effect:b(d)},null,8,["action-id","effect"]))}});export{I as default};
@@ -1 +1 @@
1
- import{_ as c}from"./definition.vue_vue_type_script_setup_true_lang-BbuC0qEM.js";import{d as s,aJ as o,aU as i,c as r,b as f,aI as u,a as m}from"./index-BNaI1T0H.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=o(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(c,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
1
+ import{_ as c}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";import{d as s,aK as o,aV as i,c as r,b as f,aJ as u,a as m}from"./index-CHzOsSTW.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=o(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(c,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
@@ -0,0 +1 @@
1
+ import{d as f,aK as u,aM as l,aE as d,c as m,b as w,h as p,m as h,s as _,a as g}from"./index-CHzOsSTW.js";import{_ as b}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";function v(){return{resolve:e=>({href:new URL(e,window.location.href).href})}}function x(e,t){return window.location.assign(e),Promise.resolve()}const B=f({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,i=v(),a=_(),r=(n,o)=>p(n,{...h(a),...o});function c(n){try{return new URL(n,window.location.href).origin!==window.location.origin}catch{return!1}}const s=u(()=>l(r(t.config.url),n=>d(async()=>{const o=c(n);if(t.config.mode==="_blank"){window.open(o?n:i.resolve(n).href,"_blank");return}await x(n)})));return(n,o)=>(g(),m(b,{"action-id":e.buttonId,effect:w(s)},null,8,["action-id","effect"]))}});export{B as default};
@@ -0,0 +1 @@
1
+ import{d as i,G as x,aO as M,g as T,M as c,aP as p,t as S,c as b,H as d,b as u,r as N,y as k,aJ as I,aQ as L,a as H,S as w,n as A,I as r,aR as F,aS as R,ax as V,s as $,aT as f,D as m,aU as j}from"./index-CHzOsSTW.js";import{_ as z}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";const Y=i({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(n){const a=n,{locale:l}=x(),v=e=>{},g=$(),s=k(f,void 0),h=I(),o=N(null),C=M(a.buttonId,{close:()=>L(()=>{o.value?.()})},h),y=i({name:"ModalBoundaryBridge",setup(e,{slots:t}){return R(g),m(j,C),s&&m(f,s),()=>t.default?.()}}),E=(e,t)=>V()?.(e,t),_=T(function*(){const e=c(a.config.modalTitle,l.value)??c(a.buttonTitle,l.value)??"",{modal:t,close:B}=yield*p({title:e,width:a.config.modalWidth});o.value=()=>S(B()),yield*t,o.value=null});return(e,t)=>(H(),b(z,{"action-id":n.buttonId,effect:u(_)},{default:d(()=>[w("div",{style:A(n.config.modalMinHeight?`min-height: ${n.config.modalMinHeight}`:void 0)},[r(u(y),null,{default:d(()=>[r(F,{"slot-value":n.config.slot,configure:v,"find-entry":E},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{Y as default};
@@ -1 +1 @@
1
- import{d as _,aJ as E,g as S,aN as r,aU as m,aV as b,aW as j,c as k,b as v,f as x,k as B,aI as L,q as C,a as R}from"./index-BNaI1T0H.js";import{_ as U}from"./definition.vue_vue_type_script_setup_true_lang-BbuC0qEM.js";const O=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=C(),t=(e,n)=>x(e,{...B(g),...n}),l=L(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=E(()=>S(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*b(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(R(),k(U,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{O as default};
1
+ import{d as _,aK as E,g as S,aQ as r,aV as m,aW as b,aX as j,c as v,b as x,h as B,m as L,aJ as k,s as C,a as R}from"./index-CHzOsSTW.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";const q=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=C(),t=(e,n)=>B(e,{...L(g),...n}),l=k(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=E(()=>S(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*b(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[i](s))}if(i==="success"||i==="info"){const w=yield*(yield*t(e.download,a)).file();yield*r(()=>f(w))}const h={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,h[i])}));return(e,n)=>(R(),v(T,{"action-id":d.buttonId,effect:x(y)},null,8,["action-id","effect"]))}});export{q as default};
@@ -1 +1 @@
1
- import{_ as n}from"./definition.vue_vue_type_script_setup_true_lang-BbuC0qEM.js";import{d as o,c as a,b as c,a as f,aM as i}from"./index-BNaI1T0H.js";const _=o({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(t){const e=i;return(r,s)=>(f(),a(n,{"action-id":t.buttonId,effect:c(e)},null,8,["action-id","effect"]))}});export{_ as default};
1
+ import{_ as n}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";import{d as o,c as a,b as c,a as f,aN as i}from"./index-CHzOsSTW.js";const _=o({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(t){const e=i;return(r,s)=>(f(),a(n,{"action-id":t.buttonId,effect:c(e)},null,8,["action-id","effect"]))}});export{_ as default};
@@ -0,0 +1 @@
1
+ import{d as l,G as u,g,aE as m,M as d,aF as p,aG as x,aH as E,c as _,b as h,h as k,m as w,aI as C,s as I,aJ as b,a as v}from"./index-CHzOsSTW.js";import{_ as y}from"./definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js";const R=l({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:i}=u(),a=I(),t=(e,o)=>k(e,{...w(a),...o}),r=b(),c=C(),f=g(function*(){if(c&&!(yield*m(()=>c())))return;const e=d(n.config.markdown,i.value)??"",o=p(e,t);(yield*x({content:o,icon:n.config.icon,color:n.config.color}))||(yield*E(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:r,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(v(),_(y,{"action-id":s.buttonId,effect:h(f)},null,8,["action-id","effect"]))}});export{R as default};
@@ -0,0 +1 @@
1
+ import{d as u,G as i,c as l,b as p,e as m,a as d,J as f,M as _,aF as k,h as w,m as x,s as g}from"./index-CHzOsSTW.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const o=n,{locale:t}=i(),a=g(),c=(e,s)=>w(e,{...x(a),...s}),r=m(()=>{const e=_(o.config.content,t.value)??"";return k(e,c)});return(e,s)=>(d(),l(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
@@ -10,7 +10,7 @@
10
10
  `--primary`, the primary button variant renders as transparent. */
11
11
  body { --primary: #009689; }
12
12
  </style>
13
- <script type="module" crossorigin src="./assets/index-BNaI1T0H.js"></script>
13
+ <script type="module" crossorigin src="./assets/index-CHzOsSTW.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="./assets/index-B0PL01fm.css">
15
15
  </head>
16
16
  <body>
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { Effect } from "effect";
3
+ import { navigateTo, useRouter } from "#app";
3
4
  import { cel as _rawCel } from "../../../../../utils/cel";
4
5
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
5
6
  import ShwfedActionDefinition from "../../../components/definition.vue";
@@ -8,13 +9,26 @@ const props = defineProps({
8
9
  buttonId: { type: String, required: true },
9
10
  config: { type: null, required: true }
10
11
  });
12
+ const router = useRouter();
11
13
  const inherited = injectCELContext();
12
14
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
15
+ function isExternal(url) {
16
+ try {
17
+ return new URL(url, window.location.href).origin !== window.location.origin;
18
+ } catch {
19
+ return false;
20
+ }
21
+ }
13
22
  const effect = Effect.suspend(
14
23
  () => Effect.flatMap(
15
24
  $cel(props.config.url),
16
- (url) => Effect.sync(() => {
17
- window.open(url, props.config.mode);
25
+ (url) => Effect.promise(async () => {
26
+ const external = isExternal(url);
27
+ if (props.config.mode === "_blank") {
28
+ window.open(external ? url : router.resolve(url).href, "_blank");
29
+ return;
30
+ }
31
+ await navigateTo(url, { external });
18
32
  })
19
33
  )
20
34
  );
@@ -20,6 +20,7 @@ import { Markdown } from "../../../../ui/markdown";
20
20
  import { cel } from "../../../../../utils/cel";
21
21
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
22
22
  import { getLocalizedText } from "../../../../../share/locale";
23
+ import { fetchJsonOption } from "../../../../../share/request";
23
24
  defineOptions({ name: "ShwfedBlockChartXyRuntime" });
24
25
  const block = defineModel("block", { type: null, ...{ required: true } });
25
26
  const { locale } = useI18n();
@@ -70,8 +71,7 @@ async function fetchAll() {
70
71
  const program = Effect.gen(function* () {
71
72
  let jsonOpt = Option.none();
72
73
  if (ds.request) {
73
- const builder = yield* cel(ds.request, ctx);
74
- jsonOpt = Option.some(yield* builder.json());
74
+ jsonOpt = yield* fetchJsonOption(yield* cel(ds.request, ctx));
75
75
  }
76
76
  return yield* cel(ds.data, { ...ctx, json: jsonOpt });
77
77
  });
@@ -6,6 +6,7 @@ import { useIntervalFn, useWindowFocus } from "@vueuse/core";
6
6
  import NumberFlow from "@number-flow/vue";
7
7
  import { cel } from "../../../../../utils/cel";
8
8
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
+ import { fetchJsonOption } from "../../../../../share/request";
9
10
  defineOptions({ name: "ShwfedBlockAnimatedNumberItem" });
10
11
  const props = defineProps({
11
12
  item: { type: null, required: true }
@@ -57,8 +58,7 @@ async function refresh() {
57
58
  const program = Effect.gen(function* () {
58
59
  let jsonOpt = Option.none();
59
60
  if (ds.request) {
60
- const builder = yield* cel(ds.request, ctx);
61
- jsonOpt = Option.some(yield* builder.json());
61
+ jsonOpt = yield* fetchJsonOption(yield* cel(ds.request, ctx));
62
62
  }
63
63
  const value = yield* cel(ds.value, { ...ctx, json: jsonOpt });
64
64
  return { json: Option.getOrUndefined(jsonOpt), value };
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  export { getStructFieldDescription, getStructFieldTitle } from "../../../../table/utils/schema-meta.js";
4
4
  export const type = "com.shwfed.block.animated.number";
5
5
  export const compatibilityDate = "2026-06-01";
@@ -18,7 +18,7 @@ function registerJson(env) {
18
18
  export function dataSourceSchema(configure) {
19
19
  const CelRequest = Expression({
20
20
  configure,
21
- resultType: "HttpRequest"
21
+ resultType: HttpRequestResult
22
22
  });
23
23
  const CelNumber = Expression({
24
24
  configure: (env) => {
@@ -7,6 +7,7 @@ import { useI18n } from "vue-i18n";
7
7
  import { getLocalizedText } from "../../../../../share/locale";
8
8
  import { cel } from "../../../../../utils/cel";
9
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
+ import { fetchJsonOption } from "../../../../../share/request";
10
11
  import { interpolateMarkdown } from "../../../../table/utils/runtime";
11
12
  import { Badge } from "../../../../ui/badge";
12
13
  import { Markdown } from "../../../../ui/markdown";
@@ -43,8 +44,8 @@ async function refresh() {
43
44
  if (!req) return;
44
45
  const ctx = baseContext();
45
46
  const program = Effect.gen(function* () {
46
- const builder = yield* cel(req, ctx);
47
- return yield* builder.json();
47
+ const json2 = yield* fetchJsonOption(yield* cel(req, ctx));
48
+ return Option.getOrUndefined(json2);
48
49
  });
49
50
  try {
50
51
  json.value = await Effect.runPromise(Effect.provide(program, Fetch.layer));
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Slot, defaultSlot } from "../../../../../share/layout.js";
4
4
  export { getStructFieldDescription, getStructFieldTitle } from "../../../../table/utils/schema-meta.js";
5
5
  export const type = "com.shwfed.block.card";
@@ -20,7 +20,7 @@ export const BADGE_VARIANTS = ["default", "secondary", "destructive", "outline"]
20
20
  export function badgeSchema(configure) {
21
21
  const CelRequest = Expression({
22
22
  configure,
23
- resultType: "HttpRequest"
23
+ resultType: HttpRequestResult
24
24
  });
25
25
  const Content = LocaleMarkdown({
26
26
  configure: (env) => {
@@ -1,10 +1,11 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
- import { Effect } from "effect";
4
+ import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
6
  import { computed, nextTick, ref } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
8
9
  import { cel as _rawCel } from "../../../../../utils/cel";
9
10
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
11
  import { getLocalizedText } from "../../../../../share/locale";
@@ -100,8 +101,8 @@ const requestSignature = computed(() => {
100
101
  const expr = props.config.request;
101
102
  if (!expr) return null;
102
103
  try {
103
- const builder = Effect.runSync($cel(expr, { form: state.value ?? {} }));
104
- return JSON.stringify(builder.describe());
104
+ const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
105
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
105
106
  } catch {
106
107
  return null;
107
108
  }
@@ -117,8 +118,8 @@ async function fetchOptions() {
117
118
  const expr = props.config.request;
118
119
  isLoading.value = true;
119
120
  const program = Effect.gen(function* () {
120
- const builder = yield* $cel(expr, { form: state.value ?? {} });
121
- return yield* builder.json();
121
+ const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
122
+ return Option.getOrNull(body);
122
123
  });
123
124
  try {
124
125
  const result = await Effect.runPromise(Effect.provide(program, Fetch.layer));
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
5
5
  export const type = "com.shwfed.form.field.combobox.single.remote";
@@ -35,7 +35,7 @@ function configureWithJson(configure) {
35
35
  const isListType = (actual) => actual === "dyn" || actual.startsWith("list");
36
36
  export function schema(configure) {
37
37
  const CelBool = Expression({ configure, resultType: "bool" });
38
- const CelHttpRequest = Expression({ configure, resultType: "HttpRequest" });
38
+ const CelHttpRequest = Expression({ configure, resultType: HttpRequestResult });
39
39
  const CelOptions = Expression({ configure: configureWithJson(configure), resultType: isListType });
40
40
  const CelOptionValue = Expression({ configure: configureWithOption(configure), resultType: "dyn" });
41
41
  const LocaleOptionLabel = LocaleMarkdown({ configure: configureWithOption(configure) });
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -100,11 +101,9 @@ async function fetchTree() {
100
101
  const effect = Effect.gen(function* () {
101
102
  let jsonOpt = Option.none();
102
103
  if (dataSource.request) {
103
- const builder = yield* $cel(dataSource.request, {
104
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
104
105
  form: state.value ?? {}
105
- });
106
- const response = yield* builder.json();
107
- jsonOpt = Option.some(response);
106
+ }));
108
107
  }
109
108
  const dataRaw = yield* $cel(dataSource.data, {
110
109
  form: state.value ?? {},
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -163,11 +164,9 @@ async function fetchTree() {
163
164
  const effect = Effect.gen(function* () {
164
165
  let jsonOpt = Option.none();
165
166
  if (dataSource.request) {
166
- const builder = yield* $cel(dataSource.request, {
167
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
167
168
  form: state.value ?? {}
168
- });
169
- const response = yield* builder.json();
170
- jsonOpt = Option.some(response);
169
+ }));
171
170
  }
172
171
  const dataRaw = yield* $cel(dataSource.data, {
173
172
  form: state.value ?? {},
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -164,11 +165,9 @@ async function fetchTree() {
164
165
  const effect = Effect.gen(function* () {
165
166
  let jsonOpt = Option.none();
166
167
  if (dataSource.request) {
167
- const builder = yield* $cel(dataSource.request, {
168
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
168
169
  form: state.value ?? {}
169
- });
170
- const response = yield* builder.json();
171
- jsonOpt = Option.some(response);
170
+ }));
172
171
  }
173
172
  const dataRaw = yield* $cel(dataSource.data, {
174
173
  form: state.value ?? {},
@@ -1,10 +1,11 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
- import { Effect } from "effect";
4
+ import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
6
  import { computed, ref } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
8
9
  import { cel as _rawCel } from "../../../../../utils/cel";
9
10
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
11
  import { interpolateMarkdown } from "../../../../table/utils/runtime";
@@ -101,8 +102,8 @@ const requestSignature = computed(() => {
101
102
  const expr = opts.request;
102
103
  if (!expr) return null;
103
104
  try {
104
- const builder = Effect.runSync($cel(expr, { form: state.value ?? {} }));
105
- return JSON.stringify(builder.describe());
105
+ const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
106
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
106
107
  } catch {
107
108
  return null;
108
109
  }
@@ -124,8 +125,8 @@ async function fetchOptions() {
124
125
  }
125
126
  isLoading.value = true;
126
127
  const program = Effect.gen(function* () {
127
- const builder = yield* $cel(expr, { form: state.value ?? {} });
128
- return yield* builder.json();
128
+ const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
129
+ return Option.getOrNull(body);
129
130
  });
130
131
  try {
131
132
  const result = await Effect.runPromise(Effect.provide(program, Fetch.layer));
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
5
5
  export const type = "com.shwfed.form.field.combobox.multi";
@@ -59,7 +59,7 @@ export function itemSchema(configure) {
59
59
  export function remoteOptionsSchema(configure) {
60
60
  const CelRequest = Schema.Union(
61
61
  Schema.Literal(""),
62
- Expression({ configure, resultType: "HttpRequest" })
62
+ Expression({ configure, resultType: HttpRequestResult })
63
63
  );
64
64
  const CelOptions = Expression({ configure: configureWithJson(configure), resultType: isListType });
65
65
  const CelOptionValue = Expression({ configure: configureWithOption(configure), resultType: "dyn" });
@@ -1,10 +1,11 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
- import { Effect } from "effect";
4
+ import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
6
  import { computed, nextTick, ref, watch } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
+ import { asRequest, fetchJsonOption } from "../../../../../share/request";
8
9
  import { cel as _rawCel } from "../../../../../utils/cel";
9
10
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
11
  import { interpolateMarkdown } from "../../../../table/utils/runtime";
@@ -101,8 +102,8 @@ const requestSignature = computed(() => {
101
102
  const expr = opts.request;
102
103
  if (!expr) return null;
103
104
  try {
104
- const builder = Effect.runSync($cel(expr, { form: state.value ?? {} }));
105
- return JSON.stringify(builder.describe());
105
+ const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
106
+ return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
106
107
  } catch {
107
108
  return null;
108
109
  }
@@ -124,8 +125,8 @@ async function fetchOptions() {
124
125
  }
125
126
  isLoading.value = true;
126
127
  const program = Effect.gen(function* () {
127
- const builder = yield* $cel(expr, { form: state.value ?? {} });
128
- return yield* builder.json();
128
+ const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
129
+ return Option.getOrNull(body);
129
130
  });
130
131
  try {
131
132
  const result = await Effect.runPromise(Effect.provide(program, Fetch.layer));
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
- import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
2
+ import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
3
3
  import { Locale } from "../../../../../share/locale.js";
4
4
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
5
5
  export const type = "com.shwfed.form.field.combobox.single";
@@ -59,7 +59,7 @@ export function itemSchema(configure) {
59
59
  export function remoteOptionsSchema(configure) {
60
60
  const CelRequest = Schema.Union(
61
61
  Schema.Literal(""),
62
- Expression({ configure, resultType: "HttpRequest" })
62
+ Expression({ configure, resultType: HttpRequestResult })
63
63
  );
64
64
  const CelOptions = Expression({ configure: configureWithJson(configure), resultType: isListType });
65
65
  const CelOptionValue = Expression({ configure: configureWithOption(configure), resultType: "dyn" });
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -181,11 +182,9 @@ async function fetchTree() {
181
182
  const effect = Effect.gen(function* () {
182
183
  let jsonOpt = Option.none();
183
184
  if (dataSource.request) {
184
- const builder = yield* $cel(dataSource.request, {
185
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
185
186
  form: state.value ?? {}
186
- });
187
- const response = yield* builder.json();
188
- jsonOpt = Option.some(response);
187
+ }));
189
188
  }
190
189
  const dataRaw = yield* $cel(dataSource.data, {
191
190
  form: state.value ?? {},
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -182,11 +183,9 @@ async function fetchTree() {
182
183
  const effect = Effect.gen(function* () {
183
184
  let jsonOpt = Option.none();
184
185
  if (dataSource.request) {
185
- const builder = yield* $cel(dataSource.request, {
186
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
186
187
  form: state.value ?? {}
187
- });
188
- const response = yield* builder.json();
189
- jsonOpt = Option.some(response);
188
+ }));
190
189
  }
191
190
  const dataRaw = yield* $cel(dataSource.data, {
192
191
  form: state.value ?? {},
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { computed, ref, shallowRef, watch } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
7
8
  import { cel as _rawCel } from "../../../../../utils/cel";
8
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
10
  import { getLocalizedText } from "../../../../../share/locale";
@@ -108,11 +109,9 @@ async function fetchTree() {
108
109
  const effect = Effect.gen(function* () {
109
110
  let jsonOpt = Option.none();
110
111
  if (dataSource.request) {
111
- const builder = yield* $cel(dataSource.request, {
112
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
112
113
  form: state.value ?? {}
113
- });
114
- const response = yield* builder.json();
115
- jsonOpt = Option.some(response);
114
+ }));
116
115
  }
117
116
  const dataRaw = yield* $cel(dataSource.data, {
118
117
  form: state.value ?? {},