mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
1 line
18 KiB
JavaScript
Vendored
1 line
18 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5348],{63606:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1413),o=n(67294),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},l=n(42135),i=function(e,t){return o.createElement(l.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:a}))};i.displayName="CheckOutlined";var c=o.forwardRef(i)},34952:function(e,t,n){"use strict";var r=n(87462),o=n(15105),a=n(67294),l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},i={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},c=a.forwardRef(function(e,t){var n=e.style,c=e.noStyle,u=e.disabled,s=l(e,["style","noStyle","disabled"]),f={};return c||(f=(0,r.Z)({},i)),u&&(f.pointerEvents="none"),f=(0,r.Z)((0,r.Z)({},f),n),a.createElement("div",(0,r.Z)({role:"button",tabIndex:0,ref:t},s,{onKeyDown:function(e){e.keyCode===o.Z.ENTER&&e.preventDefault()},onKeyUp:function(t){var n=t.keyCode,r=e.onClick;n===o.Z.ENTER&&r&&r()},style:f}))});t.Z=c},85818:function(e,t,n){"use strict";n.d(t,{default:function(){return el}});var r=n(87462),o=n(67294),a=n(4942),l=n(71002),i=n(97685),c=n(63606),u=n(1413),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},f=n(42135),d=function(e,t){return o.createElement(f.Z,(0,u.Z)((0,u.Z)({},e),{},{ref:t,icon:s}))};d.displayName="CopyOutlined";var p=o.forwardRef(d),v={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},m=function(e,t){return o.createElement(f.Z,(0,u.Z)((0,u.Z)({},e),{},{ref:t,icon:v}))};m.displayName="EditOutlined";var y=o.forwardRef(m),b=n(94184),g=n.n(b),h=n(20640),E=n.n(h),Z=n(48555),w=n(50344),x=n(8410),O=n(21770),C=n(98423),S=n(42550),k=n(53124),R=n(23715),j=n(34952),P=n(79370),N=n(94199),z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},D=function(e,t){return o.createElement(f.Z,(0,u.Z)((0,u.Z)({},e),{},{ref:t,icon:z}))};D.displayName="EnterOutlined";var M=o.forwardRef(D),I=n(15105),T=n(80173),A=n(96159),H=function(e){var t=e.prefixCls,n=e["aria-label"],r=e.className,l=e.style,c=e.direction,u=e.maxLength,s=e.autoSize,f=e.value,d=e.onSave,p=e.onCancel,v=e.onEnd,m=e.component,y=e.enterIcon,b=void 0===y?o.createElement(M,null):y,h=o.useRef(null),E=o.useRef(!1),Z=o.useRef(),w=o.useState(f),x=(0,i.Z)(w,2),O=x[0],C=x[1];o.useEffect(function(){C(f)},[f]),o.useEffect(function(){if(h.current&&h.current.resizableTextArea){var e=h.current.resizableTextArea.textArea;e.focus();var t=e.value.length;e.setSelectionRange(t,t)}},[]);var S=function(){d(O.trim())},k=m?"".concat(t,"-").concat(m):"",R=g()(t,"".concat(t,"-edit-content"),(0,a.Z)({},"".concat(t,"-rtl"),"rtl"===c),r,k);return o.createElement("div",{className:R,style:l},o.createElement(T.Z,{ref:h,maxLength:u,value:O,onChange:function(e){C(e.target.value.replace(/[\n\r]/g,""))},onKeyDown:function(e){var t=e.keyCode;E.current||(Z.current=t)},onKeyUp:function(e){var t=e.keyCode,n=e.ctrlKey,r=e.altKey,o=e.metaKey,a=e.shiftKey;Z.current!==t||E.current||n||r||o||a||(t===I.Z.ENTER?(S(),null==v||v()):t===I.Z.ESC&&p())},onCompositionStart:function(){E.current=!0},onCompositionEnd:function(){E.current=!1},onBlur:function(){S()},"aria-label":n,rows:1,autoSize:void 0===s||s}),null!==b?(0,A.Tm)(b,{className:"".concat(t,"-edit-content-confirm")}):null)};function L(e,t){return o.useMemo(function(){var n=!!e;return[n,(0,r.Z)((0,r.Z)({},t),n&&"object"===(0,l.Z)(e)?e:null)]},[e])}var K=function(e,t){var n=o.useRef(!1);o.useEffect(function(){n.current?e():n.current=!0},t)},U=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},_=o.forwardRef(function(e,t){var n=e.prefixCls,l=e.component,i=void 0===l?"article":l,c=e.className,u=e.setContentRef,s=e.children,f=e.direction,d=U(e,["prefixCls","component","className","setContentRef","children","direction"]),p=o.useContext(k.E_),v=p.getPrefixCls,m=p.direction,y=null!=f?f:m,b=t;u&&(b=(0,S.sQ)(t,u));var h=v("typography",n),E=g()(h,(0,a.Z)({},"".concat(h,"-rtl"),"rtl"===y),c);return o.createElement(i,(0,r.Z)({className:E,ref:b},d),s)});function B(e){var t=(0,l.Z)(e);return"string"===t||"number"===t}function V(e,t){for(var n=0,r=[],o=0;o<e.length;o+=1){if(n===t)return r;var a=e[o],l=n+(B(a)?String(a).length:1);if(l>t){var i=t-n;return r.push(String(a).slice(0,i)),r}r.push(a),n=l}return e}var W=function(e){var t=e.enabledMeasure,n=e.children,a=e.text,l=e.width,c=e.fontSize,u=e.rows,s=e.onEllipsis,f=o.useState([0,0,0]),d=(0,i.Z)(f,2),p=(0,i.Z)(d[0],3),v=p[0],m=p[1],y=p[2],b=d[1],g=o.useState(0),h=(0,i.Z)(g,2),E=h[0],Z=h[1],O=o.useState(0),C=(0,i.Z)(O,2),S=C[0],k=C[1],R=o.useRef(null),j=o.useRef(null),P=o.useMemo(function(){return(0,w.Z)(a)},[a]),N=o.useMemo(function(){var e;return e=0,P.forEach(function(t){B(t)?e+=String(t).length:e+=1}),e},[P]),z=o.useMemo(function(){return t&&3===E?n(V(P,m),m<N):n(P,!1)},[t,E,n,P,m,N]);(0,x.Z)(function(){t&&l&&c&&N&&(Z(1),b([0,Math.ceil(N/2),N]))},[t,l,c,a,N,u]),(0,x.Z)(function(){var e;1===E&&k((null===(e=R.current)||void 0===e?void 0:e.offsetHeight)||0)},[E]),(0,x.Z)(function(){var e,t;if(S){if(1===E)((null===(e=j.current)||void 0===e?void 0:e.offsetHeight)||0)<=u*S?(Z(4),s(!1)):Z(2);else if(2===E){if(v!==y){var n=(null===(t=j.current)||void 0===t?void 0:t.offsetHeight)||0,r=u*S,o=v,a=y;v===y-1?a=v:n<=r?o=m:a=m;var l=Math.ceil((o+a)/2);b([o,l,a])}else Z(3),s(!0)}}},[E,v,y,u,S]);var D=function(e,t,n){return o.createElement("span",{"aria-hidden":!0,ref:t,style:(0,r.Z)({position:"fixed",display:"block",left:0,top:0,zIndex:-9999,visibility:"hidden",pointerEvents:"none",fontSize:2*Math.floor(c/2)},n)},e)};return o.createElement(o.Fragment,null,z,t&&3!==E&&4!==E&&o.createElement(o.Fragment,null,D("lg",R,{wordBreak:"keep-all",whiteSpace:"nowrap"}),D(1===E?n(P,!1):n(V(P,m),!0),j,{width:l,whiteSpace:"normal",margin:0,padding:0})))},F=function(e){var t=e.enabledEllipsis,n=e.isEllipsis,a=e.children,l=e.tooltipProps;return(null==l?void 0:l.title)&&t?o.createElement(N.Z,(0,r.Z)({open:!!n&&void 0},l),a):a},G=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Q(e,t,n){return!0===e||void 0===e?t:e||n&&t}function X(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}var q=o.forwardRef(function(e,t){var n,u,s,f=e.prefixCls,d=e.className,v=e.style,m=e.type,b=e.disabled,h=e.children,z=e.ellipsis,D=e.editable,M=e.copyable,I=e.component,T=e.title,A=G(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),U=o.useContext(k.E_),B=U.getPrefixCls,V=U.direction,q=(0,R.E)("Text")[0],J=o.useRef(null),Y=o.useRef(null),$=B("typography",f),ee=(0,C.Z)(A,["mark","code","delete","underline","strong","keyboard","italic"]),et=L(D),en=(0,i.Z)(et,2),er=en[0],eo=en[1],ea=(0,O.Z)(!1,{value:eo.editing}),el=(0,i.Z)(ea,2),ei=el[0],ec=el[1],eu=eo.triggerType,es=void 0===eu?["icon"]:eu,ef=function(e){var t;e&&(null===(t=eo.onStart)||void 0===t||t.call(eo)),ec(e)};K(function(){var e;ei||null===(e=Y.current)||void 0===e||e.focus()},[ei]);var ed=function(e){null==e||e.preventDefault(),ef(!0)},ep=L(M),ev=(0,i.Z)(ep,2),em=ev[0],ey=ev[1],eb=o.useState(!1),eg=(0,i.Z)(eb,2),eh=eg[0],eE=eg[1],eZ=o.useRef(),ew={};ey.format&&(ew.format=ey.format);var ex=function(){window.clearTimeout(eZ.current)},eO=function(e){var t;null==e||e.preventDefault(),null==e||e.stopPropagation(),E()(ey.text||String(h)||"",ew),eE(!0),ex(),eZ.current=window.setTimeout(function(){eE(!1)},3e3),null===(t=ey.onCopy)||void 0===t||t.call(ey,e)};o.useEffect(function(){return ex},[]);var eC=o.useState(!1),eS=(0,i.Z)(eC,2),ek=eS[0],eR=eS[1],ej=o.useState(!1),eP=(0,i.Z)(ej,2),eN=eP[0],ez=eP[1],eD=o.useState(!1),eM=(0,i.Z)(eD,2),eI=eM[0],eT=eM[1],eA=o.useState(!1),eH=(0,i.Z)(eA,2),eL=eH[0],eK=eH[1],eU=o.useState(!1),e_=(0,i.Z)(eU,2),eB=e_[0],eV=e_[1],eW=o.useState(!0),eF=(0,i.Z)(eW,2),eG=eF[0],eQ=eF[1],eX=L(z,{expandable:!1}),eq=(0,i.Z)(eX,2),eJ=eq[0],eY=eq[1],e$=eJ&&!eI,e0=eY.rows,e1=void 0===e0?1:e0,e2=o.useMemo(function(){return!e$||void 0!==eY.suffix||eY.onEllipsis||eY.expandable||er||em},[e$,eY,er,em]);(0,x.Z)(function(){eJ&&!e2&&(eR((0,P.G)("webkitLineClamp")),ez((0,P.G)("textOverflow")))},[e2,eJ]);var e4=o.useMemo(function(){return!e2&&(1===e1?eN:ek)},[e2,eN,ek]),e3=e$&&(e4?eB:eL),e6=e$&&1===e1&&e4,e8=e$&&e1>1&&e4,e9=function(e){var t;eT(!0),null===(t=eY.onExpand)||void 0===t||t.call(eY,e)},e7=o.useState(0),e5=(0,i.Z)(e7,2),te=e5[0],tt=e5[1],tn=o.useState(0),tr=(0,i.Z)(tn,2),to=tr[0],ta=tr[1],tl=function(e){var t;eK(e),eL!==e&&(null===(t=eY.onEllipsis)||void 0===t||t.call(eY,e))};o.useEffect(function(){var e=J.current;if(eJ&&e4&&e){var t=e8?e.offsetHeight<e.scrollHeight:e.offsetWidth<e.scrollWidth;eB!==t&&eV(t)}},[eJ,e4,h,e8,eG]),o.useEffect(function(){var e=J.current;if("undefined"!=typeof IntersectionObserver&&e&&e4&&e$){var t=new IntersectionObserver(function(){eQ(!!e.offsetParent)});return t.observe(e),function(){t.disconnect()}}},[e4,e$]);var ti={};ti=!0===eY.tooltip?{title:null!==(n=eo.text)&&void 0!==n?n:h}:o.isValidElement(eY.tooltip)?{title:eY.tooltip}:"object"===(0,l.Z)(eY.tooltip)?(0,r.Z)({title:null!==(u=eo.text)&&void 0!==u?u:h},eY.tooltip):{title:eY.tooltip};var tc=o.useMemo(function(){var e=function(e){return["string","number"].includes((0,l.Z)(e))};return!eJ||e4?void 0:e(eo.text)?eo.text:e(h)?h:e(T)?T:e(ti.title)?ti.title:void 0},[eJ,e4,T,ti.title,e3]);if(ei)return o.createElement(H,{value:null!==(s=eo.text)&&void 0!==s?s:"string"==typeof h?h:"",onSave:function(e){var t;null===(t=eo.onChange)||void 0===t||t.call(eo,e),ef(!1)},onCancel:function(){var e;null===(e=eo.onCancel)||void 0===e||e.call(eo),ef(!1)},onEnd:eo.onEnd,prefixCls:$,className:d,style:v,direction:V,component:I,maxLength:eo.maxLength,autoSize:eo.autoSize,enterIcon:eo.enterIcon});var tu=function(){var e,t=eY.expandable,n=eY.symbol;return t?(e=n||q.expand,o.createElement("a",{key:"expand",className:"".concat($,"-expand"),onClick:e9,"aria-label":q.expand},e)):null},ts=function(){if(er){var e=eo.icon,t=eo.tooltip,n=(0,w.Z)(t)[0]||q.edit;return es.includes("icon")?o.createElement(N.Z,{key:"edit",title:!1===t?"":n},o.createElement(j.Z,{ref:Y,className:"".concat($,"-edit"),onClick:ed,"aria-label":"string"==typeof n?n:""},e||o.createElement(y,{role:"button"}))):null}},tf=function(){if(em){var e=ey.tooltips,t=ey.icon,n=X(e),r=X(t),a=eh?Q(n[1],q.copied):Q(n[0],q.copy),l=eh?q.copied:q.copy;return o.createElement(N.Z,{key:"copy",title:a},o.createElement(j.Z,{className:g()("".concat($,"-copy"),eh&&"".concat($,"-copy-success")),onClick:eO,"aria-label":"string"==typeof a?a:l},eh?Q(r[1],o.createElement(c.Z,null),!0):Q(r[0],o.createElement(p,null),!0)))}};return o.createElement(Z.default,{onResize:function(e,t){var n;tt(e.offsetWidth),ta(parseInt(null===(n=window.getComputedStyle)||void 0===n?void 0:n.call(window,t).fontSize,10)||0)},disabled:!e$||e4},function(n){var l;return o.createElement(F,{tooltipProps:ti,enabledEllipsis:e$,isEllipsis:e3},o.createElement(_,(0,r.Z)({className:g()((l={},(0,a.Z)(l,"".concat($,"-").concat(m),m),(0,a.Z)(l,"".concat($,"-disabled"),b),(0,a.Z)(l,"".concat($,"-ellipsis"),eJ),(0,a.Z)(l,"".concat($,"-single-line"),e$&&1===e1),(0,a.Z)(l,"".concat($,"-ellipsis-single-line"),e6),(0,a.Z)(l,"".concat($,"-ellipsis-multiple-line"),e8),l),d),prefixCls:f,style:(0,r.Z)((0,r.Z)({},v),{WebkitLineClamp:e8?e1:void 0}),component:I,ref:(0,S.sQ)(n,J,t),direction:V,onClick:es.includes("text")?ed:void 0,"aria-label":null==tc?void 0:tc.toString(),title:T},ee),o.createElement(W,{enabledMeasure:e$&&!e4,text:h,rows:e1,width:te,fontSize:to,onEllipsis:tl},function(t,n){var r=t;return t.length&&n&&tc&&(r=o.createElement("span",{key:"show-content","aria-hidden":!0},r)),function(e,t){var n=e.mark,r=e.code,a=e.underline,l=e.delete,i=e.strong,c=e.keyboard,u=e.italic,s=t;function f(e,t){e&&(s=o.createElement(t,{},s))}return f(i,"strong"),f(a,"u"),f(l,"del"),f(r,"code"),f(n,"mark"),f(c,"kbd"),f(u,"i"),s}(e,o.createElement(o.Fragment,null,r,[n&&o.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),eY.suffix,[n&&tu(),ts(),tf()]]))})))})}),J=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Y=o.forwardRef(function(e,t){var n=e.ellipsis,a=e.rel,l=J(e,["ellipsis","rel"]),i=(0,r.Z)((0,r.Z)({},l),{rel:void 0===a&&"_blank"===l.target?"noopener noreferrer":a});return delete i.navigate,o.createElement(q,(0,r.Z)({},i,{ref:t,ellipsis:!!n,component:"a"}))}),$=o.forwardRef(function(e,t){return o.createElement(q,(0,r.Z)({ref:t},e,{component:"div"}))}),ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},et=o.forwardRef(function(e,t){var n=e.ellipsis,a=ee(e,["ellipsis"]),i=o.useMemo(function(){return n&&"object"===(0,l.Z)(n)?(0,C.Z)(n,["expandable","rows"]):n},[n]);return o.createElement(q,(0,r.Z)({ref:t},a,{ellipsis:i,component:"span"}))}),en=n(93355),er=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},eo=(0,en.a)(1,2,3,4,5),ea=o.forwardRef(function(e,t){var n,a=e.level,l=void 0===a?1:a,i=er(e,["level"]);return n=eo.includes(l)?"h".concat(l):"h1",o.createElement(q,(0,r.Z)({ref:t},i,{component:n}))});_.Text=et,_.Link=Y,_.Title=ea,_.Paragraph=$;var el=_},20640:function(e,t,n){"use strict";var r=n(11742),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,l,i,c,u,s,f,d=!1;t||(t={}),l=t.debug||!1;try{if(c=r(),u=document.createRange(),s=document.getSelection(),(f=document.createElement("span")).textContent=e,f.ariaHidden="true",f.style.all="unset",f.style.position="fixed",f.style.top=0,f.style.clip="rect(0, 0, 0, 0)",f.style.whiteSpace="pre",f.style.webkitUserSelect="text",f.style.MozUserSelect="text",f.style.msUserSelect="text",f.style.userSelect="text",f.addEventListener("copy",function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),void 0===n.clipboardData){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=o[t.format]||o.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(f),u.selectNodeContents(f),s.addRange(u),!document.execCommand("copy"))throw Error("copy command was unsuccessful");d=!0}catch(r){l&&console.error("unable to copy using execCommand: ",r),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(r){l&&console.error("unable to copy using clipboardData: ",r),l&&console.error("falling back to prompt"),n="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",i=n.replace(/#{\s*key\s*}/g,a),window.prompt(i,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(u):s.removeAllRanges()),f&&document.body.removeChild(f),c()}return d}},79370:function(e,t,n){"use strict";n.d(t,{G:function(){return l}});var r=n(98924),o=function(e){if((0,r.Z)()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1},a=function(e,t){if(!o(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function l(e,t){return Array.isArray(e)||void 0===t?o(e):a(e,t)}},11742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}}}]); |