markdown-flow-ui 0.1.100-beta.18 → 0.1.100-beta.19
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/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.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.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/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.es4.js +4 -4
- package/dist/_virtual/index.es5.js +4 -4
- package/dist/_virtual/index.es6.js +5 -5
- package/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.es.js +176 -165
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.cjs.js"),u=require("../../../../devlop@1.1.0/node_modules/devlop/lib/default.cjs.js"),f=require("../../../../property-information@7.1.0/node_modules/property-information/index.cjs.js"),C=require("../../../../space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.cjs.js"),S=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.cjs.js"),u=require("../../../../devlop@1.1.0/node_modules/devlop/lib/default.cjs.js"),f=require("../../../../property-information@7.1.0/node_modules/property-information/index.cjs.js"),C=require("../../../../space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.cjs.js"),S=require("../../../../../../../../../_virtual/index.cjs4.js"),N=require("../../../../hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.cjs.js"),x=require("../../../../estree-util-is-identifier-name@3.0.0/node_modules/estree-util-is-identifier-name/lib/index.cjs.js"),h=require("../../../../vfile-message@4.0.3/node_modules/vfile-message/lib/index.cjs.js"),j=require("../../../../property-information@7.1.0/node_modules/property-information/lib/find.cjs.js"),A=require("../../../../property-information@7.1.0/node_modules/property-information/lib/hast-to-react.cjs.js"),T=require("../../../../unist-util-position@5.0.0/node_modules/unist-util-position/lib/index.cjs.js"),m={}.hasOwnProperty,F=new Map,P=/[A-Z]/g,q=new Set(["table","tbody","thead","tfoot","tr"]),J=new Set(["td","th"]),g="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function M(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=K(r,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=k(r,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?f.svg:f.html,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=E(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function E(t,e,r){if(e.type==="element")return I(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return L(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return V(t,e,r);if(e.type==="mdxjsEsm")return $(t,e);if(e.type==="root")return D(t,e,r);if(e.type==="text")return O(t,e)}function I(t,e,r){const n=t.schema;let s=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(s=f.svg,t.schema=s),t.ancestors.push(e);const i=b(t,e.tagName,!1),a=R(t,e);let o=d(t,e);return q.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!N.whitespace(l):!0})),v(t,a,i,e),y(a,o),t.ancestors.pop(),t.schema=n,t.create(e,i,a,r)}function L(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return u.ok(n.type==="ExpressionStatement"),t.evaluater.evaluateExpression(n.expression)}p(t,e.position)}function $(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);p(t,e.position)}function V(t,e,r){const n=t.schema;let s=n;e.name==="svg"&&n.space==="html"&&(s=f.svg,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:b(t,e.name,!0),a=_(t,e),o=d(t,e);return v(t,a,i,e),y(a,o),t.ancestors.pop(),t.schema=n,t.create(e,i,a,r)}function D(t,e,r){const n={};return y(n,d(t,e)),t.create(e,t.Fragment,n,r)}function O(t,e){return e.value}function v(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function y(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function k(t,e,r){return n;function n(s,i,a,o){const c=Array.isArray(a.children)?r:e;return o?c(i,a,o):c(i,a)}}function K(t,e){return r;function r(n,s,i,a){const o=Array.isArray(i.children),l=T.pointStart(n);return e(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function R(t,e){const r={};let n,s;for(s in e.properties)if(s!=="children"&&m.call(e.properties,s)){const i=B(t,s,e.properties[s]);if(i){const[a,o]=i;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&J.has(e.tagName)?n=o:r[a]=o}}if(n){const i=r.style||(r.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function _(t,e){const r={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const i=n.data.estree.body[0];u.ok(i.type==="ExpressionStatement");const a=i.expression;u.ok(a.type==="ObjectExpression");const o=a.properties[0];u.ok(o.type==="SpreadElement"),Object.assign(r,t.evaluater.evaluateExpression(o.argument))}else p(t,e.position);else{const s=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const o=n.value.data.estree.body[0];u.ok(o.type==="ExpressionStatement"),i=t.evaluater.evaluateExpression(o.expression)}else p(t,e.position);else i=n.value===null?!0:n.value;r[s]=i}return r}function d(t,e){const r=[];let n=-1;const s=t.passKeys?new Map:F;for(;++n<e.children.length;){const i=e.children[n];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;a=l+"-"+c,s.set(l,c+1)}}const o=E(t,i,a);o!==void 0&&r.push(o)}return r}function B(t,e,r){const n=j.find(t.schema,e);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?w.stringify(r):C.stringify(r)),n.property==="style"){let s=typeof r=="object"?r:z(t,String(r));return t.stylePropertyNameCase==="css"&&(s=X(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&n.space?A.hastToReact[n.property]||n.property:n.attribute,r]}}function z(t,e){try{return S.default(e,{reactCompat:!0})}catch(r){if(t.ignoreInvalidStyle)return{};const n=r,s=new h.VFileMessage("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=g+"#cannot-parse-style-attribute",s}}function b(t,e,r){let n;if(!r)n={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const o=x.name(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}n=a}else n=x.name(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const s=n.value;return m.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(n);p(t)}function p(t,e){const r=new h.VFileMessage("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=g+"#cannot-handle-mdx-estrees-without-createevaluater",r}function X(t){const e={};let r;for(r in t)m.call(t,r)&&(e[Z(r)]=t[r]);return e}function Z(t){let e=t.replace(P,G);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function G(t){return"-"+t.toLowerCase()}exports.toJsxRuntime=M;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -2,7 +2,7 @@ import { stringify as w } from "../../../../comma-separated-tokens@2.0.3/node_mo
|
|
|
2
2
|
import { ok as u } from "../../../../devlop@1.1.0/node_modules/devlop/lib/default.es.js";
|
|
3
3
|
import { svg as m, html as C } from "../../../../property-information@7.1.0/node_modules/property-information/index.es.js";
|
|
4
4
|
import { stringify as N } from "../../../../space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.es.js";
|
|
5
|
-
import S from "../../../../../../../../../_virtual/index.
|
|
5
|
+
import S from "../../../../../../../../../_virtual/index.es4.js";
|
|
6
6
|
import { whitespace as j } from "../../../../hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.es.js";
|
|
7
7
|
import { name as x } from "../../../../estree-util-is-identifier-name@3.0.0/node_modules/estree-util-is-identifier-name/lib/index.es.js";
|
|
8
8
|
import { VFileMessage as h } from "../../../../vfile-message@4.0.3/node_modules/vfile-message/lib/index.es.js";
|
|
@@ -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 P=require("../../../../bail@2.0.2/node_modules/bail/index.cjs.js"),w=require("../../../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../../../bail@2.0.2/node_modules/bail/index.cjs.js"),w=require("../../../../../../../../../_virtual/index.cjs5.js"),z=require("../../../../is-plain-obj@4.1.0/node_modules/is-plain-obj/index.cjs.js"),C=require("./callable-instance.cjs.js"),S=require("../../../../trough@2.2.0/node_modules/trough/lib/index.cjs.js"),A=require("../../../../vfile@6.0.3/node_modules/vfile/lib/index.cjs.js"),F={}.hasOwnProperty;class m extends C.CallableInstance{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=S.trough()}copy(){const e=new m;let n=-1;for(;++n<this.attachers.length;){const t=this.attachers[n];e.use(...t)}return e.data(w.default(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(x("data",this.frozen),this.namespace[e]=n,this):F.call(this.namespace,e)&&this.namespace[e]||void 0:e?(x("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...t]=this.attachers[this.freezeIndex];if(t[0]===!1)continue;t[0]===!0&&(t[0]=void 0);const i=n.call(e,...t);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=y(e),t=this.parser||this.Parser;return g("parse",t),t(String(n),n)}process(e,n){const t=this;return this.freeze(),g("process",this.parser||this.Parser),b("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,h){const u=y(e),l=t.parse(u);t.run(l,u,function(o,c,f){if(o||!c||!f)return s(o);const p=c,d=t.stringify(p,f);D(d)?f.value=d:f.result=d,s(o,f)});function s(o,c){o||!c?h(o):a?a(c):n(void 0,c)}}}processSync(e){let n=!1,t;return this.freeze(),g("processSync",this.parser||this.Parser),b("processSync",this.compiler||this.Compiler),this.process(e,i),T("processSync","process",n),t;function i(a,h){n=!0,P.bail(a),t=h}}run(e,n,t){I(e),this.freeze();const i=this.transformers;return!t&&typeof n=="function"&&(t=n,n=void 0),t?a(void 0,t):new Promise(a);function a(h,u){const l=y(n);i.run(e,l,s);function s(o,c,f){const p=c||e;o?u(o):h?h(p):t(void 0,p,f)}}}runSync(e,n){let t=!1,i;return this.run(e,n,a),T("runSync","run",t),i;function a(h,u){P.bail(h),i=u,t=!0}}stringify(e,n){this.freeze();const t=y(n),i=this.compiler||this.Compiler;return b("stringify",i),I(e),i(e,t)}use(e,...n){const t=this.attachers,i=this.namespace;if(x("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):h(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(s){if(typeof s=="function")l(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[o,...c]=s;l(o,c)}else h(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function h(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(s.plugins),s.settings&&(i.settings=w.default(!0,i.settings,s.settings))}function u(s){let o=-1;if(s!=null)if(Array.isArray(s))for(;++o<s.length;){const c=s[o];a(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function l(s,o){let c=-1,f=-1;for(;++c<t.length;)if(t[c][0]===s){f=c;break}if(f===-1)t.push([s,...o]);else if(o.length>0){let[p,...d]=o;const E=t[f][1];z.default(E)&&z.default(p)&&(p=w.default(!0,E,p)),t[f]=[s,p,...d]}}}}const q=new m().freeze();function g(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `parser`")}function b(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `compiler`")}function x(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I(r){if(!z.default(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function T(r,e,n){if(!n)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function y(r){return j(r)?r:new A.VFile(r)}function j(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function D(r){return typeof r=="string"||L(r)}function L(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}exports.Processor=m;exports.unified=q;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bail as P } from "../../../../bail@2.0.2/node_modules/bail/index.es.js";
|
|
2
|
-
import y from "../../../../../../../../../_virtual/index.
|
|
2
|
+
import y from "../../../../../../../../../_virtual/index.es5.js";
|
|
3
3
|
import z from "../../../../is-plain-obj@4.1.0/node_modules/is-plain-obj/index.es.js";
|
|
4
4
|
import { CallableInstance as C } from "./callable-instance.es.js";
|
|
5
5
|
import { trough as A } from "../../../../trough@2.2.0/node_modules/trough/lib/index.es.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
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/
|
|
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/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.cjs.js");var t=r.__require();const o=e.getDefaultExportFromCjs(t);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),t=require("../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.cjs.js");var r=t.__require();const o=e.getDefaultExportFromCjs(r);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./_commonjsHelpers.cjs.js"),
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
2
|
+
import { __require as o } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.es.js";
|
|
3
|
+
var t = o();
|
|
4
|
+
const a = /* @__PURE__ */ r(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.es4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var t =
|
|
4
|
-
const a = /* @__PURE__ */
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as r } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.es.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const a = /* @__PURE__ */ e(t);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
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);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
t as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.es6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.cjs.js"),r=require("react")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.cjs.js"),r=require("react"),$=require("../../lib/utils.cjs.js");;/* empty css */const ie=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/ellipsis-vertical.cjs.js"),oe=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/volume-2.cjs.js"),fe=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/rotate-ccw.cjs.js"),de=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/rotate-cw.cjs.js"),me=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/maximize.cjs.js"),pe=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/file-pen-line.cjs.js"),O=new Set,z=x=>{if(typeof document>"u"||!x||O.has(x))return;const y=document.createElement("link");y.rel="preload",y.as="audio",y.href=x,/^https?:/i.test(x)&&(y.crossOrigin="anonymous"),document.head.appendChild(y),O.add(x)},xe=()=>t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",children:[t.jsxRuntimeExports.jsx("path",{d:"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",fill:"#0A0A0A"}),t.jsxRuntimeExports.jsx("path",{d:"M12 10H16V24H12V10ZM18 10H22V24H18V10Z",fill:"white"})]}),he=()=>t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",children:[t.jsxRuntimeExports.jsx("path",{d:"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",fill:"#0A0A0A"}),t.jsxRuntimeExports.jsx("path",{d:"M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z",fill:"white"})]}),Re=({audioList:x=[],className:y,currentAudioIndex:i=-1,defaultPlaying:o=!0,onLoadingChange:q,onPrev:G,onNext:J,onFullscreen:Q,onEnded:V,onPlayRequest:U,onInteractionToggle:X,hasInteraction:Y=!1,isInteractionOpen:D=!1,prevDisabled:I=!1,nextDisabled:ee=!1,showControls:re=!0,...te})=>{const h=r.useRef(null),b=r.useRef(null),F=r.useRef(null),E=r.useRef(0),f=r.useRef(null),K=r.useRef(void 0),w=r.useRef([]),L=r.useRef(!1),c=r.useRef(!1),S=r.useRef(null),p=r.useRef(!1),s=r.useRef(!1),m=r.useRef(null),R=r.useRef(!1),[T,l]=r.useState(o),d=i>=0?x[i]:void 0,k=d?.audioUrl,j=r.useMemo(()=>[...d?.audioSegments??[]].sort((e,a)=>e.segment_index-a.segment_index),[d?.audioSegments]),W=`${i}:${d?.audioKey??"none"}`;r.useEffect(()=>{K.current=d},[d]),r.useEffect(()=>{w.current=j},[j]),r.useEffect(()=>{const e=d?.audioUrl,a=i>=0?x[i+1]?.audioUrl:void 0;z(e),z(a)},[x,d?.audioUrl,i]);const u=r.useCallback(e=>{L.current!==e&&(L.current=e,q?.(e))},[q]),P=r.useCallback(e=>e?e.startsWith("data:")?e:`data:audio/mpeg;base64,${e}`:"",[]),Z=r.useCallback(()=>{const e=f.current;return e==null||e<=0?0:w.current.slice(0,e).reduce((a,n)=>a+Math.max(Number(n.duration_ms??0),0),0)/1e3},[]),N=r.useCallback(()=>{const e=h.current;e&&(s.current=!1,c.current=!1,S.current=null,m.current=null,p.current=!1,R.current=!1,e.pause(),e.removeAttribute("src"),e.load(),b.current=null,E.current=0,f.current=null,l(!1),u(!1))},[u]),g=r.useCallback(e=>{const a=h.current;if(!a)return!1;const n=a.play();return n&&typeof n.then=="function"&&n.then(()=>{s.current=!1,R.current=!1}).catch(v=>{l(!1)}),!0},[i]),C=r.useCallback((e,a)=>{const n=h.current,v=w.current[e];if(!n||!v)return!1;const _=P(v.audio_data);E.current=e,f.current=null,p.current=!1,R.current=!0;const M=o&&!c.current;s.current=M,u(!1);const H=b.current!==_;return S.current="segment",H&&(n.pause(),n.removeAttribute("src"),n.load(),b.current=_,n.src=_,n.load()),m.current=0,n.readyState>0&&(n.currentTime=0,m.current=null),M?H?!0:g(`start-segment:${a}`):(s.current=!1,R.current=!1,n.pause(),l(!1),!0)},[o,P,g,u]),A=r.useCallback(e=>{s.current=!1,p.current=!1,R.current=!1,l(!1),u(!1),i>=0&&V?.(i)},[i,V,u]),B=r.useCallback(()=>{const e=E.current+1,a=w.current,n=a[e],v=K.current,_=a.some(M=>M.is_final);if(n){C(e,"ended");return}if(v?.isAudioStreaming||!_){E.current=e,f.current=e,p.current=!0,s.current=o,l(o),u(!0);return}A("segments-completed")},[o,A,C,u]);r.useEffect(()=>{if(F.current===W)return;F.current=W,E.current=0,f.current=null,p.current=!1,c.current=!1,s.current=!1,R.current=!1,S.current=null,b.current=null,u(!1);const e=h.current;e&&(e.pause(),e.removeAttribute("src"),e.load(),l(!1))},[i,W,j.length,k,u]),r.useEffect(()=>{const e=h.current;if(e){if(!d){N();return}if(k){const a=b.current!==k,n=o&&!c.current;if(S.current==="segment"&&!!b.current&&f.current===null){if(!n){s.current=!1,e.pause(),l(!1);return}e.paused&&(s.current=!0,g("keep-segment-source"));return}if(a){const _=f.current!==null?Z():0;e.pause(),e.removeAttribute("src"),e.load(),b.current=k,S.current="url",e.src=k,e.load(),m.current=_,e.readyState>0&&(e.currentTime=_,m.current=null)}if(s.current=n,p.current=!1,R.current=!1,u(!1),!n){s.current=!1,e.pause(),l(!1);return}a||g("sync-url");return}if(f.current!==null){if(f.current<j.length){if(c.current){l(!1),u(!1);return}C(f.current,"wait-resume");return}p.current=!0,s.current=o&&!c.current,l(o&&!c.current),u(!c.current);return}if(!j.length){if(d.isAudioStreaming){f.current=E.current,p.current=!0,s.current=o&&!c.current,l(o&&!c.current),u(!c.current);return}N();return}if(!b.current){C(Math.min(E.current,j.length-1),"effect-init");return}if(!o||c.current){s.current=!1,e.pause(),l(!1);return}e.paused&&(s.current=!0,g("sync-paused-retry"))}},[d,i,j,k,o,N,C,g,Z,u]),r.useEffect(()=>N,[N]);const ne=r.useCallback(()=>{l(!0),u(!1)},[u]),se=r.useCallback(()=>{p.current||R.current||l(!1)},[i]),ue=r.useCallback(()=>{const e=h.current;e&&m.current!==null&&(e.currentTime=m.current,m.current=null),!(!s.current||!o)&&g("canplay")},[i,o,g]),ce=r.useCallback(()=>{const e=h.current;e&&m.current!==null&&(e.currentTime=m.current,m.current=null)},[i]),le=r.useCallback(()=>{const e=S.current==="url"||w.current.length===0;if(R.current=!1,e){A("url-ended");return}B()},[A,B]),ae=r.useCallback(()=>{l(!1),u(!1)},[u]);return t.jsxRuntimeExports.jsxs("div",{className:$.cn("slide-player",y),...te,children:[t.jsxRuntimeExports.jsx("audio",{ref:h,preload:"auto",playsInline:!0,onLoadedMetadata:ce,onCanPlay:ue,onPlay:ne,onPause:se,onEnded:le,onError:ae}),re?t.jsxRuntimeExports.jsxs("div",{className:"slide-player__controls",children:[t.jsxRuntimeExports.jsxs("div",{className:"slide-player__group",children:[t.jsxRuntimeExports.jsx("button",{"aria-label":"More options",className:"hidden",type:"button",children:t.jsxRuntimeExports.jsx(ie.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Volume",className:"hidden",type:"button",children:t.jsxRuntimeExports.jsx(oe.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Rewind",className:"slide-player__action",disabled:I,onClick:G,type:"button",children:t.jsxRuntimeExports.jsx(fe.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":T?"Pause":"Play",className:"slide-player__toggle",onClick:()=>{const e=h.current;if(!(!e||!d)){if(f.current!==null){if(T){s.current=!1,c.current=!0,f.current=null,p.current=!1,l(!1),u(!1),e.pause();return}U?.(),c.current=!1,s.current=!0,l(!0);return}if(!e.src&&j.length>0){U?.(),c.current=!1,C(Math.min(E.current,j.length-1),"toggle");return}if(e.paused){U?.(),c.current=!1,s.current=!0,g("toggle-resume");return}s.current=!1,c.current=!0,e.pause()}},type:"button",children:T?t.jsxRuntimeExports.jsx(xe,{}):t.jsxRuntimeExports.jsx(he,{})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Forward",className:"slide-player__action",disabled:ee,onClick:J,type:"button",children:t.jsxRuntimeExports.jsx(de.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Fullscreen",className:"hidden",onClick:Q,type:"button",children:t.jsxRuntimeExports.jsx(me.default,{className:"slide-player__icon",strokeWidth:2.25})})]}),t.jsxRuntimeExports.jsx("div",{className:"slide-player__separator"}),t.jsxRuntimeExports.jsx("div",{className:"slide-player__group",children:t.jsxRuntimeExports.jsx("button",{"aria-label":"Notes",className:$.cn("slide-player__action",D&&"slide-player__action--active"),disabled:!Y,onClick:X,type:"button",children:t.jsxRuntimeExports.jsx(pe.default,{className:"slide-player__icon",strokeWidth:2.25})})})]}):null]})};exports.default=Re;
|
|
2
2
|
//# sourceMappingURL=Player.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.cjs.js","sources":["../../../src/components/Slide/Player.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n EllipsisVertical,\n FilePenLine,\n Maximize,\n RotateCcw,\n RotateCw,\n Volume2,\n} from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport type { SlideAudioItem } from \"./useSlide\";\nimport \"./player.css\";\n\nconst audioPreloadLinkCache = new Set<string>();\n\nconst preloadAudioUrl = (url?: string) => {\n if (\n typeof document === \"undefined\" ||\n !url ||\n audioPreloadLinkCache.has(url)\n ) {\n return;\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"preload\";\n link.as = \"audio\";\n link.href = url;\n if (/^https?:/i.test(url)) {\n link.crossOrigin = \"anonymous\";\n }\n document.head.appendChild(link);\n audioPreloadLinkCache.add(url);\n};\n\nexport type PlayerProps = React.ComponentProps<\"div\"> & {\n audioList?: SlideAudioItem[];\n currentAudioIndex?: number;\n defaultPlaying?: boolean;\n onLoadingChange?: (loading: boolean) => void;\n onPrev?: () => void;\n onNext?: () => void;\n onFullscreen?: () => void;\n onEnded?: (audioIndex: number) => void;\n onPlayRequest?: () => void;\n onInteractionToggle?: () => void;\n hasInteraction?: boolean;\n isInteractionOpen?: boolean;\n prevDisabled?: boolean;\n nextDisabled?: boolean;\n showControls?: boolean;\n};\n\nconst PauseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"34\"\n height=\"34\"\n viewBox=\"0 0 34 34\"\n fill=\"none\"\n >\n <path\n d=\"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z\"\n fill=\"#0A0A0A\"\n />\n <path d=\"M12 10H16V24H12V10ZM18 10H22V24H18V10Z\" fill=\"white\" />\n </svg>\n);\n\nconst PlayIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"34\"\n height=\"34\"\n viewBox=\"0 0 34 34\"\n fill=\"none\"\n >\n <path\n d=\"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z\"\n fill=\"#0A0A0A\"\n />\n <path d=\"M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z\" fill=\"white\" />\n </svg>\n);\n\nconst Player: React.FC<PlayerProps> = ({\n audioList = [],\n className,\n currentAudioIndex = -1,\n defaultPlaying = true,\n onLoadingChange,\n onPrev,\n onNext,\n onFullscreen,\n onEnded,\n onPlayRequest,\n onInteractionToggle,\n hasInteraction = false,\n isInteractionOpen = false,\n prevDisabled = false,\n nextDisabled = false,\n showControls = true,\n ...props\n}) => {\n const audioRef = useRef<HTMLAudioElement | null>(null);\n const audioSrcRef = useRef<string | null>(null);\n const currentAudioKeyRef = useRef<string | null>(null);\n const currentSegmentIndexRef = useRef(0);\n const waitingSegmentIndexRef = useRef<number | null>(null);\n const currentAudioRef = useRef<SlideAudioItem | undefined>(undefined);\n const currentAudioSegmentsRef = useRef<\n NonNullable<SlideAudioItem[\"audioSegments\"]>\n >([]);\n const isLoadingRef = useRef(false);\n const isPausedByUserRef = useRef(false);\n const activeSourceTypeRef = useRef<\"url\" | \"segment\" | null>(null);\n const isWaitingForSegmentRef = useRef(false);\n const pendingAutoPlayRef = useRef(false);\n const pendingSeekTimeRef = useRef<number | null>(null);\n const isSwitchingSegmentRef = useRef(false);\n const [isPlaying, setIsPlaying] = useState(defaultPlaying);\n const currentAudio =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex] : undefined;\n const currentAudioUrl = currentAudio?.audioUrl;\n const currentAudioSegments = useMemo(\n () =>\n [...(currentAudio?.audioSegments ?? [])].sort(\n (prevSegment, nextSegment) =>\n prevSegment.segment_index - nextSegment.segment_index\n ),\n [currentAudio?.audioSegments]\n );\n const currentAudioKey = `${currentAudioIndex}:${currentAudio?.audioKey ?? \"none\"}`;\n\n useEffect(() => {\n currentAudioRef.current = currentAudio;\n }, [currentAudio]);\n\n useEffect(() => {\n currentAudioSegmentsRef.current = currentAudioSegments;\n }, [currentAudioSegments]);\n\n useEffect(() => {\n const currentUrl = currentAudio?.audioUrl;\n const nextUrl =\n currentAudioIndex >= 0\n ? audioList[currentAudioIndex + 1]?.audioUrl\n : undefined;\n\n preloadAudioUrl(currentUrl);\n preloadAudioUrl(nextUrl);\n }, [audioList, currentAudio?.audioUrl, currentAudioIndex]);\n\n const updateLoading = useCallback(\n (loading: boolean) => {\n if (isLoadingRef.current === loading) {\n return;\n }\n\n isLoadingRef.current = loading;\n onLoadingChange?.(loading);\n },\n [onLoadingChange]\n );\n\n const getSegmentSrc = useCallback((audioData: string) => {\n if (!audioData) {\n return \"\";\n }\n\n if (audioData.startsWith(\"data:\")) {\n return audioData;\n }\n\n return `data:audio/mpeg;base64,${audioData}`;\n }, []);\n\n const resetAudio = useCallback(() => {\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return;\n }\n\n pendingAutoPlayRef.current = false;\n isPausedByUserRef.current = false;\n activeSourceTypeRef.current = null;\n pendingSeekTimeRef.current = null;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = false;\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n audioSrcRef.current = null;\n currentSegmentIndexRef.current = 0;\n waitingSegmentIndexRef.current = null;\n setIsPlaying(false);\n updateLoading(false);\n }, [updateLoading]);\n\n const tryPlayCurrentAudio = useCallback(\n (_reason: string) => {\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return false;\n }\n\n const playPromise = audioElement.play();\n\n if (playPromise && typeof playPromise.then === \"function\") {\n void playPromise\n .then(() => {\n pendingAutoPlayRef.current = false;\n isSwitchingSegmentRef.current = false;\n })\n .catch((_error: unknown) => {\n setIsPlaying(false);\n });\n }\n\n return true;\n },\n [currentAudioIndex]\n );\n\n const startSegmentPlayback = useCallback(\n (segmentIndex: number, _reason: string) => {\n const audioElement = audioRef.current;\n const segment = currentAudioSegmentsRef.current[segmentIndex];\n\n if (!audioElement || !segment) {\n return false;\n }\n\n const nextAudioSrc = getSegmentSrc(segment.audio_data);\n\n currentSegmentIndexRef.current = segmentIndex;\n waitingSegmentIndexRef.current = null;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = true;\n const shouldAutoResume = defaultPlaying && !isPausedByUserRef.current;\n\n pendingAutoPlayRef.current = shouldAutoResume;\n updateLoading(false);\n\n const hasNewSrc = audioSrcRef.current !== nextAudioSrc;\n\n activeSourceTypeRef.current = \"segment\";\n\n if (hasNewSrc) {\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n audioSrcRef.current = nextAudioSrc;\n audioElement.src = nextAudioSrc;\n audioElement.load();\n }\n\n pendingSeekTimeRef.current = 0;\n\n if (audioElement.readyState > 0) {\n audioElement.currentTime = 0;\n pendingSeekTimeRef.current = null;\n }\n\n if (!shouldAutoResume) {\n pendingAutoPlayRef.current = false;\n isSwitchingSegmentRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return true;\n }\n\n if (hasNewSrc) {\n return true;\n }\n\n return tryPlayCurrentAudio(`start-segment:${_reason}`);\n },\n [defaultPlaying, getSegmentSrc, tryPlayCurrentAudio, updateLoading]\n );\n\n const finishAudioItem = useCallback(\n (_reason?: string) => {\n pendingAutoPlayRef.current = false;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = false;\n setIsPlaying(false);\n updateLoading(false);\n\n if (currentAudioIndex >= 0) {\n onEnded?.(currentAudioIndex);\n }\n },\n [currentAudioIndex, onEnded, updateLoading]\n );\n\n const handleSegmentEnded = useCallback(() => {\n const nextSegmentIndex = currentSegmentIndexRef.current + 1;\n const segments = currentAudioSegmentsRef.current;\n const nextSegment = segments[nextSegmentIndex];\n const activeAudio = currentAudioRef.current;\n const hasFinal = segments.some((segment) => segment.is_final);\n\n if (nextSegment) {\n startSegmentPlayback(nextSegmentIndex, \"ended\");\n return;\n }\n\n if (activeAudio?.isAudioStreaming || !hasFinal) {\n currentSegmentIndexRef.current = nextSegmentIndex;\n waitingSegmentIndexRef.current = nextSegmentIndex;\n isWaitingForSegmentRef.current = true;\n pendingAutoPlayRef.current = defaultPlaying;\n setIsPlaying(defaultPlaying);\n updateLoading(true);\n\n return;\n }\n\n finishAudioItem(\"segments-completed\");\n }, [defaultPlaying, finishAudioItem, startSegmentPlayback, updateLoading]);\n\n useEffect(() => {\n if (currentAudioKeyRef.current === currentAudioKey) {\n return;\n }\n\n currentAudioKeyRef.current = currentAudioKey;\n currentSegmentIndexRef.current = 0;\n waitingSegmentIndexRef.current = null;\n isWaitingForSegmentRef.current = false;\n isPausedByUserRef.current = false;\n pendingAutoPlayRef.current = false;\n isSwitchingSegmentRef.current = false;\n activeSourceTypeRef.current = null;\n audioSrcRef.current = null;\n updateLoading(false);\n\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return;\n }\n\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n setIsPlaying(false);\n }, [\n currentAudioIndex,\n currentAudioKey,\n currentAudioSegments.length,\n currentAudioUrl,\n updateLoading,\n ]);\n\n useEffect(() => {\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return;\n }\n\n if (!currentAudio) {\n resetAudio();\n return;\n }\n\n if (currentAudioUrl) {\n const hasNewSrc = audioSrcRef.current !== currentAudioUrl;\n const shouldAutoResume = defaultPlaying && !isPausedByUserRef.current;\n const shouldKeepSegmentSource =\n activeSourceTypeRef.current === \"segment\" &&\n Boolean(audioSrcRef.current);\n\n if (shouldKeepSegmentSource) {\n if (!shouldAutoResume) {\n pendingAutoPlayRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return;\n }\n\n if (audioElement.paused) {\n pendingAutoPlayRef.current = true;\n tryPlayCurrentAudio(\"keep-segment-source\");\n }\n\n return;\n }\n\n if (hasNewSrc) {\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n audioSrcRef.current = currentAudioUrl;\n activeSourceTypeRef.current = \"url\";\n audioElement.src = currentAudioUrl;\n audioElement.load();\n pendingSeekTimeRef.current = 0;\n\n if (audioElement.readyState > 0) {\n audioElement.currentTime = 0;\n pendingSeekTimeRef.current = null;\n }\n }\n\n pendingAutoPlayRef.current = shouldAutoResume;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = false;\n updateLoading(false);\n\n if (!shouldAutoResume) {\n pendingAutoPlayRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return;\n }\n\n if (!hasNewSrc) {\n tryPlayCurrentAudio(\"sync-url\");\n }\n return;\n }\n\n if (waitingSegmentIndexRef.current !== null) {\n if (waitingSegmentIndexRef.current < currentAudioSegments.length) {\n if (isPausedByUserRef.current) {\n setIsPlaying(false);\n updateLoading(false);\n return;\n }\n\n startSegmentPlayback(waitingSegmentIndexRef.current, \"wait-resume\");\n return;\n }\n\n isWaitingForSegmentRef.current = true;\n pendingAutoPlayRef.current = defaultPlaying && !isPausedByUserRef.current;\n setIsPlaying(defaultPlaying && !isPausedByUserRef.current);\n updateLoading(!isPausedByUserRef.current);\n return;\n }\n\n if (!currentAudioSegments.length) {\n if (currentAudio.isAudioStreaming) {\n waitingSegmentIndexRef.current = currentSegmentIndexRef.current;\n isWaitingForSegmentRef.current = true;\n pendingAutoPlayRef.current =\n defaultPlaying && !isPausedByUserRef.current;\n setIsPlaying(defaultPlaying && !isPausedByUserRef.current);\n updateLoading(!isPausedByUserRef.current);\n return;\n }\n\n resetAudio();\n return;\n }\n\n if (!audioSrcRef.current) {\n startSegmentPlayback(\n Math.min(\n currentSegmentIndexRef.current,\n currentAudioSegments.length - 1\n ),\n \"effect-init\"\n );\n return;\n }\n\n if (!defaultPlaying || isPausedByUserRef.current) {\n pendingAutoPlayRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return;\n }\n\n if (audioElement.paused) {\n pendingAutoPlayRef.current = true;\n tryPlayCurrentAudio(\"sync-paused-retry\");\n }\n }, [\n currentAudio,\n currentAudioIndex,\n currentAudioSegments,\n currentAudioUrl,\n defaultPlaying,\n resetAudio,\n startSegmentPlayback,\n tryPlayCurrentAudio,\n updateLoading,\n ]);\n\n useEffect(() => resetAudio, [resetAudio]);\n\n const handleAudioPlay = useCallback(() => {\n setIsPlaying(true);\n updateLoading(false);\n }, [updateLoading]);\n\n const handleAudioPause = useCallback(() => {\n if (isWaitingForSegmentRef.current || isSwitchingSegmentRef.current) {\n return;\n }\n\n setIsPlaying(false);\n }, [currentAudioIndex]);\n\n const handleAudioCanPlay = useCallback(() => {\n const audioElement = audioRef.current;\n\n if (audioElement && pendingSeekTimeRef.current !== null) {\n audioElement.currentTime = pendingSeekTimeRef.current;\n pendingSeekTimeRef.current = null;\n }\n\n if (!pendingAutoPlayRef.current || !defaultPlaying) {\n return;\n }\n\n tryPlayCurrentAudio(\"canplay\");\n }, [currentAudioIndex, defaultPlaying, tryPlayCurrentAudio]);\n\n const handleLoadedMetadata = useCallback(() => {\n const audioElement = audioRef.current;\n\n if (audioElement && pendingSeekTimeRef.current !== null) {\n audioElement.currentTime = pendingSeekTimeRef.current;\n pendingSeekTimeRef.current = null;\n }\n }, [currentAudioIndex]);\n\n const handleAudioEnded = useCallback(() => {\n const shouldFinishAsUrl =\n activeSourceTypeRef.current === \"url\" ||\n currentAudioSegmentsRef.current.length === 0;\n\n isSwitchingSegmentRef.current = false;\n\n if (shouldFinishAsUrl) {\n finishAudioItem(\"url-ended\");\n return;\n }\n\n handleSegmentEnded();\n }, [finishAudioItem, handleSegmentEnded]);\n\n const handleAudioError = useCallback(() => {\n setIsPlaying(false);\n updateLoading(false);\n }, [updateLoading]);\n\n return (\n <div className={cn(\"slide-player\", className)} {...props}>\n <audio\n ref={audioRef}\n preload=\"auto\"\n playsInline\n onLoadedMetadata={handleLoadedMetadata}\n onCanPlay={handleAudioCanPlay}\n onPlay={handleAudioPlay}\n onPause={handleAudioPause}\n onEnded={handleAudioEnded}\n onError={handleAudioError}\n />\n\n {showControls ? (\n <div className=\"slide-player__controls\">\n <div className=\"slide-player__group\">\n <button aria-label=\"More options\" className=\"hidden\" type=\"button\">\n <EllipsisVertical\n className=\"slide-player__icon\"\n strokeWidth={2.25}\n />\n </button>\n <button aria-label=\"Volume\" className=\"hidden\" type=\"button\">\n <Volume2 className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n <button\n aria-label=\"Rewind\"\n className=\"slide-player__action\"\n disabled={prevDisabled}\n onClick={onPrev}\n type=\"button\"\n >\n <RotateCcw className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n <button\n aria-label={isPlaying ? \"Pause\" : \"Play\"}\n className=\"slide-player__toggle\"\n onClick={() => {\n const audioElement = audioRef.current;\n\n if (!audioElement || !currentAudio) {\n return;\n }\n\n if (waitingSegmentIndexRef.current !== null) {\n if (isPlaying) {\n pendingAutoPlayRef.current = false;\n isPausedByUserRef.current = true;\n waitingSegmentIndexRef.current = null;\n isWaitingForSegmentRef.current = false;\n setIsPlaying(false);\n updateLoading(false);\n audioElement.pause();\n return;\n }\n\n onPlayRequest?.();\n isPausedByUserRef.current = false;\n pendingAutoPlayRef.current = true;\n setIsPlaying(true);\n return;\n }\n\n if (!audioElement.src && currentAudioSegments.length > 0) {\n // Only the player play button can unlock playback when autoplay is unavailable.\n onPlayRequest?.();\n isPausedByUserRef.current = false;\n startSegmentPlayback(\n Math.min(\n currentSegmentIndexRef.current,\n currentAudioSegments.length - 1\n ),\n \"toggle\"\n );\n return;\n }\n\n if (audioElement.paused) {\n onPlayRequest?.();\n isPausedByUserRef.current = false;\n pendingAutoPlayRef.current = true;\n tryPlayCurrentAudio(\"toggle-resume\");\n return;\n }\n\n pendingAutoPlayRef.current = false;\n isPausedByUserRef.current = true;\n audioElement.pause();\n }}\n type=\"button\"\n >\n {isPlaying ? <PauseIcon /> : <PlayIcon />}\n </button>\n <button\n aria-label=\"Forward\"\n className=\"slide-player__action\"\n disabled={nextDisabled}\n onClick={onNext}\n type=\"button\"\n >\n <RotateCw className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n <button\n aria-label=\"Fullscreen\"\n className=\"hidden\"\n onClick={onFullscreen}\n type=\"button\"\n >\n <Maximize className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n </div>\n\n <div className=\"slide-player__separator\" />\n\n <div className=\"slide-player__group\">\n <button\n aria-label=\"Notes\"\n className={cn(\n \"slide-player__action\",\n isInteractionOpen && \"slide-player__action--active\"\n )}\n disabled={!hasInteraction}\n onClick={onInteractionToggle}\n type=\"button\"\n >\n <FilePenLine className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n </div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Player;\n"],"names":["audioPreloadLinkCache","preloadAudioUrl","url","link","PauseIcon","jsxs","jsx","PlayIcon","Player","audioList","className","currentAudioIndex","defaultPlaying","onLoadingChange","onPrev","onNext","onFullscreen","onEnded","onPlayRequest","onInteractionToggle","hasInteraction","isInteractionOpen","prevDisabled","nextDisabled","showControls","props","audioRef","useRef","audioSrcRef","currentAudioKeyRef","currentSegmentIndexRef","waitingSegmentIndexRef","currentAudioRef","currentAudioSegmentsRef","isLoadingRef","isPausedByUserRef","activeSourceTypeRef","isWaitingForSegmentRef","pendingAutoPlayRef","pendingSeekTimeRef","isSwitchingSegmentRef","isPlaying","setIsPlaying","useState","currentAudio","currentAudioUrl","currentAudioSegments","useMemo","prevSegment","nextSegment","currentAudioKey","useEffect","currentUrl","nextUrl","updateLoading","useCallback","loading","getSegmentSrc","audioData","resetAudio","audioElement","tryPlayCurrentAudio","_reason","playPromise","_error","startSegmentPlayback","segmentIndex","segment","nextAudioSrc","shouldAutoResume","hasNewSrc","finishAudioItem","handleSegmentEnded","nextSegmentIndex","segments","activeAudio","hasFinal","handleAudioPlay","handleAudioPause","handleAudioCanPlay","handleLoadedMetadata","handleAudioEnded","shouldFinishAsUrl","handleAudioError","cn","EllipsisVertical","Volume2","RotateCcw","RotateCw","Maximize","FilePenLine"],"mappings":"kvCAoBMA,MAA4B,IAE5BC,EAAmBC,GAAiB,CACxC,GACE,OAAO,SAAa,KACpB,CAACA,GACDF,EAAsB,IAAIE,CAAG,EAE7B,OAGF,MAAMC,EAAO,SAAS,cAAc,MAAM,EAC1CA,EAAK,IAAM,UACXA,EAAK,GAAK,QACVA,EAAK,KAAOD,EACR,YAAY,KAAKA,CAAG,IACtBC,EAAK,YAAc,aAErB,SAAS,KAAK,YAAYA,CAAI,EAC9BH,EAAsB,IAAIE,CAAG,CAC/B,EAoBME,GAAY,IAChBC,EAAAA,kBAAAA,KAAC,MAAA,CACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAE,gLACF,KAAK,SAAA,CAAA,EAEPA,EAAAA,kBAAAA,IAAC,OAAA,CAAK,EAAE,yCAAyC,KAAK,OAAA,CAAQ,CAAA,CAAA,CAChE,EAGIC,GAAW,IACfF,EAAAA,kBAAAA,KAAC,MAAA,CACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAE,gLACF,KAAK,SAAA,CAAA,EAEPA,EAAAA,kBAAAA,IAAC,OAAA,CAAK,EAAE,kDAAkD,KAAK,OAAA,CAAQ,CAAA,CAAA,CACzE,EAGIE,GAAgC,CAAC,CACrC,UAAAC,EAAY,CAAA,EACZ,UAAAC,EACA,kBAAAC,EAAoB,GACpB,eAAAC,EAAiB,GACjB,gBAAAC,EACA,OAAAC,EACA,OAAAC,EACA,aAAAC,EACA,QAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,eAAAC,EAAiB,GACjB,kBAAAC,EAAoB,GACpB,aAAAC,EAAe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CACjE,CACF,CAAA,CAAA,CACF,EACE,IAAA,EACN,CAEJ"}
|
|
1
|
+
{"version":3,"file":"Player.cjs.js","sources":["../../../src/components/Slide/Player.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n EllipsisVertical,\n FilePenLine,\n Maximize,\n RotateCcw,\n RotateCw,\n Volume2,\n} from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport type { SlideAudioItem } from \"./useSlide\";\nimport \"./player.css\";\n\nconst audioPreloadLinkCache = new Set<string>();\n\nconst preloadAudioUrl = (url?: string) => {\n if (\n typeof document === \"undefined\" ||\n !url ||\n audioPreloadLinkCache.has(url)\n ) {\n return;\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"preload\";\n link.as = \"audio\";\n link.href = url;\n if (/^https?:/i.test(url)) {\n link.crossOrigin = \"anonymous\";\n }\n document.head.appendChild(link);\n audioPreloadLinkCache.add(url);\n};\n\nexport type PlayerProps = React.ComponentProps<\"div\"> & {\n audioList?: SlideAudioItem[];\n currentAudioIndex?: number;\n defaultPlaying?: boolean;\n onLoadingChange?: (loading: boolean) => void;\n onPrev?: () => void;\n onNext?: () => void;\n onFullscreen?: () => void;\n onEnded?: (audioIndex: number) => void;\n onPlayRequest?: () => void;\n onInteractionToggle?: () => void;\n hasInteraction?: boolean;\n isInteractionOpen?: boolean;\n prevDisabled?: boolean;\n nextDisabled?: boolean;\n showControls?: boolean;\n};\n\nconst PauseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"34\"\n height=\"34\"\n viewBox=\"0 0 34 34\"\n fill=\"none\"\n >\n <path\n d=\"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z\"\n fill=\"#0A0A0A\"\n />\n <path d=\"M12 10H16V24H12V10ZM18 10H22V24H18V10Z\" fill=\"white\" />\n </svg>\n);\n\nconst PlayIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"34\"\n height=\"34\"\n viewBox=\"0 0 34 34\"\n fill=\"none\"\n >\n <path\n d=\"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z\"\n fill=\"#0A0A0A\"\n />\n <path d=\"M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z\" fill=\"white\" />\n </svg>\n);\n\nconst Player: React.FC<PlayerProps> = ({\n audioList = [],\n className,\n currentAudioIndex = -1,\n defaultPlaying = true,\n onLoadingChange,\n onPrev,\n onNext,\n onFullscreen,\n onEnded,\n onPlayRequest,\n onInteractionToggle,\n hasInteraction = false,\n isInteractionOpen = false,\n prevDisabled = false,\n nextDisabled = false,\n showControls = true,\n ...props\n}) => {\n const audioRef = useRef<HTMLAudioElement | null>(null);\n const audioSrcRef = useRef<string | null>(null);\n const currentAudioKeyRef = useRef<string | null>(null);\n const currentSegmentIndexRef = useRef(0);\n const waitingSegmentIndexRef = useRef<number | null>(null);\n const currentAudioRef = useRef<SlideAudioItem | undefined>(undefined);\n const currentAudioSegmentsRef = useRef<\n NonNullable<SlideAudioItem[\"audioSegments\"]>\n >([]);\n const isLoadingRef = useRef(false);\n const isPausedByUserRef = useRef(false);\n const activeSourceTypeRef = useRef<\"url\" | \"segment\" | null>(null);\n const isWaitingForSegmentRef = useRef(false);\n const pendingAutoPlayRef = useRef(false);\n const pendingSeekTimeRef = useRef<number | null>(null);\n const isSwitchingSegmentRef = useRef(false);\n const [isPlaying, setIsPlaying] = useState(defaultPlaying);\n const currentAudio =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex] : undefined;\n const currentAudioUrl = currentAudio?.audioUrl;\n const currentAudioSegments = useMemo(\n () =>\n [...(currentAudio?.audioSegments ?? [])].sort(\n (prevSegment, nextSegment) =>\n prevSegment.segment_index - nextSegment.segment_index\n ),\n [currentAudio?.audioSegments]\n );\n const currentAudioKey = `${currentAudioIndex}:${currentAudio?.audioKey ?? \"none\"}`;\n\n useEffect(() => {\n currentAudioRef.current = currentAudio;\n }, [currentAudio]);\n\n useEffect(() => {\n currentAudioSegmentsRef.current = currentAudioSegments;\n }, [currentAudioSegments]);\n\n useEffect(() => {\n const currentUrl = currentAudio?.audioUrl;\n const nextUrl =\n currentAudioIndex >= 0\n ? audioList[currentAudioIndex + 1]?.audioUrl\n : undefined;\n\n preloadAudioUrl(currentUrl);\n preloadAudioUrl(nextUrl);\n }, [audioList, currentAudio?.audioUrl, currentAudioIndex]);\n\n const updateLoading = useCallback(\n (loading: boolean) => {\n if (isLoadingRef.current === loading) {\n return;\n }\n\n isLoadingRef.current = loading;\n onLoadingChange?.(loading);\n },\n [onLoadingChange]\n );\n\n const getSegmentSrc = useCallback((audioData: string) => {\n if (!audioData) {\n return \"\";\n }\n\n if (audioData.startsWith(\"data:\")) {\n return audioData;\n }\n\n return `data:audio/mpeg;base64,${audioData}`;\n }, []);\n\n const getWaitingSegmentSeekTime = useCallback(() => {\n const waitingSegmentIndex = waitingSegmentIndexRef.current;\n\n if (waitingSegmentIndex == null || waitingSegmentIndex <= 0) {\n return 0;\n }\n\n return (\n currentAudioSegmentsRef.current\n .slice(0, waitingSegmentIndex)\n .reduce(\n (totalDurationMs, segment) =>\n totalDurationMs + Math.max(Number(segment.duration_ms ?? 0), 0),\n 0\n ) / 1000\n );\n }, []);\n\n const resetAudio = useCallback(() => {\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return;\n }\n\n pendingAutoPlayRef.current = false;\n isPausedByUserRef.current = false;\n activeSourceTypeRef.current = null;\n pendingSeekTimeRef.current = null;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = false;\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n audioSrcRef.current = null;\n currentSegmentIndexRef.current = 0;\n waitingSegmentIndexRef.current = null;\n setIsPlaying(false);\n updateLoading(false);\n }, [updateLoading]);\n\n const tryPlayCurrentAudio = useCallback(\n (_reason: string) => {\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return false;\n }\n\n const playPromise = audioElement.play();\n\n if (playPromise && typeof playPromise.then === \"function\") {\n void playPromise\n .then(() => {\n pendingAutoPlayRef.current = false;\n isSwitchingSegmentRef.current = false;\n })\n .catch((_error: unknown) => {\n setIsPlaying(false);\n });\n }\n\n return true;\n },\n [currentAudioIndex]\n );\n\n const startSegmentPlayback = useCallback(\n (segmentIndex: number, _reason: string) => {\n const audioElement = audioRef.current;\n const segment = currentAudioSegmentsRef.current[segmentIndex];\n\n if (!audioElement || !segment) {\n return false;\n }\n\n const nextAudioSrc = getSegmentSrc(segment.audio_data);\n\n currentSegmentIndexRef.current = segmentIndex;\n waitingSegmentIndexRef.current = null;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = true;\n const shouldAutoResume = defaultPlaying && !isPausedByUserRef.current;\n\n pendingAutoPlayRef.current = shouldAutoResume;\n updateLoading(false);\n\n const hasNewSrc = audioSrcRef.current !== nextAudioSrc;\n\n activeSourceTypeRef.current = \"segment\";\n\n if (hasNewSrc) {\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n audioSrcRef.current = nextAudioSrc;\n audioElement.src = nextAudioSrc;\n audioElement.load();\n }\n\n pendingSeekTimeRef.current = 0;\n\n if (audioElement.readyState > 0) {\n audioElement.currentTime = 0;\n pendingSeekTimeRef.current = null;\n }\n\n if (!shouldAutoResume) {\n pendingAutoPlayRef.current = false;\n isSwitchingSegmentRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return true;\n }\n\n if (hasNewSrc) {\n return true;\n }\n\n return tryPlayCurrentAudio(`start-segment:${_reason}`);\n },\n [defaultPlaying, getSegmentSrc, tryPlayCurrentAudio, updateLoading]\n );\n\n const finishAudioItem = useCallback(\n (_reason?: string) => {\n pendingAutoPlayRef.current = false;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = false;\n setIsPlaying(false);\n updateLoading(false);\n\n if (currentAudioIndex >= 0) {\n onEnded?.(currentAudioIndex);\n }\n },\n [currentAudioIndex, onEnded, updateLoading]\n );\n\n const handleSegmentEnded = useCallback(() => {\n const nextSegmentIndex = currentSegmentIndexRef.current + 1;\n const segments = currentAudioSegmentsRef.current;\n const nextSegment = segments[nextSegmentIndex];\n const activeAudio = currentAudioRef.current;\n const hasFinal = segments.some((segment) => segment.is_final);\n\n if (nextSegment) {\n startSegmentPlayback(nextSegmentIndex, \"ended\");\n return;\n }\n\n if (activeAudio?.isAudioStreaming || !hasFinal) {\n currentSegmentIndexRef.current = nextSegmentIndex;\n waitingSegmentIndexRef.current = nextSegmentIndex;\n isWaitingForSegmentRef.current = true;\n pendingAutoPlayRef.current = defaultPlaying;\n setIsPlaying(defaultPlaying);\n updateLoading(true);\n\n return;\n }\n\n finishAudioItem(\"segments-completed\");\n }, [defaultPlaying, finishAudioItem, startSegmentPlayback, updateLoading]);\n\n useEffect(() => {\n if (currentAudioKeyRef.current === currentAudioKey) {\n return;\n }\n\n currentAudioKeyRef.current = currentAudioKey;\n currentSegmentIndexRef.current = 0;\n waitingSegmentIndexRef.current = null;\n isWaitingForSegmentRef.current = false;\n isPausedByUserRef.current = false;\n pendingAutoPlayRef.current = false;\n isSwitchingSegmentRef.current = false;\n activeSourceTypeRef.current = null;\n audioSrcRef.current = null;\n updateLoading(false);\n\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return;\n }\n\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n setIsPlaying(false);\n }, [\n currentAudioIndex,\n currentAudioKey,\n currentAudioSegments.length,\n currentAudioUrl,\n updateLoading,\n ]);\n\n useEffect(() => {\n const audioElement = audioRef.current;\n\n if (!audioElement) {\n return;\n }\n\n if (!currentAudio) {\n resetAudio();\n return;\n }\n\n if (currentAudioUrl) {\n const hasNewSrc = audioSrcRef.current !== currentAudioUrl;\n const shouldAutoResume = defaultPlaying && !isPausedByUserRef.current;\n const shouldKeepSegmentSource =\n activeSourceTypeRef.current === \"segment\" &&\n Boolean(audioSrcRef.current) &&\n waitingSegmentIndexRef.current === null;\n\n if (shouldKeepSegmentSource) {\n if (!shouldAutoResume) {\n pendingAutoPlayRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return;\n }\n\n if (audioElement.paused) {\n pendingAutoPlayRef.current = true;\n tryPlayCurrentAudio(\"keep-segment-source\");\n }\n\n return;\n }\n\n if (hasNewSrc) {\n const nextSeekTime =\n waitingSegmentIndexRef.current !== null\n ? getWaitingSegmentSeekTime()\n : 0;\n\n audioElement.pause();\n audioElement.removeAttribute(\"src\");\n audioElement.load();\n audioSrcRef.current = currentAudioUrl;\n activeSourceTypeRef.current = \"url\";\n audioElement.src = currentAudioUrl;\n audioElement.load();\n pendingSeekTimeRef.current = nextSeekTime;\n\n if (audioElement.readyState > 0) {\n audioElement.currentTime = nextSeekTime;\n pendingSeekTimeRef.current = null;\n }\n }\n\n pendingAutoPlayRef.current = shouldAutoResume;\n isWaitingForSegmentRef.current = false;\n isSwitchingSegmentRef.current = false;\n updateLoading(false);\n\n if (!shouldAutoResume) {\n pendingAutoPlayRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return;\n }\n\n if (!hasNewSrc) {\n tryPlayCurrentAudio(\"sync-url\");\n }\n return;\n }\n\n if (waitingSegmentIndexRef.current !== null) {\n if (waitingSegmentIndexRef.current < currentAudioSegments.length) {\n if (isPausedByUserRef.current) {\n setIsPlaying(false);\n updateLoading(false);\n return;\n }\n\n startSegmentPlayback(waitingSegmentIndexRef.current, \"wait-resume\");\n return;\n }\n\n isWaitingForSegmentRef.current = true;\n pendingAutoPlayRef.current = defaultPlaying && !isPausedByUserRef.current;\n setIsPlaying(defaultPlaying && !isPausedByUserRef.current);\n updateLoading(!isPausedByUserRef.current);\n return;\n }\n\n if (!currentAudioSegments.length) {\n if (currentAudio.isAudioStreaming) {\n waitingSegmentIndexRef.current = currentSegmentIndexRef.current;\n isWaitingForSegmentRef.current = true;\n pendingAutoPlayRef.current =\n defaultPlaying && !isPausedByUserRef.current;\n setIsPlaying(defaultPlaying && !isPausedByUserRef.current);\n updateLoading(!isPausedByUserRef.current);\n return;\n }\n\n resetAudio();\n return;\n }\n\n if (!audioSrcRef.current) {\n startSegmentPlayback(\n Math.min(\n currentSegmentIndexRef.current,\n currentAudioSegments.length - 1\n ),\n \"effect-init\"\n );\n return;\n }\n\n if (!defaultPlaying || isPausedByUserRef.current) {\n pendingAutoPlayRef.current = false;\n audioElement.pause();\n setIsPlaying(false);\n return;\n }\n\n if (audioElement.paused) {\n pendingAutoPlayRef.current = true;\n tryPlayCurrentAudio(\"sync-paused-retry\");\n }\n }, [\n currentAudio,\n currentAudioIndex,\n currentAudioSegments,\n currentAudioUrl,\n defaultPlaying,\n resetAudio,\n startSegmentPlayback,\n tryPlayCurrentAudio,\n getWaitingSegmentSeekTime,\n updateLoading,\n ]);\n\n useEffect(() => resetAudio, [resetAudio]);\n\n const handleAudioPlay = useCallback(() => {\n setIsPlaying(true);\n updateLoading(false);\n }, [updateLoading]);\n\n const handleAudioPause = useCallback(() => {\n if (isWaitingForSegmentRef.current || isSwitchingSegmentRef.current) {\n return;\n }\n\n setIsPlaying(false);\n }, [currentAudioIndex]);\n\n const handleAudioCanPlay = useCallback(() => {\n const audioElement = audioRef.current;\n\n if (audioElement && pendingSeekTimeRef.current !== null) {\n audioElement.currentTime = pendingSeekTimeRef.current;\n pendingSeekTimeRef.current = null;\n }\n\n if (!pendingAutoPlayRef.current || !defaultPlaying) {\n return;\n }\n\n tryPlayCurrentAudio(\"canplay\");\n }, [currentAudioIndex, defaultPlaying, tryPlayCurrentAudio]);\n\n const handleLoadedMetadata = useCallback(() => {\n const audioElement = audioRef.current;\n\n if (audioElement && pendingSeekTimeRef.current !== null) {\n audioElement.currentTime = pendingSeekTimeRef.current;\n pendingSeekTimeRef.current = null;\n }\n }, [currentAudioIndex]);\n\n const handleAudioEnded = useCallback(() => {\n const shouldFinishAsUrl =\n activeSourceTypeRef.current === \"url\" ||\n currentAudioSegmentsRef.current.length === 0;\n\n isSwitchingSegmentRef.current = false;\n\n if (shouldFinishAsUrl) {\n finishAudioItem(\"url-ended\");\n return;\n }\n\n handleSegmentEnded();\n }, [finishAudioItem, handleSegmentEnded]);\n\n const handleAudioError = useCallback(() => {\n setIsPlaying(false);\n updateLoading(false);\n }, [updateLoading]);\n\n return (\n <div className={cn(\"slide-player\", className)} {...props}>\n <audio\n ref={audioRef}\n preload=\"auto\"\n playsInline\n onLoadedMetadata={handleLoadedMetadata}\n onCanPlay={handleAudioCanPlay}\n onPlay={handleAudioPlay}\n onPause={handleAudioPause}\n onEnded={handleAudioEnded}\n onError={handleAudioError}\n />\n\n {showControls ? (\n <div className=\"slide-player__controls\">\n <div className=\"slide-player__group\">\n <button aria-label=\"More options\" className=\"hidden\" type=\"button\">\n <EllipsisVertical\n className=\"slide-player__icon\"\n strokeWidth={2.25}\n />\n </button>\n <button aria-label=\"Volume\" className=\"hidden\" type=\"button\">\n <Volume2 className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n <button\n aria-label=\"Rewind\"\n className=\"slide-player__action\"\n disabled={prevDisabled}\n onClick={onPrev}\n type=\"button\"\n >\n <RotateCcw className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n <button\n aria-label={isPlaying ? \"Pause\" : \"Play\"}\n className=\"slide-player__toggle\"\n onClick={() => {\n const audioElement = audioRef.current;\n\n if (!audioElement || !currentAudio) {\n return;\n }\n\n if (waitingSegmentIndexRef.current !== null) {\n if (isPlaying) {\n pendingAutoPlayRef.current = false;\n isPausedByUserRef.current = true;\n waitingSegmentIndexRef.current = null;\n isWaitingForSegmentRef.current = false;\n setIsPlaying(false);\n updateLoading(false);\n audioElement.pause();\n return;\n }\n\n onPlayRequest?.();\n isPausedByUserRef.current = false;\n pendingAutoPlayRef.current = true;\n setIsPlaying(true);\n return;\n }\n\n if (!audioElement.src && currentAudioSegments.length > 0) {\n // Only the player play button can unlock playback when autoplay is unavailable.\n onPlayRequest?.();\n isPausedByUserRef.current = false;\n startSegmentPlayback(\n Math.min(\n currentSegmentIndexRef.current,\n currentAudioSegments.length - 1\n ),\n \"toggle\"\n );\n return;\n }\n\n if (audioElement.paused) {\n onPlayRequest?.();\n isPausedByUserRef.current = false;\n pendingAutoPlayRef.current = true;\n tryPlayCurrentAudio(\"toggle-resume\");\n return;\n }\n\n pendingAutoPlayRef.current = false;\n isPausedByUserRef.current = true;\n audioElement.pause();\n }}\n type=\"button\"\n >\n {isPlaying ? <PauseIcon /> : <PlayIcon />}\n </button>\n <button\n aria-label=\"Forward\"\n className=\"slide-player__action\"\n disabled={nextDisabled}\n onClick={onNext}\n type=\"button\"\n >\n <RotateCw className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n <button\n aria-label=\"Fullscreen\"\n className=\"hidden\"\n onClick={onFullscreen}\n type=\"button\"\n >\n <Maximize className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n </div>\n\n <div className=\"slide-player__separator\" />\n\n <div className=\"slide-player__group\">\n <button\n aria-label=\"Notes\"\n className={cn(\n \"slide-player__action\",\n isInteractionOpen && \"slide-player__action--active\"\n )}\n disabled={!hasInteraction}\n onClick={onInteractionToggle}\n type=\"button\"\n >\n <FilePenLine className=\"slide-player__icon\" strokeWidth={2.25} />\n </button>\n </div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Player;\n"],"names":["audioPreloadLinkCache","preloadAudioUrl","url","link","PauseIcon","jsxs","jsx","PlayIcon","Player","audioList","className","currentAudioIndex","defaultPlaying","onLoadingChange","onPrev","onNext","onFullscreen","onEnded","onPlayRequest","onInteractionToggle","hasInteraction","isInteractionOpen","prevDisabled","nextDisabled","showControls","props","audioRef","useRef","audioSrcRef","currentAudioKeyRef","currentSegmentIndexRef","waitingSegmentIndexRef","currentAudioRef","currentAudioSegmentsRef","isLoadingRef","isPausedByUserRef","activeSourceTypeRef","isWaitingForSegmentRef","pendingAutoPlayRef","pendingSeekTimeRef","isSwitchingSegmentRef","isPlaying","setIsPlaying","useState","currentAudio","currentAudioUrl","currentAudioSegments","useMemo","prevSegment","nextSegment","currentAudioKey","useEffect","currentUrl","nextUrl","updateLoading","useCallback","loading","getSegmentSrc","audioData","getWaitingSegmentSeekTime","waitingSegmentIndex","totalDurationMs","segment","resetAudio","audioElement","tryPlayCurrentAudio","_reason","playPromise","_error","startSegmentPlayback","segmentIndex","nextAudioSrc","shouldAutoResume","hasNewSrc","finishAudioItem","handleSegmentEnded","nextSegmentIndex","segments","activeAudio","hasFinal","nextSeekTime","handleAudioPlay","handleAudioPause","handleAudioCanPlay","handleLoadedMetadata","handleAudioEnded","shouldFinishAsUrl","handleAudioError","cn","EllipsisVertical","Volume2","RotateCcw","RotateCw","Maximize","FilePenLine"],"mappings":"kvCAoBMA,MAA4B,IAE5BC,EAAmBC,GAAiB,CACxC,GACE,OAAO,SAAa,KACpB,CAACA,GACDF,EAAsB,IAAIE,CAAG,EAE7B,OAGF,MAAMC,EAAO,SAAS,cAAc,MAAM,EAC1CA,EAAK,IAAM,UACXA,EAAK,GAAK,QACVA,EAAK,KAAOD,EACR,YAAY,KAAKA,CAAG,IACtBC,EAAK,YAAc,aAErB,SAAS,KAAK,YAAYA,CAAI,EAC9BH,EAAsB,IAAIE,CAAG,CAC/B,EAoBME,GAAY,IAChBC,EAAAA,kBAAAA,KAAC,MAAA,CACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAE,gLACF,KAAK,SAAA,CAAA,EAEPA,EAAAA,kBAAAA,IAAC,OAAA,CAAK,EAAE,yCAAyC,KAAK,OAAA,CAAQ,CAAA,CAAA,CAChE,EAGIC,GAAW,IACfF,EAA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