vendor: 7,554 bytes, lines 1-2
1import"./i18n-Dub1g69U.js";import{B as A,c as F,u as G,E as J,I as K,F as Q,S as U,a as V,D as Z}from"./FullscreenButton-CY3DenSN.js";import{I as x}from"./Image-BUv-GoCO.js";import{D as ee}from"./DownloadLink-Clun45p7.js";const te=r=>{let e;if(r.currentTarget instanceof Element)e=r.currentTarget.querySelector("img");else return[NaN,NaN];const n=e.getBoundingClientRect(),t=e.naturalWidth/n.width,l=e.naturalHeight/n.height;if(t>l){const f=e.naturalHeight/t,s=(n.height-f)/2;var o=Math.round((r.clientX-n.left)*t),i=Math.round((r.clientY-n.top-s)*t)}else{const f=e.naturalWidth/l,s=(n.width-f)/2;var o=Math.round((r.clientX-n.left-s)*l),i=Math.round((r.clientY-n.top)*l)}return o<0||o>=e.naturalWidth||i<0||i>=e.naturalHeight?null:[o,i]},{SvelteComponent:ne,append:M,attr:j,binding_callbacks:le,bubble:I,check_outros:N,create_component:d,destroy_component:w,detach:k,element:D,empty:P,flush:g,group_outros:S,init:oe,insert:v,listen:re,mount_component:p,safe_not_equal:se,space:y,toggle_class:E,transition_in:m,transition_out:h}=window.__gradio__svelte__internal,{createEventDispatcher:ae,onMount:$e}=window.__gradio__svelte__internal;function ie(r){let e,n,t,l,o,i,f,s,c;return n=new K({props:{display_top_corner:r[8],$$slots:{default:[ce]},$$scope:{ctx:r}}}),i=new x({props:{src:r[0].url,alt:"",loading:"lazy"}}),i.$on("load",r[16]),{c(){e=D("div"),d(n.$$.fragment),t=y(),l=D("button"),o=D("div"),d(i.$$.fragment),j(o,"class","image-frame svelte-zxsjoa"),E(o,"selectable",r[4]),j(l,"class","svelte-zxsjoa"),j(e,"class","image-container svelte-zxsjoa")},m(a,_){v(a,e,_),p(n,e,null),M(e,t),M(e,l),M(l,o),p(i,o,null),r[17](e),f=!0,s||(c=re(l,"click",r[11]),s=!0)},p(a,_){const b={};_&256&&(b.display_top_corner=a[8]),_&525033&&(b.$$scope={dirty:_,ctx:a}),n.$set(b);const $={};_&1&&($.src=a[0].url),i.$set($),(!f||_&16)&&E(o,"selectable",a[4])},i(a){f||(m(n.$$.fragment,a),m(i.$$.fragment,a),f=!0)},o(a){h(n.$$.fragment,a),h(i.$$.fragment,a),f=!1},d(a){a&&k(e),w(n),w(i),r[17](null),s=!1,c()}}}function ue(r){let e,n;return e=new J({props:{unpadded_box:!0,size:"large",$$slots:{default:[_e]},$$scope:{ctx:r}}}),{c(){d(e.$$.fragment)},m(t,l){p(e,t,l),n=!0},p(t,l){const o={};l&524288&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){w(e,t)}}}function H(r){let e,n;return e=new Q({props:{fullscreen:r[9]}}),e.$on("fullscreen",r[12]),{c(){d(e.$$.fragment)},m(t,l){p(e,t,l),n=!0},p(t,l){const o={};l&512&&(o.fullscreen=t[9]),e.$set(o)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){w(e,t)}}}function T(r){let e,n;return e=new ee({props:{href:r[0].url,download:r[0].orig_name||"image",$$slots:{default:[fe]},$$scope:{ctx:r}}}),{c(){d(e.$$.fragment)},m(t,l){p(e,t,l),n=!0},p(t,l){const o={};l&1&&(o.href=t[0].url),l&1&&(o.download=t[0].orig_name||"image"),l&524352&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){w(e,t)}}}function fe(r){let e,n;return e=new V({props:{Icon:Z,label:r[6]("common.download")}}),{c(){d(e.$$.fragment)},m(t,l){p(e,t,l),n=!0},p(t,l){const o={};l&64&&(o.label=t[6]("common.download")),e.$set(o)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){w(e,t)}}}function W(r){let e,n;return e=new U({props:{i18n:r[6],formatter:r[13],value:r[0]}}),e.$on("share",r[14]),e.$on("error",r[15]),{c(){d(e.$$.fragment)},m(t,l){p(e,t,l),n=!0},p(t,l){const o={};l&64&&(o.i18n=t[6]),l&1&&(o.value=t[0]),e.$set(o)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){w(e,t)}}}function ce(r){let e,n,t,l,o=r[7]&&H(r),i=r[3]&&T(r),f=r[5]&&W(r);return{c(){o&&o.c(),e=y(),i&&i.c(),n=y(),f&&f.c(),t=P()},m(s,c){o&&o.m(s,c),v(s,e,c),i&&i.m(s,c),v(s,n,c),f&&f.m(s,c),v(s,t,c),l=!0},p(s,c){s[7]?o?(o.p(s,c),c&128&&m(o,1)):(o=H(s),o.c(),m(o,1),o.m(e.parentNode,e)):o&&(S(),h(o,1,1,()=>{o=null}),N()),s[3]?i?(i.p(s,c),c&8&&m(i,1)):(i=T(s),i.c(),m(i,1),i.m(n.parentNode,n)):i&&(S(),h(i,1,1,()=>{i=null}),N()),s[5]?f?(f.p(s,c),c&32&&m(f,1)):(f=W(s),f.c(),m(f,1),f.m(t.parentNode,t)):f&&(S(),h(f,1,1,()=>{f=null}),N())},i(s){l||(m(o),m(i),m(f),l=!0)},o(s){h(o),h(i),h(f),l=!1},d(s){s&&(k(e),k(n),k(t)),o&&o.d(s),i&&i.d(s),f&&f.d(s)}}}function _e(r){let e,n;return e=new F({}),{c(){d(e.$$.fragment)},m(t,l){p(e,t,l),n=!0},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){w(e,t)}}}function me(r){let e,n,t,l,o,i;e=new A({props:{show_label:r[2],Icon:F,label:r[2]?r[1]||r[6]("image.image"):""}});const f=[ue,ie],s=[];function c(a,_){return a[0]===null||!a[0].url?0:1}return t=c(r),l=s[t]=f[t](r),{c(){d(e.$$.fragment),n=y(),l.c(),o=P()},m(a,_){p(e,a,_),v(a,n,_),s[t].m(a,_),v(a,o,_),i=!0},p(a,[_]){const b={};_&4&&(b.show_label=a[2]),_&70&&(b.label=a[2]?a[1]||a[6]("image.image"):""),e.$set(b);let $=t;t=c(a),t===$?s[t].p(a,_):(S(),h(s[$],1,1,()=>{s[$]=null}),N(),l=s[t],l?l.p(a,_):(l=s[t]=f[t](a),l.c()),m(l,1),l.m(o.parentNode,o))},i(a){i||(m(e.$$.fragment,a),m(l),i=!0)},o(a){h(e.$$.fragment,a),h(l),i=!1},d(a){a&&(k(n),k(o)),w(e,a),s[t].d(a)}}}function he(r,e,n){let{value:t}=e,{label:l=void 0}=e,{show_label:o}=e,{show_download_button:i=!0}=e,{selectable:f=!1}=e,{show_share_button:s=!1}=e,{i18n:c}=e,{show_fullscreen_button:a=!0}=e,{display_icon_button_wrapper_top_corner:_=!1}=e,{fullscreen:b=!1}=e;const $=ae(),q=u=>{let z=te(u);z&&$("select",{index:z,value:null})};let B;function C(u){I.call(this,r,u)}const L=async u=>u?`<img src="${await G(u)}" />`:"";function O(u){I.call(this,r,u)}function R(u){I.call(this,r,u)}function X(u){I.call(this,r,u)}function Y(u){le[u?"unshift":"push"](()=>{B=u,n(10,B)})}return r.$$set=u=>{"value"in u&&n(0,t=u.value),"label"in u&&n(1,l=u.label),"show_label"in u&&n(2,o=u.show_label),"show_download_button"in u&&n(3,i=u.show_download_button),"selectable"in u&&n(4,f=u.selectable),"show_share_button"in u&&n(5,s=u.show_share_button),"i18n"in u&&n(6,c=u.i18n),"show_fullscreen_button"in u&&n(7,a=u.show_fullscreen_button),"display_icon_button_wrapper_top_corner"in u&&n(8,_=u.display_icon_button_wrapper_top_corner),"fullscreen"in u&&n(9,b=u.fullscreen)},[t,l,o,i,f,s,c,a,_,b,B,q,C,L,O,R,X,Y]}class be extends ne{constructor(e){super(),oe(this,e,he,me,se,{value:0,label:1,show_label:2,show_download_button:3,selectable:4,show_share_button:5,i18n:6,show_fullscreen_button:7,display_icon_button_wrapper_top_corner:8,fullscreen:9})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),g()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),g()}get show_label(){return this.$$.ctx[2]}set show_label(e){this.$$set({show_label:e}),g()}get show_download_button(){return this.$$.ctx[3]}set show_download_button(e){this.$$set({show_download_button:e}),g()}get selectable(){return this.$$.ctx[4]}set selectable(e){this.$$set({selectable:e}),g()}get show_share_button(){return this.$$.ctx[5]}set show_share_button(e){this.$$set({show_share_button:e}),g()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),g()}get show_fullscreen_button(){return this.$$.ctx[7]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),g()}get display_icon_button_wrapper_top_corner(){return this.$$.ctx[8]}set display_icon_button_wrapper_top_corner(e){this.$$set({display_icon_button_wrapper_top_corner:e}),g()}get fullscreen(){return this.$$.ctx[9]}set fullscreen(e){this.$$set({fullscreen:e}),g()}}const ke=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{be as I,ke as a,te as g}; 2//# sourceMappingURL=ImagePreview-BH4pRMMF.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.