1import{S as Q,e as Z,s as W,J as Y,K as g,p as L,M as C,n as G,A as M,Z as me,N as z,O as U,m as ge,Q as q,z as N,u as ne,v as R,y as te,a1 as we,B as be,G as x,L as H,af as ve,ao as oe,V as ke,P as ie,U as E,R as se,h as P,j as ee,k as I,o as K,ap as ue,t as le,x as V,am as Se,E as Ee,ae as Ne,q as ye,r as Re,F as X}from"./index-8930c306.js";/* empty css */import{b as fe,B as Te}from"./Button-18480e49.js";import{B as ze}from"./BlockTitle-dfec92bb.js";import"./Info-e3927cbd.js";function Je(n){let e,l;return{c(){e=Y("svg"),l=Y("path"),g(l,"d","M5 8l4 4 4-4z"),g(e,"class","dropdown-arrow svelte-p5edak"),g(e,"xmlns","http://www.w3.org/2000/svg"),g(e,"width","18"),g(e,"height","18"),g(e,"viewBox","0 0 18 18")},m(i,o){L(i,e,o),C(e,l)},p:G,i:G,o:G,d(i){i&&M(e)}}}class Le extends Q{constructor(e){super(),Z(this,e,null,Je,W,{})}}function Me(n){let e,l;return{c(){e=Y("svg"),l=Y("path"),g(l,"d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"),g(e,"xmlns","http://www.w3.org/2000/svg"),g(e,"width","16"),g(e,"height","16"),g(e,"viewBox","0 0 24 24")},m(i,o){L(i,e,o),C(e,l)},p:G,i:G,o:G,d(i){i&&M(e)}}}class Oe extends Q{constructor(e){super(),Z(this,e,null,Me,W,{})}}function ae(n,e,l){const i=n.slice();return i[24]=e[l],i}function re(n){let e,l,i,o,d,t=x(n[0]),u=[];for(let s=0;s<t.length;s+=1)u[s]=_e(ae(n,t,s));return{c(){e=z("ul");for(let s=0;s<u.length;s+=1)u[s].c();g(e,"class","options svelte-1aonegi"),g(e,"aria-expanded",n[1]),H(e,"top",n[7]),H(e,"bottom",n[8]),H(e,"max-height",`calc(${n[9]}px - var(--window-padding))`),H(e,"width",n[6]+"px")},m(s,f){L(s,e,f);for(let a=0;a<u.length;a+=1)u[a]&&u[a].m(e,null);n[21](e),i=!0,o||(d=q(e,"mousedown",ve(n[20])),o=!0)},p(s,f){if(f&2053){t=x(s[0]);let a;for(a=0;a<t.length;a+=1){const m=ae(s,t,a);u[a]?u[a].p(m,f):(u[a]=_e(m),u[a].c(),u[a].m(e,null))}for(;a<u.length;a+=1)u[a].d(1);u.length=t.length}(!i||f&2)&&g(e,"aria-expanded",s[1]),f&128&&H(e,"top",s[7]),f&256&&H(e,"bottom",s[8]),f&512&&H(e,"max-height",`calc(${s[9]}px - var(--window-padding))`),f&64&&H(e,"width",s[6]+"px")},i(s){i||(s&&me(()=>{i&&(l||(l=oe(e,fe,{duration:200,y:5},!0)),l.run(1))}),i=!0)},o(s){s&&(l||(l=oe(e,fe,{duration:200,y:5},!1)),l.run(0)),i=!1},d(s){s&&M(e),ke(u,s),n[21](null),s&&l&&l.end(),o=!1,d()}}}function _e(n){let e,l,i,o=n[24]+"",d,t,u,s;return{c(){e=z("li"),l=z("span"),l.textContent="â",i=U(),d=ie(o),t=U(),g(l,"class","inner-item svelte-1aonegi"),E(l,"hide",!n[11].includes(n[24])),g(e,"class","item svelte-1aonegi"),g(e,"role","button"),g(e,"data-value",u=n[24]),g(e,"aria-label",s=n[24]),E(e,"selected",n[11].includes(n[24])),E(e,"active",n[2]===n[24]),E(e,"bg-gray-100",n[2]===n[24]),E(e,"dark:bg-gray-600",n[2]===n[24])},m(f,a){L(f,e,a),C(e,l),C(e,i),C(e,d),C(e,t)},p(f,a){a&2049&&E(l,"hide",!f[11].includes(f[24])),a&1&&o!==(o=f[24]+"")&&se(d,o),a&1&&u!==(u=f[24])&&g(e,"data-value",u),a&1&&s!==(s=f[24])&&g(e,"aria-label",s),a&2049&&E(e,"selected",f[11].includes(f[24])),a&5&&E(e,"active",f[2]===f[24]),a&5&&E(e,"bg-gray-100",f[2]===f[24]),a&5&&E(e,"dark:bg-gray-600",f[2]===f[24])},d(f){f&&M(e)}}}function Ue(n){let e,l,i,o,d;me(n[18]);let t=n[1]&&!n[3]&&re(n);return{c(){e=z("div"),l=U(),t&&t.c(),i=ge(),g(e,"class","reference")},m(u,s){L(u,e,s),n[19](e),L(u,l,s),t&&t.m(u,s),L(u,i,s),o||(d=[q(window,"scroll",n[12]),q(window,"resize",n[18])],o=!0)},p(u,[s]){u[1]&&!u[3]?t?(t.p(u,s),s&10&&N(t,1)):(t=re(u),t.c(),N(t,1),t.m(i.parentNode,i)):t&&(ne(),R(t,1,1,()=>{t=null}),te())},i(u){N(t)},o(u){R(t)},d(u){u&&(M(e),M(l),M(i)),n[19](null),t&&t.d(u),o=!1,we(d)}}}function qe(n,e,l){let i,{value:o=void 0}=e,{filtered:d}=e,{showOptions:t=!1}=e,{activeOption:u}=e,{disabled:s=!1}=e,f,a,m,_,w,A,b,B,v,k;const S=()=>{const{top:O,bottom:F}=w.getBoundingClientRect();l(15,f=O),l(16,a=k-F)};let y=null;const D=()=>{t&&(y!==null&&clearTimeout(y),y=setTimeout(()=>{S(),y=null},10))},j=be();function J(){l(10,k=window.innerHeight)}function h(O){P[O?"unshift":"push"](()=>{w=O,l(4,w)})}const p=O=>j("change",O);function r(O){P[O?"unshift":"push"](()=>{A=O,l(5,A)})}return n.$$set=O=>{"value"in O&&l(14,o=O.value),"filtered"in O&&l(0,d=O.filtered),"showOptions"in O&&l(1,t=O.showOptions),"activeOption"in O&&l(2,u=O.activeOption),"disabled"in O&&l(3,s=O.disabled)},n.$$.update=()=>
1{if(n.$$.dirty&245810){if(t&&w){if(A&&typeof o=="string"){let F=document.querySelector(`li[data-value="${o}"]`);F&&A.scrollTo(0,F.offsetTop)}S();const O=w.parentElement?.getBoundingClientRect();l(17,m=O?.height||0),l(6,_=O?.width||0)}a>f?(l(7,b=`${f}px`),l(9,v=a),l(8,B=null)):(l(8,B=`${a+m}px`),l(9,v=f-m),l(7,b=null))}n.$$.dirty&16384&&l(11,i=Array.isArray(o)?o:[o])},[d,t,u,s,w,A,_,b,B,v,k,i,D,j,o,f,a,m,J,h,p,r]}class je extends Q{constructor(e){super(),Z(this,e,qe,Ue,W,{value:14,filtered:0,showOptions:1,activeOption:2,disabled:3})}}function ce(n,e,l){const i=n.slice();return i[31]=e[l],i}function He(n){let e;return{c(){e=ie(n[1])},m(l,i){L(l,e,i)},p(l,i){i[0]&2&&se(e,l[1])},d(l){l&&M(e)}}}function de(n){let e,l,i=x(n[0]),o=[];for(let t=0;t<i.length;t+=1)o[t]=he(ce(n,i,t));const d=t=>R(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=ge()},m(t,u){for(let s=0;s<o.length;s+=1)o[s]&&o[s].m(t,u);L(t,e,u),l=!0},p(t,u){if(u[0]&8209){i=x(t[0]);let s;for(s=0;s<i.length;s+=1){const f=ce(t,i,s);o[s]?(o[s].p(f,u),N(o[s],1)):(o[s]=he(f),o[s].c(),N(o[s],1),o[s].m(e.parentNode,e))}for(ne(),s=i.length;s<o.length;s+=1)d(s);te()}},i(t){if(!l){for(let u=0;u<i.length;u+=1)N(o[u]);l=!0}},o(t){o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)R(o[u]);l=!1},d(t){t&&M(e),ke(o,t)}}}function he(n){let e,l,i=n[31]+"",o,d,t,u,s,f,a,m,_;u=new Oe({});function w(){return n[21](n[31])}return{c(){e=z("div"),l=z("span"),o=ie(i),d=U(),t=z("div"),I(u.$$.fragment),f=U(),g(l,"class","svelte-c0u3f0"),g(t,"class","token-remove svelte-c0u3f0"),g(t,"title",s="Remove "+n[31]),E(t,"hidden",n[4]),g(e,"class","token svelte-c0u3f0")},m(A,b){L(A,e,b),C(e,l),C(l,o),C(e,d),C(e,t),K(u,t,null),C(e,f),a=!0,m||(_=q(e,"click",ve(w)),m=!0)},p(A,b){n=A,(!a||b[0]&1)&&i!==(i=n[31]+"")&&se(o,i),(!a||b[0]&1&&s!==(s="Remove "+n[31]))&&g(t,"title",s),(!a||b[0]&16)&&E(t,"hidden",n[4])},i(A){a||(N(u.$$.fragment,A),a=!0)},o(A){R(u.$$.fragment,A),a=!1},d(A){A&&M(e),V(u),m=!1,_()}}}function Ie(n){let e,l,i,o,d,t=n[3]&&Array.isArray(n[0]),u,s,f,a,m,_,w,A,b,B,v,k,S,y;l=new ze({props:{show_label:n[5],info:n[2],$$slots:{default:[He]},$$scope:{ctx:n}}});let D=t&&de(n);_=new Oe({}),A=new Le({});function j(h){n[27](h)}let J={showOptions:n[11],filtered:n[10],activeOption:n[9],disabled:n[4]};return n[0]!==void 0&&(J.value=n[0]),B=new je({props:J}),P.push(()=>ee(B,"value",j)),B.$on("change",n[15]),{c(){e=z("label"),I(l.$$.fragment),i=U(),o=z("div"),d=z("div"),D&&D.c(),u=U(),s=z("div"),f=z("input"),a=U(),m=z("div"),I(_.$$.fragment),w=U(),I(A.$$.fragment),b=U(),I(B.$$.fragment),g(f,"class","border-none svelte-c0u3f0"),f.disabled=n[4],g(f,"autocomplete","off"),E(f,"subdued",n[0]!==n[8]&&!n[7]),g(m,"class","token-remove remove-all svelte-c0u3f0"),g(m,"title","Clear"),E(m,"hide",!n[3]||!n[0]?.length||n[4]),g(s,"class","secondary-wrap svelte-c0u3f0"),g(d,"class","wrap-inner svelte-c0u3f0"),E(d,"showOptions",n[11]),g(o,"class","wrap svelte-c0u3f0"),g(e,"class","svelte-c0u3f0"),E(e,"container",n[6])},m(h,p){L(h,e,p),K(l,e,null),C(e,i),C(e,o),C(o,d),D&&D.m(d,null),C(d,u),C(d,s),C(s,f),ue(f,n[8]),n[23](f),C(s,a),C(s,m),K(_,m,null),C(s,w),K(A,s,null),C(o,b),K(B,o,null),k=!0,S||(y=[q(f,"input",n[22]),q(f,"focus",n[24]),q(f,"keydown",n[16]),q(f,"keyup",n[25]),q(f,"blur",n[26]),q(m,"click",n[14])],S=!0)},p(h,p){const r={};p[0]&32&&(r.show_label=h[5]),p[0]&4&&(r.info=h[2]),p[0]&2|p[1]&8&&(r.$$scope={dirty:p,ctx:h}),l.$set(r),p[0]&9&&(t=h[3]&&Array.isArray(h[0])),t?D?(D.p(h,p),p[0]&9&&N(D,1)):(D=de(h),D.c(),N(D,1),D.m(d,u)):D&&(ne(),R(D,1,1,()=>{D=null}),te()),(!k||p[0]&16)&&(f.disabled=h[4]),p[0]&256&&f.value!==h[8]&&ue(f,h[8]),(!k||p[0]&385)&&E(f,"subdued",h[0]!==h[8]&&!h[7]),(!k||p[0]&25)&&E(m,"hide",!h[3]||!h[0]?.length||h[4]),(!k||p[0]&2048)&&E(d,"showOptions",h[11]);const O={};p[0]&2048&&(O.showOptions=h[11]),p[0]&1024&&(O.filtered=h[10]),p[0]&512&&(O.activeOption=h[9]),p[0]&16&&(O.disabled=h[4]),!v&&p[0]&1&&(v=!0,O.value=h[0],le(()=>v=!1)),B.$set(O),(!k||p[0]&64)&&E(e,"container",h[6])},i(h){k||(N(l.$$.fragment,h),N(D),N(_.$$.fragment,h),N(A.$$.fragment,h),N(B.$$.fragment,h),k=!0)},o(h){R(l.$$.fragment,h),R(D),R(_.$$.fragment,h),R(A.$$.fragment,h),R(B.$$.fragment,h),k=!1},d(h){h&&M(e),V(l),D&&D.d(),n[23](null),V(_),V(A),V(B),S=!1,we(y)}}}function Ke(n,e,l){let i,{label:o}=e,{info:d=void 0}=e,{value:t}=e,u=Array.isArray(t)?t.slice():t,{value_is_output:s=!1}=e,{multiselect:f=!1}=e,{max_choices:a}=e,{choices:m}=e,{disabled:_=!1}=e,{show_label:w}=e,{container:A=!0}=e,{allow_custom_value:b=!1}=e;const B=be();let v,k,S=!1,y;function D(){B("change",t),s||B("input")}Se(()=>{l(17,s=!1)});function j(c){l(0,t),(!a||t.length<a)&&(t.push(c),B("select",{index:m.indexOf(c),value:c,selected:!0})),l(0,t)}function J(c){l(0,t),l(0,t=t.filter(T=>T!==c)),B("select",{index:m.indexOf(c),value:c,selected:!1})}function h(c){l(0,t=[]),l(8,v=""),c.preventDefault()}function p(c){const T=c.detail.target.dataset.value;if(b&&l(8,v=T),T!==void 0)if(f)t?.includes(T)?J(T):j(T),l(8,v="");else{l(0,t=T),l(8,v=T),l(11,S=!1),B("select",{index:m.indexOf(T),value:T,selected:!0});return}}function r(c){if(c.key==="Enter"&&k!=null)f?f&&Array.isArray(t)&&(t.includes(k)?J(k):j(k),l(8,v="")):(t!==k&&(l(0,t=k),B("select",{index:m.indexOf(t),value:t,selected:!0})),l(8,v=k),l(11,S=!1));else if(l(11,S=!0),c.key==="ArrowUp"||c.key==="ArrowDown"){k===null&&l(9,k=i[0]);const T=c.key==="ArrowUp"?-1:1,$=i.indexOf(k)+T;l(9,k=$<0?i[i.length-1]:$===i.length?i[0]:i[$]),c.preventDefault()}else c.key==="Escape"?l(11,S=!1):c.key==="Backspace"?f&&(!v||v==="")&&Array.isArray(t)&&t.length>0&&(J(t[t.length-1]),l(8,v="")):l(11,S=!0)}const O=c=>J(c);function F(){v=this.value,l(8,v),l(0,t)}function Ae(c){P[c?"unshift":"push"](()=>{y=c,l(12,y)})}const pe=()=>{l(11,S=!S),S?l(8,v=""):y.blur()},Be=()=>{b&&l(0,t=v)},De=()=>{f?l(8,v=""):b||t!==v&&(typeof t=="string"&&v==""?l(8,v=t):(l(0,t=void 0),l(8,v=""))),l(11,S=!1)};function Ce(c){t=c,l(0,t)}return n.$$set=c=>{"label"in c&&l(1,o=c.label),"info"in c&&l(2,d=c.info),"value"in c&&l(0,t=c.value),"value_is_output"in c&&l(17,s=c.value_is_output),"multiselect"in c&&l(3,f=c.multiselect),"max_choices"in c&&l(18,a=c.max_choices),"choices"in c&&l(19,m=c.choices),"disabled"in c&&l(4,_=c.disabled),"show_label"in c&&l(5,w=c.show_label),"container"in c&&l(6,A=c.container),"allow_custom_value"in c&&l(7,b=c.allow_custom_value)},n.$$.update=()=>{n.$$.dirty[0]&1&&(typeof t=="string"||t===null)&&l(8,v=t),n.$$.dirty[0]&524544&&l(10,i=m.filter(c=>v?c.toLowerCase().includes(v.toLowerCase()):c)),n.$$.dirty[0]&1536&&(!k||!i.includes(k))&&l(9,k=i.length?i[0]:null),n.$$.dirty[0]&1048577&&JSON.stringify(t)!=JSON.stringify(u)&&(l(20,u=Array.isArray(t)?t.slice():t),D()),n.$$.dirty[0]&1048577&&JSON.stringify(t)!=JSON.stringify(u)&&(B("change",t),l(20,u=Array.isArray(t)?t.slice():t))},[t,o,d,f,_,w,A,b,v,k,i,S,y,J,h,p,r,s,a,m,u,O,F,Ae,pe,Be,De,Ce]}class Ve extends Q{constructor(e){super(),Z(this,e,Ke,Ie,W,{label:1,info:2,value:0,value_is_output:17,multiselect:3,max_choices:18,choices:19,disabled:4,show_label:5,container:6,allow_custom_value:7},null,[-1,-1])}}function Fe(n){let e,l,i,o,d,t;const u=[n[14]];let s={};for(let _=0;_<u.length;_+=1)s=Ee(s,u[_]);e=new Ne({props:s});function f(_){n[17](_)}function a(_){n[18](_)}let m={choices:n[9],multiselect:n[7],max_choices:n[8],label:n[2],info:n[3],show_label:n[10],allow_custom_value:n[15],container:n[11],disabled:n[16]==="static"};return n[0]!==void 0&&(m.value=n[0]),n[1]!==void 0&&(m.value_is_output=n[1]),i=new Ve({props:m}),P.push(()=>ee(i,"value",f)),P.push(()=>ee(i,"value_is_output",a)),i.$on("change",n[19]),i.$on("input",n[20]),i.$on("select",n[21]),i.$on("blur",n[22]),{c(){I(e.$$.fragment),l=U(),I(i.$$.fragment)},m(_,w){K(e,_,w),L(_,l,w),K(i,_,w),t=!0},p(_,w){const A=w&16384?ye(u,[Re(_[14])]):{};e.$set(A);const b={};w&512&&(b.choices=_[9]),w&128&&(b.multiselect=_[7]),w&256&&(b.max_choices=_[8]),w&4&&(b.label=_[2]),w&8&&(b.info=_[3]),w&1024&&(b.show_label=_[10]),w&32768&&(b.allow_custom_value=_[15]),w&2048&&(b.container=_[11]),w&65536&&(b.disabled=_[16]==="static"),!o&&w&1&&(o=!0,b.value=_[0],le(()=>o=!1)),!d&&w&2&&(d=!0,b.value_is_output=_[1],le(()=>d=!1)),i.$set(b)},i(_){t||(N(e.$$.fragment,_),N(i.$$.fragment,_),t=!0)},o(_){R(e.$$.fragment,_),R(i.$$.fragment,_),t=!1},d(_){_&&M(l),V(e,_),V(i,_)}}}function Ge(n){let e,l;return e=new Te({props:{visible:n[6],elem_id:n[4],elem_classes:n[5],padding:n[11],allow_overflow:!1,scale:n[12],min_width:n[13],$$slots:{default:[Fe]},$$scope:{ctx:n}}}),{c(){I(e.$$.fragment)},m(i,o){K(e,i,o),l=!0},p(i,[o]){const d={};o&64&&(d.visible=i[6]),o&16&&(d.elem_id=i[4]),o&32&&(d.elem_classes=i[5]),o&2048&&(d.padding=i[11]),o&4096&&(d.scale=i[12]),o&8192&&(d.min_width=i[13]),o&8507279&&(d.$$scope={dirty:o,ctx:i}),e.$set(d)},i(i){l||(N(e.$$.fragment,i),l=!0)},o(i){R(e.$$.fragment,i),l=!1},d(i){V(e,i)}}}function Pe(n,e,l){let{label:i="Dropdown"}=e,{info:o=void 0}=e,{elem_id:d=""}=e,{elem_classes:t=[]}=e,{visible:u=!0}=e,{value:s}=e,{value_is_output:f=!1}=e,{multiselect:a=!1}=e,{max_choices:m}=e,{choices:_}=e,{show_label:w}=e,{container:A=!0}=e,{scale:b=null}=e,{min_width:B=void 0}=e,{loading_status:v}=e,{allow_custom_value:k=!1}=e,{mode:S}=e;a&&!s?s=[]:s||(s="");function y(r){s=r,l(0,s)}function D(r){f=r,l(1,f)}function j(r){X.call(this,n,r)}function J(r){X.call(this,n,r)}function h(r){X.call(this,n,r)}function p(r){X.call(this,n,r)}return n.$$set=r=>{"label"in r&&l(2,i=r.label),"info"in r&&l(3,o=r.info),"elem_id"in r&&l(4,d=r.elem_id),"elem_classes"in r&&l(5,t=r.elem_classes),"visible"in r&&l(6,u=r.visible),"value"in r&&l(0,s=r.value),"value_is_output"in r&&l(1,f=r.value_is_output),"multiselect"in r&&l(7,a=r.multiselect),"max_choices"in r&&l(8,m=r.max_choices),"choices"in r&&l(9,_=r.choices),"show_label"in r&&l(10,w=r.show_label),"container"in r&&l(11,A=r.container),"scale"in r&&l(12,b=r.scale),"min_width"in r&&l(13,B=r.min_width),"loading_status"in r&&l(14,v=r.loading_status),"allow_custom_value"in r&&l(15,k=r.allow_custom_value),"mode"in r&&l(16,S=r.mode)},[s,f,i,o,d,t,u,a,m,_,w,A,b,B,v,k,S,y,D,j,J,h,p]}class Qe extends Q{constructor(e){super(),Z(this,e,Pe,Ge,W,{label:2,info:3,elem_id:4,elem_classes:5,visible:6,value:0,value_is_output:1,multiselect:7,max_choices:8,choices:9,show_label:10,container:11,scale:12,min_width:13,loading_status:14,allow_custom_value:15,mode:16})}}const $e=Qe,el=["static","dynamic"],ll=n=>({type:{payload:"string"},description:{payload:"selected choice"},example_data:n.choices.length?n.choices[0]:""});export{$e as Component,ll as document,el as modes}; 2//# sourceMappingURL=index-d7a7ecf2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.