markdown-flow-ui 0.1.100-beta.49 → 0.1.100-beta.50
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.
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs7.js +1 -1
- package/dist/_virtual/index.es6.js +5 -2
- package/dist/_virtual/index.es6.js.map +1 -1
- package/dist/_virtual/index.es7.js +2 -5
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.es.js +39 -32
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +1 -0
- package/dist/components/Slide/utils/interactionPlayback.cjs.js +2 -0
- package/dist/components/Slide/utils/interactionPlayback.cjs.js.map +1 -0
- package/dist/components/Slide/utils/interactionPlayback.d.ts +9 -0
- package/dist/components/Slide/utils/interactionPlayback.es.js +11 -0
- package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -0
- package/dist/components/Slide/utils/interactionPlayback.test.d.ts +1 -0
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/lib/interaction-defaults.cjs.js.map +1 -1
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectSpread2.cjs.js"),te=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.cjs.js"),i=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),oe=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.cjs.js"),u=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectSpread2.cjs.js"),te=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.cjs.js"),i=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),oe=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.cjs.js"),u=require("../../../../../../../../../_virtual/index.cjs6.js"),n=require("react"),T=require("./utils/commonUtils.cjs.js");var de=n.forwardRef(function(e,U){var p,x,y,$=e.inputElement,N=e.children,r=e.prefixCls,k=e.prefix,f=e.suffix,C=e.addonBefore,W=e.addonAfter,z=e.className,J=e.style,m=e.disabled,I=e.readOnly,K=e.focused,E=e.triggerFocus,d=e.allowClear,b=e.value,h=e.handleReset,L=e.hidden,t=e.classes,a=e.classNames,g=e.dataAttrs,o=e.styles,l=e.components,w=e.onClear,M=N??$,Q=l?.affixWrapper||"span",V=l?.groupWrapper||"span",X=l?.wrapper||"span",S=l?.groupAddon||"span",A=n.useRef(null),Y=function(s){var q;(q=A.current)!==null&&q!==void 0&&q.contains(s.target)&&E?.()},j=T.hasPrefixSuffix(e),c=n.cloneElement(M,{value:b,className:u.default((p=M.props)===null||p===void 0?void 0:p.className,!j&&a?.variant)||null}),B=n.useRef(null);if(n.useImperativeHandle(U,function(){return{nativeElement:B.current||A.current}}),j){var D=null;if(d){var Z=!m&&!I&&b,R="".concat(r,"-clear-icon"),P=oe.default(d)==="object"&&d!==null&&d!==void 0&&d.clearIcon?d.clearIcon:"✖";D=n.createElement("button",{type:"button",tabIndex:-1,onClick:function(s){h?.(s),w?.()},onMouseDown:function(s){return s.preventDefault()},className:u.default(R,i.default(i.default({},"".concat(R,"-hidden"),!Z),"".concat(R,"-has-suffix"),!!f))},P)}var v="".concat(r,"-affix-wrapper"),ee=u.default(v,i.default(i.default(i.default(i.default(i.default({},"".concat(r,"-disabled"),m),"".concat(v,"-disabled"),m),"".concat(v,"-focused"),K),"".concat(v,"-readonly"),I),"".concat(v,"-input-with-clear-btn"),f&&d&&b),t?.affixWrapper,a?.affixWrapper,a?.variant),ae=(f||d)&&n.createElement("span",{className:u.default("".concat(r,"-suffix"),a?.suffix),style:o?.suffix},D,f);c=n.createElement(Q,te.default({className:ee,style:o?.affixWrapper,onClick:Y},g?.affixWrapper,{ref:A}),k&&n.createElement("span",{className:u.default("".concat(r,"-prefix"),a?.prefix),style:o?.prefix},k),c,ae)}if(T.hasAddon(e)){var _="".concat(r,"-group"),O="".concat(_,"-addon"),F="".concat(_,"-wrapper"),ne=u.default("".concat(r,"-wrapper"),_,t?.wrapper,a?.wrapper),le=u.default(F,i.default({},"".concat(F,"-disabled"),m),t?.group,a?.groupWrapper);c=n.createElement(V,{className:le,ref:B},n.createElement(X,{className:ne},C&&n.createElement(S,{className:O},C),c,W&&n.createElement(S,{className:O},W)))}return n.cloneElement(c,{className:u.default((x=c.props)===null||x===void 0?void 0:x.className,z)||null,style:H.default(H.default({},(y=c.props)===null||y===void 0?void 0:y.style),J),hidden:L})});exports.default=de;
|
|
2
2
|
//# sourceMappingURL=BaseInput.cjs.js.map
|
|
@@ -2,7 +2,7 @@ import $ from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/hel
|
|
|
2
2
|
import oe from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.es.js";
|
|
3
3
|
import r from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.es.js";
|
|
4
4
|
import te from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.es.js";
|
|
5
|
-
import d from "../../../../../../../../../_virtual/index.
|
|
5
|
+
import d from "../../../../../../../../../_virtual/index.es6.js";
|
|
6
6
|
import l, { useRef as q, cloneElement as ie } from "react";
|
|
7
7
|
import { hasPrefixSuffix as re, hasAddon as de } from "./utils/commonUtils.es.js";
|
|
8
8
|
var xe = /* @__PURE__ */ l.forwardRef(function(e, z) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Y=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.cjs.js"),F=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),N=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectSpread2.cjs.js"),J=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.cjs.js"),f=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.cjs.js"),K=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs.js"),Q=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Y=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.cjs.js"),F=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),N=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectSpread2.cjs.js"),J=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.cjs.js"),f=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.cjs.js"),K=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs.js"),Q=require("../../../../../../../../../_virtual/index.cjs6.js"),ee=require("../../../../rc-resize-observer@1.4.3_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-resize-observer/es/index.cjs.js"),j=require("../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useLayoutEffect.cjs.js"),te=require("../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useMergedState.cjs.js"),w=require("../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/raf.cjs.js"),ae=require("react"),re=require("./calculateNodeHeight.cjs.js");function ne(n){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(o,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return o.default=n,Object.freeze(o)}const t=ne(ae);var ue=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],g=0,m=1,_=2,le=t.forwardRef(function(n,o){var e=n,s=e.prefixCls,O=e.defaultValue,p=e.value,a=e.autoSize,i=e.onResize,T=e.className,$=e.style,b=e.disabled,c=e.onChange,d=e.onInternalAutoSize,P=K.default(e,ue),V=te.default(O,{value:p,postState:function(r){return r??""}}),y=f.default(V,2),D=y[0],Z=y[1],H=function(r){Z(r.target.value),c?.(r)},S=t.useRef();t.useImperativeHandle(o,function(){return{textArea:S.current}});var L=t.useMemo(function(){return a&&J.default(a)==="object"?[a.minRows,a.maxRows]:[]},[a]),E=f.default(L,2),q=E[0],x=E[1],R=!!a,k=t.useState(_),A=f.default(k,2),u=A[0],v=A[1],B=t.useState(),I=f.default(B,2),G=I[0],U=I[1],M=function(){v(g),process.env.NODE_ENV==="test"&&d?.()};j.default(function(){R&&M()},[p,q,x,R]),j.default(function(){if(u===g)v(m);else if(u===m){var l=re.default(S.current,!1,q,x);v(_),U(l)}},[u]);var h=t.useRef(),C=function(){w.default.cancel(h.current)},W=function(r){u===_&&(i?.(r),a&&(C(),h.current=w.default(function(){M()})))};t.useEffect(function(){return C},[]);var X=R?G:null,z=N.default(N.default({},$),X);return(u===g||u===m)&&(z.overflowY="hidden",z.overflowX="hidden"),t.createElement(ee.default,{onResize:W,disabled:!(a||i)},t.createElement("textarea",Y.default({},P,{ref:S,style:z,className:Q.default(s,T,F.default({},"".concat(s,"-disabled"),b)),disabled:b,value:D,onChange:H})))});exports.default=le;
|
|
2
2
|
//# sourceMappingURL=ResizableTextArea.cjs.js.map
|
|
@@ -4,7 +4,7 @@ import w from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/hel
|
|
|
4
4
|
import J from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.es.js";
|
|
5
5
|
import s from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.es.js";
|
|
6
6
|
import K from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.es.js";
|
|
7
|
-
import Q from "../../../../../../../../../_virtual/index.
|
|
7
|
+
import Q from "../../../../../../../../../_virtual/index.es6.js";
|
|
8
8
|
import ee from "../../../../rc-resize-observer@1.4.3_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-resize-observer/es/index.es.js";
|
|
9
9
|
import M from "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useLayoutEffect.es.js";
|
|
10
10
|
import te from "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useMergedState.es.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const be=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.cjs.js"),X=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),d=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectSpread2.cjs.js"),ze=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs.js"),x=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.cjs.js"),qe=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs.js"),g=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const be=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.cjs.js"),X=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),d=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectSpread2.cjs.js"),ze=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs.js"),x=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.cjs.js"),qe=require("../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs.js"),g=require("../../../../../../../../../_virtual/index.cjs6.js"),Te=require("../../../../rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js"),Ae=require("../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useMergedState.cjs.js"),n=require("react"),Fe=require("../../../../rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/hooks/useCount.cjs.js"),Y=require("../../../../rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/utils/commonUtils.cjs.js"),Ne=require("./ResizableTextArea.cjs.js");var Oe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],$e=n.forwardRef(function(t,Z){var C,B=t.defaultValue,_=t.value,p=t.onFocus,y=t.onBlur,L=t.onChange,R=t.allowClear,M=t.maxLength,S=t.onCompositionStart,w=t.onCompositionEnd,ee=t.suffix,P=t.prefixCls,s=P===void 0?"rc-textarea":P,E=t.showCount,te=t.count,ae=t.className,v=t.style,m=t.disabled,ne=t.hidden,l=t.classNames,i=t.styles,b=t.onResize,oe=t.onClear,D=t.onPressEnter,K=t.readOnly,V=t.autoSize,z=t.onKeyDown,le=qe.default(t,Oe),re=Ae.default(B,{value:_,defaultValue:B}),W=x.default(re,2),q=W[0],j=W[1],T=q==null?"":String(q),ue=n.useState(!1),k=x.default(ue,2),se=k[0],A=k[1],F=n.useRef(!1),ie=n.useState(null),H=x.default(ie,2),de=H[0],ce=H[1],U=n.useRef(null),N=n.useRef(null),r=function(){var e;return(e=N.current)===null||e===void 0?void 0:e.textArea},G=function(){r().focus()};n.useImperativeHandle(Z,function(){var a;return{resizableTextArea:N.current,focus:G,blur:function(){r().blur()},nativeElement:((a=U.current)===null||a===void 0?void 0:a.nativeElement)||r()}}),n.useEffect(function(){A(function(a){return!m&&a})},[m]);var fe=n.useState(null),J=x.default(fe,2),O=J[0],ve=J[1];n.useEffect(function(){if(O){var a;(a=r()).setSelectionRange.apply(a,ze.default(O))}},[O]);var o=Fe.default(te,E),c=(C=o.max)!==null&&C!==void 0?C:M,me=Number(c)>0,$=o.strategy(T),he=!!c&&$>c,Q=function(e,u){var h=u;!F.current&&o.exceedFormatter&&o.max&&o.strategy(u)>o.max&&(h=o.exceedFormatter(u,{max:o.max}),u!==h&&ve([r().selectionStart||0,r().selectionEnd||0])),j(h),Y.resolveOnChange(e.currentTarget,e,L,h)},xe=function(e){F.current=!0,S?.(e)},ge=function(e){F.current=!1,Q(e,e.currentTarget.value),w?.(e)},Ce=function(e){Q(e,e.target.value)},pe=function(e){e.key==="Enter"&&D&&D(e),z?.(e)},ye=function(e){A(!0),p?.(e)},Re=function(e){A(!1),y?.(e)},Se=function(e){j(""),G(),Y.resolveOnChange(r(),e,L)},I=ee,f;o.show&&(o.showFormatter?f=o.showFormatter({value:T,count:$,maxLength:c}):f="".concat($).concat(me?" / ".concat(c):""),I=n.createElement(n.Fragment,null,I,n.createElement("span",{className:g.default("".concat(s,"-data-count"),l?.count),style:i?.count},f)));var we=function(e){var u;b?.(e),(u=r())!==null&&u!==void 0&&u.style.height&&ce(!0)},Ee=!V&&!E&&!R;return n.createElement(Te.default,{ref:U,value:T,allowClear:R,handleReset:Se,suffix:I,prefixCls:s,classNames:d.default(d.default({},l),{},{affixWrapper:g.default(l?.affixWrapper,X.default(X.default({},"".concat(s,"-show-count"),E),"".concat(s,"-textarea-allow-clear"),R))}),disabled:m,focused:se,className:g.default(ae,he&&"".concat(s,"-out-of-range")),style:d.default(d.default({},v),de&&!Ee?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof f=="string"?f:void 0}},hidden:ne,readOnly:K,onClear:oe},n.createElement(Ne.default,be.default({},le,{autoSize:V,maxLength:M,onKeyDown:pe,onChange:Ce,onFocus:ye,onBlur:Re,onCompositionStart:xe,onCompositionEnd:ge,className:g.default(l?.textarea),style:d.default(d.default({},i?.textarea),{},{resize:v?.resize}),disabled:m,prefixCls:s,onResize:we,ref:N,readOnly:K})))});exports.default=$e;
|
|
2
2
|
//# sourceMappingURL=TextArea.cjs.js.map
|
|
@@ -4,7 +4,7 @@ import d from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/hel
|
|
|
4
4
|
import Ae from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/toConsumableArray.es.js";
|
|
5
5
|
import x from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.es.js";
|
|
6
6
|
import Fe from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.es.js";
|
|
7
|
-
import h from "../../../../../../../../../_virtual/index.
|
|
7
|
+
import h from "../../../../../../../../../_virtual/index.es6.js";
|
|
8
8
|
import Ne from "../../../../rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js";
|
|
9
9
|
import Te from "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useMergedState.es.js";
|
|
10
10
|
import o, { useRef as Y, useImperativeHandle as $e, useEffect as Ie } from "react";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./TextArea.cjs.js");require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./TextArea.cjs.js");require("../../../../../../../../../_virtual/index.cjs6.js");require("../../../../rc-resize-observer@1.4.3_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-resize-observer/es/index.cjs.js");require("../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useLayoutEffect.cjs.js");require("react");require("../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/raf.cjs.js");exports.default=e.default;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import t from "./TextArea.es.js";
|
|
2
|
-
import "../../../../../../../../../_virtual/index.
|
|
2
|
+
import "../../../../../../../../../_virtual/index.es6.js";
|
|
3
3
|
import "../../../../rc-resize-observer@1.4.3_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-resize-observer/es/index.es.js";
|
|
4
4
|
import "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useLayoutEffect.es.js";
|
|
5
5
|
import "react";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../../../../../../_virtual/index.cjs7.js"),a=require("../../../../inline-style-parser@0.2.4/node_modules/inline-style-parser/index.cjs.js");var i;function d(){if(i)return t.__exports;i=1;var s=t.__exports&&t.__exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t.__exports,"__esModule",{value:!0}),t.__exports.default=l;const f=s(a.__require());function l(e,o){let r=null;if(!e||typeof e!="string")return r;const c=(0,f.default)(e),p=typeof o=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:_,value:n}=u;p?o(_,n,u):n&&(r=r||{},r[_]=n)}),r}return t.__exports}exports.__require=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as r } from "../../../../../../../../../_virtual/index.
|
|
1
|
+
import { __exports as r } from "../../../../../../../../../_virtual/index.es7.js";
|
|
2
2
|
import { __require as p } from "../../../../inline-style-parser@0.2.4/node_modules/inline-style-parser/index.es.js";
|
|
3
3
|
var f;
|
|
4
4
|
function q() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),r=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js");var s=r.__require();const t=e.getDefaultExportFromCjs(s);exports.default=t;
|
|
2
2
|
//# sourceMappingURL=index.cjs6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs7.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as s } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
3
|
+
var e = s();
|
|
4
|
+
const t = /* @__PURE__ */ r(e);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
t as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index.es6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as s } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
3
|
-
var e = s();
|
|
4
|
-
const t = /* @__PURE__ */ r(e);
|
|
1
|
+
var r = {};
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
r as __exports
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index.es7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es7.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../_virtual/jsx-runtime.cjs.js"),t=require("react"),nt=require("../../lib/sandboxInteraction.cjs.js"),W=require("../../lib/utils.cjs.js"),rt=require("../ContentRender/ContentRender.cjs.js"),Ae=require("../ContentRender/IframeSandbox.cjs.js");require("../ui/inputGroup/input-group.cjs.js");const Te=require("../../lib/interaction-defaults.cjs.js"),st=require("./Player.cjs.js"),ot=require("./useSlide.cjs.js"),ut=require("./useWakePlayerFromIframe.cjs.js"),lt=require("./utils/playerCustomActions.cjs.js");;/* empty css */const it=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.js"),at=1e3,ke=t.memo(({content:w,title:C,defaultButtonText:m,defaultInputText:O,defaultSelectedValues:S,confirmButtonText:ne,copyButtonText:re,copiedButtonText:_,onSend:H,readonly:A=!1})=>r.jsxRuntimeExports.jsxs("div",{className:"slide-player__interaction-card",children:[r.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-header",children:r.jsxRuntimeExports.jsx("p",{className:"slide-player__interaction-title",children:C})}),r.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-body",children:r.jsxRuntimeExports.jsx(rt.default,{content:w,defaultButtonText:m,defaultInputText:O,defaultSelectedValues:S,confirmButtonText:ne,copyButtonText:re,copiedButtonText:_,onSend:H,readonly:A,enableTypewriter:!1,sandboxMode:"content"})}),r.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-arrow"})]}));ke.displayName="InteractionOverlayCard";const ct=(w,C)=>w.length===C.length&&w.every((m,O)=>{const S=C[O];return m.sequence_number===S?.sequence_number&&m.type===S?.type&&m.content===S?.content}),dt=({elementList:w=[],showPlayer:C=!0,playerAlwaysVisible:m=!1,playerClassName:O,playerCustomActions:S,bufferingText:ne="Buffering...",interactionTitle:re,interactionTexts:_,playerAutoHideDelay:H=3e3,interactionDefaultValueOptions:A,onSend:ae,onPlayerVisibilityChange:se,onStepChange:ce,className:Pe,onPointerDown:de,...qe})=>{const oe=t.useRef(null),ue=t.useRef(null),fe=t.useRef(null),$=t.useRef(null),D=t.useRef(null),U=t.useRef(null),me=t.useRef([]),G=t.useRef(!1),T=t.useRef(null),{currentElementList:v,stepElementLists:xe,slideElementList:k,currentIndex:c,audioList:h,currentAudioSequenceIndexes:pe,currentStepHasSpeakableElement:E,currentInteractionElement:i,canGoPrev:Be,canGoNext:I,handlePrev:he,handleNext:R}=ot.default(w),ge=t.useMemo(()=>{if(!(c<0))return k[c]},[c,k]),Me=k.filter(e=>e.is_renderable!==!1).length===1,g=C&&(k.length>0||h.length>0||!!i),x=t.useMemo(()=>pe.map(e=>h[e]?.audioKey).filter(e=>!!e),[h,pe]),[ye,Y]=t.useState(!0),[J,z]=t.useState(!1),[y,P]=t.useState(null),[Ne,f]=t.useState(!1),[q,Se]=t.useState(!1),[o,Q]=t.useState(),[X,V]=t.useState(!1),B=g&&(m||ye),ve=t.useMemo(()=>lt.getPlayerCustomActionCount(S),[S]),Fe=t.useMemo(()=>({"--slide-player-custom-action-count":String(ve)}),[ve]),{mountedStepStates:Ke,currentMountedStateIndex:Le}=t.useMemo(()=>{const e=[],n=new Map;return xe.forEach((l,a)=>{const s=e.findIndex(u=>ct(u.elementList,l));if(s>=0){e[s]?.sourceStepIndexes.push(a),n.set(a,s);return}e.push({elementList:l,sourceStepIndexes:[a]}),n.set(a,e.length-1)}),{mountedStepStates:e,currentMountedStateIndex:c>=0?n.get(c)??-1:-1}},[c,xe]),be=t.useMemo(()=>String(c),[c]),le=t.useMemo(()=>y?h.findIndex(e=>(e.audioKey??"")===y):-1,[h,y]),Z=t.useMemo(()=>x[0]??"none",[x]),Ee=t.useMemo(()=>i?`${i.sequence_number??"none"}:${String(i.content??"")}`:"none",[i]),Oe=t.useMemo(()=>[be,Ee].join("|"),[Ee,be]),M=!!t.useMemo(()=>!Z||Z==="none"?"":h.find(n=>n.audioKey===Z)?.audioUrl?.trim()??"",[h,Z]),j=t.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),b=t.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),N=t.useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null)},[]),F=t.useCallback(()=>{N(),b(),P(null),f(!1),Se(!1),Q(void 0),V(!1)},[N,b]),K=t.useCallback(()=>{const e=x[0];return e?(P(e),!0):!1},[x]),ee=t.useCallback(()=>{b(),V(!1),!K()&&I&&R()},[I,b,R,K]),d=t.useCallback((e=J)=>{g&&(Y(!0),j(),!(m||!e||H<=0)&&($.current=window.setTimeout(()=>{Y(!1),$.current=null},H)))},[j,J,m,H,g]),ie=!!(i?.readonly||i?.user_input?.trim()),L=!!i&&!ie;t.useEffect(()=>()=>{N(),j(),b()},[N,b,j]),t.useEffect(()=>(se?.(B),()=>{se?.(!1)}),[se,B]),t.useEffect(()=>{ce?.(ge,c)},[c,ge,ce]),t.useEffect(()=>{if(!g){j(),Y(!1);return}if(m){j(),Y(!0);return}J||d(!0)},[j,J,m,g,d]),t.useEffect(()=>{if(typeof window>"u")return;const e=n=>{n.origin===window.location.origin&&nt.isSandboxInteractionMessage(n.data)&&g&&(z(!0),d(!0))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[g,d]),ut.default({sectionRef:oe,enabled:g,onWake:()=>{z(!0),d(!0)}}),t.useEffect(()=>{const e=T.current===c&&!!i,n=!!i&&(L||e||ie);if(F(),!(v.length===0&&!i)){if(n){Q(i),V(!0),T.current=null;return}if(i&&(Q(i),V(!1),T.current=null),!K()){if(E){f(!0);return}if(I)return D.current=window.setTimeout(()=>{D.current=null,R()},at),()=>{N()}}}},[I,N,v.length,i,Oe,E,R,ie,L,F,K]),t.useEffect(()=>{if(!E||L){f(!1);return}if(q){f(!1);return}x.length===0&&f(!0)},[x.length,E,q,L]),t.useEffect(()=>{y||x.length===0||!E||L||q||K()},[y,x,E,q,L,K]),t.useEffect(()=>{!y||le>=0||P(null)},[le,y]),t.useEffect(()=>{M&&f(!1)},[M]);const Re=t.useMemo(()=>{if(!o)return{};const e=!!o.user_input?.trim();return Te.getInteractionDefaultValues(typeof o.content=="string"?o.content:void 0,o.user_input,e?void 0:A)},[o,A]),He=t.useMemo(()=>{if(!o)return;const e=!!o.user_input?.trim();return Te.getInteractionDefaultSelectedValues(typeof o.content=="string"?o.content:void 0,o.user_input,e?void 0:A)},[o,A]),Ie=!!o?.user_input?.trim(),je=!!o?.readonly||Ie,we=je||Ie,$e=t.useCallback(e=>{const l=[...e.selectedValues??[],e.inputText?.trim()??"",e.buttonText?.trim()??""].filter(Boolean).join(", ");Q(a=>!a||!l?a:{...a,user_input:l}),ae?.(e,o),ee()},[o,ee,ae]);t.useEffect(()=>{if(b(),!(!X||!we))return U.current=window.setTimeout(()=>{U.current=null,ee()},2e3),()=>{b()}},[b,ee,X,we]);const De=(e,n={})=>e?e.type==="slot"?r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:e.content}):e.type==="html"?r.jsxRuntimeExports.jsx(Ae.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",replaceRootScreenHeightWithFull:n.replaceRootScreenHeightWithFull,type:"sandbox",content:e.content}):r.jsxRuntimeExports.jsx(Ae.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",type:"markdown",content:e.content}):null,Ue=(e=[],n=!1)=>{if(e.length===0)return null;const l=e.filter(s=>s.is_renderable!==!1).length,a=e.reduce((s,u,p)=>u.is_renderable!==!1?p:s,-1);return r.jsxRuntimeExports.jsx("div",{className:"slide-stage__content flex w-full flex-col gap-4",children:e.map((s,u)=>{const p=s.type==="html"&&s.is_renderable===!1;return r.jsxRuntimeExports.jsx("div",{ref:n&&u===a?fe:null,"aria-hidden":p||void 0,className:W.cn("w-full shrink-0",l===1&&s.is_renderable!==!1&&"slide-element--single",p?"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0":s.is_renderable===!1&&"hidden"),children:De(s,{replaceRootScreenHeightWithFull:l===1&&s.type==="html"&&s.is_renderable!==!1})},s.sequence_number??`${s.type}-${u}`)})})},ze=()=>{const e=oe.current;if(e){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}e.requestFullscreen?.().catch(()=>{})}},Ce=t.useCallback(()=>{const e=ue.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[]),Ve=t.useCallback(()=>{G.current=!0,T.current=null,z(!0),f(!1),d(!0),F(),he()},[he,F,d]),We=t.useCallback(()=>{G.current=!0,T.current=null,z(!0),f(!1),d(!0),F(),R()},[R,F,d]),Ge=t.useCallback(e=>{if(M){f(!1);return}if(!E||q){f(!1);return}f(e)},[E,q,M]),Ye=t.useCallback(e=>{const n=h[e]?.audioKey;if(!n||!y||n!==y)return;const l=x.findIndex(u=>u===n);if(l<0){P(null);return}const a=l+1,s=x[a];if(s){P(s);return}if(P(null),Se(!0),f(!1),I){const u=c+1,p=k[u];M&&p?.type==="interaction"&&(T.current=u),R()}},[h,I,c,y,x,R,M,k]),Je=t.useCallback(()=>{o&&V(e=>!e)},[o]),_e=t.useCallback(e=>{e.stopPropagation(),B&&d(!0)},[ye,d]),Qe=t.useCallback(e=>{de?.(e),z(!0),d(!0)},[de,d]),Xe=!!o&&X,te=t.useMemo(()=>v.map((e,n)=>`${e.sequence_number??`${e.type}-${n}`}:${String(e.is_new??"")}`),[v]);return t.useEffect(()=>{const e=me.current,a=(e.length>0&&e.length<te.length&&e.every((u,p)=>u===te[p])?v.slice(e.length):[]).some(u=>u.is_new===!1);if(me.current=te,!a)return;const s=window.requestAnimationFrame(()=>{const u=ue.current,p=fe.current;if(!u||!p)return;const Ze=u.getBoundingClientRect(),et=p.getBoundingClientRect(),tt=u.scrollTop+(et.top-Ze.top);u.scrollTo({top:Math.max(tt,0),behavior:"smooth"})});return()=>{window.cancelAnimationFrame(s)}},[v,te]),t.useEffect(()=>{if(!G.current||(G.current=!1,v.length===0))return;const e=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(e)}},[v,Ce]),r.jsxRuntimeExports.jsxs("section",{ref:oe,className:W.cn("relative h-full w-full",Pe),onPointerDown:Qe,...qe,children:[r.jsxRuntimeExports.jsx("div",{className:W.cn("h-full min-h-0 w-full",Me?"slide-content--single":"grid gap-4"),children:v.length>0?r.jsxRuntimeExports.jsx("div",{className:"slide-stage",children:r.jsxRuntimeExports.jsx("div",{ref:ue,className:"slide-stage__layer w-full",children:Ke.map((e,n)=>{const l=n===Le;return r.jsxRuntimeExports.jsx("div",{"aria-hidden":!l||void 0,className:"w-full h-full",style:{display:l?void 0:"none"},children:Ue(e.elementList,l)},e.sourceStepIndexes[0]??n)})})}):null}),Ne?r.jsxRuntimeExports.jsxs("div",{className:"pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm",children:[r.jsxRuntimeExports.jsx(it.default,{className:"size-5 animate-spin text-background"}),r.jsxRuntimeExports.jsx("span",{children:ne})]}):null,Xe?r.jsxRuntimeExports.jsx("div",{className:W.cn("slide-interaction-overlay",B&&g?"slide-interaction-overlay--with-player":"slide-interaction-overlay--standalone"),onClick:_e,onPointerDown:_e,style:Fe,children:r.jsxRuntimeExports.jsx(ke,{content:String(o?.content??""),defaultButtonText:Re.buttonText??"",defaultInputText:Re.inputText??"",defaultSelectedValues:He,confirmButtonText:_?.confirmButtonText,copyButtonText:_?.copyButtonText,copiedButtonText:_?.copiedButtonText,onSend:$e,readonly:je,title:_?.title??re??"Submit the content below to continue."})}):null,g?r.jsxRuntimeExports.jsx(st.default,{audioList:h,className:W.cn("absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",O,!B&&"pointer-events-none opacity-0"),currentAudioIndex:le,defaultPlaying:!0,hasInteraction:!!o,isInteractionOpen:X,onLoadingChange:Ge,nextDisabled:!I,onEnded:Ye,onFullscreen:ze,onInteractionToggle:Je,onNext:We,onPrev:Ve,prevDisabled:!Be,showControls:B,customActions:S}):null]})};exports.default=dt;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../_virtual/jsx-runtime.cjs.js"),t=require("react"),nt=require("../../lib/sandboxInteraction.cjs.js"),W=require("../../lib/utils.cjs.js"),rt=require("../ContentRender/ContentRender.cjs.js"),Ae=require("../ContentRender/IframeSandbox.cjs.js");require("../ui/inputGroup/input-group.cjs.js");const Pe=require("../../lib/interaction-defaults.cjs.js"),st=require("./Player.cjs.js"),ot=require("./useSlide.cjs.js"),ut=require("./useWakePlayerFromIframe.cjs.js"),lt=require("./utils/interactionPlayback.cjs.js"),it=require("./utils/playerCustomActions.cjs.js");;/* empty css */const at=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.js"),ct=1e3,Te=t.memo(({content:w,title:C,defaultButtonText:m,defaultInputText:L,defaultSelectedValues:S,confirmButtonText:ne,copyButtonText:re,copiedButtonText:_,onSend:H,readonly:A=!1})=>r.jsxRuntimeExports.jsxs("div",{className:"slide-player__interaction-card",children:[r.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-header",children:r.jsxRuntimeExports.jsx("p",{className:"slide-player__interaction-title",children:C})}),r.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-body",children:r.jsxRuntimeExports.jsx(rt.default,{content:w,defaultButtonText:m,defaultInputText:L,defaultSelectedValues:S,confirmButtonText:ne,copyButtonText:re,copiedButtonText:_,onSend:H,readonly:A,enableTypewriter:!1,sandboxMode:"content"})}),r.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-arrow"})]}));Te.displayName="InteractionOverlayCard";const dt=(w,C)=>w.length===C.length&&w.every((m,L)=>{const S=C[L];return m.sequence_number===S?.sequence_number&&m.type===S?.type&&m.content===S?.content}),ft=({elementList:w=[],showPlayer:C=!0,playerAlwaysVisible:m=!1,playerClassName:L,playerCustomActions:S,bufferingText:ne="Buffering...",interactionTitle:re,interactionTexts:_,playerAutoHideDelay:H=3e3,interactionDefaultValueOptions:A,onSend:ae,onPlayerVisibilityChange:se,onStepChange:ce,className:ke,onPointerDown:de,...qe})=>{const oe=t.useRef(null),ue=t.useRef(null),fe=t.useRef(null),$=t.useRef(null),D=t.useRef(null),U=t.useRef(null),me=t.useRef([]),G=t.useRef(!1),P=t.useRef(null),{currentElementList:v,stepElementLists:xe,slideElementList:T,currentIndex:c,audioList:h,currentAudioSequenceIndexes:pe,currentStepHasSpeakableElement:b,currentInteractionElement:i,canGoPrev:Be,canGoNext:I,handlePrev:he,handleNext:R}=ot.default(w),ge=t.useMemo(()=>{if(!(c<0))return T[c]},[c,T]),Me=T.filter(e=>e.is_renderable!==!1).length===1,g=C&&(T.length>0||h.length>0||!!i),x=t.useMemo(()=>pe.map(e=>h[e]?.audioKey).filter(e=>!!e),[h,pe]),[ye,Y]=t.useState(!0),[J,z]=t.useState(!1),[y,k]=t.useState(null),[Ne,f]=t.useState(!1),[q,Se]=t.useState(!1),[o,Q]=t.useState(),[X,V]=t.useState(!1),B=g&&(m||ye),ve=t.useMemo(()=>it.getPlayerCustomActionCount(S),[S]),Fe=t.useMemo(()=>({"--slide-player-custom-action-count":String(ve)}),[ve]),{mountedStepStates:Ke,currentMountedStateIndex:Oe}=t.useMemo(()=>{const e=[],n=new Map;return xe.forEach((l,a)=>{const s=e.findIndex(u=>dt(u.elementList,l));if(s>=0){e[s]?.sourceStepIndexes.push(a),n.set(a,s);return}e.push({elementList:l,sourceStepIndexes:[a]}),n.set(a,e.length-1)}),{mountedStepStates:e,currentMountedStateIndex:c>=0?n.get(c)??-1:-1}},[c,xe]),be=t.useMemo(()=>String(c),[c]),le=t.useMemo(()=>y?h.findIndex(e=>(e.audioKey??"")===y):-1,[h,y]),Z=t.useMemo(()=>x[0]??"none",[x]),Ee=t.useMemo(()=>i?`${i.sequence_number??"none"}:${String(i.content??"")}`:"none",[i]),Le=t.useMemo(()=>[be,Ee].join("|"),[Ee,be]),M=!!t.useMemo(()=>!Z||Z==="none"?"":h.find(n=>n.audioKey===Z)?.audioUrl?.trim()??"",[h,Z]),j=t.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),E=t.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),N=t.useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null)},[]),F=t.useCallback(()=>{N(),E(),k(null),f(!1),Se(!1),Q(void 0),V(!1)},[N,E]),K=t.useCallback(()=>{const e=x[0];return e?(k(e),!0):!1},[x]),ee=t.useCallback(()=>{E(),V(!1),!K()&&I&&R()},[I,E,R,K]),d=t.useCallback((e=J)=>{g&&(Y(!0),j(),!(m||!e||H<=0)&&($.current=window.setTimeout(()=>{Y(!1),$.current=null},H)))},[j,J,m,H,g]),ie=!!(i?.readonly||i?.user_input?.trim()),O=!!i&&!ie;t.useEffect(()=>()=>{N(),j(),E()},[N,E,j]),t.useEffect(()=>(se?.(B),()=>{se?.(!1)}),[se,B]),t.useEffect(()=>{ce?.(ge,c)},[c,ge,ce]),t.useEffect(()=>{if(!g){j(),Y(!1);return}if(m){j(),Y(!0);return}J||d(!0)},[j,J,m,g,d]),t.useEffect(()=>{if(typeof window>"u")return;const e=n=>{n.origin===window.location.origin&&nt.isSandboxInteractionMessage(n.data)&&g&&(z(!0),d(!0))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[g,d]),ut.default({sectionRef:oe,enabled:g,onWake:()=>{z(!0),d(!0)}}),t.useEffect(()=>{const e=P.current===c&&!!i,n=lt.shouldPresentInteractionOverlay({hasInteraction:!!i,shouldBlockPlaybackForInteraction:O,shouldOpenInteractionOverlayAfterAudio:e,hasResolvedCurrentInteraction:ie,currentStepHasSpeakableElement:b});if(F(),!(v.length===0&&!i)){if(n){Q(i),V(!0),P.current=null;return}if(i&&(Q(i),V(!1),P.current=null),!K()){if(b){f(!0);return}if(I)return D.current=window.setTimeout(()=>{D.current=null,R()},ct),()=>{N()}}}},[I,N,v.length,i,Le,b,R,ie,O,F,K]),t.useEffect(()=>{if(!b||O){f(!1);return}if(q){f(!1);return}x.length===0&&f(!0)},[x.length,b,q,O]),t.useEffect(()=>{y||x.length===0||!b||O||q||K()},[y,x,b,q,O,K]),t.useEffect(()=>{!y||le>=0||k(null)},[le,y]),t.useEffect(()=>{M&&f(!1)},[M]);const Re=t.useMemo(()=>{if(!o)return{};const e=!!o.user_input?.trim();return Pe.getInteractionDefaultValues(typeof o.content=="string"?o.content:void 0,o.user_input,e?void 0:A)},[o,A]),He=t.useMemo(()=>{if(!o)return;const e=!!o.user_input?.trim();return Pe.getInteractionDefaultSelectedValues(typeof o.content=="string"?o.content:void 0,o.user_input,e?void 0:A)},[o,A]),Ie=!!o?.user_input?.trim(),je=!!o?.readonly||Ie,we=je||Ie,$e=t.useCallback(e=>{const l=[...e.selectedValues??[],e.inputText?.trim()??"",e.buttonText?.trim()??""].filter(Boolean).join(", ");Q(a=>!a||!l?a:{...a,user_input:l}),ae?.(e,o),ee()},[o,ee,ae]);t.useEffect(()=>{if(E(),!(!X||!we))return U.current=window.setTimeout(()=>{U.current=null,ee()},2e3),()=>{E()}},[E,ee,X,we]);const De=(e,n={})=>e?e.type==="slot"?r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:e.content}):e.type==="html"?r.jsxRuntimeExports.jsx(Ae.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",replaceRootScreenHeightWithFull:n.replaceRootScreenHeightWithFull,type:"sandbox",content:e.content}):r.jsxRuntimeExports.jsx(Ae.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",type:"markdown",content:e.content}):null,Ue=(e=[],n=!1)=>{if(e.length===0)return null;const l=e.filter(s=>s.is_renderable!==!1).length,a=e.reduce((s,u,p)=>u.is_renderable!==!1?p:s,-1);return r.jsxRuntimeExports.jsx("div",{className:"slide-stage__content flex w-full flex-col gap-4",children:e.map((s,u)=>{const p=s.type==="html"&&s.is_renderable===!1;return r.jsxRuntimeExports.jsx("div",{ref:n&&u===a?fe:null,"aria-hidden":p||void 0,className:W.cn("w-full shrink-0",l===1&&s.is_renderable!==!1&&"slide-element--single",p?"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0":s.is_renderable===!1&&"hidden"),children:De(s,{replaceRootScreenHeightWithFull:l===1&&s.type==="html"&&s.is_renderable!==!1})},s.sequence_number??`${s.type}-${u}`)})})},ze=()=>{const e=oe.current;if(e){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}e.requestFullscreen?.().catch(()=>{})}},Ce=t.useCallback(()=>{const e=ue.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[]),Ve=t.useCallback(()=>{G.current=!0,P.current=null,z(!0),f(!1),d(!0),F(),he()},[he,F,d]),We=t.useCallback(()=>{G.current=!0,P.current=null,z(!0),f(!1),d(!0),F(),R()},[R,F,d]),Ge=t.useCallback(e=>{if(M){f(!1);return}if(!b||q){f(!1);return}f(e)},[b,q,M]),Ye=t.useCallback(e=>{const n=h[e]?.audioKey;if(!n||!y||n!==y)return;const l=x.findIndex(u=>u===n);if(l<0){k(null);return}const a=l+1,s=x[a];if(s){k(s);return}if(k(null),Se(!0),f(!1),I){const u=c+1,p=T[u];M&&p?.type==="interaction"&&(P.current=u),R()}},[h,I,c,y,x,R,M,T]),Je=t.useCallback(()=>{o&&V(e=>!e)},[o]),_e=t.useCallback(e=>{e.stopPropagation(),B&&d(!0)},[ye,d]),Qe=t.useCallback(e=>{de?.(e),z(!0),d(!0)},[de,d]),Xe=!!o&&X,te=t.useMemo(()=>v.map((e,n)=>`${e.sequence_number??`${e.type}-${n}`}:${String(e.is_new??"")}`),[v]);return t.useEffect(()=>{const e=me.current,a=(e.length>0&&e.length<te.length&&e.every((u,p)=>u===te[p])?v.slice(e.length):[]).some(u=>u.is_new===!1);if(me.current=te,!a)return;const s=window.requestAnimationFrame(()=>{const u=ue.current,p=fe.current;if(!u||!p)return;const Ze=u.getBoundingClientRect(),et=p.getBoundingClientRect(),tt=u.scrollTop+(et.top-Ze.top);u.scrollTo({top:Math.max(tt,0),behavior:"smooth"})});return()=>{window.cancelAnimationFrame(s)}},[v,te]),t.useEffect(()=>{if(!G.current||(G.current=!1,v.length===0))return;const e=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(e)}},[v,Ce]),r.jsxRuntimeExports.jsxs("section",{ref:oe,className:W.cn("relative h-full w-full",ke),onPointerDown:Qe,...qe,children:[r.jsxRuntimeExports.jsx("div",{className:W.cn("h-full min-h-0 w-full",Me?"slide-content--single":"grid gap-4"),children:v.length>0?r.jsxRuntimeExports.jsx("div",{className:"slide-stage",children:r.jsxRuntimeExports.jsx("div",{ref:ue,className:"slide-stage__layer w-full",children:Ke.map((e,n)=>{const l=n===Oe;return r.jsxRuntimeExports.jsx("div",{"aria-hidden":!l||void 0,className:"w-full h-full",style:{display:l?void 0:"none"},children:Ue(e.elementList,l)},e.sourceStepIndexes[0]??n)})})}):null}),Ne?r.jsxRuntimeExports.jsxs("div",{className:"pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm",children:[r.jsxRuntimeExports.jsx(at.default,{className:"size-5 animate-spin text-background"}),r.jsxRuntimeExports.jsx("span",{children:ne})]}):null,Xe?r.jsxRuntimeExports.jsx("div",{className:W.cn("slide-interaction-overlay",B&&g?"slide-interaction-overlay--with-player":"slide-interaction-overlay--standalone"),onClick:_e,onPointerDown:_e,style:Fe,children:r.jsxRuntimeExports.jsx(Te,{content:String(o?.content??""),defaultButtonText:Re.buttonText??"",defaultInputText:Re.inputText??"",defaultSelectedValues:He,confirmButtonText:_?.confirmButtonText,copyButtonText:_?.copyButtonText,copiedButtonText:_?.copiedButtonText,onSend:$e,readonly:je,title:_?.title??re??"Submit the content below to continue."})}):null,g?r.jsxRuntimeExports.jsx(st.default,{audioList:h,className:W.cn("absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",L,!B&&"pointer-events-none opacity-0"),currentAudioIndex:le,defaultPlaying:!0,hasInteraction:!!o,isInteractionOpen:X,onLoadingChange:Ge,nextDisabled:!I,onEnded:Ye,onFullscreen:ze,onInteractionToggle:Je,onNext:We,onPrev:Ve,prevDisabled:!Be,showControls:B,customActions:S}):null]})};exports.default=ft;
|
|
2
2
|
//# sourceMappingURL=Slide.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slide.cjs.js","sources":["../../../src/components/Slide/Slide.tsx"],"sourcesContent":["import React, {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\n\nimport { isSandboxInteractionMessage } from \"../../lib/sandboxInteraction\";\nimport { cn } from \"../../lib/utils\";\nimport ContentRender from \"../ContentRender\";\nimport type { ContentRenderProps } from \"../ContentRender/ContentRender\";\nimport IframeSandbox from \"../ContentRender/IframeSandbox\";\nimport type { OnSendContentParams } from \"../types\";\nimport {\n getInteractionDefaultSelectedValues,\n getInteractionDefaultValues,\n type InteractionDefaultValueOptions,\n} from \"../../lib/interaction-defaults\";\nimport Player from \"./Player\";\nimport type { PlayerProps } from \"./Player\";\nimport type { Element } from \"./types\";\nimport useSlide from \"./useSlide\";\nimport useWakePlayerFromIframe from \"./useWakePlayerFromIframe\";\nimport { getPlayerCustomActionCount } from \"./utils/playerCustomActions\";\nimport \"./slide.css\";\nexport type { Element, ElementAudioSegment } from \"./types\";\n\nconst CHECKPOINT_AUTO_ADVANCE_DELAY_MS = 1000;\n\ntype RenderSlideElementOptions = {\n replaceRootScreenHeightWithFull?: boolean;\n};\n\ninterface InteractionOverlayCardProps {\n content: string;\n title: string;\n defaultButtonText?: string;\n defaultInputText?: string;\n defaultSelectedValues?: string[];\n confirmButtonText?: string;\n copyButtonText?: string;\n copiedButtonText?: string;\n onSend?: (content: OnSendContentParams) => void;\n readonly?: boolean;\n}\n\nexport interface SlideInteractionTexts extends Pick<\n ContentRenderProps,\n \"confirmButtonText\" | \"copyButtonText\" | \"copiedButtonText\"\n> {\n title?: string;\n}\n\nconst InteractionOverlayCard = memo(\n ({\n content,\n title,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n onSend,\n readonly = false,\n }: InteractionOverlayCardProps) => (\n <div className=\"slide-player__interaction-card\">\n <div className=\"slide-player__interaction-header\">\n <p className=\"slide-player__interaction-title\">{title}</p>\n </div>\n <div className=\"slide-player__interaction-body\">\n <ContentRender\n content={content}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n confirmButtonText={confirmButtonText}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n onSend={onSend}\n readonly={readonly}\n enableTypewriter={false}\n sandboxMode=\"content\"\n />\n </div>\n <div className=\"slide-player__interaction-arrow\" />\n </div>\n )\n);\n\nInteractionOverlayCard.displayName = \"InteractionOverlayCard\";\n\nconst areStepElementListsEqual = (\n prevElementList: Element[],\n nextElementList: Element[]\n) =>\n prevElementList.length === nextElementList.length &&\n prevElementList.every((element, index) => {\n const nextElement = nextElementList[index];\n\n return (\n element.sequence_number === nextElement?.sequence_number &&\n element.type === nextElement?.type &&\n element.content === nextElement?.content\n );\n });\n\nexport interface SlideProps extends React.ComponentProps<\"section\"> {\n elementList?: Element[];\n showPlayer?: boolean;\n playerAlwaysVisible?: boolean;\n playerClassName?: string;\n playerCustomActions?: PlayerProps[\"customActions\"];\n bufferingText?: string;\n interactionTitle?: string;\n interactionTexts?: SlideInteractionTexts;\n playerAutoHideDelay?: number;\n interactionDefaultValueOptions?: InteractionDefaultValueOptions;\n onSend?: (content: OnSendContentParams, element?: Element) => void;\n onPlayerVisibilityChange?: (visible: boolean) => void;\n onStepChange?: (element: Element | undefined, index: number) => void;\n}\n\nconst Slide: React.FC<SlideProps> = ({\n elementList = [],\n showPlayer = true,\n playerAlwaysVisible = false,\n playerClassName,\n playerCustomActions,\n bufferingText = \"Buffering...\",\n interactionTitle,\n interactionTexts,\n playerAutoHideDelay = 3000,\n interactionDefaultValueOptions,\n onSend,\n onPlayerVisibilityChange,\n onStepChange,\n className,\n onPointerDown,\n ...props\n}) => {\n const sectionRef = useRef<HTMLElement | null>(null);\n const stageLayerRef = useRef<HTMLDivElement | null>(null);\n const lastElementRef = useRef<HTMLDivElement | null>(null);\n const playerHideTimerRef = useRef<number | null>(null);\n const autoAdvanceTimerRef = useRef<number | null>(null);\n const interactionAutoCloseTimerRef = useRef<number | null>(null);\n const prevRenderElementKeysRef = useRef<string[]>([]);\n const shouldScrollToBottomRef = useRef(false);\n const pendingInteractionOverlayStepIndexRef = useRef<number | null>(null);\n const {\n currentElementList,\n stepElementLists,\n slideElementList,\n currentIndex,\n audioList,\n currentAudioSequenceIndexes,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n canGoPrev,\n canGoNext,\n handlePrev: goPrev,\n handleNext: goNext,\n } = useSlide(elementList);\n const currentStepElement = useMemo(() => {\n if (currentIndex < 0) {\n return undefined;\n }\n\n return slideElementList[currentIndex];\n }, [currentIndex, slideElementList]);\n const visibleMarkerCount = slideElementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const isSingleSlide = visibleMarkerCount === 1;\n const shouldRenderPlayer =\n showPlayer &&\n (slideElementList.length > 0 ||\n audioList.length > 0 ||\n Boolean(currentInteractionElement));\n const currentAudioSequenceKeys = useMemo(\n () =>\n currentAudioSequenceIndexes\n .map((audioIndex) => audioList[audioIndex]?.audioKey)\n .filter((audioKey): audioKey is string => Boolean(audioKey)),\n [audioList, currentAudioSequenceIndexes]\n );\n const [isPlayerVisible, setIsPlayerVisible] = useState(true);\n const [hasPlayerInteracted, setHasPlayerInteracted] = useState(false);\n const [currentAudioKey, setCurrentAudioKey] = useState<string | null>(null);\n const [isAudioLoadingVisible, setIsAudioLoadingVisible] = useState(false);\n const [hasCompletedCurrentStepAudio, setHasCompletedCurrentStepAudio] =\n useState(false);\n const [activeInteractionElement, setActiveInteractionElement] = useState<\n Element | undefined\n >();\n const [isInteractionOverlayOpen, setIsInteractionOverlayOpen] =\n useState(false);\n const playerVisible =\n shouldRenderPlayer && (playerAlwaysVisible || isPlayerVisible);\n const playerCustomActionCount = useMemo(\n () => getPlayerCustomActionCount(playerCustomActions),\n [playerCustomActions]\n );\n const interactionOverlayStyle = useMemo(\n () =>\n ({\n \"--slide-player-custom-action-count\": String(playerCustomActionCount),\n }) as React.CSSProperties,\n [playerCustomActionCount]\n );\n const { mountedStepStates, currentMountedStateIndex } = useMemo(() => {\n const nextMountedStepStates: Array<{\n elementList: Element[];\n sourceStepIndexes: number[];\n }> = [];\n const mountedStateIndexByStep = new Map<number, number>();\n\n stepElementLists.forEach((stepElementList, stepIndex) => {\n const existingMountedStateIndex = nextMountedStepStates.findIndex(\n (mountedStepState) =>\n areStepElementListsEqual(\n mountedStepState.elementList,\n stepElementList\n )\n );\n\n if (existingMountedStateIndex >= 0) {\n nextMountedStepStates[\n existingMountedStateIndex\n ]?.sourceStepIndexes.push(stepIndex);\n mountedStateIndexByStep.set(stepIndex, existingMountedStateIndex);\n return;\n }\n\n nextMountedStepStates.push({\n elementList: stepElementList,\n sourceStepIndexes: [stepIndex],\n });\n mountedStateIndexByStep.set(stepIndex, nextMountedStepStates.length - 1);\n });\n\n return {\n mountedStepStates: nextMountedStepStates,\n currentMountedStateIndex:\n currentIndex >= 0\n ? (mountedStateIndexByStep.get(currentIndex) ?? -1)\n : -1,\n };\n }, [currentIndex, stepElementLists]);\n const currentStepKey = useMemo(() => String(currentIndex), [currentIndex]);\n const currentAudioIndex = useMemo(() => {\n if (!currentAudioKey) {\n return -1;\n }\n\n return audioList.findIndex(\n (audioItem) => (audioItem.audioKey ?? \"\") === currentAudioKey\n );\n }, [audioList, currentAudioKey]);\n const currentAudioSequenceStartKey = useMemo(\n () => currentAudioSequenceKeys[0] ?? \"none\",\n [currentAudioSequenceKeys]\n );\n const currentInteractionResetKey = useMemo(() => {\n if (!currentInteractionElement) {\n return \"none\";\n }\n\n return `${currentInteractionElement.sequence_number ?? \"none\"}:${String(\n currentInteractionElement.content ?? \"\"\n )}`;\n }, [currentInteractionElement]);\n const currentPlaybackResetKey = useMemo(\n () => [currentStepKey, currentInteractionResetKey].join(\"|\"),\n [currentInteractionResetKey, currentStepKey]\n );\n const currentStepAudioUrl = useMemo(() => {\n if (\n !currentAudioSequenceStartKey ||\n currentAudioSequenceStartKey === \"none\"\n ) {\n return \"\";\n }\n\n const currentStepAudioItem = audioList.find(\n (audioItem) => audioItem.audioKey === currentAudioSequenceStartKey\n );\n\n return currentStepAudioItem?.audioUrl?.trim() ?? \"\";\n }, [audioList, currentAudioSequenceStartKey]);\n const hasCurrentStepAudioUrl = Boolean(currentStepAudioUrl);\n\n const clearPlayerHideTimer = useCallback(() => {\n if (playerHideTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(playerHideTimerRef.current);\n playerHideTimerRef.current = null;\n }, []);\n\n const clearInteractionAutoCloseTimer = useCallback(() => {\n if (interactionAutoCloseTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(interactionAutoCloseTimerRef.current);\n interactionAutoCloseTimerRef.current = null;\n }, []);\n\n const clearAutoAdvanceTimer = useCallback(() => {\n if (autoAdvanceTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(autoAdvanceTimerRef.current);\n autoAdvanceTimerRef.current = null;\n }, []);\n\n const resetAudioSequence = useCallback(() => {\n clearAutoAdvanceTimer();\n clearInteractionAutoCloseTimer();\n setCurrentAudioKey(null);\n setIsAudioLoadingVisible(false);\n setHasCompletedCurrentStepAudio(false);\n setActiveInteractionElement(undefined);\n setIsInteractionOverlayOpen(false);\n }, [clearAutoAdvanceTimer, clearInteractionAutoCloseTimer]);\n\n const startCurrentAudioSequence = useCallback(() => {\n const nextAudioKey = currentAudioSequenceKeys[0];\n\n if (!nextAudioKey) {\n return false;\n }\n\n // Start the first audio segment for the current step immediately.\n setCurrentAudioKey(nextAudioKey);\n return true;\n }, [currentAudioSequenceKeys]);\n\n const continueAfterInteraction = useCallback(() => {\n clearInteractionAutoCloseTimer();\n setIsInteractionOverlayOpen(false);\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (canGoNext) {\n goNext();\n }\n }, [\n canGoNext,\n clearInteractionAutoCloseTimer,\n goNext,\n startCurrentAudioSequence,\n ]);\n\n const showPlayerControls = useCallback(\n (enableAutoHide = hasPlayerInteracted) => {\n if (!shouldRenderPlayer) {\n return;\n }\n\n setIsPlayerVisible(true);\n clearPlayerHideTimer();\n\n if (playerAlwaysVisible || !enableAutoHide || playerAutoHideDelay <= 0) {\n return;\n }\n\n playerHideTimerRef.current = window.setTimeout(() => {\n setIsPlayerVisible(false);\n playerHideTimerRef.current = null;\n }, playerAutoHideDelay);\n },\n [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n playerAutoHideDelay,\n shouldRenderPlayer,\n ]\n );\n\n const hasResolvedCurrentInteraction = Boolean(\n currentInteractionElement?.readonly ||\n currentInteractionElement?.user_input?.trim()\n );\n\n const shouldBlockPlaybackForInteraction =\n Boolean(currentInteractionElement) && !hasResolvedCurrentInteraction;\n\n useEffect(() => {\n return () => {\n clearAutoAdvanceTimer();\n clearPlayerHideTimer();\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearAutoAdvanceTimer,\n clearInteractionAutoCloseTimer,\n clearPlayerHideTimer,\n ]);\n\n useEffect(() => {\n onPlayerVisibilityChange?.(playerVisible);\n\n return () => {\n onPlayerVisibilityChange?.(false);\n };\n }, [onPlayerVisibilityChange, playerVisible]);\n\n useEffect(() => {\n onStepChange?.(currentStepElement, currentIndex);\n }, [currentIndex, currentStepElement, onStepChange]);\n\n useEffect(() => {\n if (!shouldRenderPlayer) {\n clearPlayerHideTimer();\n setIsPlayerVisible(false);\n return;\n }\n\n if (playerAlwaysVisible) {\n clearPlayerHideTimer();\n setIsPlayerVisible(true);\n return;\n }\n\n if (!hasPlayerInteracted) {\n // Keep the initial player visible briefly, then hide it automatically.\n showPlayerControls(true);\n }\n }, [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n shouldRenderPlayer,\n showPlayerControls,\n ]);\n\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const handleSandboxInteraction = (event: MessageEvent) => {\n if (event.origin !== window.location.origin) {\n return;\n }\n\n if (!isSandboxInteractionMessage(event.data)) {\n return;\n }\n\n if (!shouldRenderPlayer) {\n return;\n }\n\n // Restore player controls without blocking native iframe scrolling.\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n };\n\n window.addEventListener(\"message\", handleSandboxInteraction);\n\n return () => {\n window.removeEventListener(\"message\", handleSandboxInteraction);\n };\n }, [shouldRenderPlayer, showPlayerControls]);\n\n useWakePlayerFromIframe({\n sectionRef,\n enabled: shouldRenderPlayer,\n onWake: () => {\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n });\n\n useEffect(() => {\n const shouldOpenInteractionOverlayAfterAudio =\n pendingInteractionOverlayStepIndexRef.current === currentIndex &&\n Boolean(currentInteractionElement);\n const shouldPresentInteractionOverlay =\n Boolean(currentInteractionElement) &&\n (shouldBlockPlaybackForInteraction ||\n shouldOpenInteractionOverlayAfterAudio ||\n hasResolvedCurrentInteraction);\n\n resetAudioSequence();\n\n if (currentElementList.length === 0 && !currentInteractionElement) {\n return;\n }\n\n if (shouldPresentInteractionOverlay) {\n // Re-open history interaction checkpoints so manual prev/next still reveals the overlay.\n setActiveInteractionElement(currentInteractionElement);\n setIsInteractionOverlayOpen(true);\n pendingInteractionOverlayStepIndexRef.current = null;\n return;\n }\n\n if (currentInteractionElement) {\n setActiveInteractionElement(currentInteractionElement);\n setIsInteractionOverlayOpen(false);\n pendingInteractionOverlayStepIndexRef.current = null;\n }\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (currentStepHasSpeakableElement) {\n setIsAudioLoadingVisible(true);\n return;\n }\n\n if (!canGoNext) {\n return;\n }\n\n // Auto-advance silent marker-only steps so playback flow does not stall.\n autoAdvanceTimerRef.current = window.setTimeout(() => {\n autoAdvanceTimerRef.current = null;\n goNext();\n }, CHECKPOINT_AUTO_ADVANCE_DELAY_MS);\n\n return () => {\n clearAutoAdvanceTimer();\n };\n }, [\n canGoNext,\n clearAutoAdvanceTimer,\n currentElementList.length,\n currentInteractionElement,\n currentPlaybackResetKey,\n currentStepHasSpeakableElement,\n goNext,\n hasResolvedCurrentInteraction,\n shouldBlockPlaybackForInteraction,\n resetAudioSequence,\n startCurrentAudioSequence,\n ]);\n\n useEffect(() => {\n if (!currentStepHasSpeakableElement || shouldBlockPlaybackForInteraction) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (hasCompletedCurrentStepAudio) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (currentAudioSequenceKeys.length === 0) {\n setIsAudioLoadingVisible(true);\n }\n }, [\n currentAudioSequenceKeys.length,\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n shouldBlockPlaybackForInteraction,\n ]);\n\n useEffect(() => {\n if (currentAudioKey || currentAudioSequenceKeys.length === 0) {\n return;\n }\n\n if (!currentStepHasSpeakableElement || shouldBlockPlaybackForInteraction) {\n return;\n }\n\n if (hasCompletedCurrentStepAudio) {\n return;\n }\n\n startCurrentAudioSequence();\n }, [\n currentAudioKey,\n currentAudioSequenceKeys,\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n shouldBlockPlaybackForInteraction,\n startCurrentAudioSequence,\n ]);\n\n useEffect(() => {\n if (!currentAudioKey || currentAudioIndex >= 0) {\n return;\n }\n\n setCurrentAudioKey(null);\n }, [currentAudioIndex, currentAudioKey]);\n\n useEffect(() => {\n if (!hasCurrentStepAudioUrl) {\n return;\n }\n\n // Treat the arrived audio URL as ready and hide the buffering overlay.\n setIsAudioLoadingVisible(false);\n }, [hasCurrentStepAudioUrl]);\n\n const interactionDefaults = useMemo(() => {\n if (!activeInteractionElement) {\n return {};\n }\n\n const shouldPreferResolvedInteractionInput = Boolean(\n activeInteractionElement.user_input?.trim()\n );\n\n return getInteractionDefaultValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n shouldPreferResolvedInteractionInput\n ? undefined\n : interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const interactionDefaultSelectedValues = useMemo(() => {\n if (!activeInteractionElement) {\n return undefined;\n }\n\n const shouldPreferResolvedInteractionInput = Boolean(\n activeInteractionElement.user_input?.trim()\n );\n\n return getInteractionDefaultSelectedValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n shouldPreferResolvedInteractionInput\n ? undefined\n : interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const hasResolvedInteractionInput = Boolean(\n activeInteractionElement?.user_input?.trim()\n );\n\n const isInteractionReadonly =\n Boolean(activeInteractionElement?.readonly) || hasResolvedInteractionInput;\n const shouldAutoContinueInteraction =\n isInteractionReadonly || hasResolvedInteractionInput;\n\n const handleInteractionSend = useCallback(\n (content: OnSendContentParams) => {\n const submittedValues = [\n ...(content.selectedValues ?? []),\n content.inputText?.trim() ?? \"\",\n content.buttonText?.trim() ?? \"\",\n ].filter(Boolean);\n const resolvedUserInput = submittedValues.join(\", \");\n\n setActiveInteractionElement((prevElement) => {\n if (!prevElement || !resolvedUserInput) {\n return prevElement;\n }\n\n return {\n ...prevElement,\n user_input: resolvedUserInput,\n };\n });\n\n onSend?.(content, activeInteractionElement);\n continueAfterInteraction();\n },\n [activeInteractionElement, continueAfterInteraction, onSend]\n );\n\n useEffect(() => {\n clearInteractionAutoCloseTimer();\n\n if (!isInteractionOverlayOpen || !shouldAutoContinueInteraction) {\n return;\n }\n\n // Auto-close passive interaction checkpoints to keep playback moving.\n interactionAutoCloseTimerRef.current = window.setTimeout(() => {\n interactionAutoCloseTimerRef.current = null;\n\n continueAfterInteraction();\n }, 2000);\n\n return () => {\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearInteractionAutoCloseTimer,\n continueAfterInteraction,\n isInteractionOverlayOpen,\n shouldAutoContinueInteraction,\n ]);\n\n const renderSlideElement = (\n element?: Element,\n options: RenderSlideElementOptions = {}\n ) => {\n if (!element) {\n return null;\n }\n\n if (element.type === \"slot\") {\n return <>{element.content}</>;\n }\n\n if (element.type === \"html\") {\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n replaceRootScreenHeightWithFull={\n options.replaceRootScreenHeightWithFull\n }\n type=\"sandbox\"\n content={element.content as string}\n />\n );\n }\n\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n type=\"markdown\"\n content={element.content as string}\n />\n );\n };\n\n const renderSlideElementList = (\n elementList: Element[] = [],\n isActiveStep = false\n ) => {\n if (elementList.length === 0) {\n return null;\n }\n\n const visibleElementCount = elementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const lastVisibleElementIndex = elementList.reduce(\n (lastVisibleIndex, element, index) =>\n element.is_renderable !== false ? index : lastVisibleIndex,\n -1\n );\n\n return (\n <div className=\"slide-stage__content flex w-full flex-col gap-4\">\n {elementList.map((element, index) => {\n const isPreRenderedHtml =\n element.type === \"html\" && element.is_renderable === false;\n\n return (\n <div\n key={element.sequence_number ?? `${element.type}-${index}`}\n ref={\n isActiveStep && index === lastVisibleElementIndex\n ? lastElementRef\n : null\n }\n aria-hidden={isPreRenderedHtml || undefined}\n className={cn(\n \"w-full shrink-0\",\n visibleElementCount === 1 &&\n element.is_renderable !== false &&\n \"slide-element--single\",\n isPreRenderedHtml\n ? \"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0\"\n : element.is_renderable === false && \"hidden\"\n )}\n >\n {renderSlideElement(element, {\n replaceRootScreenHeightWithFull:\n visibleElementCount === 1 &&\n element.type === \"html\" &&\n element.is_renderable !== false,\n })}\n </div>\n );\n })}\n </div>\n );\n };\n\n const handleFullscreen = () => {\n const target = sectionRef.current;\n if (!target) return;\n\n if (document.fullscreenElement) {\n document.exitFullscreen().catch(() => {});\n return;\n }\n\n target.requestFullscreen?.().catch(() => {});\n };\n\n const scrollStageToBottom = useCallback(() => {\n const stageLayerElement = stageLayerRef.current;\n\n if (!stageLayerElement) {\n return;\n }\n\n // Keep the latest content visible after manual player navigation.\n stageLayerElement.scrollTo({\n top: stageLayerElement.scrollHeight,\n behavior: \"smooth\",\n });\n }, []);\n\n const handlePrev = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n pendingInteractionOverlayStepIndexRef.current = null;\n setHasPlayerInteracted(true);\n setIsAudioLoadingVisible(false);\n showPlayerControls(true);\n resetAudioSequence();\n goPrev();\n }, [goPrev, resetAudioSequence, showPlayerControls]);\n\n const handleNext = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n pendingInteractionOverlayStepIndexRef.current = null;\n setHasPlayerInteracted(true);\n setIsAudioLoadingVisible(false);\n showPlayerControls(true);\n resetAudioSequence();\n goNext();\n }, [goNext, resetAudioSequence, showPlayerControls]);\n\n const handlePlayerLoadingChange = useCallback(\n (loading: boolean) => {\n if (hasCurrentStepAudioUrl) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (!currentStepHasSpeakableElement || hasCompletedCurrentStepAudio) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n setIsAudioLoadingVisible(loading);\n },\n [\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n hasCurrentStepAudioUrl,\n ]\n );\n\n const handlePlayerEnded = useCallback(\n (audioIndex: number) => {\n const endedAudioKey = audioList[audioIndex]?.audioKey;\n\n if (!endedAudioKey || !currentAudioKey) {\n return;\n }\n\n if (endedAudioKey !== currentAudioKey) {\n return;\n }\n\n const activeSequencePosition = currentAudioSequenceKeys.findIndex(\n (audioSequenceKey) => audioSequenceKey === endedAudioKey\n );\n if (activeSequencePosition < 0) {\n setCurrentAudioKey(null);\n return;\n }\n\n const nextSequencePosition = activeSequencePosition + 1;\n const nextAudioKey = currentAudioSequenceKeys[nextSequencePosition];\n\n if (nextAudioKey) {\n setCurrentAudioKey(nextAudioKey);\n return;\n }\n\n setCurrentAudioKey(null);\n setHasCompletedCurrentStepAudio(true);\n setIsAudioLoadingVisible(false);\n\n if (canGoNext) {\n const nextStepIndex = currentIndex + 1;\n const nextStepElement = slideElementList[nextStepIndex];\n\n if (hasCurrentStepAudioUrl && nextStepElement?.type === \"interaction\") {\n pendingInteractionOverlayStepIndexRef.current = nextStepIndex;\n }\n\n goNext();\n }\n },\n [\n audioList,\n canGoNext,\n currentIndex,\n currentAudioKey,\n currentAudioSequenceKeys,\n goNext,\n hasCurrentStepAudioUrl,\n slideElementList,\n ]\n );\n\n const handleInteractionToggle = useCallback(() => {\n if (!activeInteractionElement) {\n return;\n }\n\n setIsInteractionOverlayOpen((prevOpen) => !prevOpen);\n }, [activeInteractionElement]);\n\n const stopOverlayPropagation = useCallback(\n (\n event:\n | React.PointerEvent<HTMLDivElement>\n | React.MouseEvent<HTMLDivElement>\n ) => {\n event.stopPropagation();\n\n // Keep the player visible a bit longer when users interact with the overlay.\n if (playerVisible) {\n showPlayerControls(true);\n }\n },\n [isPlayerVisible, showPlayerControls]\n );\n\n const handleSurfacePointerDown = useCallback(\n (event: React.PointerEvent<HTMLElement>) => {\n onPointerDown?.(event);\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n [onPointerDown, showPlayerControls]\n );\n\n const shouldShowInteractionOverlay =\n Boolean(activeInteractionElement) && isInteractionOverlayOpen;\n const currentRenderElementKeys = useMemo(\n () =>\n currentElementList.map(\n (element, index) =>\n `${element.sequence_number ?? `${element.type}-${index}`}:${String(element.is_new ?? \"\")}`\n ),\n [currentElementList]\n );\n\n useEffect(() => {\n const prevKeys = prevRenderElementKeysRef.current;\n const hasStablePrefix =\n prevKeys.length > 0 &&\n prevKeys.length < currentRenderElementKeys.length &&\n prevKeys.every((key, index) => key === currentRenderElementKeys[index]);\n const appendedElements = hasStablePrefix\n ? currentElementList.slice(prevKeys.length)\n : [];\n const shouldAutoScrollToAppend = appendedElements.some(\n (element) => element.is_new === false\n );\n\n prevRenderElementKeysRef.current = currentRenderElementKeys;\n\n if (!shouldAutoScrollToAppend) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const stageLayerElement = stageLayerRef.current;\n const targetElement = lastElementRef.current;\n\n if (!stageLayerElement || !targetElement) {\n return;\n }\n\n const stageLayerRect = stageLayerElement.getBoundingClientRect();\n const targetRect = targetElement.getBoundingClientRect();\n const nextScrollTop =\n stageLayerElement.scrollTop + (targetRect.top - stageLayerRect.top);\n\n // Keep newly appended content visible when the current slide grows downward.\n stageLayerElement.scrollTo({\n top: Math.max(nextScrollTop, 0),\n behavior: \"smooth\",\n });\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, currentRenderElementKeys]);\n\n useEffect(() => {\n if (!shouldScrollToBottomRef.current) {\n return;\n }\n\n shouldScrollToBottomRef.current = false;\n\n if (currentElementList.length === 0) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n scrollStageToBottom();\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, scrollStageToBottom]);\n\n return (\n <section\n ref={sectionRef}\n className={cn(\"relative h-full w-full\", className)}\n onPointerDown={handleSurfacePointerDown}\n {...props}\n >\n <div\n className={cn(\n \"h-full min-h-0 w-full\",\n isSingleSlide ? \"slide-content--single\" : \"grid gap-4\"\n )}\n >\n {currentElementList.length > 0 ? (\n <div className=\"slide-stage\">\n <div ref={stageLayerRef} className=\"slide-stage__layer w-full\">\n {mountedStepStates.map(\n (mountedStepState, mountedStepStateIndex) => {\n const isActiveStep =\n mountedStepStateIndex === currentMountedStateIndex;\n\n return (\n <div\n key={\n mountedStepState.sourceStepIndexes[0] ??\n mountedStepStateIndex\n }\n aria-hidden={!isActiveStep || undefined}\n className=\"w-full h-full\"\n style={{ display: isActiveStep ? undefined : \"none\" }}\n >\n {renderSlideElementList(\n mountedStepState.elementList,\n isActiveStep\n )}\n </div>\n );\n }\n )}\n </div>\n </div>\n ) : null}\n </div>\n\n {isAudioLoadingVisible ? (\n <div className=\"pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm\">\n <LoaderCircle className=\"size-5 animate-spin text-background\" />\n <span>{bufferingText}</span>\n </div>\n ) : null}\n\n {shouldShowInteractionOverlay ? (\n <div\n className={cn(\n \"slide-interaction-overlay\",\n playerVisible && shouldRenderPlayer\n ? \"slide-interaction-overlay--with-player\"\n : \"slide-interaction-overlay--standalone\"\n )}\n onClick={stopOverlayPropagation}\n onPointerDown={stopOverlayPropagation}\n style={interactionOverlayStyle}\n >\n <InteractionOverlayCard\n content={String(activeInteractionElement?.content ?? \"\")}\n defaultButtonText={interactionDefaults.buttonText ?? \"\"}\n defaultInputText={interactionDefaults.inputText ?? \"\"}\n defaultSelectedValues={interactionDefaultSelectedValues}\n confirmButtonText={interactionTexts?.confirmButtonText}\n copyButtonText={interactionTexts?.copyButtonText}\n copiedButtonText={interactionTexts?.copiedButtonText}\n onSend={handleInteractionSend}\n readonly={isInteractionReadonly}\n title={\n interactionTexts?.title ??\n interactionTitle ??\n \"Submit the content below to continue.\"\n }\n />\n </div>\n ) : null}\n\n {shouldRenderPlayer ? (\n <Player\n audioList={audioList}\n className={cn(\n \"absolute left-1/2 bottom-6 z-[2] -translate-x-1/2\",\n playerClassName,\n !playerVisible && \"pointer-events-none opacity-0\"\n )}\n currentAudioIndex={currentAudioIndex}\n defaultPlaying\n hasInteraction={Boolean(activeInteractionElement)}\n isInteractionOpen={isInteractionOverlayOpen}\n onLoadingChange={handlePlayerLoadingChange}\n nextDisabled={!canGoNext}\n onEnded={handlePlayerEnded}\n onFullscreen={handleFullscreen}\n onInteractionToggle={handleInteractionToggle}\n onNext={handleNext}\n onPrev={handlePrev}\n prevDisabled={!canGoPrev}\n showControls={playerVisible}\n customActions={playerCustomActions}\n />\n ) : null}\n </section>\n );\n};\n\nexport default Slide;\n"],"names":["CHECKPOINT_AUTO_ADVANCE_DELAY_MS","InteractionOverlayCard","memo","content","title","defaultButtonText","defaultInputText","defaultSelectedValues","confirmButtonText","copyButtonText","copiedButtonText","onSend","readonly","jsxs","jsx","ContentRender","areStepElementListsEqual","prevElementList","nextElementList","element","index","nextElement","Slide","elementList","showPlayer","playerAlwaysVisible","playerClassName","playerCustomActions","bufferingText","interactionTitle","interactionTexts","playerAutoHideDelay","interactionDefaultValueOptions","onPlayerVisibilityChange","onStepChange","className","onPointerDown","props","sectionRef","useRef","stageLayerRef","lastElementRef","playerHideTimerRef","autoAdvanceTimerRef","interactionAutoCloseTimerRef","prevRenderElementKeysRef","shouldScrollToBottomRef","pendingInteractionOverlayStepIndexRef","currentElementList","stepElementLists","slideElementList","currentIndex","audioList","currentAudioSequenceIndexes","currentStepHasSpeakableElement","currentInteractionElement","canGoPrev","canGoNext","goPrev","goNext","useSlide","currentStepElement","useMemo","isSingleSlide","shouldRenderPlayer","currentAudioSequenceKeys","audioIndex","audioKey","isPlayerVisible","setIsPlayerVisible","useState","hasPlayerInteracted","setHasPlayerInteracted","currentAudioKey","setCurrentAudioKey","isAudioLoadingVisible","setIsAudioLoadingVisible","hasCompletedCurrentStepAudio","setHasCompletedCurrentStepAudio","activeInteractionElement","setActiveInteractionElement","isInteractionOverlayOpen","setIsInteractionOverlayOpen","playerVisible","playerCustomActionCount","getPlayerCustomActionCount","interactionOverlayStyle","mountedStepStates","currentMountedStateIndex","nextMountedStepStates","mountedStateIndexByStep","stepElementList","stepIndex","existingMountedStateIndex","mountedStepState","currentStepKey","currentAudioIndex","audioItem","currentAudioSequenceStartKey","currentInteractionResetKey","currentPlaybackResetKey","hasCurrentStepAudioUrl","clearPlayerHideTimer","useCallback","clearInteractionAutoCloseTimer","clearAutoAdvanceTimer","resetAudioSequence","startCurrentAudioSequence","nextAudioKey","continueAfterInteraction","showPlayerControls","enableAutoHide","hasResolvedCurrentInteraction","shouldBlockPlaybackForInteraction","useEffect","handleSandboxInteraction","event","isSandboxInteractionMessage","useWakePlayerFromIframe","shouldOpenInteractionOverlayAfterAudio","shouldPresentInteractionOverlay","interactionDefaults","shouldPreferResolvedInteractionInput","getInteractionDefaultValues","interactionDefaultSelectedValues","getInteractionDefaultSelectedValues","hasResolvedInteractionInput","isInteractionReadonly","shouldAutoContinueInteraction","handleInteractionSend","resolvedUserInput","prevElement","renderSlideElement","options","Fragment","IframeSandbox","renderSlideElementList","isActiveStep","visibleElementCount","lastVisibleElementIndex","lastVisibleIndex","isPreRenderedHtml","cn","handleFullscreen","target","scrollStageToBottom","stageLayerElement","handlePrev","handleNext","handlePlayerLoadingChange","loading","handlePlayerEnded","endedAudioKey","activeSequencePosition","audioSequenceKey","nextSequencePosition","nextStepIndex","nextStepElement","handleInteractionToggle","prevOpen","stopOverlayPropagation","handleSurfacePointerDown","shouldShowInteractionOverlay","currentRenderElementKeys","prevKeys","shouldAutoScrollToAppend","key","animationFrameId","targetElement","stageLayerRect","targetRect","nextScrollTop","mountedStepStateIndex","LoaderCircle","Player"],"mappings":"w0BA8BMA,GAAmC,IA0BnCC,GAAyBC,EAAAA,KAC7B,CAAC,CACC,QAAAC,EACA,MAAAC,EACA,kBAAAC,EACA,iBAAAC,EACA,sBAAAC,EACA,kBAAAC,GACA,eAAAC,GACA,iBAAAC,EACA,OAAAC,EACA,SAAAC,EAAW,EAAA,IAEXC,EAAAA,kBAAAA,KAA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AE,EACvD,kBAAmB0C,GAAoB,YAAc,GACrD,iBAAkBA,GAAoB,WAAa,GACnD,sBAAuBG,GACvB,kBAAmB9F,GAAkB,kBACrC,eAAgBA,GAAkB,eAClC,iBAAkBA,GAAkB,iBACpC,OAAQmG,GACR,SAAUF,GACV,MACEjG,GAAkB,OAClBD,IACA,uCAAA,CAAA,CAEJ,CAAA,EAEA,KAEHmC,EACClD,EAAAA,kBAAAA,IAACgK,GAAAA,QAAA,CACC,UAAA1H,EACA,UAAW0F,EAAAA,GACT,oDACApH,EACA,CAACyD,GAAiB,+BAAA,EAEpB,kBAAAa,GACA,eAAc,GACd,eAAgB,EAAQjB,EACxB,kBAAmBE,EACnB,gBAAiBoE,GACjB,aAAc,CAAC5F,EACf,QAAS8F,GACT,aAAcR,GACd,oBAAqBe,GACrB,OAAQV,GACR,OAAQD,GACR,aAAc,CAAC3F,GACf,aAAc2B,EACd,cAAexD,CAAA,CAAA,EAEf,IAAA,CAAA,CAAA,CAGV"}
|
|
1
|
+
{"version":3,"file":"Slide.cjs.js","sources":["../../../src/components/Slide/Slide.tsx"],"sourcesContent":["import React, {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\n\nimport { isSandboxInteractionMessage } from \"../../lib/sandboxInteraction\";\nimport { cn } from \"../../lib/utils\";\nimport ContentRender from \"../ContentRender\";\nimport type { ContentRenderProps } from \"../ContentRender/ContentRender\";\nimport IframeSandbox from \"../ContentRender/IframeSandbox\";\nimport type { OnSendContentParams } from \"../types\";\nimport {\n getInteractionDefaultSelectedValues,\n getInteractionDefaultValues,\n type InteractionDefaultValueOptions,\n} from \"../../lib/interaction-defaults\";\nimport Player from \"./Player\";\nimport type { PlayerProps } from \"./Player\";\nimport type { Element } from \"./types\";\nimport useSlide from \"./useSlide\";\nimport useWakePlayerFromIframe from \"./useWakePlayerFromIframe\";\nimport { shouldPresentInteractionOverlay } from \"./utils/interactionPlayback\";\nimport { getPlayerCustomActionCount } from \"./utils/playerCustomActions\";\nimport \"./slide.css\";\nexport type { Element, ElementAudioSegment } from \"./types\";\n\nconst CHECKPOINT_AUTO_ADVANCE_DELAY_MS = 1000;\n\ntype RenderSlideElementOptions = {\n replaceRootScreenHeightWithFull?: boolean;\n};\n\ninterface InteractionOverlayCardProps {\n content: string;\n title: string;\n defaultButtonText?: string;\n defaultInputText?: string;\n defaultSelectedValues?: string[];\n confirmButtonText?: string;\n copyButtonText?: string;\n copiedButtonText?: string;\n onSend?: (content: OnSendContentParams) => void;\n readonly?: boolean;\n}\n\nexport interface SlideInteractionTexts\n extends Pick<\n ContentRenderProps,\n \"confirmButtonText\" | \"copyButtonText\" | \"copiedButtonText\"\n > {\n title?: string;\n}\n\nconst InteractionOverlayCard = memo(\n ({\n content,\n title,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n onSend,\n readonly = false,\n }: InteractionOverlayCardProps) => (\n <div className=\"slide-player__interaction-card\">\n <div className=\"slide-player__interaction-header\">\n <p className=\"slide-player__interaction-title\">{title}</p>\n </div>\n <div className=\"slide-player__interaction-body\">\n <ContentRender\n content={content}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n confirmButtonText={confirmButtonText}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n onSend={onSend}\n readonly={readonly}\n enableTypewriter={false}\n sandboxMode=\"content\"\n />\n </div>\n <div className=\"slide-player__interaction-arrow\" />\n </div>\n )\n);\n\nInteractionOverlayCard.displayName = \"InteractionOverlayCard\";\n\nconst areStepElementListsEqual = (\n prevElementList: Element[],\n nextElementList: Element[]\n) =>\n prevElementList.length === nextElementList.length &&\n prevElementList.every((element, index) => {\n const nextElement = nextElementList[index];\n\n return (\n element.sequence_number === nextElement?.sequence_number &&\n element.type === nextElement?.type &&\n element.content === nextElement?.content\n );\n });\n\nexport interface SlideProps extends React.ComponentProps<\"section\"> {\n elementList?: Element[];\n showPlayer?: boolean;\n playerAlwaysVisible?: boolean;\n playerClassName?: string;\n playerCustomActions?: PlayerProps[\"customActions\"];\n bufferingText?: string;\n interactionTitle?: string;\n interactionTexts?: SlideInteractionTexts;\n playerAutoHideDelay?: number;\n interactionDefaultValueOptions?: InteractionDefaultValueOptions;\n onSend?: (content: OnSendContentParams, element?: Element) => void;\n onPlayerVisibilityChange?: (visible: boolean) => void;\n onStepChange?: (element: Element | undefined, index: number) => void;\n}\n\nconst Slide: React.FC<SlideProps> = ({\n elementList = [],\n showPlayer = true,\n playerAlwaysVisible = false,\n playerClassName,\n playerCustomActions,\n bufferingText = \"Buffering...\",\n interactionTitle,\n interactionTexts,\n playerAutoHideDelay = 3000,\n interactionDefaultValueOptions,\n onSend,\n onPlayerVisibilityChange,\n onStepChange,\n className,\n onPointerDown,\n ...props\n}) => {\n const sectionRef = useRef<HTMLElement | null>(null);\n const stageLayerRef = useRef<HTMLDivElement | null>(null);\n const lastElementRef = useRef<HTMLDivElement | null>(null);\n const playerHideTimerRef = useRef<number | null>(null);\n const autoAdvanceTimerRef = useRef<number | null>(null);\n const interactionAutoCloseTimerRef = useRef<number | null>(null);\n const prevRenderElementKeysRef = useRef<string[]>([]);\n const shouldScrollToBottomRef = useRef(false);\n const pendingInteractionOverlayStepIndexRef = useRef<number | null>(null);\n const {\n currentElementList,\n stepElementLists,\n slideElementList,\n currentIndex,\n audioList,\n currentAudioSequenceIndexes,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n canGoPrev,\n canGoNext,\n handlePrev: goPrev,\n handleNext: goNext,\n } = useSlide(elementList);\n const currentStepElement = useMemo(() => {\n if (currentIndex < 0) {\n return undefined;\n }\n\n return slideElementList[currentIndex];\n }, [currentIndex, slideElementList]);\n const visibleMarkerCount = slideElementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const isSingleSlide = visibleMarkerCount === 1;\n const shouldRenderPlayer =\n showPlayer &&\n (slideElementList.length > 0 ||\n audioList.length > 0 ||\n Boolean(currentInteractionElement));\n const currentAudioSequenceKeys = useMemo(\n () =>\n currentAudioSequenceIndexes\n .map((audioIndex) => audioList[audioIndex]?.audioKey)\n .filter((audioKey): audioKey is string => Boolean(audioKey)),\n [audioList, currentAudioSequenceIndexes]\n );\n const [isPlayerVisible, setIsPlayerVisible] = useState(true);\n const [hasPlayerInteracted, setHasPlayerInteracted] = useState(false);\n const [currentAudioKey, setCurrentAudioKey] = useState<string | null>(null);\n const [isAudioLoadingVisible, setIsAudioLoadingVisible] = useState(false);\n const [hasCompletedCurrentStepAudio, setHasCompletedCurrentStepAudio] =\n useState(false);\n const [activeInteractionElement, setActiveInteractionElement] = useState<\n Element | undefined\n >();\n const [isInteractionOverlayOpen, setIsInteractionOverlayOpen] =\n useState(false);\n const playerVisible =\n shouldRenderPlayer && (playerAlwaysVisible || isPlayerVisible);\n const playerCustomActionCount = useMemo(\n () => getPlayerCustomActionCount(playerCustomActions),\n [playerCustomActions]\n );\n const interactionOverlayStyle = useMemo(\n () =>\n ({\n \"--slide-player-custom-action-count\": String(playerCustomActionCount),\n }) as React.CSSProperties,\n [playerCustomActionCount]\n );\n const { mountedStepStates, currentMountedStateIndex } = useMemo(() => {\n const nextMountedStepStates: Array<{\n elementList: Element[];\n sourceStepIndexes: number[];\n }> = [];\n const mountedStateIndexByStep = new Map<number, number>();\n\n stepElementLists.forEach((stepElementList, stepIndex) => {\n const existingMountedStateIndex = nextMountedStepStates.findIndex(\n (mountedStepState) =>\n areStepElementListsEqual(\n mountedStepState.elementList,\n stepElementList\n )\n );\n\n if (existingMountedStateIndex >= 0) {\n nextMountedStepStates[\n existingMountedStateIndex\n ]?.sourceStepIndexes.push(stepIndex);\n mountedStateIndexByStep.set(stepIndex, existingMountedStateIndex);\n return;\n }\n\n nextMountedStepStates.push({\n elementList: stepElementList,\n sourceStepIndexes: [stepIndex],\n });\n mountedStateIndexByStep.set(stepIndex, nextMountedStepStates.length - 1);\n });\n\n return {\n mountedStepStates: nextMountedStepStates,\n currentMountedStateIndex:\n currentIndex >= 0\n ? (mountedStateIndexByStep.get(currentIndex) ?? -1)\n : -1,\n };\n }, [currentIndex, stepElementLists]);\n const currentStepKey = useMemo(() => String(currentIndex), [currentIndex]);\n const currentAudioIndex = useMemo(() => {\n if (!currentAudioKey) {\n return -1;\n }\n\n return audioList.findIndex(\n (audioItem) => (audioItem.audioKey ?? \"\") === currentAudioKey\n );\n }, [audioList, currentAudioKey]);\n const currentAudioSequenceStartKey = useMemo(\n () => currentAudioSequenceKeys[0] ?? \"none\",\n [currentAudioSequenceKeys]\n );\n const currentInteractionResetKey = useMemo(() => {\n if (!currentInteractionElement) {\n return \"none\";\n }\n\n return `${currentInteractionElement.sequence_number ?? \"none\"}:${String(\n currentInteractionElement.content ?? \"\"\n )}`;\n }, [currentInteractionElement]);\n const currentPlaybackResetKey = useMemo(\n () => [currentStepKey, currentInteractionResetKey].join(\"|\"),\n [currentInteractionResetKey, currentStepKey]\n );\n const currentStepAudioUrl = useMemo(() => {\n if (\n !currentAudioSequenceStartKey ||\n currentAudioSequenceStartKey === \"none\"\n ) {\n return \"\";\n }\n\n const currentStepAudioItem = audioList.find(\n (audioItem) => audioItem.audioKey === currentAudioSequenceStartKey\n );\n\n return currentStepAudioItem?.audioUrl?.trim() ?? \"\";\n }, [audioList, currentAudioSequenceStartKey]);\n const hasCurrentStepAudioUrl = Boolean(currentStepAudioUrl);\n\n const clearPlayerHideTimer = useCallback(() => {\n if (playerHideTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(playerHideTimerRef.current);\n playerHideTimerRef.current = null;\n }, []);\n\n const clearInteractionAutoCloseTimer = useCallback(() => {\n if (interactionAutoCloseTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(interactionAutoCloseTimerRef.current);\n interactionAutoCloseTimerRef.current = null;\n }, []);\n\n const clearAutoAdvanceTimer = useCallback(() => {\n if (autoAdvanceTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(autoAdvanceTimerRef.current);\n autoAdvanceTimerRef.current = null;\n }, []);\n\n const resetAudioSequence = useCallback(() => {\n clearAutoAdvanceTimer();\n clearInteractionAutoCloseTimer();\n setCurrentAudioKey(null);\n setIsAudioLoadingVisible(false);\n setHasCompletedCurrentStepAudio(false);\n setActiveInteractionElement(undefined);\n setIsInteractionOverlayOpen(false);\n }, [clearAutoAdvanceTimer, clearInteractionAutoCloseTimer]);\n\n const startCurrentAudioSequence = useCallback(() => {\n const nextAudioKey = currentAudioSequenceKeys[0];\n\n if (!nextAudioKey) {\n return false;\n }\n\n // Start the first audio segment for the current step immediately.\n setCurrentAudioKey(nextAudioKey);\n return true;\n }, [currentAudioSequenceKeys]);\n\n const continueAfterInteraction = useCallback(() => {\n clearInteractionAutoCloseTimer();\n setIsInteractionOverlayOpen(false);\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (canGoNext) {\n goNext();\n }\n }, [\n canGoNext,\n clearInteractionAutoCloseTimer,\n goNext,\n startCurrentAudioSequence,\n ]);\n\n const showPlayerControls = useCallback(\n (enableAutoHide = hasPlayerInteracted) => {\n if (!shouldRenderPlayer) {\n return;\n }\n\n setIsPlayerVisible(true);\n clearPlayerHideTimer();\n\n if (playerAlwaysVisible || !enableAutoHide || playerAutoHideDelay <= 0) {\n return;\n }\n\n playerHideTimerRef.current = window.setTimeout(() => {\n setIsPlayerVisible(false);\n playerHideTimerRef.current = null;\n }, playerAutoHideDelay);\n },\n [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n playerAutoHideDelay,\n shouldRenderPlayer,\n ]\n );\n\n const hasResolvedCurrentInteraction = Boolean(\n currentInteractionElement?.readonly ||\n currentInteractionElement?.user_input?.trim()\n );\n\n const shouldBlockPlaybackForInteraction =\n Boolean(currentInteractionElement) && !hasResolvedCurrentInteraction;\n\n useEffect(() => {\n return () => {\n clearAutoAdvanceTimer();\n clearPlayerHideTimer();\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearAutoAdvanceTimer,\n clearInteractionAutoCloseTimer,\n clearPlayerHideTimer,\n ]);\n\n useEffect(() => {\n onPlayerVisibilityChange?.(playerVisible);\n\n return () => {\n onPlayerVisibilityChange?.(false);\n };\n }, [onPlayerVisibilityChange, playerVisible]);\n\n useEffect(() => {\n onStepChange?.(currentStepElement, currentIndex);\n }, [currentIndex, currentStepElement, onStepChange]);\n\n useEffect(() => {\n if (!shouldRenderPlayer) {\n clearPlayerHideTimer();\n setIsPlayerVisible(false);\n return;\n }\n\n if (playerAlwaysVisible) {\n clearPlayerHideTimer();\n setIsPlayerVisible(true);\n return;\n }\n\n if (!hasPlayerInteracted) {\n // Keep the initial player visible briefly, then hide it automatically.\n showPlayerControls(true);\n }\n }, [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n shouldRenderPlayer,\n showPlayerControls,\n ]);\n\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const handleSandboxInteraction = (event: MessageEvent) => {\n if (event.origin !== window.location.origin) {\n return;\n }\n\n if (!isSandboxInteractionMessage(event.data)) {\n return;\n }\n\n if (!shouldRenderPlayer) {\n return;\n }\n\n // Restore player controls without blocking native iframe scrolling.\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n };\n\n window.addEventListener(\"message\", handleSandboxInteraction);\n\n return () => {\n window.removeEventListener(\"message\", handleSandboxInteraction);\n };\n }, [shouldRenderPlayer, showPlayerControls]);\n\n useWakePlayerFromIframe({\n sectionRef,\n enabled: shouldRenderPlayer,\n onWake: () => {\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n });\n\n useEffect(() => {\n const shouldOpenInteractionOverlayAfterAudio =\n pendingInteractionOverlayStepIndexRef.current === currentIndex &&\n Boolean(currentInteractionElement);\n const shouldPresentOverlay = shouldPresentInteractionOverlay({\n hasInteraction: Boolean(currentInteractionElement),\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n });\n\n resetAudioSequence();\n\n if (currentElementList.length === 0 && !currentInteractionElement) {\n return;\n }\n\n if (shouldPresentOverlay) {\n // Re-open history interaction checkpoints so manual prev/next still reveals the overlay.\n setActiveInteractionElement(currentInteractionElement);\n setIsInteractionOverlayOpen(true);\n pendingInteractionOverlayStepIndexRef.current = null;\n return;\n }\n\n if (currentInteractionElement) {\n setActiveInteractionElement(currentInteractionElement);\n setIsInteractionOverlayOpen(false);\n pendingInteractionOverlayStepIndexRef.current = null;\n }\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (currentStepHasSpeakableElement) {\n setIsAudioLoadingVisible(true);\n return;\n }\n\n if (!canGoNext) {\n return;\n }\n\n // Auto-advance silent marker-only steps so playback flow does not stall.\n autoAdvanceTimerRef.current = window.setTimeout(() => {\n autoAdvanceTimerRef.current = null;\n goNext();\n }, CHECKPOINT_AUTO_ADVANCE_DELAY_MS);\n\n return () => {\n clearAutoAdvanceTimer();\n };\n }, [\n canGoNext,\n clearAutoAdvanceTimer,\n currentElementList.length,\n currentInteractionElement,\n currentPlaybackResetKey,\n currentStepHasSpeakableElement,\n goNext,\n hasResolvedCurrentInteraction,\n shouldBlockPlaybackForInteraction,\n resetAudioSequence,\n startCurrentAudioSequence,\n ]);\n\n useEffect(() => {\n if (!currentStepHasSpeakableElement || shouldBlockPlaybackForInteraction) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (hasCompletedCurrentStepAudio) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (currentAudioSequenceKeys.length === 0) {\n setIsAudioLoadingVisible(true);\n }\n }, [\n currentAudioSequenceKeys.length,\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n shouldBlockPlaybackForInteraction,\n ]);\n\n useEffect(() => {\n if (currentAudioKey || currentAudioSequenceKeys.length === 0) {\n return;\n }\n\n if (!currentStepHasSpeakableElement || shouldBlockPlaybackForInteraction) {\n return;\n }\n\n if (hasCompletedCurrentStepAudio) {\n return;\n }\n\n startCurrentAudioSequence();\n }, [\n currentAudioKey,\n currentAudioSequenceKeys,\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n shouldBlockPlaybackForInteraction,\n startCurrentAudioSequence,\n ]);\n\n useEffect(() => {\n if (!currentAudioKey || currentAudioIndex >= 0) {\n return;\n }\n\n setCurrentAudioKey(null);\n }, [currentAudioIndex, currentAudioKey]);\n\n useEffect(() => {\n if (!hasCurrentStepAudioUrl) {\n return;\n }\n\n // Treat the arrived audio URL as ready and hide the buffering overlay.\n setIsAudioLoadingVisible(false);\n }, [hasCurrentStepAudioUrl]);\n\n const interactionDefaults = useMemo(() => {\n if (!activeInteractionElement) {\n return {};\n }\n\n const shouldPreferResolvedInteractionInput = Boolean(\n activeInteractionElement.user_input?.trim()\n );\n\n return getInteractionDefaultValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n shouldPreferResolvedInteractionInput\n ? undefined\n : interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const interactionDefaultSelectedValues = useMemo(() => {\n if (!activeInteractionElement) {\n return undefined;\n }\n\n const shouldPreferResolvedInteractionInput = Boolean(\n activeInteractionElement.user_input?.trim()\n );\n\n return getInteractionDefaultSelectedValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n shouldPreferResolvedInteractionInput\n ? undefined\n : interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const hasResolvedInteractionInput = Boolean(\n activeInteractionElement?.user_input?.trim()\n );\n\n const isInteractionReadonly =\n Boolean(activeInteractionElement?.readonly) || hasResolvedInteractionInput;\n const shouldAutoContinueInteraction =\n isInteractionReadonly || hasResolvedInteractionInput;\n\n const handleInteractionSend = useCallback(\n (content: OnSendContentParams) => {\n const submittedValues = [\n ...(content.selectedValues ?? []),\n content.inputText?.trim() ?? \"\",\n content.buttonText?.trim() ?? \"\",\n ].filter(Boolean);\n const resolvedUserInput = submittedValues.join(\", \");\n\n setActiveInteractionElement((prevElement) => {\n if (!prevElement || !resolvedUserInput) {\n return prevElement;\n }\n\n return {\n ...prevElement,\n user_input: resolvedUserInput,\n };\n });\n\n onSend?.(content, activeInteractionElement);\n continueAfterInteraction();\n },\n [activeInteractionElement, continueAfterInteraction, onSend]\n );\n\n useEffect(() => {\n clearInteractionAutoCloseTimer();\n\n if (!isInteractionOverlayOpen || !shouldAutoContinueInteraction) {\n return;\n }\n\n // Auto-close passive interaction checkpoints to keep playback moving.\n interactionAutoCloseTimerRef.current = window.setTimeout(() => {\n interactionAutoCloseTimerRef.current = null;\n\n continueAfterInteraction();\n }, 2000);\n\n return () => {\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearInteractionAutoCloseTimer,\n continueAfterInteraction,\n isInteractionOverlayOpen,\n shouldAutoContinueInteraction,\n ]);\n\n const renderSlideElement = (\n element?: Element,\n options: RenderSlideElementOptions = {}\n ) => {\n if (!element) {\n return null;\n }\n\n if (element.type === \"slot\") {\n return <>{element.content}</>;\n }\n\n if (element.type === \"html\") {\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n replaceRootScreenHeightWithFull={\n options.replaceRootScreenHeightWithFull\n }\n type=\"sandbox\"\n content={element.content as string}\n />\n );\n }\n\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n type=\"markdown\"\n content={element.content as string}\n />\n );\n };\n\n const renderSlideElementList = (\n elementList: Element[] = [],\n isActiveStep = false\n ) => {\n if (elementList.length === 0) {\n return null;\n }\n\n const visibleElementCount = elementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const lastVisibleElementIndex = elementList.reduce(\n (lastVisibleIndex, element, index) =>\n element.is_renderable !== false ? index : lastVisibleIndex,\n -1\n );\n\n return (\n <div className=\"slide-stage__content flex w-full flex-col gap-4\">\n {elementList.map((element, index) => {\n const isPreRenderedHtml =\n element.type === \"html\" && element.is_renderable === false;\n\n return (\n <div\n key={element.sequence_number ?? `${element.type}-${index}`}\n ref={\n isActiveStep && index === lastVisibleElementIndex\n ? lastElementRef\n : null\n }\n aria-hidden={isPreRenderedHtml || undefined}\n className={cn(\n \"w-full shrink-0\",\n visibleElementCount === 1 &&\n element.is_renderable !== false &&\n \"slide-element--single\",\n isPreRenderedHtml\n ? \"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0\"\n : element.is_renderable === false && \"hidden\"\n )}\n >\n {renderSlideElement(element, {\n replaceRootScreenHeightWithFull:\n visibleElementCount === 1 &&\n element.type === \"html\" &&\n element.is_renderable !== false,\n })}\n </div>\n );\n })}\n </div>\n );\n };\n\n const handleFullscreen = () => {\n const target = sectionRef.current;\n if (!target) return;\n\n if (document.fullscreenElement) {\n document.exitFullscreen().catch(() => {});\n return;\n }\n\n target.requestFullscreen?.().catch(() => {});\n };\n\n const scrollStageToBottom = useCallback(() => {\n const stageLayerElement = stageLayerRef.current;\n\n if (!stageLayerElement) {\n return;\n }\n\n // Keep the latest content visible after manual player navigation.\n stageLayerElement.scrollTo({\n top: stageLayerElement.scrollHeight,\n behavior: \"smooth\",\n });\n }, []);\n\n const handlePrev = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n pendingInteractionOverlayStepIndexRef.current = null;\n setHasPlayerInteracted(true);\n setIsAudioLoadingVisible(false);\n showPlayerControls(true);\n resetAudioSequence();\n goPrev();\n }, [goPrev, resetAudioSequence, showPlayerControls]);\n\n const handleNext = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n pendingInteractionOverlayStepIndexRef.current = null;\n setHasPlayerInteracted(true);\n setIsAudioLoadingVisible(false);\n showPlayerControls(true);\n resetAudioSequence();\n goNext();\n }, [goNext, resetAudioSequence, showPlayerControls]);\n\n const handlePlayerLoadingChange = useCallback(\n (loading: boolean) => {\n if (hasCurrentStepAudioUrl) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (!currentStepHasSpeakableElement || hasCompletedCurrentStepAudio) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n setIsAudioLoadingVisible(loading);\n },\n [\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n hasCurrentStepAudioUrl,\n ]\n );\n\n const handlePlayerEnded = useCallback(\n (audioIndex: number) => {\n const endedAudioKey = audioList[audioIndex]?.audioKey;\n\n if (!endedAudioKey || !currentAudioKey) {\n return;\n }\n\n if (endedAudioKey !== currentAudioKey) {\n return;\n }\n\n const activeSequencePosition = currentAudioSequenceKeys.findIndex(\n (audioSequenceKey) => audioSequenceKey === endedAudioKey\n );\n if (activeSequencePosition < 0) {\n setCurrentAudioKey(null);\n return;\n }\n\n const nextSequencePosition = activeSequencePosition + 1;\n const nextAudioKey = currentAudioSequenceKeys[nextSequencePosition];\n\n if (nextAudioKey) {\n setCurrentAudioKey(nextAudioKey);\n return;\n }\n\n setCurrentAudioKey(null);\n setHasCompletedCurrentStepAudio(true);\n setIsAudioLoadingVisible(false);\n\n if (canGoNext) {\n const nextStepIndex = currentIndex + 1;\n const nextStepElement = slideElementList[nextStepIndex];\n\n if (hasCurrentStepAudioUrl && nextStepElement?.type === \"interaction\") {\n pendingInteractionOverlayStepIndexRef.current = nextStepIndex;\n }\n\n goNext();\n }\n },\n [\n audioList,\n canGoNext,\n currentIndex,\n currentAudioKey,\n currentAudioSequenceKeys,\n goNext,\n hasCurrentStepAudioUrl,\n slideElementList,\n ]\n );\n\n const handleInteractionToggle = useCallback(() => {\n if (!activeInteractionElement) {\n return;\n }\n\n setIsInteractionOverlayOpen((prevOpen) => !prevOpen);\n }, [activeInteractionElement]);\n\n const stopOverlayPropagation = useCallback(\n (\n event:\n | React.PointerEvent<HTMLDivElement>\n | React.MouseEvent<HTMLDivElement>\n ) => {\n event.stopPropagation();\n\n // Keep the player visible a bit longer when users interact with the overlay.\n if (playerVisible) {\n showPlayerControls(true);\n }\n },\n [isPlayerVisible, showPlayerControls]\n );\n\n const handleSurfacePointerDown = useCallback(\n (event: React.PointerEvent<HTMLElement>) => {\n onPointerDown?.(event);\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n [onPointerDown, showPlayerControls]\n );\n\n const shouldShowInteractionOverlay =\n Boolean(activeInteractionElement) && isInteractionOverlayOpen;\n const currentRenderElementKeys = useMemo(\n () =>\n currentElementList.map(\n (element, index) =>\n `${element.sequence_number ?? `${element.type}-${index}`}:${String(element.is_new ?? \"\")}`\n ),\n [currentElementList]\n );\n\n useEffect(() => {\n const prevKeys = prevRenderElementKeysRef.current;\n const hasStablePrefix =\n prevKeys.length > 0 &&\n prevKeys.length < currentRenderElementKeys.length &&\n prevKeys.every((key, index) => key === currentRenderElementKeys[index]);\n const appendedElements = hasStablePrefix\n ? currentElementList.slice(prevKeys.length)\n : [];\n const shouldAutoScrollToAppend = appendedElements.some(\n (element) => element.is_new === false\n );\n\n prevRenderElementKeysRef.current = currentRenderElementKeys;\n\n if (!shouldAutoScrollToAppend) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const stageLayerElement = stageLayerRef.current;\n const targetElement = lastElementRef.current;\n\n if (!stageLayerElement || !targetElement) {\n return;\n }\n\n const stageLayerRect = stageLayerElement.getBoundingClientRect();\n const targetRect = targetElement.getBoundingClientRect();\n const nextScrollTop =\n stageLayerElement.scrollTop + (targetRect.top - stageLayerRect.top);\n\n // Keep newly appended content visible when the current slide grows downward.\n stageLayerElement.scrollTo({\n top: Math.max(nextScrollTop, 0),\n behavior: \"smooth\",\n });\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, currentRenderElementKeys]);\n\n useEffect(() => {\n if (!shouldScrollToBottomRef.current) {\n return;\n }\n\n shouldScrollToBottomRef.current = false;\n\n if (currentElementList.length === 0) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n scrollStageToBottom();\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, scrollStageToBottom]);\n\n return (\n <section\n ref={sectionRef}\n className={cn(\"relative h-full w-full\", className)}\n onPointerDown={handleSurfacePointerDown}\n {...props}\n >\n <div\n className={cn(\n \"h-full min-h-0 w-full\",\n isSingleSlide ? \"slide-content--single\" : \"grid gap-4\"\n )}\n >\n {currentElementList.length > 0 ? (\n <div className=\"slide-stage\">\n <div ref={stageLayerRef} className=\"slide-stage__layer w-full\">\n {mountedStepStates.map(\n (mountedStepState, mountedStepStateIndex) => {\n const isActiveStep =\n mountedStepStateIndex === currentMountedStateIndex;\n\n return (\n <div\n key={\n mountedStepState.sourceStepIndexes[0] ??\n mountedStepStateIndex\n }\n aria-hidden={!isActiveStep || undefined}\n className=\"w-full h-full\"\n style={{ display: isActiveStep ? undefined : \"none\" }}\n >\n {renderSlideElementList(\n mountedStepState.elementList,\n isActiveStep\n )}\n </div>\n );\n }\n )}\n </div>\n </div>\n ) : null}\n </div>\n\n {isAudioLoadingVisible ? (\n <div className=\"pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm\">\n <LoaderCircle className=\"size-5 animate-spin text-background\" />\n <span>{bufferingText}</span>\n </div>\n ) : null}\n\n {shouldShowInteractionOverlay ? (\n <div\n className={cn(\n \"slide-interaction-overlay\",\n playerVisible && shouldRenderPlayer\n ? \"slide-interaction-overlay--with-player\"\n : \"slide-interaction-overlay--standalone\"\n )}\n onClick={stopOverlayPropagation}\n onPointerDown={stopOverlayPropagation}\n style={interactionOverlayStyle}\n >\n <InteractionOverlayCard\n content={String(activeInteractionElement?.content ?? \"\")}\n defaultButtonText={interactionDefaults.buttonText ?? \"\"}\n defaultInputText={interactionDefaults.inputText ?? \"\"}\n defaultSelectedValues={interactionDefaultSelectedValues}\n confirmButtonText={interactionTexts?.confirmButtonText}\n copyButtonText={interactionTexts?.copyButtonText}\n copiedButtonText={interactionTexts?.copiedButtonText}\n onSend={handleInteractionSend}\n readonly={isInteractionReadonly}\n title={\n interactionTexts?.title ??\n interactionTitle ??\n \"Submit the content below to continue.\"\n }\n />\n </div>\n ) : null}\n\n {shouldRenderPlayer ? (\n <Player\n audioList={audioList}\n className={cn(\n \"absolute left-1/2 bottom-6 z-[2] -translate-x-1/2\",\n playerClassName,\n !playerVisible && \"pointer-events-none opacity-0\"\n )}\n currentAudioIndex={currentAudioIndex}\n defaultPlaying\n hasInteraction={Boolean(activeInteractionElement)}\n isInteractionOpen={isInteractionOverlayOpen}\n onLoadingChange={handlePlayerLoadingChange}\n nextDisabled={!canGoNext}\n onEnded={handlePlayerEnded}\n onFullscreen={handleFullscreen}\n onInteractionToggle={handleInteractionToggle}\n onNext={handleNext}\n onPrev={handlePrev}\n prevDisabled={!canGoPrev}\n showControls={playerVisible}\n customActions={playerCustomActions}\n />\n ) : null}\n </section>\n );\n};\n\nexport default Slide;\n"],"names":["CHECKPOINT_AUTO_ADVANCE_DELAY_MS","InteractionOverlayCard","memo","content","title","defaultButtonText","defaultInputText","defaultSelectedValues","confirmButtonText","copyButtonText","copiedButtonText","onSend","readonly","jsxs","jsx","ContentRender","areStepElementListsEqual","prevElementList","nextElementList","element","index","nextElement","Slide","elementList","showPlayer","playerAlwaysVisible","playerClassName","playerCustomActions","bufferingText","interactionTitle","interactionTexts","playerAutoHideDelay","interactionDefaultValueOptions","onPlayerVisibilityChange","onStepChange","className","onPointerDown","props","sectionRef","useRef","stageLayerRef","lastElementRef","playerHideTimerRef","autoAdvanceTimerRef","interactionAutoCloseTimerRef","prevRenderElementKeysRef","shouldScrollToBottomRef","pendingInteractionOverlayStepIndexRef","currentElementList","stepElementLists","slideElementList","currentIndex","audioList","currentAudioSequenceIndexes","currentStepHasSpeakableElement","currentInteractionElement","canGoPrev","canGoNext","goPrev","goNext","useSlide","currentStepElement","useMemo","isSingleSlide","shouldRenderPlayer","currentAudioSequenceKeys","audioIndex","audioKey","isPlayerVisible","setIsPlayerVisible","useState","hasPlayerInteracted","setHasPlayerInteracted","currentAudioKey","setCurrentAudioKey","isAudioLoadingVisible","setIsAudioLoadingVisible","hasCompletedCurrentStepAudio","setHasCompletedCurrentStepAudio","activeInteractionElement","setActiveInteractionElement","isInteractionOverlayOpen","setIsInteractionOverlayOpen","playerVisible","playerCustomActionCount","getPlayerCustomActionCount","interactionOverlayStyle","mountedStepStates","currentMountedStateIndex","nextMountedStepStates","mountedStateIndexByStep","stepElementList","stepIndex","existingMountedStateIndex","mountedStepState","currentStepKey","currentAudioIndex","audioItem","currentAudioSequenceStartKey","currentInteractionResetKey","currentPlaybackResetKey","hasCurrentStepAudioUrl","clearPlayerHideTimer","useCallback","clearInteractionAutoCloseTimer","clearAutoAdvanceTimer","resetAudioSequence","startCurrentAudioSequence","nextAudioKey","continueAfterInteraction","showPlayerControls","enableAutoHide","hasResolvedCurrentInteraction","shouldBlockPlaybackForInteraction","useEffect","handleSandboxInteraction","event","isSandboxInteractionMessage","useWakePlayerFromIframe","shouldOpenInteractionOverlayAfterAudio","shouldPresentOverlay","shouldPresentInteractionOverlay","interactionDefaults","shouldPreferResolvedInteractionInput","getInteractionDefaultValues","interactionDefaultSelectedValues","getInteractionDefaultSelectedValues","hasResolvedInteractionInput","isInteractionReadonly","shouldAutoContinueInteraction","handleInteractionSend","resolvedUserInput","prevElement","renderSlideElement","options","Fragment","IframeSandbox","renderSlideElementList","isActiveStep","visibleElementCount","lastVisibleElementIndex","lastVisibleIndex","isPreRenderedHtml","cn","handleFullscreen","target","scrollStageToBottom","stageLayerElement","handlePrev","handleNext","handlePlayerLoadingChange","loading","handlePlayerEnded","endedAudioKey","activeSequencePosition","audioSequenceKey","nextSequencePosition","nextStepIndex","nextStepElement","handleInteractionToggle","prevOpen","stopOverlayPropagation","handleSurfacePointerDown","shouldShowInteractionOverlay","currentRenderElementKeys","prevKeys","shouldAutoScrollToAppend","key","animationFrameId","targetElement","stageLayerRect","targetRect","nextScrollTop","mountedStepStateIndex","LoaderCircle","Player"],"mappings":"y3BA+BMA,GAAmC,IA2BnCC,GAAyBC,EAAAA,KAC7B,CAAC,CACC,QAAAC,EACA,MAAAC,EACA,kBAAAC,EACA,iBAAAC,EACA,sBAAAC,EACA,kBAAAC,GACA,eAAAC,GACA,iBAAAC,EACA,OAAAC,EACA,SAAAC,EAAW,EAAA,IAEXC,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,iCACb,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,mCACb,SAAAA,EAAAA,kBAAAA,IAAC,KAAE,UAAU,kCAAmC,WAAM,CAAA,CACxD,EACAA,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,iCACb,SAAAA,EAAAA,kBAAAA,IAACC,GAAAA,QAAA,CACC,QAAAZ,EACA,kBAAAE,EACA,iBAAAC,EACA,sBAAAC,EACA,kBAAAC,GACA,eAAAC,GACA,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,iBAAkB,GAClB,YAAY,SAAA,CAAA,EAEhB,EACAE,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,iCAAA,CAAkC,CAAA,CAAA,CACnD,CAEJ,EAEAb,GAAuB,YAAc,yBAErC,MAAMe,GAA2B,CAC/BC,EACAC,IAEAD,EAAgB,SAAWC,EAAgB,QAC3CD,EAAgB,MAAM,CAACE,EAASC,IAAU,CACxC,MAAMC,EAAcH,EAAgBE,CAAK,EAEzC,OACED,EAAQ,kBAAoBE,GAAa,iBACzCF,EAAQ,OAASE,GAAa,MAC9BF,EAAQ,UAAYE,GAAa,OAErC,CAAC,EAkBGC,GAA8B,CAAC,CACnC,YAAAC,EAAc,CAAA,EACd,WAAAC,EAAa,GACb,oBAAAC,EAAsB,GACtB,gBAAAC,EAAA,oBACAC,EACA,cAAAC,GAAgB,eAChB,iBAAAC,GACA,iBAAAC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