import{S as e,i as t,s as n,v as o,D as i,q as s,h as l,n as a,M as c,o as r,w as p,g as d,j as u,k as f,l as b,p as m,N as h,y as $,x,r as g,I as y,z as v,A as w,t as k,b as T,J as E,B as C,P as D,C as M,G as B,H as N,L as A,O as L,c as S,a as P,m as V,K as R,d as H,Y as O,E as _,F as j}from"./index.c2c9d961.js";import{B as I}from"./Button.37430222.js";import{C as q}from"./ChevronDown16.d70ae9ed.js";function Y(e){let t,n=(e[1]||e[5]["aria-label"])+"";return{c(){t=l(n)},l(e){t=a(e,n)},m(e,n){s(e,t,n)},p(e,o){34&o&&n!==(n=(e[1]||e[5]["aria-label"])+"")&&c(t,n)},d(e){e&&r(t)}}}function z(e){let t,n,C,D,M,B,N,A,L;const S=e[7].default,P=o(S,e,e[6],null),V=P||function(e){let t,n=e[3]&&Y(e);return{c(){n&&n.c(),t=i()},l(e){n&&n.l(e),t=i()},m(e,o){n&&n.m(e,o),s(e,t,o)},p(e,o){e[3]?n?n.p(e,o):(n=Y(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&r(t)}}}(e);let R=[{type:"button"},{"aria-live":"polite"},{"aria-label":M=e[3]?e[1]:void 0},e[5],{class:B=e[5].class+" "+(e[3]&&"bx--copy-btn--"+e[3])}],H={};for(let e=0;e()=>{clearTimeout(u)});return e.$$set=e=>{t=p(p({},t),M(e)),n(5,i=C(t,o)),"feedback"in e&&n(1,a=e.feedback),"feedbackTimeout"in e&&n(2,c=e.feedbackTimeout),"ref"in e&&n(0,r=e.ref),"$$scope"in e&&n(6,l=e.$$scope)},[r,a,c,d,u,i,l,s,function(t){B(e,t)},function(t){B(e,t)},function(e){N[e?"unshift":"push"](()=>{r=e,n(0,r)})},()=>{"fade-in"!==d&&(n(3,d="fade-in"),n(4,u=setTimeout(()=>{n(3,d="fade-out")},c)))},({animationName:e})=>{"hide-feedback"===e&&n(3,d=void 0)}]}class F extends e{constructor(e){super(),t(this,e,Z,z,n,{feedback:1,feedbackTimeout:2,ref:0})}}function G(e){let t,n;return{c(){t=A("title"),n=l(e[2])},l(o){t=f(o,"title",{},1);var i=b(t);n=a(i,e[2]),i.forEach(r)},m(e,o){s(e,t,o),g(t,n)},p(e,t){4&t&&c(n,e[2])},d(e){e&&r(t)}}}function J(e){let t,n,l,a,c,d;const u=e[8].default,m=o(u,e,e[7],null),$=m||function(e){let t,n=e[2]&&G(e);return{c(){n&&n.c(),t=i()},l(e){n&&n.l(e),t=i()},m(e,o){n&&n.m(e,o),s(e,t,o)},p(e,o){e[2]?n?n.p(e,o):(n=G(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&r(t)}}}(e);let x=[{"data-carbon-icon":"Copy16"},{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{width:"16"},{height:"16"},{class:e[0]},{preserveAspectRatio:"xMidYMid meet"},{style:e[3]},{id:e[1]},e[4]],C={};for(let e=0;e{n(18,t=p(p({},t),M(e))),"class"in e&&n(0,r=e.class),"id"in e&&n(1,d=e.id),"tabindex"in e&&n(5,u=e.tabindex),"focusable"in e&&n(6,f=e.focusable),"title"in e&&n(2,b=e.title),"style"in e&&n(3,m=e.style),"$$scope"in e&&n(7,c=e.$$scope)},e.$$.update=()=>{n(15,o=t["aria-label"]),n(16,i=t["aria-labelledby"]),98308&e.$$.dirty&&n(17,s=o||i||b),229472&e.$$.dirty&&n(4,l={"aria-label":o,"aria-labelledby":i,"aria-hidden":!s||void 0,role:s?"img":void 0,focusable:"0"===u||f,tabindex:u})},t=M(t),[r,d,b,m,l,u,f,c,a,function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)}]}class U extends e{constructor(e){super(),t(this,e,K,J,n,{class:0,id:1,tabindex:5,focusable:6,title:2,style:3})}}function Q(e){let t,n;return t=new U({props:{class:"bx--snippet__icon"}}),{c(){S(t.$$.fragment)},l(e){P(t.$$.fragment,e)},m(e,o){V(t,e,o),n=!0},p:O,i(e){n||(k(t.$$.fragment,e),n=!0)},o(e){T(t.$$.fragment,e),n=!1},d(e){H(t,e)}}}function W(e){let t,n;const o=[{class:"bx--copy-btn"},{"aria-label":e[0]},{title:e[0]},e[1]];let i={$$slots:{default:[Q]},$$scope:{ctx:e}};for(let e=0;e{t=p(p({},t),M(e)),n(1,i=C(t,o)),"iconDescription"in e&&n(0,s=e.iconDescription)},[s,i,function(t){B(e,t)},function(t){B(e,t)}]}class ee extends e{constructor(e){super(),t(this,e,X,W,n,{iconDescription:0})}}function te(e){let t,n,o,i,l;return{c(){t=d("span"),n=u(),o=d("span"),i=u(),l=d("span")},l(e){t=f(e,"SPAN",{}),b(t).forEach(r),n=m(e),o=f(e,"SPAN",{}),b(o).forEach(r),i=m(e),l=f(e,"SPAN",{}),b(l).forEach(r)},m(e,a){s(e,t,a),s(e,n,a),s(e,o,a),s(e,i,a),s(e,l,a)},d(e){e&&r(t),e&&r(n),e&&r(o),e&&r(i),e&&r(l)}}}function ne(e){let t;return{c(){t=d("span")},l(e){t=f(e,"SPAN",{}),b(t).forEach(r)},m(e,n){s(e,t,n)},d(e){e&&r(t)}}}function oe(e){let t,n,o,i;function l(e,t){return"single"===e[0]?ne:"multi"===e[0]?te:void 0}let a=l(e),c=a&&a(e),u=[e[1]],m={};for(let e=0;e{t=p(p({},t),M(e)),n(1,i=C(t,o)),"type"in e&&n(0,s=e.type)},[s,i,function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)}]}class se extends e{constructor(e){super(),t(this,e,ie,oe,n,{type:0})}}function le(e){let t,n,i,C,D,M,B,N,A,L,S,P,V;const R=e[17].default,H=o(R,e,e[33],null),O=H||function(e){let t;return{c(){t=l(e[4])},l(n){t=a(n,e[4])},m(e,n){s(e,t,n)},p(e,n){16&n[0]&&c(t,e[4])},d(e){e&&r(t)}}}(e);let I=!e[5]&&re(e),q=e[1]&&pe(e),Y=[e[14],{class:L=(e[3]&&"bx--snippet--"+e[3])+" "+e[14].class}],z={};for(let e=0;e{I=null}),j()):I?(I.p(e,o),32&o[0]&&k(I,1)):(I=re(e),I.c(),k(I,1),I.m(t,A)),e[1]?q?(q.p(e,o),2&o[0]&&k(q,1)):(q=pe(e),q.c(),k(q,1),q.m(t,null)):q&&(_(),T(q,1,1,()=>{q=null}),j()),x(t,z=w(Y,[16384&o[0]&&e[14],(!S||16392&o[0]&&L!==(L=(e[3]&&"bx--snippet--"+e[3])+" "+e[14].class))&&{class:L}])),$(t,"bx--snippet",!0),$(t,"bx--btn--copy","inline"===e[3]),$(t,"bx--snippet--expand",e[0]),$(t,"bx--snippet--light",e[6]),$(t,"bx--snippet--no-copy",e[5])},i(e){S||(k(O,e),k(I),k(q),S=!0)},o(e){T(O,e),T(I),T(q),S=!1},d(n){n&&r(t),O&&O.d(n),e[29](null),I&&I.d(),q&&q.d(),P=!1,E(V)}}}function ae(e){let t,n,o,l;const a=[fe,ue],c=[];function p(e,t){return e[5]?0:1}return t=p(e),n=c[t]=a[t](e),{c(){n.c(),o=i()},l(e){n.l(e),o=i()},m(e,n){c[t].m(e,n),s(e,o,n),l=!0},p(e,i){let s=t;t=p(e),t===s?c[t].p(e,i):(_(),T(c[s],1,1,()=>{c[s]=null}),j(),n=c[t],n||(n=c[t]=a[t](e),n.c()),k(n,1),n.m(o.parentNode,o))},i(e){l||(k(n),l=!0)},o(e){T(n),l=!1},d(e){c[t].d(e),e&&r(o)}}}function ce(e){let t,n;const o=[{type:e[3]},e[14]];let i={};for(let e=0;e{c[s]=null}),j(),n=c[t],n||(n=c[t]=a[t](e),n.c()),k(n,1),n.m(o.parentNode,o))},i(e){l||(k(n),l=!0)},o(e){T(n),l=!1},d(e){c[t].d(e),e&&r(o)}}}function he(e,t,n){const o=["type","code","expanded","hideCopyButton","light","skeleton","copyButtonDescription","copyLabel","feedback","feedbackTimeout","showLessText","showMoreText","showMoreLess","id","ref"];let i=C(t,o),{$$slots:s={},$$scope:l}=t,{type:a="single"}=t,{code:c}=t,{expanded:r=!1}=t,{hideCopyButton:d=!1}=t,{light:u=!1}=t,{skeleton:f=!1}=t,{copyButtonDescription:b}=t,{copyLabel:m}=t,{feedback:h="Copied!"}=t,{feedbackTimeout:$=2e3}=t,{showLessText:x="Show less"}=t,{showMoreText:g="Show more"}=t,{showMoreLess:y=!1}=t,{id:v="ccs-"+Math.random().toString(36)}=t,{ref:w=null}=t;let k;return e.$$set=e=>{t=p(p({},t),M(e)),n(14,i=C(t,o)),"type"in e&&n(3,a=e.type),"code"in e&&n(4,c=e.code),"expanded"in e&&n(0,r=e.expanded),"hideCopyButton"in e&&n(5,d=e.hideCopyButton),"light"in e&&n(6,u=e.light),"skeleton"in e&&n(7,f=e.skeleton),"copyButtonDescription"in e&&n(8,b=e.copyButtonDescription),"copyLabel"in e&&n(9,m=e.copyLabel),"feedback"in e&&n(10,h=e.feedback),"feedbackTimeout"in e&&n(11,$=e.feedbackTimeout),"showLessText"in e&&n(15,x=e.showLessText),"showMoreText"in e&&n(16,g=e.showMoreText),"showMoreLess"in e&&n(1,y=e.showMoreLess),"id"in e&&n(12,v=e.id),"ref"in e&&n(2,w=e.ref),"$$scope"in e&&n(33,l=e.$$scope)},e.$$.update=()=>{98305&e.$$.dirty[0]&&n(13,k=r?x:g),12&e.$$.dirty[0]&&"multi"===a&&w&&n(1,y=w.getBoundingClientRect().height>255)},[r,y,w,a,c,d,u,f,b,m,h,$,v,k,i,x,g,s,function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(t){B(e,t)},function(e){N[e?"unshift":"push"](()=>{w=e,n(2,w)})},function(t){B(e,t)},function(t){B(e,t)},()=>{n(0,r=!r)},l]}class $e extends e{constructor(e){super(),t(this,e,he,me,n,{type:3,code:4,expanded:0,hideCopyButton:5,light:6,skeleton:7,copyButtonDescription:8,copyLabel:9,feedback:10,feedbackTimeout:11,showLessText:15,showMoreText:16,showMoreLess:1,id:12,ref:2},[-1,-1])}}var xe=function(e){if(navigator.clipboard)return navigator.clipboard.writeText(e).catch((function(e){throw void 0!==e?e:new DOMException("The request is not allowed","NotAllowedError")}));var t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",document.body.appendChild(t);var n=window.getSelection(),o=window.document.createRange();n.removeAllRanges(),o.selectNode(t),n.addRange(o);var i=!1;try{i=window.document.execCommand("copy")}catch(e){console.log("error",e)}return n.removeAllRanges(),window.document.body.removeChild(t),i?Promise.resolve():Promise.reject(new DOMException("The request is not allowed","NotAllowedError"))};export{$e as C,ee as a,xe as c};