@kelet-ai/feedback-ui 0.3.1 → 0.4.1
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/README.md +17 -0
- package/dist/components/vote-feedback.d.ts +1 -1
- package/dist/feedback-ui.es.js +826 -795
- package/dist/feedback-ui.umd.js +16 -16
- package/dist/index.d.ts +1 -0
- package/dist/lib/otel-trace.d.ts +22 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +9 -2
- package/dist/lib/utils.d.ts +0 -2
package/dist/feedback-ui.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(M,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(M=typeof globalThis<"u"?globalThis:M||self,P(M["@kelet-ai/feedback-ui"]={},M.React))})(this,function(M,P){"use strict";function Ee(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Pe(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return n[r]}})}),t}var ee={exports:{}},X={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ae;function
|
|
9
|
+
*/var ae;function xe(){if(ae)return X;ae=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:n,type:r,key:d,ref:o!==void 0?o:null,props:u}}return X.Fragment=e,X.jsx=t,X.jsxs=t,X}var Z={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var le;function
|
|
17
|
+
*/var le;function Ce(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){function n(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===s?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case g:return"Fragment";case x:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case F:return"SuspenseList";case l:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case h:return"Portal";case E:return(a.displayName||"Context")+".Provider";case b:return(a._context.displayName||"Context")+".Consumer";case O:var T=a.render;return a=a.displayName,a||(a=T.displayName||T.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case W:return T=a.displayName||null,T!==null?T:n(a.type)||"Memo";case i:T=a._payload,a=a._init;try{return n(a(T))}catch{}}return null}function e(a){return""+a}function t(a){try{e(a);var T=!1}catch{T=!0}if(T){T=console;var _=T.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return _.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),e(a)}}function r(a){if(a===g)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===i)return"<...>";try{var T=n(a);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function o(){var a=c.A;return a===null?null:a.getOwner()}function u(){return Error("react-stack-top-frame")}function d(a){if(v.call(a,"key")){var T=Object.getOwnPropertyDescriptor(a,"key").get;if(T&&T.isReactWarning)return!1}return a.key!==void 0}function f(a,T){function _(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",T))}_.isReactWarning=!0,Object.defineProperty(a,"key",{get:_,configurable:!0})}function p(){var a=n(this.type);return I[a]||(I[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function y(a,T,_,j,K,z,G,J){return _=z.ref,a={$$typeof:k,type:a,key:T,props:z,_owner:K},(_!==void 0?_:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:p}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function m(a,T,_,j,K,z,G,J){var N=T.children;if(N!==void 0)if(j)if(A(N)){for(j=0;j<N.length;j++)S(N[j]);Object.freeze&&Object.freeze(N)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else S(N);if(v.call(T,"key")){N=n(a);var U=Object.keys(T).filter(function(et){return et!=="key"});j=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",re[N+j]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,_,N,U,N),re[N+_]=!0)}if(N=null,j!==void 0&&(r(j),N=""+j),c(T)&&(r(T.key),N=""+T.key),"key"in T){j={};for(var se in T)se!=="key"&&(j[se]=T[se])}else j=T;return N&&f(j,typeof a=="function"?a.displayName||a.name||"Unknown":a),y(a,N,W,z,i(),j,G,J)}function C(a){typeof a=="object"&&a!==null&&a.$$typeof===k&&a._store&&(a._store.validated=1)}var P=E,k=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),w=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),o=Symbol.for("react.client.reference"),p=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,v=Object.prototype.hasOwnProperty,D=Array.isArray,x=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(a){return a()}};var K,I={},B=P.react_stack_bottom_frame.bind(P,u)(),V=x(n(u)),re={};Z.Fragment=g,Z.jsx=function(a,T,j,_,z){var W=1e4>p.recentlyCreatedOwnerStacks++;return b(a,T,j,!1,_,z,W?Error("react-stack-top-frame"):B,W?x(n(a)):V)},Z.jsxs=function(a,T,j,_,z){var W=1e4>p.recentlyCreatedOwnerStacks++;return b(a,T,j,!0,_,z,W?Error("react-stack-top-frame"):B,W?x(n(a)):V)}}()),Z}var ue;function Te(){return ue||(ue=1,process.env.NODE_ENV==="production"?ee.exports=Ce():ee.exports=xe()),ee.exports}var L=Te();const Q=E.createContext(null),Re="https://api.kelet.ai/",Oe=()=>{const t=E.useContext(Q);if(!t)throw new Error("useKelet must be used within a KeletProvider");return t},oe=()=>{const t=E.useContext(Q);return t?t.feedback:async()=>{}},Ae=({apiKey:t,project:e,children:r})=>{const n=E.useContext(Q),i=t||n?.api_key;if(!i)throw new Error("apiKey is required either directly or from a parent KeletProvider");const c={api_key:i,project:e,feedback:async f=>{const d=`${Re}/projects/${e}/feedback`,y={tx_id:f.tx_id,source:f.source||"EXPLICIT",vote:f.vote,explanation:f.explanation,correction:f.correction,selection:f.selection},b=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(y)});if(!b.ok)throw new Error(`Failed to submit feedback: ${b.statusText}`)}};return L.jsx(Q.Provider,{value:c,children:r})},q=(t,e)=>{const r={...e};for(const n in e){const i=t[n],u=e[n];/^on[A-Z]/.test(n)?i&&u?r[n]=(...f)=>{u(...f),i(...f)}:i&&(r[n]=i):n==="style"?r[n]={...i,...u}:n==="className"?r[n]=[i,u].filter(Boolean).join(" "):r[n]=u!==void 0?u:i}return{...t,...r}},fe=E.createContext(null),$=()=>{const t=E.useContext(fe);if(!t)throw new Error("VoteFeedback components must be used within VoteFeedback.Root");return t},De={Root:({children:t,onFeedback:e,defaultText:r="",tx_id:n,extra_metadata:i,trigger_name:u})=>{const[c,f]=E.useState(!1),[d,y]=E.useState(r),[b,C]=E.useState(!1),[P,k]=E.useState(null),h=E.useRef(null),g=E.useRef(null),R=E.useId(),O=E.useId(),m=oe(),w=e||m,S=E.useCallback(async()=>{k("upvote");const o={tx_id:n,vote:"upvote",...i&&{extra_metadata:i},...u&&{trigger_name:u}};try{C(!0),await w(o)}finally{C(!1)}},[w,n,i,u]),A=E.useCallback(async()=>{if(k("downvote"),w){const o={tx_id:n,vote:"downvote",...i&&{extra_metadata:i},...u&&{trigger_name:u}};try{C(!0),await w(o)}finally{C(!1)}}f(!0),setTimeout(()=>{h.current?.focus();const o=document.createElement("div");o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true"),o.className="sr-only",o.textContent="Feedback dialog opened. You can provide additional details about your downvote.",document.body.appendChild(o),setTimeout(()=>document.body.removeChild(o),1e3)},0)},[w,n,i,u]),F=E.useCallback(o=>{y(o.target.value)},[]),M=E.useCallback(async()=>{const o=d.trim().length>0;if(o){const p={tx_id:n,vote:"downvote",explanation:d,...i&&{extra_metadata:i},...u&&{trigger_name:u}};try{C(!0),await w(p)}finally{C(!1)}}if(f(!1),y(r),g.current?.focus(),o){const p=document.createElement("div");p.setAttribute("aria-live","polite"),p.className="sr-only",p.textContent="Feedback submitted successfully.",document.body.appendChild(p),setTimeout(()=>document.body.removeChild(p),1e3)}},[w,d,r,n,i,u]),s=E.useCallback(o=>{if(o.key==="Escape")f(!1),y(r),g.current?.focus();else if((o.metaKey||o.ctrlKey)&&o.key==="Enter")o.preventDefault(),M().then(p=>{});else if(o.key==="Tab"&&c){const p=document.getElementById(R);if(p){const v=p.querySelectorAll('button, textarea, input, select, a[href], [tabindex]:not([tabindex="-1"])'),D=v[0],x=v[v.length-1];o.shiftKey&&document.activeElement===D?(o.preventDefault(),x?.focus()):!o.shiftKey&&document.activeElement===x&&(o.preventDefault(),D?.focus())}}},[M,c,R,r]),l={onFeedback:w,showPopover:c,setShowPopover:f,feedbackText:d,setFeedbackText:y,isSubmitting:b,setIsSubmitting:C,vote:P,handleUpvote:S,handleDownvote:A,handleTextareaChange:F,handleSubmit:M,handleKeyDown:s,textareaRef:h,triggerRef:g,popoverId:R,triggerId:O,tx_id:n,extra_metadata:i,trigger_name:u};return L.jsx(fe.Provider,{value:l,children:t})},UpvoteButton:({asChild:t,children:e,onClick:r,...n})=>{const{handleUpvote:i,isSubmitting:u,vote:c}=$(),f=E.useCallback(b=>{i(),r?.(b)},[i,r]),d={...n,onClick:f,disabled:u||n.disabled,"aria-label":n["aria-label"]||"Upvote feedback",type:"button"},y=c==="upvote";if(t){const b=typeof e=="function"?e({isSelected:y}):e;if(E.isValidElement(b))return E.cloneElement(b,q(d,b.props))}return L.jsx("button",{...d,children:typeof e=="function"?e({isSelected:y}):e})},DownvoteButton:({asChild:t,children:e,onClick:r,...n})=>{const{handleDownvote:i,showPopover:u,isSubmitting:c,popoverId:f,triggerId:d,triggerRef:y,vote:b}=$(),C=E.useCallback(h=>{i(),r?.(h)},[i,r]),P={...n,ref:y,onClick:C,disabled:c||n.disabled,"aria-label":n["aria-label"]||"Downvote feedback","aria-expanded":u,"aria-controls":f,id:d,type:"button"},k=b==="downvote";if(t){const h=typeof e=="function"?e({isSelected:k}):e;if(E.isValidElement(h))return E.cloneElement(h,q(P,h.props));if(h)return h}return L.jsx("button",{...P,children:typeof e=="function"?e({isSelected:k}):e})},Popover:({asChild:t,children:e,...r})=>{const{showPopover:n,handleKeyDown:i,popoverId:u,triggerId:c}=$();if(!n)return null;const f={...r,role:"dialog","aria-labelledby":c,"aria-modal":!0,"aria-describedby":`${u}-description`,id:u,onKeyDown:i,tabIndex:-1};return t&&E.isValidElement(e)?L.jsxs(L.Fragment,{children:[E.cloneElement(e,q(f,e.props)),L.jsx("div",{id:`${u}-description`,className:"sr-only",children:"Provide additional feedback for your downvote"})]}):L.jsxs("div",{...f,children:[L.jsx("div",{id:`${u}-description`,className:"sr-only",children:"Provide additional feedback for your downvote"}),e]})},Textarea:({asChild:t,value:e,onChange:r,...n})=>{const{feedbackText:i,handleTextareaChange:u,textareaRef:c,handleKeyDown:f,popoverId:d}=$(),y={...n,ref:c,value:e!==void 0?e:i,onChange:r||u,onKeyDown:f,placeholder:n.placeholder||"What did we miss?","aria-label":n["aria-label"]||"Additional feedback","aria-describedby":`${d}-help`,rows:n.rows||3};return t&&E.isValidElement(n.children)?E.cloneElement(n.children,q(y,n.children.props)):L.jsx("textarea",{...y})},SubmitButton:({asChild:t,children:e,onClick:r,...n})=>{const{handleSubmit:i,isSubmitting:u,feedbackText:c}=$(),f=E.useCallback(C=>{i(),r?.(C)},[i,r]),d=c.trim().length>0,y=d?"Submit feedback":"Close without feedback",b={...n,onClick:f,disabled:u||n.disabled,type:"button","aria-label":n["aria-label"]||y,"aria-describedby":d?void 0:"submit-help"};return t&&E.isValidElement(e)?L.jsxs(L.Fragment,{children:[E.cloneElement(e,q(b,e.props)),!d&&L.jsx("span",{id:"submit-help",className:"sr-only",children:"This will close the dialog without submitting feedback"})]}):L.jsxs("button",{...b,children:[e,!d&&L.jsx("span",{id:"submit-help",className:"sr-only",children:"This will close the dialog without submitting feedback"})]})}};var te={exports:{}},Se=te.exports,ce;function je(){return ce||(ce=1,function(t,e){(function(r,n){var i=n(r);t.exports=i})(Se,function(r){var n=["N","E","A","D"];function i(s,l){s.super_=l,s.prototype=Object.create(l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}})}function u(s,l){Object.defineProperty(this,"kind",{value:s,enumerable:!0}),l&&l.length&&Object.defineProperty(this,"path",{value:l,enumerable:!0})}function c(s,l,o){c.super_.call(this,"E",s),Object.defineProperty(this,"lhs",{value:l,enumerable:!0}),Object.defineProperty(this,"rhs",{value:o,enumerable:!0})}i(c,u);function f(s,l){f.super_.call(this,"N",s),Object.defineProperty(this,"rhs",{value:l,enumerable:!0})}i(f,u);function d(s,l){d.super_.call(this,"D",s),Object.defineProperty(this,"lhs",{value:l,enumerable:!0})}i(d,u);function y(s,l,o){y.super_.call(this,"A",s),Object.defineProperty(this,"index",{value:l,enumerable:!0}),Object.defineProperty(this,"item",{value:o,enumerable:!0})}i(y,u);function b(s,l,o){var p=s.slice(l+1||s.length);return s.length=l<0?s.length+l:l,s.push.apply(s,p),s}function C(s){var l=typeof s;return l!=="object"?l:s===Math?"math":s===null?"null":Array.isArray(s)?"array":Object.prototype.toString.call(s)==="[object Date]"?"date":typeof s.toString=="function"&&/^\/.*\//.test(s.toString())?"regexp":"object"}function P(s){var l=0;if(s.length===0)return l;for(var o=0;o<s.length;o++){var p=s.charCodeAt(o);l=(l<<5)-l+p,l=l&l}return l}function k(s){var l=0,o=C(s);if(o==="array"){s.forEach(function(K){l+=k(K)});var p="[type: array, hash: "+l+"]";return l+P(p)}if(o==="object"){for(var v in s)if(s.hasOwnProperty(v)){var D="[ type: object, key: "+v+", value hash: "+k(s[v])+"]";l+=P(D)}return l}var x="[ type: "+o+" ; value: "+s+"]";return l+P(x)}function h(s,l,o,p,v,D,x,K){o=o||[],v=v||[],x=x||[];var I=v.slice(0);if(typeof D<"u"&&D!==null){if(p){if(typeof p=="function"&&p(I,D))return;if(typeof p=="object"){if(p.prefilter&&p.prefilter(I,D))return;if(p.normalize){var B=p.normalize(I,D,s,l);B&&(s=B[0],l=B[1])}}}I.push(D)}C(s)==="regexp"&&C(l)==="regexp"&&(s=s.toString(),l=l.toString());var V=typeof s,re=typeof l,a,T,j,_,z=V!=="undefined"||x&&x.length>0&&x[x.length-1].lhs&&Object.getOwnPropertyDescriptor(x[x.length-1].lhs,D),W=re!=="undefined"||x&&x.length>0&&x[x.length-1].rhs&&Object.getOwnPropertyDescriptor(x[x.length-1].rhs,D);if(!z&&W)o.push(new f(I,l));else if(!W&&z)o.push(new d(I,s));else if(C(s)!==C(l))o.push(new c(I,s,l));else if(C(s)==="date"&&s-l!==0)o.push(new c(I,s,l));else if(V==="object"&&s!==null&&l!==null){for(a=x.length-1;a>-1;--a)if(x[a].lhs===s){_=!0;break}if(_)s!==l&&o.push(new c(I,s,l));else{if(x.push({lhs:s,rhs:l}),Array.isArray(s)){for(K&&(s.sort(function(N,U){return k(N)-k(U)}),l.sort(function(N,U){return k(N)-k(U)})),a=l.length-1,T=s.length-1;a>T;)o.push(new y(I,a,new f(void 0,l[a--])));for(;T>a;)o.push(new y(I,T,new d(void 0,s[T--])));for(;a>=0;--a)h(s[a],l[a],o,p,I,a,x,K)}else{var G=Object.keys(s),J=Object.keys(l);for(a=0;a<G.length;++a)j=G[a],_=J.indexOf(j),_>=0?(h(s[j],l[j],o,p,I,j,x,K),J[_]=null):h(s[j],void 0,o,p,I,j,x,K);for(a=0;a<J.length;++a)j=J[a],j&&h(void 0,l[j],o,p,I,j,x,K)}x.length=x.length-1}}else s!==l&&(V==="number"&&isNaN(s)&&isNaN(l)||o.push(new c(I,s,l)))}function g(s,l,o,p,v){var D=[];if(h(s,l,D,p,null,null,null,v),o)for(var x=0;x<D.length;++x)o(D[x]);return D}function R(s,l,o,p,v,D,x){return h(s,l,o,p,v,D,x,!0)}function O(s,l,o,p){var v=p?function(x){x&&p.push(x)}:void 0,D=g(s,l,v,o);return p||(D.length?D:void 0)}function m(s,l,o,p){var v=p?function(x){x&&p.push(x)}:void 0,D=g(s,l,v,o,!0);return p||(D.length?D:void 0)}function w(s,l,o){if(o.path&&o.path.length){var p=s[l],v,D=o.path.length-1;for(v=0;v<D;v++)p=p[o.path[v]];switch(o.kind){case"A":w(p[o.path[v]],o.index,o.item);break;case"D":delete p[o.path[v]];break;case"E":case"N":p[o.path[v]]=o.rhs;break}}else switch(o.kind){case"A":w(s[l],o.index,o.item);break;case"D":s=b(s,l);break;case"E":case"N":s[l]=o.rhs;break}return s}function S(s,l,o){if(typeof o>"u"&&l&&~n.indexOf(l.kind)&&(o=l),s&&o&&o.kind){for(var p=s,v=-1,D=o.path?o.path.length-1:0;++v<D;)typeof p[o.path[v]]>"u"&&(p[o.path[v]]=typeof o.path[v+1]<"u"&&typeof o.path[v+1]=="number"?[]:{}),p=p[o.path[v]];switch(o.kind){case"A":o.path&&typeof p[o.path[v]]>"u"&&(p[o.path[v]]=[]),w(o.path?p[o.path[v]]:p,o.index,o.item);break;case"D":delete p[o.path[v]];break;case"E":case"N":p[o.path[v]]=o.rhs;break}}}function A(s,l,o){if(o.path&&o.path.length){var p=s[l],v,D=o.path.length-1;for(v=0;v<D;v++)p=p[o.path[v]];switch(o.kind){case"A":A(p[o.path[v]],o.index,o.item);break;case"D":p[o.path[v]]=o.lhs;break;case"E":p[o.path[v]]=o.lhs;break;case"N":delete p[o.path[v]];break}}else switch(o.kind){case"A":A(s[l],o.index,o.item);break;case"D":s[l]=o.lhs;break;case"E":s[l]=o.lhs;break;case"N":s=b(s,l);break}return s}function F(s,l,o){if(s&&l&&o&&o.kind){var p=s,v,D;for(D=o.path.length-1,v=0;v<D;v++)typeof p[o.path[v]]>"u"&&(p[o.path[v]]={}),p=p[o.path[v]];switch(o.kind){case"A":A(p[o.path[v]],o.index,o.item);break;case"D":p[o.path[v]]=o.lhs;break;case"E":p[o.path[v]]=o.lhs;break;case"N":delete p[o.path[v]];break}}}function M(s,l,o){if(s&&l){var p=function(v){(!o||o(s,l,v))&&S(s,l,v)};g(s,l,p)}}return Object.defineProperties(O,{diff:{value:O,enumerable:!0},orderIndependentDiff:{value:m,enumerable:!0},observableDiff:{value:g,enumerable:!0},orderIndependentObservableDiff:{value:R,enumerable:!0},orderIndepHash:{value:k,enumerable:!0},applyDiff:{value:M,enumerable:!0},applyChange:{value:S,enumerable:!0},revertChange:{value:F,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),O.DeepDiff=O,r&&(r.DeepDiff=O),O})}(te)),te.exports}var de=je(),ne={exports:{}};const H=new Uint32Array(65536),_e=(t,e)=>{const r=t.length,n=e.length,i=1<<r-1;let u=-1,c=0,f=r,d=r;for(;d--;)H[t.charCodeAt(d)]|=1<<d;for(d=0;d<n;d++){let y=H[e.charCodeAt(d)];const b=y|c;y|=(y&u)+u^u,c|=~(y|u),u&=y,c&i&&f++,u&i&&f--,c=c<<1|1,u=u<<1|~(b|c),c&=b}for(d=r;d--;)H[t.charCodeAt(d)]=0;return f},Ne=(t,e)=>{const r=e.length,n=t.length,i=[],u=[],c=Math.ceil(r/32),f=Math.ceil(n/32);for(let h=0;h<c;h++)u[h]=-1,i[h]=0;let d=0;for(;d<f-1;d++){let h=0,g=-1;const R=d*32,O=Math.min(32,n)+R;for(let m=R;m<O;m++)H[t.charCodeAt(m)]|=1<<m;for(let m=0;m<r;m++){const w=H[e.charCodeAt(m)],S=u[m/32|0]>>>m&1,A=i[m/32|0]>>>m&1,F=w|h,M=((w|A)&g)+g^g|w|A;let s=h|~(M|g),l=g&M;s>>>31^S&&(u[m/32|0]^=1<<m),l>>>31^A&&(i[m/32|0]^=1<<m),s=s<<1|S,l=l<<1|A,g=l|~(F|s),h=s&F}for(let m=R;m<O;m++)H[t.charCodeAt(m)]=0}let y=0,b=-1;const C=d*32,P=Math.min(32,n-C)+C;for(let h=C;h<P;h++)H[t.charCodeAt(h)]|=1<<h;let k=n;for(let h=0;h<r;h++){const g=H[e.charCodeAt(h)],R=u[h/32|0]>>>h&1,O=i[h/32|0]>>>h&1,m=g|y,w=((g|O)&b)+b^b|g|O;let S=y|~(w|b),A=b&w;k+=S>>>n-1&1,k-=A>>>n-1&1,S>>>31^R&&(u[h/32|0]^=1<<h),A>>>31^O&&(i[h/32|0]^=1<<h),S=S<<1|R,A=A<<1|O,b=A|~(m|S),y=S&m}for(let h=C;h<P;h++)H[t.charCodeAt(h)]=0;return k},pe=(t,e)=>{if(t.length<e.length){const r=e;e=t,t=r}return e.length===0?t.length:t.length<=32?_e(t,e):Ne(t,e)},Ie=Pe(Object.freeze(Object.defineProperty({__proto__:null,closest:(t,e)=>{let r=1/0,n=0;for(let i=0;i<e.length;i++){const u=pe(t,e[i]);u<r&&(r=u,n=i)}return e[n]},distance:pe},Symbol.toStringTag,{value:"Module"})));var he;function Fe(){return he||(he=1,function(t,e){(function(){var r;try{r=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null}catch{console.log("Collator could not be initialized and wouldn't be used")}var n=Ie,i=[],u=[],c={get:function(f,d,y){var b=y&&r&&y.useCollator;if(b){var C=f.length,P=d.length;if(C===0)return P;if(P===0)return C;var k,h,g,R,O;for(g=0;g<P;++g)i[g]=g,u[g]=d.charCodeAt(g);i[P]=P;var m;for(g=0;g<C;++g){for(h=g+1,R=0;R<P;++R)k=h,m=r.compare(f.charAt(g),String.fromCharCode(u[R]))===0,h=i[R]+(m?0:1),O=k+1,h>O&&(h=O),O=i[R+1]+1,h>O&&(h=O),i[R]=k;i[R]=h}return h}return n.distance(f,d)}};t!==null&&t.exports===e?t.exports=c:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=c:typeof window<"u"&&window!==null&&(window.Levenshtein=c)})()}(ne,ne.exports)),ne.exports}var Le=Fe();const Me=Ee(Le);class We{diff(e,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);const u=this.castInput(e,n),c=this.castInput(r,n),f=this.removeEmpty(this.tokenize(u,n)),d=this.removeEmpty(this.tokenize(c,n));return this.diffWithOptionsObj(f,d,n,i)}diffWithOptionsObj(e,r,n,i){var u;const c=m=>{if(m=this.postProcess(m,n),i){setTimeout(function(){i(m)},0);return}else return m},f=r.length,d=e.length;let y=1,b=f+d;n.maxEditLength!=null&&(b=Math.min(b,n.maxEditLength));const C=(u=n.timeout)!==null&&u!==void 0?u:1/0,P=Date.now()+C,k=[{oldPos:-1,lastComponent:void 0}];let h=this.extractCommon(k[0],r,e,0,n);if(k[0].oldPos+1>=d&&h+1>=f)return c(this.buildValues(k[0].lastComponent,r,e));let g=-1/0,R=1/0;const O=()=>{for(let m=Math.max(g,-y);m<=Math.min(R,y);m+=2){let w;const S=k[m-1],A=k[m+1];S&&(k[m-1]=void 0);let F=!1;if(A){const s=A.oldPos-m;F=A&&0<=s&&s<f}const M=S&&S.oldPos+1<d;if(!F&&!M){k[m]=void 0;continue}if(!M||F&&S.oldPos<A.oldPos?w=this.addToPath(A,!0,!1,0,n):w=this.addToPath(S,!1,!0,1,n),h=this.extractCommon(w,r,e,m,n),w.oldPos+1>=d&&h+1>=f)return c(this.buildValues(w.lastComponent,r,e))||!0;k[m]=w,w.oldPos+1>=d&&(R=Math.min(R,m-1)),h+1>=f&&(g=Math.max(g,m+1))}y++};if(i)(function m(){setTimeout(function(){if(y>b||Date.now()>P)return i(void 0);O()||m()},0)})();else for(;y<=b&&Date.now()<=P;){const m=O();if(m)return m}}addToPath(e,r,n,i,u){const c=e.lastComponent;return c&&!u.oneChangePerToken&&c.added===r&&c.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:c.count+1,added:r,removed:n,previousComponent:c.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:c}}}extractCommon(e,r,n,i,u){const c=r.length,f=n.length;let d=e.oldPos,y=d-i,b=0;for(;y+1<c&&d+1<f&&this.equals(n[d+1],r[y+1],u);)y++,d++,b++,u.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return b&&!u.oneChangePerToken&&(e.lastComponent={count:b,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=d,y}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){const r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){const i=[];let u;for(;e;)i.push(e),u=e.previousComponent,delete e.previousComponent,e=u;i.reverse();const c=i.length;let f=0,d=0,y=0;for(;f<c;f++){const b=i[f];if(b.removed)b.value=this.join(n.slice(y,y+b.count)),y+=b.count;else{if(!b.added&&this.useLongestToken){let C=r.slice(d,d+b.count);C=C.map(function(P,k){const h=n[y+k];return h.length>P.length?h:P}),b.value=this.join(C)}else b.value=this.join(r.slice(d,d+b.count));d+=b.count,b.added||(y+=b.count)}}return i}}class Ye extends We{constructor(){super(...arguments),this.tokenize=Ke}equals(e,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
23
|
-
`))&&(e=e.trim()),(!
|
|
24
|
-
`))&&(
|
|
25
|
-
`)&&(e=e.slice(0,-1)),
|
|
26
|
-
`)&&(
|
|
27
|
-
`));const
|
|
28
|
-
`)?
|
|
29
|
-
`);const e=[];
|
|
22
|
+
<%s key={someKey} {...props} />`,j,N,U,N),re[N+j]=!0)}if(N=null,_!==void 0&&(t(_),N=""+_),d(T)&&(t(T.key),N=""+T.key),"key"in T){_={};for(var se in T)se!=="key"&&(_[se]=T[se])}else _=T;return N&&f(_,typeof a=="function"?a.displayName||a.name||"Unknown":a),y(a,N,z,K,o(),_,G,J)}function S(a){typeof a=="object"&&a!==null&&a.$$typeof===k&&a._store&&(a._store.validated=1)}var w=P,k=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),i=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),s=Symbol.for("react.client.reference"),c=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,v=Object.prototype.hasOwnProperty,A=Array.isArray,C=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(a){return a()}};var Y,I={},B=w.react_stack_bottom_frame.bind(w,u)(),V=C(r(u)),re={};Z.Fragment=g,Z.jsx=function(a,T,_,j,K){var z=1e4>c.recentlyCreatedOwnerStacks++;return m(a,T,_,!1,j,K,z?Error("react-stack-top-frame"):B,z?C(r(a)):V)},Z.jsxs=function(a,T,_,j,K){var z=1e4>c.recentlyCreatedOwnerStacks++;return m(a,T,_,!0,j,K,z?Error("react-stack-top-frame"):B,z?C(r(a)):V)}}()),Z}var ue;function Te(){return ue||(ue=1,process.env.NODE_ENV==="production"?ee.exports=xe():ee.exports=Ce()),ee.exports}var L=Te();const Q=P.createContext(null),Re="https://api.kelet.ai/api",Oe=()=>{const n=P.useContext(Q);if(!n)throw new Error("useKelet must be used within a KeletProvider");return n},oe=()=>{const n=P.useContext(Q);return n?n.feedback:async()=>{}},De=({apiKey:n,project:e,children:t})=>{const r=P.useContext(Q),o=n||r?.api_key;if(!o)throw new Error("apiKey is required either directly or from a parent KeletProvider");const d={api_key:o,project:e,feedback:async f=>{const p=`${Re}/projects/${e}/feedback`,y={tx_id:f.tx_id,source:f.source||"EXPLICIT",vote:f.vote,explanation:f.explanation,correction:f.correction,selection:f.selection},m=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(y)});if(!m.ok)throw new Error(`Failed to submit feedback: ${m.statusText}`)}};return L.jsx(Q.Provider,{value:d,children:t})},q=(n,e)=>{const t={...e};for(const r in e){const o=n[r],u=e[r];/^on[A-Z]/.test(r)?o&&u?t[r]=(...f)=>{u(...f),o(...f)}:o&&(t[r]=o):r==="style"?t[r]={...o,...u}:r==="className"?t[r]=[o,u].filter(Boolean).join(" "):t[r]=u!==void 0?u:o}return{...n,...t}},ce=P.createContext(null),$=()=>{const n=P.useContext(ce);if(!n)throw new Error("VoteFeedback components must be used within VoteFeedback.Root");return n},Se={Root:({children:n,onFeedback:e,defaultText:t="",tx_id:r,extra_metadata:o,trigger_name:u})=>{const d=typeof r=="function"?r():r,[f,p]=P.useState(!1),[y,m]=P.useState(t),[S,w]=P.useState(!1),[k,h]=P.useState(null),g=P.useRef(null),R=P.useRef(null),x=P.useId(),b=P.useId(),E=oe(),O=e||E,D=P.useCallback(async()=>{h("upvote");const c={tx_id:d,vote:"upvote",...o&&{extra_metadata:o},...u&&{trigger_name:u}};try{w(!0),await O(c)}finally{w(!1)}},[O,d,o,u]),F=P.useCallback(async()=>{if(h("downvote"),O){const c={tx_id:d,vote:"downvote",...o&&{extra_metadata:o},...u&&{trigger_name:u}};try{w(!0),await O(c)}finally{w(!1)}}p(!0),setTimeout(()=>{g.current?.focus();const c=document.createElement("div");c.setAttribute("aria-live","polite"),c.setAttribute("aria-atomic","true"),c.className="sr-only",c.textContent="Feedback dialog opened. You can provide additional details about your downvote.",document.body.appendChild(c),setTimeout(()=>document.body.removeChild(c),1e3)},0)},[O,d,o,u]),W=P.useCallback(c=>{m(c.target.value)},[]),i=P.useCallback(async()=>{const c=y.trim().length>0;if(c){const v={tx_id:d,vote:"downvote",explanation:y,...o&&{extra_metadata:o},...u&&{trigger_name:u}};try{w(!0),await O(v)}finally{w(!1)}}if(p(!1),m(t),R.current?.focus(),c){const v=document.createElement("div");v.setAttribute("aria-live","polite"),v.className="sr-only",v.textContent="Feedback submitted successfully.",document.body.appendChild(v),setTimeout(()=>document.body.removeChild(v),1e3)}},[O,y,t,d,o,u]),l=P.useCallback(c=>{if(c.key==="Escape")p(!1),m(t),R.current?.focus();else if((c.metaKey||c.ctrlKey)&&c.key==="Enter")c.preventDefault(),i().then(v=>{});else if(c.key==="Tab"&&f){const v=document.getElementById(x);if(v){const A=v.querySelectorAll('button, textarea, input, select, a[href], [tabindex]:not([tabindex="-1"])'),C=A[0],Y=A[A.length-1];c.shiftKey&&document.activeElement===C?(c.preventDefault(),Y?.focus()):!c.shiftKey&&document.activeElement===Y&&(c.preventDefault(),C?.focus())}}},[i,f,x,t]),s={onFeedback:O,showPopover:f,setShowPopover:p,feedbackText:y,setFeedbackText:m,isSubmitting:S,setIsSubmitting:w,vote:k,handleUpvote:D,handleDownvote:F,handleTextareaChange:W,handleSubmit:i,handleKeyDown:l,textareaRef:g,triggerRef:R,popoverId:x,triggerId:b,tx_id:d,extra_metadata:o,trigger_name:u};return L.jsx(ce.Provider,{value:s,children:n})},UpvoteButton:({asChild:n,children:e,onClick:t,...r})=>{const{handleUpvote:o,isSubmitting:u,vote:d}=$(),f=P.useCallback(m=>{o(),t?.(m)},[o,t]),p={...r,onClick:f,disabled:u||r.disabled,"aria-label":r["aria-label"]||"Upvote feedback",type:"button"},y=d==="upvote";if(n){const m=typeof e=="function"?e({isSelected:y}):e;if(P.isValidElement(m))return P.cloneElement(m,q(p,m.props))}return L.jsx("button",{...p,children:typeof e=="function"?e({isSelected:y}):e})},DownvoteButton:({asChild:n,children:e,onClick:t,...r})=>{const{handleDownvote:o,showPopover:u,isSubmitting:d,popoverId:f,triggerId:p,triggerRef:y,vote:m}=$(),S=P.useCallback(h=>{o(),t?.(h)},[o,t]),w={...r,ref:y,onClick:S,disabled:d||r.disabled,"aria-label":r["aria-label"]||"Downvote feedback","aria-expanded":u,"aria-controls":f,id:p,type:"button"},k=m==="downvote";if(n){const h=typeof e=="function"?e({isSelected:k}):e;if(P.isValidElement(h))return P.cloneElement(h,q(w,h.props));if(h)return h}return L.jsx("button",{...w,children:typeof e=="function"?e({isSelected:k}):e})},Popover:({asChild:n,children:e,...t})=>{const{showPopover:r,handleKeyDown:o,popoverId:u,triggerId:d}=$();if(!r)return null;const f={...t,role:"dialog","aria-labelledby":d,"aria-modal":!0,"aria-describedby":`${u}-description`,id:u,onKeyDown:o,tabIndex:-1};return n&&P.isValidElement(e)?L.jsxs(L.Fragment,{children:[P.cloneElement(e,q(f,e.props)),L.jsx("div",{id:`${u}-description`,className:"sr-only",children:"Provide additional feedback for your downvote"})]}):L.jsxs("div",{...f,children:[L.jsx("div",{id:`${u}-description`,className:"sr-only",children:"Provide additional feedback for your downvote"}),e]})},Textarea:({asChild:n,value:e,onChange:t,...r})=>{const{feedbackText:o,handleTextareaChange:u,textareaRef:d,handleKeyDown:f,popoverId:p}=$(),y={...r,ref:d,value:e!==void 0?e:o,onChange:t||u,onKeyDown:f,placeholder:r.placeholder||"What did we miss?","aria-label":r["aria-label"]||"Additional feedback","aria-describedby":`${p}-help`,rows:r.rows||3};return n&&P.isValidElement(r.children)?P.cloneElement(r.children,q(y,r.children.props)):L.jsx("textarea",{...y})},SubmitButton:({asChild:n,children:e,onClick:t,...r})=>{const{handleSubmit:o,isSubmitting:u,feedbackText:d}=$(),f=P.useCallback(S=>{o(),t?.(S)},[o,t]),p=d.trim().length>0,y=p?"Submit feedback":"Close without feedback",m={...r,onClick:f,disabled:u||r.disabled,type:"button","aria-label":r["aria-label"]||y,"aria-describedby":p?void 0:"submit-help"};return n&&P.isValidElement(e)?L.jsxs(L.Fragment,{children:[P.cloneElement(e,q(m,e.props)),!p&&L.jsx("span",{id:"submit-help",className:"sr-only",children:"This will close the dialog without submitting feedback"})]}):L.jsxs("button",{...m,children:[e,!p&&L.jsx("span",{id:"submit-help",className:"sr-only",children:"This will close the dialog without submitting feedback"})]})}};var te={exports:{}},Ae=te.exports,fe;function _e(){return fe||(fe=1,function(n,e){(function(t,r){var o=r(t);n.exports=o})(Ae,function(t){var r=["N","E","A","D"];function o(i,l){i.super_=l,i.prototype=Object.create(l.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}})}function u(i,l){Object.defineProperty(this,"kind",{value:i,enumerable:!0}),l&&l.length&&Object.defineProperty(this,"path",{value:l,enumerable:!0})}function d(i,l,s){d.super_.call(this,"E",i),Object.defineProperty(this,"lhs",{value:l,enumerable:!0}),Object.defineProperty(this,"rhs",{value:s,enumerable:!0})}o(d,u);function f(i,l){f.super_.call(this,"N",i),Object.defineProperty(this,"rhs",{value:l,enumerable:!0})}o(f,u);function p(i,l){p.super_.call(this,"D",i),Object.defineProperty(this,"lhs",{value:l,enumerable:!0})}o(p,u);function y(i,l,s){y.super_.call(this,"A",i),Object.defineProperty(this,"index",{value:l,enumerable:!0}),Object.defineProperty(this,"item",{value:s,enumerable:!0})}o(y,u);function m(i,l,s){var c=i.slice(l+1||i.length);return i.length=l<0?i.length+l:l,i.push.apply(i,c),i}function S(i){var l=typeof i;return l!=="object"?l:i===Math?"math":i===null?"null":Array.isArray(i)?"array":Object.prototype.toString.call(i)==="[object Date]"?"date":typeof i.toString=="function"&&/^\/.*\//.test(i.toString())?"regexp":"object"}function w(i){var l=0;if(i.length===0)return l;for(var s=0;s<i.length;s++){var c=i.charCodeAt(s);l=(l<<5)-l+c,l=l&l}return l}function k(i){var l=0,s=S(i);if(s==="array"){i.forEach(function(Y){l+=k(Y)});var c="[type: array, hash: "+l+"]";return l+w(c)}if(s==="object"){for(var v in i)if(i.hasOwnProperty(v)){var A="[ type: object, key: "+v+", value hash: "+k(i[v])+"]";l+=w(A)}return l}var C="[ type: "+s+" ; value: "+i+"]";return l+w(C)}function h(i,l,s,c,v,A,C,Y){s=s||[],v=v||[],C=C||[];var I=v.slice(0);if(typeof A<"u"&&A!==null){if(c){if(typeof c=="function"&&c(I,A))return;if(typeof c=="object"){if(c.prefilter&&c.prefilter(I,A))return;if(c.normalize){var B=c.normalize(I,A,i,l);B&&(i=B[0],l=B[1])}}}I.push(A)}S(i)==="regexp"&&S(l)==="regexp"&&(i=i.toString(),l=l.toString());var V=typeof i,re=typeof l,a,T,_,j,K=V!=="undefined"||C&&C.length>0&&C[C.length-1].lhs&&Object.getOwnPropertyDescriptor(C[C.length-1].lhs,A),z=re!=="undefined"||C&&C.length>0&&C[C.length-1].rhs&&Object.getOwnPropertyDescriptor(C[C.length-1].rhs,A);if(!K&&z)s.push(new f(I,l));else if(!z&&K)s.push(new p(I,i));else if(S(i)!==S(l))s.push(new d(I,i,l));else if(S(i)==="date"&&i-l!==0)s.push(new d(I,i,l));else if(V==="object"&&i!==null&&l!==null){for(a=C.length-1;a>-1;--a)if(C[a].lhs===i){j=!0;break}if(j)i!==l&&s.push(new d(I,i,l));else{if(C.push({lhs:i,rhs:l}),Array.isArray(i)){for(Y&&(i.sort(function(N,U){return k(N)-k(U)}),l.sort(function(N,U){return k(N)-k(U)})),a=l.length-1,T=i.length-1;a>T;)s.push(new y(I,a,new f(void 0,l[a--])));for(;T>a;)s.push(new y(I,T,new p(void 0,i[T--])));for(;a>=0;--a)h(i[a],l[a],s,c,I,a,C,Y)}else{var G=Object.keys(i),J=Object.keys(l);for(a=0;a<G.length;++a)_=G[a],j=J.indexOf(_),j>=0?(h(i[_],l[_],s,c,I,_,C,Y),J[j]=null):h(i[_],void 0,s,c,I,_,C,Y);for(a=0;a<J.length;++a)_=J[a],_&&h(void 0,l[_],s,c,I,_,C,Y)}C.length=C.length-1}}else i!==l&&(V==="number"&&isNaN(i)&&isNaN(l)||s.push(new d(I,i,l)))}function g(i,l,s,c,v){var A=[];if(h(i,l,A,c,null,null,null,v),s)for(var C=0;C<A.length;++C)s(A[C]);return A}function R(i,l,s,c,v,A,C){return h(i,l,s,c,v,A,C,!0)}function x(i,l,s,c){var v=c?function(C){C&&c.push(C)}:void 0,A=g(i,l,v,s);return c||(A.length?A:void 0)}function b(i,l,s,c){var v=c?function(C){C&&c.push(C)}:void 0,A=g(i,l,v,s,!0);return c||(A.length?A:void 0)}function E(i,l,s){if(s.path&&s.path.length){var c=i[l],v,A=s.path.length-1;for(v=0;v<A;v++)c=c[s.path[v]];switch(s.kind){case"A":E(c[s.path[v]],s.index,s.item);break;case"D":delete c[s.path[v]];break;case"E":case"N":c[s.path[v]]=s.rhs;break}}else switch(s.kind){case"A":E(i[l],s.index,s.item);break;case"D":i=m(i,l);break;case"E":case"N":i[l]=s.rhs;break}return i}function O(i,l,s){if(typeof s>"u"&&l&&~r.indexOf(l.kind)&&(s=l),i&&s&&s.kind){for(var c=i,v=-1,A=s.path?s.path.length-1:0;++v<A;)typeof c[s.path[v]]>"u"&&(c[s.path[v]]=typeof s.path[v+1]<"u"&&typeof s.path[v+1]=="number"?[]:{}),c=c[s.path[v]];switch(s.kind){case"A":s.path&&typeof c[s.path[v]]>"u"&&(c[s.path[v]]=[]),E(s.path?c[s.path[v]]:c,s.index,s.item);break;case"D":delete c[s.path[v]];break;case"E":case"N":c[s.path[v]]=s.rhs;break}}}function D(i,l,s){if(s.path&&s.path.length){var c=i[l],v,A=s.path.length-1;for(v=0;v<A;v++)c=c[s.path[v]];switch(s.kind){case"A":D(c[s.path[v]],s.index,s.item);break;case"D":c[s.path[v]]=s.lhs;break;case"E":c[s.path[v]]=s.lhs;break;case"N":delete c[s.path[v]];break}}else switch(s.kind){case"A":D(i[l],s.index,s.item);break;case"D":i[l]=s.lhs;break;case"E":i[l]=s.lhs;break;case"N":i=m(i,l);break}return i}function F(i,l,s){if(i&&l&&s&&s.kind){var c=i,v,A;for(A=s.path.length-1,v=0;v<A;v++)typeof c[s.path[v]]>"u"&&(c[s.path[v]]={}),c=c[s.path[v]];switch(s.kind){case"A":D(c[s.path[v]],s.index,s.item);break;case"D":c[s.path[v]]=s.lhs;break;case"E":c[s.path[v]]=s.lhs;break;case"N":delete c[s.path[v]];break}}}function W(i,l,s){if(i&&l){var c=function(v){(!s||s(i,l,v))&&O(i,l,v)};g(i,l,c)}}return Object.defineProperties(x,{diff:{value:x,enumerable:!0},orderIndependentDiff:{value:b,enumerable:!0},observableDiff:{value:g,enumerable:!0},orderIndependentObservableDiff:{value:R,enumerable:!0},orderIndepHash:{value:k,enumerable:!0},applyDiff:{value:W,enumerable:!0},applyChange:{value:O,enumerable:!0},revertChange:{value:F,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),x.DeepDiff=x,t&&(t.DeepDiff=x),x})}(te)),te.exports}var de=_e(),ne={exports:{}};const H=new Uint32Array(65536),je=(n,e)=>{const t=n.length,r=e.length,o=1<<t-1;let u=-1,d=0,f=t,p=t;for(;p--;)H[n.charCodeAt(p)]|=1<<p;for(p=0;p<r;p++){let y=H[e.charCodeAt(p)];const m=y|d;y|=(y&u)+u^u,d|=~(y|u),u&=y,d&o&&f++,u&o&&f--,d=d<<1|1,u=u<<1|~(m|d),d&=m}for(p=t;p--;)H[n.charCodeAt(p)]=0;return f},Ne=(n,e)=>{const t=e.length,r=n.length,o=[],u=[],d=Math.ceil(t/32),f=Math.ceil(r/32);for(let h=0;h<d;h++)u[h]=-1,o[h]=0;let p=0;for(;p<f-1;p++){let h=0,g=-1;const R=p*32,x=Math.min(32,r)+R;for(let b=R;b<x;b++)H[n.charCodeAt(b)]|=1<<b;for(let b=0;b<t;b++){const E=H[e.charCodeAt(b)],O=u[b/32|0]>>>b&1,D=o[b/32|0]>>>b&1,F=E|h,W=((E|D)&g)+g^g|E|D;let i=h|~(W|g),l=g&W;i>>>31^O&&(u[b/32|0]^=1<<b),l>>>31^D&&(o[b/32|0]^=1<<b),i=i<<1|O,l=l<<1|D,g=l|~(F|i),h=i&F}for(let b=R;b<x;b++)H[n.charCodeAt(b)]=0}let y=0,m=-1;const S=p*32,w=Math.min(32,r-S)+S;for(let h=S;h<w;h++)H[n.charCodeAt(h)]|=1<<h;let k=r;for(let h=0;h<t;h++){const g=H[e.charCodeAt(h)],R=u[h/32|0]>>>h&1,x=o[h/32|0]>>>h&1,b=g|y,E=((g|x)&m)+m^m|g|x;let O=y|~(E|m),D=m&E;k+=O>>>r-1&1,k-=D>>>r-1&1,O>>>31^R&&(u[h/32|0]^=1<<h),D>>>31^x&&(o[h/32|0]^=1<<h),O=O<<1|R,D=D<<1|x,m=D|~(b|O),y=O&b}for(let h=S;h<w;h++)H[n.charCodeAt(h)]=0;return k},pe=(n,e)=>{if(n.length<e.length){const t=e;e=n,n=t}return e.length===0?n.length:n.length<=32?je(n,e):Ne(n,e)},Ie=Pe(Object.freeze(Object.defineProperty({__proto__:null,closest:(n,e)=>{let t=1/0,r=0;for(let o=0;o<e.length;o++){const u=pe(n,e[o]);u<t&&(t=u,r=o)}return e[r]},distance:pe},Symbol.toStringTag,{value:"Module"})));var he;function Fe(){return he||(he=1,function(n,e){(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null}catch{console.log("Collator could not be initialized and wouldn't be used")}var r=Ie,o=[],u=[],d={get:function(f,p,y){var m=y&&t&&y.useCollator;if(m){var S=f.length,w=p.length;if(S===0)return w;if(w===0)return S;var k,h,g,R,x;for(g=0;g<w;++g)o[g]=g,u[g]=p.charCodeAt(g);o[w]=w;var b;for(g=0;g<S;++g){for(h=g+1,R=0;R<w;++R)k=h,b=t.compare(f.charAt(g),String.fromCharCode(u[R]))===0,h=o[R]+(b?0:1),x=k+1,h>x&&(h=x),x=o[R+1]+1,h>x&&(h=x),o[R]=k;o[R]=h}return h}return r.distance(f,p)}};n!==null&&n.exports===e?n.exports=d:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=d:typeof window<"u"&&window!==null&&(window.Levenshtein=d)})()}(ne,ne.exports)),ne.exports}var Le=Fe();const Me=Ee(Le);class We{diff(e,t,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const u=this.castInput(e,r),d=this.castInput(t,r),f=this.removeEmpty(this.tokenize(u,r)),p=this.removeEmpty(this.tokenize(d,r));return this.diffWithOptionsObj(f,p,r,o)}diffWithOptionsObj(e,t,r,o){var u;const d=b=>{if(b=this.postProcess(b,r),o){setTimeout(function(){o(b)},0);return}else return b},f=t.length,p=e.length;let y=1,m=f+p;r.maxEditLength!=null&&(m=Math.min(m,r.maxEditLength));const S=(u=r.timeout)!==null&&u!==void 0?u:1/0,w=Date.now()+S,k=[{oldPos:-1,lastComponent:void 0}];let h=this.extractCommon(k[0],t,e,0,r);if(k[0].oldPos+1>=p&&h+1>=f)return d(this.buildValues(k[0].lastComponent,t,e));let g=-1/0,R=1/0;const x=()=>{for(let b=Math.max(g,-y);b<=Math.min(R,y);b+=2){let E;const O=k[b-1],D=k[b+1];O&&(k[b-1]=void 0);let F=!1;if(D){const i=D.oldPos-b;F=D&&0<=i&&i<f}const W=O&&O.oldPos+1<p;if(!F&&!W){k[b]=void 0;continue}if(!W||F&&O.oldPos<D.oldPos?E=this.addToPath(D,!0,!1,0,r):E=this.addToPath(O,!1,!0,1,r),h=this.extractCommon(E,t,e,b,r),E.oldPos+1>=p&&h+1>=f)return d(this.buildValues(E.lastComponent,t,e))||!0;k[b]=E,E.oldPos+1>=p&&(R=Math.min(R,b-1)),h+1>=f&&(g=Math.max(g,b+1))}y++};if(o)(function b(){setTimeout(function(){if(y>m||Date.now()>w)return o(void 0);x()||b()},0)})();else for(;y<=m&&Date.now()<=w;){const b=x();if(b)return b}}addToPath(e,t,r,o,u){const d=e.lastComponent;return d&&!u.oneChangePerToken&&d.added===t&&d.removed===r?{oldPos:e.oldPos+o,lastComponent:{count:d.count+1,added:t,removed:r,previousComponent:d.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:t,removed:r,previousComponent:d}}}extractCommon(e,t,r,o,u){const d=t.length,f=r.length;let p=e.oldPos,y=p-o,m=0;for(;y+1<d&&p+1<f&&this.equals(r[p+1],t[y+1],u);)y++,p++,m++,u.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!u.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=p,y}equals(e,t,r){return r.comparator?r.comparator(e,t):e===t||!!r.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,r){const o=[];let u;for(;e;)o.push(e),u=e.previousComponent,delete e.previousComponent,e=u;o.reverse();const d=o.length;let f=0,p=0,y=0;for(;f<d;f++){const m=o[f];if(m.removed)m.value=this.join(r.slice(y,y+m.count)),y+=m.count;else{if(!m.added&&this.useLongestToken){let S=t.slice(p,p+m.count);S=S.map(function(w,k){const h=r[y+k];return h.length>w.length?h:w}),m.value=this.join(S)}else m.value=this.join(t.slice(p,p+m.count));p+=m.count,m.added||(y+=m.count)}}return o}}class Ye extends We{constructor(){super(...arguments),this.tokenize=Ke}equals(e,t,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
|
|
23
|
+
`))&&(e=e.trim()),(!r.newlineIsToken||!t.includes(`
|
|
24
|
+
`))&&(t=t.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
|
|
25
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
26
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,r)}}const ze=new Ye;function me(n,e,t){return ze.diff(n,e,t)}function Ke(n,e){e.stripTrailingCr&&(n=n.replace(/\r\n/g,`
|
|
27
|
+
`));const t=[],r=n.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const u=r[o];o%2&&!e.newlineIsToken?t[t.length-1]+=u:t.push(u)}return t}function be(n,e,t,r,o,u,d){let f;d?typeof d=="function"?f={callback:d}:f=d:f={},typeof f.context>"u"&&(f.context=4);const p=f.context;if(f.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(f.callback){const{callback:m}=f;me(t,r,Object.assign(Object.assign({},f),{callback:S=>{const w=y(S);m(w)}}))}else return y(me(t,r,f));function y(m){if(!m)return;m.push({value:"",lines:[]});function S(b){return b.map(function(E){return" "+E})}const w=[];let k=0,h=0,g=[],R=1,x=1;for(let b=0;b<m.length;b++){const E=m[b],O=E.lines||He(E.value);if(E.lines=O,E.added||E.removed){if(!k){const D=m[b-1];k=R,h=x,D&&(g=p>0?S(D.lines.slice(-p)):[],k-=g.length,h-=g.length)}for(const D of O)g.push((E.added?"+":"-")+D);E.added?x+=O.length:R+=O.length}else{if(k)if(O.length<=p*2&&b<m.length-2)for(const D of S(O))g.push(D);else{const D=Math.min(O.length,p);for(const W of S(O.slice(0,D)))g.push(W);const F={oldStart:k,oldLines:R-k+D,newStart:h,newLines:x-h+D,lines:g};w.push(F),k=0,h=0,g=[]}R+=O.length,x+=O.length}}for(const b of w)for(let E=0;E<b.lines.length;E++)b.lines[E].endsWith(`
|
|
28
|
+
`)?b.lines[E]=b.lines[E].slice(0,-1):(b.lines.splice(E+1,0,"\"),E++);return{oldFileName:n,newFileName:e,oldHeader:o,newHeader:u,hunks:w}}}function ie(n){if(Array.isArray(n))return n.map(ie).join(`
|
|
29
|
+
`);const e=[];n.oldFileName==n.newFileName&&e.push("Index: "+n.oldFileName),e.push("==================================================================="),e.push("--- "+n.oldFileName+(typeof n.oldHeader>"u"?"":" "+n.oldHeader)),e.push("+++ "+n.newFileName+(typeof n.newHeader>"u"?"":" "+n.newHeader));for(let t=0;t<n.hunks.length;t++){const r=n.hunks[t];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),e.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@");for(const o of r.lines)e.push(o)}return e.join(`
|
|
30
30
|
`)+`
|
|
31
|
-
`}function Ue(
|
|
32
|
-
`),
|
|
33
|
-
`).map(
|
|
34
|
-
`);return e?
|
|
31
|
+
`}function Ue(n,e,t,r,o,u,d){if(typeof d=="function"&&(d={callback:d}),d?.callback){const{callback:f}=d;be(n,e,t,r,o,u,Object.assign(Object.assign({},d),{callback:p=>{f(p?ie(p):void 0)}}))}else{const f=be(n,e,t,r,o,u,d);return f?ie(f):void 0}}function He(n){const e=n.endsWith(`
|
|
32
|
+
`),t=n.split(`
|
|
33
|
+
`).map(r=>r+`
|
|
34
|
+
`);return e?t.pop():t.push(t.pop().slice(0,-1)),t}function Je(n,e,t="git",r=3){switch(t){case"git":return ve(n,e,r);case"object":return Be(n,e);case"json":return Ve(n,e);default:return ve(n,e,r)}}function ve(n,e,t=3){const r=ke(n),o=ke(e);return Ue("","",r,o,"","",{context:t}).split(`
|
|
35
35
|
`).slice(2).join(`
|
|
36
|
-
`)}function Be(
|
|
36
|
+
`)}function Be(n,e){const t=de.diff(n,e)||[];return JSON.stringify(t,null,2)}function Ve(n,e){return JSON.stringify({before:n,after:e},null,2)}function Ge(n,e){return typeof n=="string"&&typeof e=="string"?ye(n,e):typeof n=="number"&&typeof e=="number"?we(n,e):Xe(n,e)}function ye(n,e){if(n===e)return 0;if(n.length===0||e.length===0)return 1;const t=Me.get(n,e),r=Math.max(n.length,e.length);return t/r}function we(n,e){if(n===e)return 0;if(n===0)return 1;const t=Math.abs(e-n),r=Math.max(Math.abs(n),Math.abs(e));return Math.min(t/r,1)}function Xe(n,e){if(n===e)return 0;const t=de.diff(n,e)||[];if(t.length===0)return 0;const r=ge(n),o=ge(e),u=Math.max(r,o);if(u===0)return 0;let d=0;for(const f of t)switch(f.kind){case"N":d+=1;break;case"D":d+=1;break;case"E":if(typeof f.lhs=="string"&&typeof f.rhs=="string"){const p=ye(f.lhs,f.rhs);d+=p}else if(typeof f.lhs=="number"&&typeof f.rhs=="number"){const p=we(f.lhs,f.rhs);d+=p}else d+=1;break;case"A":d+=.5;break}return Math.min(d/u,1)}function ge(n){if(n==null)return 0;if(typeof n!="object")return 1;if(Array.isArray(n))return n.length;let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e+=1);return e}function ke(n){try{return JSON.stringify(n,(e,t)=>typeof t=="function"?"[Function]":t===void 0?"[undefined]":t===1/0?"[Infinity]":Number.isNaN(t)?"[NaN]":t,2)}catch{return String(n)}}function Ze(n,e,t){const r=oe(),o=t?.onFeedback||r,u=t?.debounceMs??1500,d=t?.diffType??"git",f=t?.compareWith,p=t?.default_trigger_name??"auto_state_change",y=P.useRef(n),m=P.useRef(n),S=P.useRef(!0),w=P.useRef(null),k=P.useRef(void 0),h=P.useCallback((R,x,b)=>{const E=Ge(R,x),O=Je(R,x,d);let D;t?.vote?typeof t.vote=="function"?D=t.vote(R,x,E):D=t.vote:D=E>.5?"downvote":"upvote";const F=typeof e=="function"?e(x):e;o({tx_id:F,vote:D,explanation:`State change with diff percentage: ${(E*100).toFixed(1)}%`,correction:O,source:"IMPLICIT",extra_metadata:t?.metadata,trigger_name:b})},[t,e,d,o]),g=P.useCallback(R=>{const x=R||p;if(w.current&&k.current&&k.current!==x){clearTimeout(w.current);const b=m.current;h(b,n,k.current),w.current=null}k.current=x},[n,p,h]);return P.useEffect(()=>{if(S.current){S.current=!1,y.current=n,m.current=n;return}const R=y.current;return(f?f(R,n):JSON.stringify(R)===JSON.stringify(n))||(w.current||(m.current=R),w.current&&clearTimeout(w.current),y.current=n,w.current=setTimeout(()=>{const b=m.current,E=n;h(b,E,k.current||p),m.current=E,w.current=null},u)),()=>{w.current&&clearTimeout(w.current)}},[n,e,t,o,d,u,f,p,h]),{notifyChange:g}}function Qe(n,e,t){const[r,o]=P.useState(n),{notifyChange:u}=Ze(r,e,t),d=P.useCallback((f,p)=>{u(p),o(y=>typeof f=="function"?f(y):f)},[u]);return[r,d]}let qe=()=>{try{return require("@opentelemetry/api")}catch{throw new Error("OpenTelemetry is not available. Install @opentelemetry/api to use trace ID extraction.")}};function $e(){const{trace:n,context:e}=qe();try{const t=n.getSpanContext(e.active());if(t?.traceId)return t.traceId;const r=n.getSpan(e.active());if(r){const o=r.spanContext();if(o.traceId)return o.traceId}}catch(t){throw new Error(`Failed to extract OpenTelemetry trace ID: ${t instanceof Error?t.message:"Unknown error"}`)}throw new Error("OpenTelemetry trace ID not available. Ensure XHR/Fetch instrumentation is active and a request is in progress.")}M.KeletContext=Q,M.KeletProvider=De,M.VoteFeedback=Se,M.getOtelTraceId=$e,M.useDefaultFeedbackHandler=oe,M.useFeedbackState=Qe,M.useKelet=Oe,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export type { FeedbackData, VoteFeedbackRootProps, UpvoteButtonProps, DownvoteBu
|
|
|
3
3
|
export { KeletProvider, KeletContext, useKelet, useDefaultFeedbackHandler, } from './contexts/kelet';
|
|
4
4
|
export { useFeedbackState } from './hooks/feedback-state';
|
|
5
5
|
export type { FeedbackStateOptions, DiffType } from './hooks/feedback-state';
|
|
6
|
+
export { getOtelTraceId } from './lib/otel-trace';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function _setOtelApiLoader(loader: () => {
|
|
2
|
+
trace: any;
|
|
3
|
+
context: any;
|
|
4
|
+
}): void;
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the current OpenTelemetry trace ID from the active span context.
|
|
7
|
+
*
|
|
8
|
+
* @throws Error if OpenTelemetry is not available or no trace is currently active
|
|
9
|
+
* @returns The trace ID string from the active OTEL span
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { getOtelTraceId } from '@kelet-ai/feedback-ui';
|
|
14
|
+
*
|
|
15
|
+
* // Use as function with VoteFeedback component
|
|
16
|
+
* <VoteFeedback.Root tx_id={getOtelTraceId} onFeedback={handleFeedback}>
|
|
17
|
+
* <VoteFeedback.UpvoteButton>👍</VoteFeedback.UpvoteButton>
|
|
18
|
+
* <VoteFeedback.DownvoteButton>👎</VoteFeedback.DownvoteButton>
|
|
19
|
+
* </VoteFeedback.Root>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function getOtelTraceId(): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface VoteFeedbackRootProps {
|
|
|
20
20
|
children: ReactNode;
|
|
21
21
|
onFeedback?: (data: FeedbackData) => void | Promise<void>;
|
|
22
22
|
defaultText?: string;
|
|
23
|
-
tx_id: string;
|
|
23
|
+
tx_id: string | (() => string);
|
|
24
24
|
extra_metadata?: Record<string, any>;
|
|
25
25
|
trigger_name?: string;
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kelet-ai/feedback-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/kelet-ai/feedback-ui.git"
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"module": "./dist/feedback-ui.es.js",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@chromatic-com/storybook": "^4.1.0",
|
|
12
|
+
"@opentelemetry/api": "^1.9.0",
|
|
12
13
|
"@radix-ui/react-popover": "^1.1.14",
|
|
13
14
|
"@radix-ui/react-slot": "^1.2.3",
|
|
14
15
|
"@storybook/addon-a11y": "^9.1.0",
|
|
@@ -54,7 +55,13 @@
|
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
56
57
|
"react": "^19.1.0",
|
|
57
|
-
"react-dom": "^19.1.0"
|
|
58
|
+
"react-dom": "^19.1.0",
|
|
59
|
+
"@opentelemetry/api": "^1.9.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@opentelemetry/api": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
58
65
|
},
|
|
59
66
|
"exports": {
|
|
60
67
|
".": {
|
package/dist/lib/utils.d.ts
DELETED