diff --git a/dist/Sharee.2e0cb60d.js b/dist/Sharee.05d84ac2.js similarity index 92% rename from dist/Sharee.2e0cb60d.js rename to dist/Sharee.05d84ac2.js index 5da2daf..97554c0 100644 --- a/dist/Sharee.2e0cb60d.js +++ b/dist/Sharee.05d84ac2.js @@ -1,6 +1,6 @@ -var T = Object.defineProperty; -var k = (o, s, e) => s in o ? T(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e; -var n = (o, s, e) => (k(o, typeof s != "symbol" ? s + "" : s, e), e); +var k = Object.defineProperty; +var T = (o, s, e) => s in o ? k(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e; +var n = (o, s, e) => (T(o, typeof s != "symbol" ? s + "" : s, e), e); import l from "lodash.merge"; const u = { showTransitionDuration: "200ms", @@ -10,223 +10,45 @@ const u = { drivers: ["copy", "telegram", "facebook", "whatsapp", "twitter", "linkedin"], ripple: !0, mode: "normal" -}, m = "rtl", g = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0644\u06AF\u0631\u0627\u0645", E = "\u06A9\u067E\u06CC \u0644\u06CC\u0646\u06A9", C = "\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u06A9\u067E\u06CC \u0634\u062F!", f = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0648\u0627\u062A\u0633\u0627\u067E", L = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0648\u06CC\u06CC\u062A\u0631", w = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0644\u06CC\u0646\u06A9\u062F\u06CC\u0646", v = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0641\u06CC\u0633\u0628\u0648\u06A9", h = { +}, m = "rtl", g = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0644\u06AF\u0631\u0627\u0645", E = "\u06A9\u067E\u06CC \u0644\u06CC\u0646\u06A9", f = "\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u06A9\u067E\u06CC \u0634\u062F!", C = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0648\u0627\u062A\u0633\u0627\u067E", L = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0648\u06CC\u06CC\u062A\u0631", v = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0644\u06CC\u0646\u06A9\u062F\u06CC\u0646", w = "\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0641\u06CC\u0633\u0628\u0648\u06A9", c = { Direction: m, Telegram: g, Copy_Link: E, - CopiedSuccessfully: C, - Whatsapp: f, + CopiedSuccessfully: f, + Whatsapp: C, Twitter: L, - Linkedin: w, - Facebook: v + Linkedin: v, + Facebook: w }, D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Direction: m, Telegram: g, Copy_Link: E, - CopiedSuccessfully: C, - Whatsapp: f, + CopiedSuccessfully: f, + Whatsapp: C, Twitter: L, - Linkedin: w, - Facebook: v, - default: h + Linkedin: v, + Facebook: w, + default: c }, Symbol.toStringTag, { value: "Module" })); -class a { - constructor(s, e) { - n(this, "lang"); - n(this, "mainEl", null); - n(this, "options"); - n(this, "rippleColor", "#ffffff75"); - n(this, "rippleInitialized", !1); - this.options = e, this.lang = s; - } - getButtonText() { - return this.lang[this.buttonText.replaceAll(" ", "_")] || this.buttonText; - } - onClick(s) { - } - getName() { - return this.constructor.name; - } -} -const b = `\r -`; -class _ extends a { - constructor(e, t) { - super(e, t); - n(this, "buttonText", "Telegram"); - n(this, "icon", b); - n(this, "backgroundColor", "#0088CC"); - n(this, "backgroundHoverColor", "#0371aa"); - n(this, "textColor", "#fff"); - n(this, "textHoverColor", "#fff"); - } - getLink() { - var e, t; - return `https://telegram.me/share/url?url=${(e = this.options) == null ? void 0 : e.shareLink}&text=${encodeURIComponent((t = this.options) == null ? void 0 : t.shareText)}`; - } -} -const H = `\r -\r -\r - \r - \r -\r -\r -\r -`; -class M extends a { - constructor(e, t) { - super(e, t); - n(this, "buttonText", "Whatsapp"); - n(this, "icon", H); - n(this, "backgroundColor", "#25D366"); - n(this, "backgroundHoverColor", "#20bd5a"); - n(this, "textColor", "#fff"); - n(this, "textHoverColor", "#fff"); - } - getLink() { - var e, t; - return `whatsapp://send?text=${(e = this.options) == null ? void 0 : e.shareText} - ${(t = this.options) == null ? void 0 : t.shareLink}`; - } -} -const S = `\r -\r -`; -class z extends a { - constructor(e, t) { - super(e, t); - n(this, "buttonText", "Copy Link"); - n(this, "icon", S); - n(this, "backgroundColor", "#797979"); - n(this, "backgroundHoverColor", "#5e5e5e"); - n(this, "textColor", "#fff"); - n(this, "textHoverColor", "#fff"); - n(this, "timeout", 0); - } - onClick(e) { - super.onClick(e); - const t = this.lang.CopiedSuccessfully, r = e.currentTarget.querySelector("div:nth-child(2)"); - if (r.innerHTML === t) { - r.innerHTML = this.getButtonText(); - return; - } - let y = window.location.href; - navigator.clipboard.writeText(y).then(() => { - r.innerHTML = t, r.style.transition = "300ms all", r.style.transform = "scale(1)", r.style.transform = `scale(1.07) translateX(${this.lang.Direction === "rtl" ? "-" : ""}4px)`, clearTimeout(this.timeout), this.timeout = setTimeout(() => { - r.innerHTML = this.getButtonText(), r.style.transition = "none", r.style.transform = "scale(1)"; - }, 5e3); - }); - } -} -const O = `\r - \r -\r -`; -class R extends a { - constructor(e, t) { - super(e, t); - n(this, "buttonText", "Twitter"); - n(this, "icon", O); - n(this, "backgroundColor", "#1DA1F2"); - n(this, "backgroundHoverColor", "#1a93dd"); - n(this, "textColor", "#fff"); - n(this, "textHoverColor", "#fff"); - } - getLink() { - var e, t; - return `https://twitter.com/share?text=${encodeURIComponent((e = this.options) == null ? void 0 : e.shareText)}&url=${(t = this.options) == null ? void 0 : t.shareLink}`; - } -} -const B = `\r -`; -class $ extends a { - constructor(e, t) { - super(e, t); - n(this, "buttonText", "Linkedin"); - n(this, "icon", B); - n(this, "backgroundColor", "#0077B5"); - n(this, "backgroundHoverColor", "#026092"); - n(this, "textColor", "#fff"); - n(this, "textHoverColor", "#fff"); - } - getLink() { - var e, t; - return `https://twitter.com/share?text=${encodeURIComponent((e = this.options) == null ? void 0 : e.shareText)}&url=${(t = this.options) == null ? void 0 : t.shareLink}`; - } -} -const I = `\r - \r -\r -`; -class P extends a { - constructor(e, t) { - super(e, t); - n(this, "buttonText", "Facebook"); - n(this, "icon", I); - n(this, "backgroundColor", "#4267B2"); - n(this, "backgroundHoverColor", "#355696"); - n(this, "textColor", "#fff"); - n(this, "textHoverColor", "#fff"); - } - getLink() { - var e, t; - return `https://twitter.com/share?text=${encodeURIComponent((e = this.options) == null ? void 0 : e.shareText)}&url=${(t = this.options) == null ? void 0 : t.shareLink}`; - } -} -const d = new Object({ - telegram: _, - whatsapp: M, - copy: z, - twitter: R, - linkedin: $, - facebook: P -}); -class c { +class d { constructor() { n(this, "eventListeners", []); } resolveDriver(s) { - if (d.hasOwnProperty(s)) - return d[s]; + if (console.log(h.drivers), h.drivers.hasOwnProperty(s)) + return h.drivers[s]; throw new Error(`Unknown driver: ${s}`); } shouldRenderDriver(s) { return !0; } } -const V = { +const b = { type: "column", animation: "fade-down" }; -class x extends c { +class x extends d { constructor(e) { super(); n(this, "sharee"); @@ -236,7 +58,7 @@ class x extends c { n(this, "driverListeners", {}); n(this, "hideTimeout", 0); n(this, "options"); - this.sharee = e, this.shareeEl = document.createElement("div"), this.options = l({}, V, e.options.modeOptions); + this.sharee = e, this.shareeEl = document.createElement("div"), this.options = l({}, b, e.options.modeOptions); } show() { this.shareeEl.classList.add("showing"), setTimeout(() => { @@ -345,7 +167,7 @@ function p(o, s) { } while (o); return !1; } -class F extends x { +class _ extends x { constructor(s) { super(s), this.options.type = "row"; } @@ -419,10 +241,10 @@ class F extends x { return e.innerHTML = s.icon, s.mainEl.appendChild(e), s.mainEl; } } -const j = { +const H = { noTitle: !1 }; -class N extends c { +class M extends d { constructor(e) { super(); n(this, "sharee"); @@ -432,7 +254,7 @@ class N extends c { n(this, "driverListeners", {}); n(this, "hideTimeout", 0); n(this, "options"); - this.sharee = e, this.shareeEl = document.createElement("div"), this.options = l({}, j, e.options.modeOptions); + this.sharee = e, this.shareeEl = document.createElement("div"), this.options = l({}, H, e.options.modeOptions); } hide() { var e; @@ -494,18 +316,18 @@ class N extends c { this.driverListeners[e.buttonText] = [t], e.mainEl.addEventListener("click", t); } } -const U = { +const S = { position: "top-right", noTitle: !1 }; -class A extends c { +class z extends d { constructor(e) { super(); n(this, "sharee"); n(this, "shareeEl"); n(this, "driverListeners", {}); n(this, "options"); - this.sharee = e, this.shareeEl = document.createElement("div"), this.options = l({}, U, e.options.modeOptions); + this.sharee = e, this.shareeEl = document.createElement("div"), this.options = l({}, S, e.options.modeOptions); } destroy() { window.shareeEl = this.shareeEl, console.log(this.shareeEl), this.eventListeners.forEach((e) => { @@ -568,32 +390,213 @@ class A extends c { return i.innerHTML = e.getButtonText(), e.mainEl.appendChild(t), this.options.noTitle ? (e.mainEl.title = e.getButtonText(), e.mainEl.classList.add("sharee__no-title")) : e.mainEl.appendChild(i), e.mainEl.classList.add("sharee__driver__" + e.getName()), e.mainEl; } } -const W = { +const O = { dropdown: x, - text: F, - normal: N, - fixed: A + text: _, + normal: M, + fixed: z }; -class Z { +class a { + constructor(s, e) { + n(this, "lang"); + n(this, "mainEl", null); + n(this, "options"); + n(this, "rippleColor", "#ffffff75"); + n(this, "rippleInitialized", !1); + this.options = e, this.lang = s; + } + getButtonText() { + return this.lang[this.buttonText.replaceAll(" ", "_")] || this.buttonText; + } + onClick(s) { + } + getName() { + return this.constructor.name; + } +} +const R = `\r +`; +class B extends a { + constructor(e, t) { + super(e, t); + n(this, "buttonText", "Telegram"); + n(this, "icon", R); + n(this, "backgroundColor", "#0088CC"); + n(this, "backgroundHoverColor", "#0371aa"); + n(this, "textColor", "#fff"); + n(this, "textHoverColor", "#fff"); + } + getLink() { + var e, t; + return `https://telegram.me/share/url?url=${(e = this.options) == null ? void 0 : e.shareLink}&text=${encodeURIComponent((t = this.options) == null ? void 0 : t.shareText)}`; + } +} +const $ = `\r +\r +\r + \r + \r +\r +\r +\r +`; +class I extends a { + constructor(e, t) { + super(e, t); + n(this, "buttonText", "Whatsapp"); + n(this, "icon", $); + n(this, "backgroundColor", "#25D366"); + n(this, "backgroundHoverColor", "#20bd5a"); + n(this, "textColor", "#fff"); + n(this, "textHoverColor", "#fff"); + } + getLink() { + var e, t; + return `whatsapp://send?text=${(e = this.options) == null ? void 0 : e.shareText} + ${(t = this.options) == null ? void 0 : t.shareLink}`; + } +} +const P = `\r +\r +`; +class V extends a { + constructor(e, t) { + super(e, t); + n(this, "buttonText", "Copy Link"); + n(this, "icon", P); + n(this, "backgroundColor", "#797979"); + n(this, "backgroundHoverColor", "#5e5e5e"); + n(this, "textColor", "#fff"); + n(this, "textHoverColor", "#fff"); + n(this, "timeout", 0); + } + onClick(e) { + super.onClick(e); + const t = this.lang.CopiedSuccessfully, r = e.currentTarget.querySelector("div:nth-child(2)"); + if (r.innerHTML === t) { + r.innerHTML = this.getButtonText(); + return; + } + let y = window.location.href; + navigator.clipboard.writeText(y).then(() => { + r.innerHTML = t, r.style.transition = "300ms all", r.style.transform = "scale(1)", r.style.transform = `scale(1.07) translateX(${this.lang.Direction === "rtl" ? "-" : ""}4px)`, clearTimeout(this.timeout), this.timeout = setTimeout(() => { + r.innerHTML = this.getButtonText(), r.style.transition = "none", r.style.transform = "scale(1)"; + }, 5e3); + }); + } +} +const F = `\r + \r +\r +`; +class j extends a { + constructor(e, t) { + super(e, t); + n(this, "buttonText", "Twitter"); + n(this, "icon", F); + n(this, "backgroundColor", "#1DA1F2"); + n(this, "backgroundHoverColor", "#1a93dd"); + n(this, "textColor", "#fff"); + n(this, "textHoverColor", "#fff"); + } + getLink() { + var e, t; + return `https://twitter.com/share?text=${encodeURIComponent((e = this.options) == null ? void 0 : e.shareText)}&url=${(t = this.options) == null ? void 0 : t.shareLink}`; + } +} +const N = `\r +`; +class A extends a { + constructor(e, t) { + super(e, t); + n(this, "buttonText", "Linkedin"); + n(this, "icon", N); + n(this, "backgroundColor", "#0077B5"); + n(this, "backgroundHoverColor", "#026092"); + n(this, "textColor", "#fff"); + n(this, "textHoverColor", "#fff"); + } + getLink() { + var e; + return `https://www.linkedin.com/sharing/share-offsite/?url=${(e = this.options) == null ? void 0 : e.shareLink}`; + } +} +const U = `\r + \r +\r +`; +class W extends a { + constructor(e, t) { + super(e, t); + n(this, "buttonText", "Facebook"); + n(this, "icon", U); + n(this, "backgroundColor", "#4267B2"); + n(this, "backgroundHoverColor", "#355696"); + n(this, "textColor", "#fff"); + n(this, "textHoverColor", "#fff"); + } + getLink() { + var e, t; + return `https://twitter.com/share?text=${encodeURIComponent((e = this.options) == null ? void 0 : e.shareText)}&url=${(t = this.options) == null ? void 0 : t.shareLink}`; + } +} +const X = new Object({ + telegram: B, + whatsapp: I, + copy: V, + twitter: j, + linkedin: A, + facebook: W +}); +class h { constructor(s, e = u) { n(this, "options"); - n(this, "lang", h); + n(this, "lang", c); n(this, "strategy"); n(this, "targetElement"); - this.targetElement = s, this.options = l({}, u, e); - const t = W[this.options.mode]; + this.targetElement = s, this.options = l({}, u, e), this.options.drivers = e.drivers || this.options.drivers; + const t = O[this.options.mode]; if (typeof t > "u") throw new Error('Selected mode "' + e.mode + '" not found'); this.strategy = new t(this), this.init().then(() => { this.strategy.render(); }); } + static addDriver(s, e) { + this.drivers[s] = e; + } async init() { this.targetElement.sharee = this, await this.setLang(this.options.lang, this.options.langs); } async setLang(s, e = {}) { const t = /* @__PURE__ */ Object.assign({ "../locales/en.json": () => import("./en.7ffedfe0.js"), "../locales/fa.json": () => Promise.resolve().then(() => D) }); - let i = h; + let i = c; for (const r in t) r.includes(s) && (t[r] instanceof Function ? i = { ...await t[r]() } : i = { ...t[r] }, e[s] && l(i, e[s])); this.lang = i; @@ -608,6 +611,7 @@ class Z { this.strategy.destroy(); } } +n(h, "drivers", { ...X }); export { - Z as S + h as S }; diff --git a/dist/sharee-react.js.js b/dist/sharee-react.js.js index a0da662..73dcb17 100644 --- a/dist/sharee-react.js.js +++ b/dist/sharee-react.js.js @@ -1,5 +1,5 @@ import { useRef as n, useEffect as u } from "react"; -import { S as o } from "./Sharee.2e0cb60d.js"; +import { S as o } from "./Sharee.05d84ac2.js"; import { jsx as f } from "react/jsx-runtime"; import "lodash.merge"; function m(e) { diff --git a/dist/sharee-vue.js.js b/dist/sharee-vue.js.js index 754c5df..29275d4 100644 --- a/dist/sharee-vue.js.js +++ b/dist/sharee-vue.js.js @@ -1,5 +1,5 @@ import { defineComponent as a, ref as r, onMounted as s, onUnmounted as u, openBlock as p, createElementBlock as i } from "vue"; -import { S as c } from "./Sharee.2e0cb60d.js"; +import { S as c } from "./Sharee.05d84ac2.js"; import "lodash.merge"; const _ = /* @__PURE__ */ a({ __name: "Sharee", diff --git a/dist/sharee.js b/dist/sharee.js index ac8b99c..f6bb0a3 100644 --- a/dist/sharee.js +++ b/dist/sharee.js @@ -1,4 +1,4 @@ -import { S as a } from "./Sharee.2e0cb60d.js"; +import { S as a } from "./Sharee.05d84ac2.js"; import "lodash.merge"; export { a as default diff --git a/dist/sharee.min.js b/dist/sharee.min.js index 11e9162..f52f928 100644 --- a/dist/sharee.min.js +++ b/dist/sharee.min.js @@ -1,6 +1,6 @@ -(function(){"use strict";try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode(".sharee__normal{min-width:13em;display:flex;flex-direction:row;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:none}.sharee__normal a[href]{text-decoration:none}.sharee__normal svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__normal.sharee__rtl{direction:rtl}.sharee__normal>*{display:flex;justify-content:start;align-items:center;background:white;padding-top:3px;padding-bottom:4px;padding-inline-end:10px;padding-inline-start:5px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__normal>*:not(.sharee__no-title):hover{max-width:10em}.sharee__normal>*>*:first-child{margin-inline-end:.3em}.sharee__normal>*:hover{background:#ebebeb}.sharee__normal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__normal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__normal.sharee__normal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__normal.sharee__normal__grid>*{border-radius:0!important}.sharee__modal{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:#0006;opacity:0;transition:.3s all}.sharee__modal.showing{display:block}.sharee__modal.show{opacity:1}.sharee__modal .sharee__modal__content{background-color:#fefefe;margin:auto;padding:20px;border:1px solid #888;width:80%}.sharee__modal__close{color:#aaa;float:right;font-size:28px;font-weight:700}.sharee__modal__close:hover,.sharee__modal__close:focus{color:#000;text-decoration:none;cursor:pointer}.sharee__modal svg{width:1.9em;max-height:1.9em}.sharee__modal.sharee__rtl{direction:rtl}.sharee__modal>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__modal>*:hover{max-width:10em}.sharee__modal>* svg{transform:translateY(.13em)}.sharee__modal>*>*:first-child{margin-inline-end:.3em}.sharee__modal>*:hover{background:#ebebeb}.sharee__modal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__modal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__modal.sharee__modal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__modal.sharee__modal__grid>*{border-radius:0!important}.sharee__fixed{display:block;position:fixed;z-index:1;overflow:auto;transition:.3s all;border-start-end-radius:5px;border-end-end-radius:5px;--border-radius: 5px}.sharee__fixed a[href]{text-decoration:none}.sharee__fixed.sharee__position__top-right{right:0;top:10vh;direction:rtl!important}.sharee__fixed.sharee__position__top-left{left:0;top:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-left{left:0;bottom:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-right{bottom:10vh;right:0;direction:ltr!important}.sharee__fixed svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__fixed.sharee__rtl{direction:rtl}.sharee__fixed>*{display:flex;justify-content:start;align-items:center;background:white;padding-inline-start:2px;padding-inline-end:9px;padding-top:5px;padding-bottom:4px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__fixed>*:not(.sharee__no-title):hover{max-width:10em}.sharee__fixed>*>*:first-child{margin-inline-end:.3em}.sharee__fixed>*:hover{background:#ebebeb}.sharee__fixed>*:not(.sharee__no-title):hover{border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__fixed>*:first-child{border-start-end-radius:var(--border-radius)}.sharee__fixed>*:last-child{border-end-end-radius:var(--border-radius)}.sharee__text.sharee__dropdown{min-width:unset;left:-1000px}.sharee__text.sharee__dropdown>*{padding:0 4px}.sharee__dropdown.sharee__text>*>*:first-child{margin-inline-end:unset}.sharee__text.sharee__dropdown svg{vertical-align:middle}.sharee__dropdown{position:fixed;min-width:13em;display:flex;flex-direction:column;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:1px solid #c5c5c5;box-shadow:#3a3d42a6 0 1px,#0000007f 0 4px 16px -7px}.sharee__dropdown a[href]{text-decoration:none}.sharee__dropdown:not(.show):not(.showing){display:none!important}.sharee__dropdown.sharee__dropdown__row{border:none;box-shadow:#0000007f 0 1px 16px -7px}.sharee__dropdown.sharee__dropdown__row{flex-direction:row}.sharee__dropdown svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__dropdown.sharee__rtl{direction:rtl}.sharee__dropdown>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;min-height:2.6em}.sharee__dropdown:not(.sharee__dropdown__row)>*:first-child:not(:last-child){border-radius:var(--border-radius) var(--border-radius) 0 0}.sharee__dropdown:not(.sharee__dropdown__row)>*:last-child:not(:first-child){border-radius:0 0 var(--border-radius) var(--border-radius)}.sharee__dropdown>*>*:first-child{margin-inline-end:.3em}.sharee__dropdown>*:hover{background:#ebebeb}.sharee__dropdown.fade:not(.show){opacity:0}.sharee__dropdown.fade.show{opacity:1}.sharee__dropdown.fade-down:not(.show){opacity:0;transform:translateY(-10px)}.sharee__dropdown.fade-down.show{opacity:1;transform:translateY(0)}.sharee__dropdown.sharee__dropdown__row>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__row>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__dropdown.sharee__dropdown__grid>*{border-radius:0!important}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); -(function(x,w){typeof exports=="object"&&typeof module<"u"?module.exports=w():typeof define=="function"&&define.amd?define(w):(x=typeof globalThis<"u"?globalThis:x||self,x.Sharee=w())})(this,function(){"use strict";var fr=Object.defineProperty;var pr=(x,w,S)=>w in x?fr(x,w,{enumerable:!0,configurable:!0,writable:!0,value:S}):x[w]=S;var o=(x,w,S)=>(pr(x,typeof w!="symbol"?w+"":w,S),S);function x(g,s){for(var t=0;ti[h]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}const w={showTransitionDuration:"200ms",lang:"fa",onLoad:()=>{},drivers:["copy","telegram","facebook","whatsapp","twitter","linkedin"],ripple:!0,mode:"normal"},S="rtl",Ke="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0644\u06AF\u0631\u0627\u0645",Ye="\u06A9\u067E\u06CC \u0644\u06CC\u0646\u06A9",Je="\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u06A9\u067E\u06CC \u0634\u062F!",Qe="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0648\u0627\u062A\u0633\u0627\u067E",et="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0648\u06CC\u06CC\u062A\u0631",tt="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0644\u06CC\u0646\u06A9\u062F\u06CC\u0646",nt="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0641\u06CC\u0633\u0628\u0648\u06A9",Le={Direction:S,Telegram:Ke,Copy_Link:Ye,CopiedSuccessfully:Je,Whatsapp:Qe,Twitter:et,Linkedin:tt,Facebook:nt},Ht=Object.freeze(Object.defineProperty({__proto__:null,Direction:S,Telegram:Ke,Copy_Link:Ye,CopiedSuccessfully:Je,Whatsapp:Qe,Twitter:et,Linkedin:tt,Facebook:nt,default:Le},Symbol.toStringTag,{value:"Module"}));class R{constructor(s,t){o(this,"lang");o(this,"mainEl",null);o(this,"options");o(this,"rippleColor","#ffffff75");o(this,"rippleInitialized",!1);this.options=t,this.lang=s}getButtonText(){return this.lang[this.buttonText.replaceAll(" ","_")]||this.buttonText}onClick(s){}getName(){return this.constructor.name}}const jt=`\r -`;class Pt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Telegram");o(this,"icon",jt);o(this,"backgroundColor","#0088CC");o(this,"backgroundHoverColor","#0371aa");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://telegram.me/share/url?url=${(t=this.options)==null?void 0:t.shareLink}&text=${encodeURIComponent((i=this.options)==null?void 0:i.shareText)}`}}const zt=`\r +(function(){"use strict";try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode(".sharee__normal{min-width:13em;display:flex;flex-direction:row;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:none}.sharee__normal a[href]{text-decoration:none}.sharee__normal svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__normal.sharee__rtl{direction:rtl}.sharee__normal>*{display:flex;justify-content:start;align-items:center;background:white;padding-top:3px;padding-bottom:4px;padding-inline-end:10px;padding-inline-start:5px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__normal>*:not(.sharee__no-title):hover{max-width:10em}.sharee__normal>*>*:first-child{margin-inline-end:.3em}.sharee__normal>*:hover{background:#ebebeb}.sharee__normal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__normal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__normal.sharee__normal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__normal.sharee__normal__grid>*{border-radius:0!important}.sharee__modal{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:#0006;opacity:0;transition:.3s all}.sharee__modal.showing{display:block}.sharee__modal.show{opacity:1}.sharee__modal .sharee__modal__content{background-color:#fefefe;margin:auto;padding:20px;border:1px solid #888;width:80%}.sharee__modal__close{color:#aaa;float:right;font-size:28px;font-weight:700}.sharee__modal__close:hover,.sharee__modal__close:focus{color:#000;text-decoration:none;cursor:pointer}.sharee__modal svg{width:1.9em;max-height:1.9em}.sharee__modal.sharee__rtl{direction:rtl}.sharee__modal>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__modal>*:hover{max-width:10em}.sharee__modal>* svg{transform:translateY(.13em)}.sharee__modal>*>*:first-child{margin-inline-end:.3em}.sharee__modal>*:hover{background:#ebebeb}.sharee__modal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__modal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__modal.sharee__modal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__modal.sharee__modal__grid>*{border-radius:0!important}.sharee__fixed{display:block;position:fixed;z-index:1;overflow:auto;transition:.3s all;border-start-end-radius:5px;border-end-end-radius:5px;--border-radius: 5px}.sharee__fixed a[href]{text-decoration:none}.sharee__fixed.sharee__position__top-right{right:0;top:10vh;direction:rtl!important}.sharee__fixed.sharee__position__top-left{left:0;top:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-left{left:0;bottom:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-right{bottom:10vh;right:0;direction:rtl!important}.sharee__fixed svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__fixed.sharee__rtl{direction:rtl}.sharee__fixed>*{display:flex;justify-content:start;align-items:center;background:white;padding-inline-start:2px;padding-inline-end:9px;padding-top:5px;padding-bottom:4px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__fixed>*:not(.sharee__no-title):hover{max-width:10em}.sharee__fixed>*>*:first-child{margin-inline-end:.3em}.sharee__fixed>*:hover{background:#ebebeb}.sharee__fixed>*:not(.sharee__no-title):hover{border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__fixed>*:first-child{border-start-end-radius:var(--border-radius)}.sharee__fixed>*:last-child{border-end-end-radius:var(--border-radius)}.sharee__text.sharee__dropdown{min-width:unset;left:-1000px}.sharee__text.sharee__dropdown>*{padding:0 4px}.sharee__dropdown.sharee__text>*>*:first-child{margin-inline-end:unset}.sharee__text.sharee__dropdown svg{vertical-align:middle}.sharee__dropdown{position:fixed;min-width:13em;display:flex;flex-direction:column;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:1px solid #c5c5c5;box-shadow:#3a3d42a6 0 1px,#0000007f 0 4px 16px -7px}.sharee__dropdown a[href]{text-decoration:none}.sharee__dropdown:not(.show):not(.showing){display:none!important}.sharee__dropdown.sharee__dropdown__row{border:none;box-shadow:#0000007f 0 1px 16px -7px}.sharee__dropdown.sharee__dropdown__row{flex-direction:row}.sharee__dropdown svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__dropdown.sharee__rtl{direction:rtl}.sharee__dropdown>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;min-height:2.6em}.sharee__dropdown:not(.sharee__dropdown__row)>*:first-child:last-child{border-radius:inherit}.sharee__dropdown:not(.sharee__dropdown__row)>*:first-child:not(:last-child){border-radius:var(--border-radius) var(--border-radius) 0 0}.sharee__dropdown:not(.sharee__dropdown__row)>*:last-child:not(:first-child){border-radius:0 0 var(--border-radius) var(--border-radius)}.sharee__dropdown>*>*:first-child{margin-inline-end:.3em}.sharee__dropdown>*:hover{background:#ebebeb}.sharee__dropdown.fade:not(.show){opacity:0}.sharee__dropdown.fade.show{opacity:1}.sharee__dropdown.fade-down:not(.show){opacity:0;transform:translateY(-10px)}.sharee__dropdown.fade-down.show{opacity:1;transform:translateY(0)}.sharee__dropdown.sharee__dropdown__row>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__row>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__dropdown.sharee__dropdown__grid>*{border-radius:0!important}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); +(function(x,w){typeof exports=="object"&&typeof module<"u"?module.exports=w():typeof define=="function"&&define.amd?define(w):(x=typeof globalThis<"u"?globalThis:x||self,x.Sharee=w())})(this,function(){"use strict";var fr=Object.defineProperty;var pr=(x,w,S)=>w in x?fr(x,w,{enumerable:!0,configurable:!0,writable:!0,value:S}):x[w]=S;var o=(x,w,S)=>(pr(x,typeof w!="symbol"?w+"":w,S),S);function x(g,s){for(var t=0;ti[h]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}const w={showTransitionDuration:"200ms",lang:"fa",onLoad:()=>{},drivers:["copy","telegram","facebook","whatsapp","twitter","linkedin"],ripple:!0,mode:"normal"},S="rtl",Ye="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0644\u06AF\u0631\u0627\u0645",Je="\u06A9\u067E\u06CC \u0644\u06CC\u0646\u06A9",Qe="\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u06A9\u067E\u06CC \u0634\u062F!",et="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0648\u0627\u062A\u0633\u0627\u067E",tt="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u062A\u0648\u06CC\u06CC\u062A\u0631",nt="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0644\u06CC\u0646\u06A9\u062F\u06CC\u0646",rt="\u0627\u0634\u062A\u0631\u0627\u06A9 \u062F\u0631 \u0641\u06CC\u0633\u0628\u0648\u06A9",xe={Direction:S,Telegram:Ye,Copy_Link:Je,CopiedSuccessfully:Qe,Whatsapp:et,Twitter:tt,Linkedin:nt,Facebook:rt},Ht=Object.freeze(Object.defineProperty({__proto__:null,Direction:S,Telegram:Ye,Copy_Link:Je,CopiedSuccessfully:Qe,Whatsapp:et,Twitter:tt,Linkedin:nt,Facebook:rt,default:xe},Symbol.toStringTag,{value:"Module"}));class De{constructor(){o(this,"eventListeners",[])}resolveDriver(s){if(console.log(X.drivers),X.drivers.hasOwnProperty(s))return X.drivers[s];throw new Error(`Unknown driver: ${s}`)}shouldRenderDriver(s){return!0}}var W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oe={exports:{}};(function(g,s){var t=200,i="__lodash_hash_undefined__",h=800,d=16,M=9007199254740991,$="[object Arguments]",ne="[object Array]",re="[object AsyncFunction]",ie="[object Boolean]",se="[object Date]",oe="[object Error]",ae="[object Function]",Me="[object GeneratorFunction]",Z="[object Map]",B="[object Number]",le="[object Null]",q="[object Object]",He="[object Proxy]",K="[object RegExp]",ce="[object Set]",l="[object String]",u="[object Undefined]",c="[object WeakMap]",C="[object ArrayBuffer]",_="[object DataView]",j="[object Float32Array]",je="[object Float64Array]",Pe="[object Int8Array]",ze="[object Int16Array]",Ae="[object Int32Array]",he="[object Uint8Array]",Ie="[object Uint8ClampedArray]",ue="[object Uint16Array]",Re="[object Uint32Array]",fe=/[\\^$.*+?()[\]{}|]/g,pe=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,m={};m[j]=m[je]=m[Pe]=m[ze]=m[Ae]=m[he]=m[Ie]=m[ue]=m[Re]=!0,m[$]=m[ne]=m[C]=m[ie]=m[_]=m[se]=m[oe]=m[ae]=m[Z]=m[B]=m[q]=m[K]=m[ce]=m[l]=m[c]=!1;var Y=typeof W=="object"&&W&&W.Object===Object&&W,b=typeof self=="object"&&self&&self.Object===Object&&self,D=Y||b||Function("return this")(),N=s&&!s.nodeType&&s,H=N&&!0&&g&&!g.nodeType&&g,J=H&&H.exports===N,P=J&&Y.process,ge=function(){try{var e=H&&H.require&&H.require("util").types;return e||P&&P.binding&&P.binding("util")}catch{}}(),F=ge&&ge.isTypedArray;function me(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}function ve(e,n){for(var r=-1,a=Array(e);++r-1}function wn(e,n){var r=this.__data__,a=we(r,e);return a<0?(++this.size,r.push([e,n])):r[a][1]=n,this}k.prototype.clear=yn,k.prototype.delete=En,k.prototype.get=Cn,k.prototype.has=_n,k.prototype.set=wn;function U(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n1?r[p-1]:void 0,y=p>2?r[2]:void 0;for(v=e.length>3&&typeof v=="function"?(p--,v):void 0,y&&Yn(r[0],r[1],y)&&(v=p<3?void 0:v,p=1),n=Object(n);++a-1&&e%1==0&&e0){if(++n>=h)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function sr(e){if(e!=null){try{return Ee.call(e)}catch{}try{return e+""}catch{}}return""}function Le(e,n){return e===n||e!==e&&n!==n}var We=wt(function(){return arguments}())?wt:function(e){return ee(e)&&O.call(e,"callee")&&!ln.call(e,"callee")},Ge=Array.isArray;function Xe(e){return e!=null&&Dt(e.length)&&!Ze(e)}function or(e){return ee(e)&&Xe(e)}var xt=hn||ur;function Ze(e){if(!I(e))return!1;var n=be(e);return n==ae||n==Me||n==re||n==He}function Dt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=M}function I(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function ee(e){return e!=null&&typeof e=="object"}function ar(e){if(!ee(e)||be(e)!=q)return!1;var n=yt(e);if(n===null)return!0;var r=O.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&Ee.call(r)==on}var Ot=F?$e(F):In;function lr(e){return Gn(e,kt(e))}function kt(e){return Xe(e)?jn(e,!0):Rn(e)}var cr=Xn(function(e,n,r){bt(e,n,r)});function hr(e){return function(){return e}}function St(e){return e}function ur(){return!1}g.exports=cr})(Oe,Oe.exports);const G=Oe.exports,jt={type:"column",animation:"fade-down"};class it extends De{constructor(t){super();o(this,"sharee");o(this,"elementHovering",!1);o(this,"shareeElHovering",!1);o(this,"shareeEl");o(this,"driverListeners",{});o(this,"hideTimeout",0);o(this,"options");this.sharee=t,this.shareeEl=document.createElement("div"),this.options=G({},jt,t.options.modeOptions)}show(){this.shareeEl.classList.add("showing"),setTimeout(()=>{this.shareeEl.classList.add("show");const t=this.sharee.targetElement.getBoundingClientRect(),i=t.x,h=t.y;this.sharee.lang.Direction==="ltr"?(this.shareeEl.style.left=`${i}px`,this.shareeEl.style.right="unset"):(this.shareeEl.style.right=`${i}px`,this.shareeEl.style.left="unset"),this.shareeEl.style.top=`${h+t.height}px`})}hide(){var t;(t=this.shareeEl)==null||t.classList.remove("show"),clearTimeout(this.hideTimeout),this.hideTimeout=setTimeout(()=>{var i;(i=this.shareeEl)==null||i.classList.remove("showing")},Number.parseInt(this.sharee.options.showTransitionDuration))}elementOnMouseEnter(){this.elementHovering=!0,this.show()}elementOnMouseLeave(){setTimeout(()=>this.elementHovering=!1),setTimeout(()=>{this.shareeElHovering||this.hide()})}shareElOnMouseEnter(){this.elementHovering&&this.show(),this.shareeElHovering=!0}shareElOnMouseLeave(){setTimeout(()=>this.shareeElHovering=!1),setTimeout(()=>{this.elementHovering||this.hide()})}listenEvents(){this.shareeEl.addEventListener("mouseenter",this.shareElOnMouseEnter.bind(this)),this.shareeEl.addEventListener("mouseleave",this.shareElOnMouseLeave.bind(this));const t=this.elementOnMouseEnter.bind(this),i=this.elementOnMouseLeave.bind(this);this.sharee.targetElement.addEventListener("mouseenter",t),this.sharee.targetElement.addEventListener("mouseleave",i),this.eventListeners.push([this.sharee.targetElement,"mouseenter",t]),this.eventListeners.push([this.sharee.targetElement,"mouseleave",i])}destroy(){window.shareeEl=this.shareeEl,this.eventListeners.forEach(t=>{t[0].removeEventListener(t[1],t[2])}),this.shareeEl.parentElement.removeChild(this.shareeEl)}reRender(){this.destroy(),setTimeout(()=>{this.render()})}render(){this.shareeEl=document.createElement("div"),this.shareeEl.classList.add("sharee__dropdown"),this.shareeEl.classList.add("sharee__"+this.sharee.lang.Direction),this.shareeEl.classList.add(this.options.animation),this.shareeEl.style.transition="all "+this.sharee.options.showTransitionDuration,this.shareeEl.style.transitionProperty="transform, opacity";for(let t of this.sharee.options.drivers){if(!this.shouldRenderDriver(t))continue;const i=this.resolveDriver(t),h=new i(this.sharee.lang,{lang:this.sharee.lang,shareText:this.sharee.getShareText(),shareLink:this.sharee.getShareLink(),ripple:this.sharee.options.ripple}),d=this.renderDriver(h);this.shareeEl.appendChild(d)}document.body.appendChild(this.shareeEl),this.listenEvents(),this.options.type==="grid"?this.shareeEl.classList.add("sharee__dropdown__grid"):this.options.type==="row"&&this.shareeEl.classList.add("sharee__dropdown__row")}onDriverMouseEnter(t){return()=>{t.mainEl.style.backgroundColor=t.backgroundHoverColor,t.mainEl.style.color=t.textHoverColor}}onDriverMouseLeave(t){return()=>{this.initDriverStyles(t)}}onDriverClick(t){return i=>{t.onClick(i)}}initDriverStyles(t){var i,h;t.mainEl.style.backgroundColor=t.backgroundColor,t.mainEl.style.color=t.textColor,t.mainEl.style.transition=(((i=t.options)==null?void 0:i.transitionDuration)||"200ms")+" all",(h=t.options)!=null&&h.ripple&&this.initRipple(t)}initRipple(t){t.rippleInitialized||(t.rippleInitialized=!0,Promise.resolve().then(()=>Se).then(i=>{i.default(t.mainEl,{background:t.rippleColor})}))}renderDriver(t){t.mainEl=document.createElement("a"),"getLink"in t&&(t.mainEl.href=t.getLink()),this.initDriverStyles(t),this.listenDriverEvents(t);const i=document.createElement("div");i.innerHTML=t.icon;const h=document.createElement("div");return h.innerHTML=t.getButtonText(),t.mainEl.appendChild(i),t.mainEl.appendChild(h),t.mainEl}listenDriverEvents(t){const i=this.onDriverMouseEnter(t),h=this.onDriverMouseLeave(t),d=this.onDriverClick(t);this.driverListeners[t.buttonText]=[i,h,d],t.mainEl.addEventListener("mouseenter",i),t.mainEl.addEventListener("mouseleave",h),t.mainEl.addEventListener("click",d)}}function st(g,s){var t;do{if((t=g==null?void 0:g.className)!=null&&t.includes(s))return!0;g=g.parentNode}while(g);return!1}class Pt extends it{constructor(s){super(s),this.options.type="row"}show(){this.shareeEl.classList.add("showing"),setTimeout(()=>{this.shareeEl.classList.add("show")})}getDistanceFromTop(){return window.pageXOffset||document.documentElement.scrollTop||document.body.scrollTop}getTooltipPosition(){let s;try{s=window.getSelection().getRangeAt(0).getBoundingClientRect()}catch{return{left:0,top:0}}const t=30,i=s.top,h=s.left+(s.width-t*this.sharee.options.drivers.length)/2;return{top:i,left:h}}setPosition(s){this.shareeEl.style.right="unset";const{left:t,top:i}=this.getTooltipPosition();return t===0?(this.hide(),!1):(s.x+300>window.innerWidth?this.shareeEl.style.left=t+"px":this.shareeEl.style.left=t+"px",this.shareeEl.style.top=`${i+26}px`,!0)}shouldRenderDriver(s){return s!=="copy"}getSelectedText(){var s;try{window.getSelection().getRangeAt(0)}catch{return!1}return window.getSelection?(s=window.getSelection())==null?void 0:s.toString():typeof document.selection<"u"?document.selection.createRange().text:""}destroy(){super.destroy(),window.removeEventListener("resize",this.windowOnResize)}render(){super.render(),this.shareeEl.classList.add("sharee__text")}documentOnClick(s){st(s.target,"sharee__text")||this.hide()}elementOnMouseUp(s){const t=s.currentTarget;setTimeout(()=>{const i=this.getSelectedText();!i||st(t,"sharee__text")||(this.sharee.options.shareText=i,this.reRender(),setTimeout(()=>{this.show(),setTimeout(()=>{this.setPosition(s)})}))})}windowOnResize(){this.hide()}listenEvents(){const s=this.elementOnMouseUp.bind(this),t=this.documentOnClick.bind(this);this.sharee.targetElement.addEventListener("mouseup",s),document.addEventListener("click",t);const i=this.windowOnResize.bind(this);window.addEventListener("resize",i),this.eventListeners.push([this.sharee.targetElement,"mouseup",s]),this.eventListeners.push([document,"click",t]),this.eventListeners.push([window,"resize",i])}renderDriver(s){s.mainEl=document.createElement("a"),s.mainEl.title=s.getButtonText(),"getLink"in s&&(s.mainEl.href=s.getLink()),this.initDriverStyles(s),this.listenDriverEvents(s);const t=document.createElement("div");return t.innerHTML=s.icon,s.mainEl.appendChild(t),s.mainEl}}const zt={noTitle:!1};class At extends De{constructor(t){super();o(this,"sharee");o(this,"elementHovering",!1);o(this,"shareeElHovering",!1);o(this,"shareeEl");o(this,"driverListeners",{});o(this,"hideTimeout",0);o(this,"options");this.sharee=t,this.shareeEl=document.createElement("div"),this.options=G({},zt,t.options.modeOptions)}hide(){var t;(t=this.shareeEl)==null||t.classList.remove("show"),clearTimeout(this.hideTimeout),this.hideTimeout=setTimeout(()=>{var i;(i=this.shareeEl)==null||i.classList.remove("showing")},Number.parseInt(this.sharee.options.showTransitionDuration))}destroy(){this.eventListeners.forEach(t=>{t[0].removeEventListener(t[1],t[2])}),this.shareeEl.parentElement.removeChild(this.shareeEl)}reRender(){this.destroy(),setTimeout(()=>{this.render()})}render(){this.shareeEl=document.createElement("div"),this.shareeEl.classList.add("sharee__normal"),this.shareeEl.classList.add("sharee__"+this.sharee.lang.Direction),this.shareeEl.style.transition="all "+this.sharee.options.showTransitionDuration,this.shareeEl.style.transitionProperty="transform, opacity";for(let t of this.sharee.options.drivers){if(!this.shouldRenderDriver(t))continue;const i=this.resolveDriver(t),h=new i(this.sharee.lang,{lang:this.sharee.lang,shareText:this.sharee.getShareText(),shareLink:this.sharee.getShareLink(),ripple:this.sharee.options.ripple}),d=this.renderDriver(h);this.shareeEl.appendChild(d)}this.sharee.targetElement.appendChild(this.shareeEl)}onDriverClick(t){return i=>{t.onClick(i)}}initDriverStyles(t){var i,h;t.mainEl.style.backgroundColor=t.backgroundColor,t.mainEl.style.color=t.textColor,t.mainEl.style.transition=(((i=t.options)==null?void 0:i.transitionDuration)||"200ms")+" background, 1s max-width",(h=t.options)!=null&&h.ripple&&this.initRipple(t)}initRipple(t){t.rippleInitialized||(t.rippleInitialized=!0,Promise.resolve().then(()=>Se).then(i=>{i.default(t.mainEl,{background:t.rippleColor})}))}renderDriver(t){t.mainEl=document.createElement("a"),"getLink"in t&&(t.mainEl.href=t.getLink()),this.initDriverStyles(t),this.listenDriverEvents(t);const i=document.createElement("div");i.innerHTML=t.icon;const h=document.createElement("div");return h.innerHTML=t.getButtonText(),t.mainEl.appendChild(i),this.options.noTitle?(t.mainEl.title=t.getButtonText(),t.mainEl.classList.add("sharee__no-title")):t.mainEl.appendChild(h),t.mainEl.classList.add("sharee__driver__"+t.getName()),t.mainEl}listenDriverEvents(t){const i=this.onDriverClick(t);this.driverListeners[t.buttonText]=[i],t.mainEl.addEventListener("click",i)}}const It={position:"top-right",noTitle:!1};class Rt extends De{constructor(t){super();o(this,"sharee");o(this,"shareeEl");o(this,"driverListeners",{});o(this,"options");this.sharee=t,this.shareeEl=document.createElement("div"),this.options=G({},It,t.options.modeOptions)}destroy(){window.shareeEl=this.shareeEl,console.log(this.shareeEl),this.eventListeners.forEach(t=>{t[0].removeEventListener(t[1],t[2])}),this.shareeEl.parentElement.removeChild(this.shareeEl)}reRender(){this.destroy(),setTimeout(()=>{this.render()})}getPositionClass(){}render(){this.shareeEl=document.createElement("div"),this.shareeEl.classList.add("sharee__fixed"),this.shareeEl.classList.add("sharee__"+this.sharee.lang.Direction),this.shareeEl.classList.add("sharee__position__"+this.options.position),this.shareeEl.style.transition="all "+this.sharee.options.showTransitionDuration,this.shareeEl.style.transitionProperty="transform, opacity";for(let t of this.sharee.options.drivers){if(!this.shouldRenderDriver(t))continue;const i=this.resolveDriver(t),h=new i(this.sharee.lang,{lang:this.sharee.lang,shareText:this.sharee.getShareText(),shareLink:this.sharee.getShareLink(),ripple:this.sharee.options.ripple}),d=this.renderDriver(h);this.shareeEl.appendChild(d)}document.body.appendChild(this.shareeEl)}onDriverMouseEnter(t){return()=>{t.mainEl.style.backgroundColor=t.backgroundHoverColor,t.mainEl.style.color=t.textHoverColor}}onDriverMouseLeave(t){return()=>{this.initDriverStyles(t)}}onDriverClick(t){return i=>{t.onClick(i)}}initDriverStyles(t){var i,h;t.mainEl.style.backgroundColor=t.backgroundColor,t.mainEl.style.color=t.textColor,t.mainEl.style.transition=(((i=t.options)==null?void 0:i.transitionDuration)||"200ms")+" all",(h=t.options)!=null&&h.ripple&&this.initRipple(t)}initRipple(t){t.rippleInitialized||(t.rippleInitialized=!0,Promise.resolve().then(()=>Se).then(i=>{i.default(t.mainEl,{background:t.rippleColor})}))}renderDriver(t){t.mainEl=document.createElement("a"),"getLink"in t&&(t.mainEl.href=t.getLink()),this.initDriverStyles(t);const i=document.createElement("div");i.innerHTML=t.icon;const h=document.createElement("div");return h.innerHTML=t.getButtonText(),t.mainEl.appendChild(i),this.options.noTitle?(t.mainEl.title=t.getButtonText(),t.mainEl.classList.add("sharee__no-title")):t.mainEl.appendChild(h),t.mainEl.classList.add("sharee__driver__"+t.getName()),t.mainEl}}const $t={dropdown:it,text:Pt,normal:At,fixed:Rt},dr="";class R{constructor(s,t){o(this,"lang");o(this,"mainEl",null);o(this,"options");o(this,"rippleColor","#ffffff75");o(this,"rippleInitialized",!1);this.options=t,this.lang=s}getButtonText(){return this.lang[this.buttonText.replaceAll(" ","_")]||this.buttonText}onClick(s){}getName(){return this.constructor.name}}const Bt=`\r +`;class Nt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Telegram");o(this,"icon",Bt);o(this,"backgroundColor","#0088CC");o(this,"backgroundHoverColor","#0371aa");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://telegram.me/share/url?url=${(t=this.options)==null?void 0:t.shareLink}&text=${encodeURIComponent((i=this.options)==null?void 0:i.shareText)}`}}const Ft=`\r \r \r @@ -24,10 +24,10 @@ \r \r \r -`;class At extends R{constructor(t,i){super(t,i);o(this,"buttonText","Whatsapp");o(this,"icon",zt);o(this,"backgroundColor","#25D366");o(this,"backgroundHoverColor","#20bd5a");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`whatsapp://send?text=${(t=this.options)==null?void 0:t.shareText} - ${(i=this.options)==null?void 0:i.shareLink}`}}const It=`\r +`;class Ut extends R{constructor(t,i){super(t,i);o(this,"buttonText","Whatsapp");o(this,"icon",Ft);o(this,"backgroundColor","#25D366");o(this,"backgroundHoverColor","#20bd5a");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`whatsapp://send?text=${(t=this.options)==null?void 0:t.shareText} + ${(i=this.options)==null?void 0:i.shareLink}`}}const Vt=`\r \r -`;class Rt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Copy Link");o(this,"icon",It);o(this,"backgroundColor","#797979");o(this,"backgroundHoverColor","#5e5e5e");o(this,"textColor","#fff");o(this,"textHoverColor","#fff");o(this,"timeout",0)}onClick(t){super.onClick(t);const i=this.lang.CopiedSuccessfully,d=t.currentTarget.querySelector("div:nth-child(2)");if(d.innerHTML===i){d.innerHTML=this.getButtonText();return}let M=window.location.href;navigator.clipboard.writeText(M).then(()=>{d.innerHTML=i,d.style.transition="300ms all",d.style.transform="scale(1)",d.style.transform=`scale(1.07) translateX(${this.lang.Direction==="rtl"?"-":""}4px)`,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{d.innerHTML=this.getButtonText(),d.style.transition="none",d.style.transform="scale(1)"},5e3)})}}const $t=`{d.innerHTML=i,d.style.transition="300ms all",d.style.transform="scale(1)",d.style.transform=`scale(1.07) translateX(${this.lang.Direction==="rtl"?"-":""}4px)`,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{d.innerHTML=this.getButtonText(),d.style.transition="none",d.style.transform="scale(1)"},5e3)})}}const Gt=`\r \r \r -`;class Bt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Twitter");o(this,"icon",$t);o(this,"backgroundColor","#1DA1F2");o(this,"backgroundHoverColor","#1a93dd");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://twitter.com/share?text=${encodeURIComponent((t=this.options)==null?void 0:t.shareText)}&url=${(i=this.options)==null?void 0:i.shareLink}`}}const Nt=`\r -`;class Ft extends R{constructor(t,i){super(t,i);o(this,"buttonText","Linkedin");o(this,"icon",Nt);o(this,"backgroundColor","#0077B5");o(this,"backgroundHoverColor","#026092");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://twitter.com/share?text=${encodeURIComponent((t=this.options)==null?void 0:t.shareText)}&url=${(i=this.options)==null?void 0:i.shareLink}`}}const Ut=`\r +`;class Xt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Twitter");o(this,"icon",Gt);o(this,"backgroundColor","#1DA1F2");o(this,"backgroundHoverColor","#1a93dd");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://twitter.com/share?text=${encodeURIComponent((t=this.options)==null?void 0:t.shareText)}&url=${(i=this.options)==null?void 0:i.shareLink}`}}const Zt=`\r +`;class qt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Linkedin");o(this,"icon",Zt);o(this,"backgroundColor","#0077B5");o(this,"backgroundHoverColor","#026092");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t;return`https://www.linkedin.com/sharing/share-offsite/?url=${(t=this.options)==null?void 0:t.shareLink}`}}const Kt=`\r \r \r -`;class Vt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Facebook");o(this,"icon",Ut);o(this,"backgroundColor","#4267B2");o(this,"backgroundHoverColor","#355696");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://twitter.com/share?text=${encodeURIComponent((t=this.options)==null?void 0:t.shareText)}&url=${(i=this.options)==null?void 0:i.shareLink}`}}const rt=new Object({telegram:Pt,whatsapp:At,copy:Rt,twitter:Bt,linkedin:Ft,facebook:Vt});class xe{constructor(){o(this,"eventListeners",[])}resolveDriver(s){if(rt.hasOwnProperty(s))return rt[s];throw new Error(`Unknown driver: ${s}`)}shouldRenderDriver(s){return!0}}var W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oe={exports:{}};(function(g,s){var t=200,i="__lodash_hash_undefined__",h=800,d=16,M=9007199254740991,$="[object Arguments]",te="[object Array]",ne="[object AsyncFunction]",re="[object Boolean]",ie="[object Date]",se="[object Error]",oe="[object Function]",Se="[object GeneratorFunction]",X="[object Map]",B="[object Number]",ae="[object Null]",Z="[object Object]",Me="[object Proxy]",q="[object RegExp]",le="[object Set]",l="[object String]",u="[object Undefined]",c="[object WeakMap]",C="[object ArrayBuffer]",_="[object DataView]",j="[object Float32Array]",He="[object Float64Array]",je="[object Int8Array]",Pe="[object Int16Array]",ze="[object Int32Array]",ce="[object Uint8Array]",Ae="[object Uint8ClampedArray]",he="[object Uint16Array]",Ie="[object Uint32Array]",ue=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,m={};m[j]=m[He]=m[je]=m[Pe]=m[ze]=m[ce]=m[Ae]=m[he]=m[Ie]=!0,m[$]=m[te]=m[C]=m[re]=m[_]=m[ie]=m[se]=m[oe]=m[X]=m[B]=m[Z]=m[q]=m[le]=m[l]=m[c]=!1;var K=typeof W=="object"&&W&&W.Object===Object&&W,b=typeof self=="object"&&self&&self.Object===Object&&self,O=K||b||Function("return this")(),N=s&&!s.nodeType&&s,H=N&&!0&&g&&!g.nodeType&&g,Y=H&&H.exports===N,P=Y&&K.process,de=function(){try{var e=H&&H.require&&H.require("util").types;return e||P&&P.binding&&P.binding("util")}catch{}}(),F=de&&de.isTypedArray;function ge(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}function me(e,n){for(var r=-1,a=Array(e);++r-1}function wn(e,n){var r=this.__data__,a=_e(r,e);return a<0?(++this.size,r.push([e,n])):r[a][1]=n,this}k.prototype.clear=yn,k.prototype.delete=En,k.prototype.get=Cn,k.prototype.has=_n,k.prototype.set=wn;function U(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n1?r[p-1]:void 0,y=p>2?r[2]:void 0;for(v=e.length>3&&typeof v=="function"?(p--,v):void 0,y&&Yn(r[0],r[1],y)&&(v=p<3?void 0:v,p=1),n=Object(n);++a-1&&e%1==0&&e0){if(++n>=h)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function sr(e){if(e!=null){try{return ye.call(e)}catch{}try{return e+""}catch{}}return""}function Te(e,n){return e===n||e!==e&&n!==n}var Ve=wt(function(){return arguments}())?wt:function(e){return Q(e)&&D.call(e,"callee")&&!ln.call(e,"callee")},We=Array.isArray;function Ge(e){return e!=null&&Ot(e.length)&&!Xe(e)}function or(e){return Q(e)&&Ge(e)}var xt=hn||ur;function Xe(e){if(!I(e))return!1;var n=we(e);return n==oe||n==Se||n==ne||n==Me}function Ot(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=M}function I(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Q(e){return e!=null&&typeof e=="object"}function ar(e){if(!Q(e)||we(e)!=Z)return!1;var n=yt(e);if(n===null)return!0;var r=D.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&ye.call(r)==on}var Dt=F?Re(F):In;function lr(e){return Gn(e,kt(e))}function kt(e){return Ge(e)?jn(e,!0):Rn(e)}var cr=Xn(function(e,n,r){bt(e,n,r)});function hr(e){return function(){return e}}function St(e){return e}function ur(){return!1}g.exports=cr})(Oe,Oe.exports);const G=Oe.exports,Wt={type:"column",animation:"fade-down"};class it extends xe{constructor(t){super();o(this,"sharee");o(this,"elementHovering",!1);o(this,"shareeElHovering",!1);o(this,"shareeEl");o(this,"driverListeners",{});o(this,"hideTimeout",0);o(this,"options");this.sharee=t,this.shareeEl=document.createElement("div"),this.options=G({},Wt,t.options.modeOptions)}show(){this.shareeEl.classList.add("showing"),setTimeout(()=>{this.shareeEl.classList.add("show");const t=this.sharee.targetElement.getBoundingClientRect(),i=t.x,h=t.y;this.sharee.lang.Direction==="ltr"?(this.shareeEl.style.left=`${i}px`,this.shareeEl.style.right="unset"):(this.shareeEl.style.right=`${i}px`,this.shareeEl.style.left="unset"),this.shareeEl.style.top=`${h+t.height}px`})}hide(){var t;(t=this.shareeEl)==null||t.classList.remove("show"),clearTimeout(this.hideTimeout),this.hideTimeout=setTimeout(()=>{var i;(i=this.shareeEl)==null||i.classList.remove("showing")},Number.parseInt(this.sharee.options.showTransitionDuration))}elementOnMouseEnter(){this.elementHovering=!0,this.show()}elementOnMouseLeave(){setTimeout(()=>this.elementHovering=!1),setTimeout(()=>{this.shareeElHovering||this.hide()})}shareElOnMouseEnter(){this.elementHovering&&this.show(),this.shareeElHovering=!0}shareElOnMouseLeave(){setTimeout(()=>this.shareeElHovering=!1),setTimeout(()=>{this.elementHovering||this.hide()})}listenEvents(){this.shareeEl.addEventListener("mouseenter",this.shareElOnMouseEnter.bind(this)),this.shareeEl.addEventListener("mouseleave",this.shareElOnMouseLeave.bind(this));const t=this.elementOnMouseEnter.bind(this),i=this.elementOnMouseLeave.bind(this);this.sharee.targetElement.addEventListener("mouseenter",t),this.sharee.targetElement.addEventListener("mouseleave",i),this.eventListeners.push([this.sharee.targetElement,"mouseenter",t]),this.eventListeners.push([this.sharee.targetElement,"mouseleave",i])}destroy(){window.shareeEl=this.shareeEl,this.eventListeners.forEach(t=>{t[0].removeEventListener(t[1],t[2])}),this.shareeEl.parentElement.removeChild(this.shareeEl)}reRender(){this.destroy(),setTimeout(()=>{this.render()})}render(){this.shareeEl=document.createElement("div"),this.shareeEl.classList.add("sharee__dropdown"),this.shareeEl.classList.add("sharee__"+this.sharee.lang.Direction),this.shareeEl.classList.add(this.options.animation),this.shareeEl.style.transition="all "+this.sharee.options.showTransitionDuration,this.shareeEl.style.transitionProperty="transform, opacity";for(let t of this.sharee.options.drivers){if(!this.shouldRenderDriver(t))continue;const i=this.resolveDriver(t),h=new i(this.sharee.lang,{lang:this.sharee.lang,shareText:this.sharee.getShareText(),shareLink:this.sharee.getShareLink(),ripple:this.sharee.options.ripple}),d=this.renderDriver(h);this.shareeEl.appendChild(d)}document.body.appendChild(this.shareeEl),this.listenEvents(),this.options.type==="grid"?this.shareeEl.classList.add("sharee__dropdown__grid"):this.options.type==="row"&&this.shareeEl.classList.add("sharee__dropdown__row")}onDriverMouseEnter(t){return()=>{t.mainEl.style.backgroundColor=t.backgroundHoverColor,t.mainEl.style.color=t.textHoverColor}}onDriverMouseLeave(t){return()=>{this.initDriverStyles(t)}}onDriverClick(t){return i=>{t.onClick(i)}}initDriverStyles(t){var i,h;t.mainEl.style.backgroundColor=t.backgroundColor,t.mainEl.style.color=t.textColor,t.mainEl.style.transition=(((i=t.options)==null?void 0:i.transitionDuration)||"200ms")+" all",(h=t.options)!=null&&h.ripple&&this.initRipple(t)}initRipple(t){t.rippleInitialized||(t.rippleInitialized=!0,Promise.resolve().then(()=>ke).then(i=>{i.default(t.mainEl,{background:t.rippleColor})}))}renderDriver(t){t.mainEl=document.createElement("a"),"getLink"in t&&(t.mainEl.href=t.getLink()),this.initDriverStyles(t),this.listenDriverEvents(t);const i=document.createElement("div");i.innerHTML=t.icon;const h=document.createElement("div");return h.innerHTML=t.getButtonText(),t.mainEl.appendChild(i),t.mainEl.appendChild(h),t.mainEl}listenDriverEvents(t){const i=this.onDriverMouseEnter(t),h=this.onDriverMouseLeave(t),d=this.onDriverClick(t);this.driverListeners[t.buttonText]=[i,h,d],t.mainEl.addEventListener("mouseenter",i),t.mainEl.addEventListener("mouseleave",h),t.mainEl.addEventListener("click",d)}}function st(g,s){var t;do{if((t=g==null?void 0:g.className)!=null&&t.includes(s))return!0;g=g.parentNode}while(g);return!1}class Gt extends it{constructor(s){super(s),this.options.type="row"}show(){this.shareeEl.classList.add("showing"),setTimeout(()=>{this.shareeEl.classList.add("show")})}getDistanceFromTop(){return window.pageXOffset||document.documentElement.scrollTop||document.body.scrollTop}getTooltipPosition(){let s;try{s=window.getSelection().getRangeAt(0).getBoundingClientRect()}catch{return{left:0,top:0}}const t=30,i=s.top,h=s.left+(s.width-t*this.sharee.options.drivers.length)/2;return{top:i,left:h}}setPosition(s){this.shareeEl.style.right="unset";const{left:t,top:i}=this.getTooltipPosition();return t===0?(this.hide(),!1):(s.x+300>window.innerWidth?this.shareeEl.style.left=t+"px":this.shareeEl.style.left=t+"px",this.shareeEl.style.top=`${i+26}px`,!0)}shouldRenderDriver(s){return s!=="copy"}getSelectedText(){var s;try{window.getSelection().getRangeAt(0)}catch{return!1}return window.getSelection?(s=window.getSelection())==null?void 0:s.toString():typeof document.selection<"u"?document.selection.createRange().text:""}destroy(){super.destroy(),window.removeEventListener("resize",this.windowOnResize)}render(){super.render(),this.shareeEl.classList.add("sharee__text")}documentOnClick(s){st(s.target,"sharee__text")||this.hide()}elementOnMouseUp(s){const t=s.currentTarget;setTimeout(()=>{const i=this.getSelectedText();!i||st(t,"sharee__text")||(this.sharee.options.shareText=i,this.reRender(),setTimeout(()=>{this.show(),setTimeout(()=>{this.setPosition(s)})}))})}windowOnResize(){this.hide()}listenEvents(){const s=this.elementOnMouseUp.bind(this),t=this.documentOnClick.bind(this);this.sharee.targetElement.addEventListener("mouseup",s),document.addEventListener("click",t);const i=this.windowOnResize.bind(this);window.addEventListener("resize",i),this.eventListeners.push([this.sharee.targetElement,"mouseup",s]),this.eventListeners.push([document,"click",t]),this.eventListeners.push([window,"resize",i])}renderDriver(s){s.mainEl=document.createElement("a"),s.mainEl.title=s.getButtonText(),"getLink"in s&&(s.mainEl.href=s.getLink()),this.initDriverStyles(s),this.listenDriverEvents(s);const t=document.createElement("div");return t.innerHTML=s.icon,s.mainEl.appendChild(t),s.mainEl}}const Xt={noTitle:!1};class Zt extends xe{constructor(t){super();o(this,"sharee");o(this,"elementHovering",!1);o(this,"shareeElHovering",!1);o(this,"shareeEl");o(this,"driverListeners",{});o(this,"hideTimeout",0);o(this,"options");this.sharee=t,this.shareeEl=document.createElement("div"),this.options=G({},Xt,t.options.modeOptions)}hide(){var t;(t=this.shareeEl)==null||t.classList.remove("show"),clearTimeout(this.hideTimeout),this.hideTimeout=setTimeout(()=>{var i;(i=this.shareeEl)==null||i.classList.remove("showing")},Number.parseInt(this.sharee.options.showTransitionDuration))}destroy(){this.eventListeners.forEach(t=>{t[0].removeEventListener(t[1],t[2])}),this.shareeEl.parentElement.removeChild(this.shareeEl)}reRender(){this.destroy(),setTimeout(()=>{this.render()})}render(){this.shareeEl=document.createElement("div"),this.shareeEl.classList.add("sharee__normal"),this.shareeEl.classList.add("sharee__"+this.sharee.lang.Direction),this.shareeEl.style.transition="all "+this.sharee.options.showTransitionDuration,this.shareeEl.style.transitionProperty="transform, opacity";for(let t of this.sharee.options.drivers){if(!this.shouldRenderDriver(t))continue;const i=this.resolveDriver(t),h=new i(this.sharee.lang,{lang:this.sharee.lang,shareText:this.sharee.getShareText(),shareLink:this.sharee.getShareLink(),ripple:this.sharee.options.ripple}),d=this.renderDriver(h);this.shareeEl.appendChild(d)}this.sharee.targetElement.appendChild(this.shareeEl)}onDriverClick(t){return i=>{t.onClick(i)}}initDriverStyles(t){var i,h;t.mainEl.style.backgroundColor=t.backgroundColor,t.mainEl.style.color=t.textColor,t.mainEl.style.transition=(((i=t.options)==null?void 0:i.transitionDuration)||"200ms")+" background, 1s max-width",(h=t.options)!=null&&h.ripple&&this.initRipple(t)}initRipple(t){t.rippleInitialized||(t.rippleInitialized=!0,Promise.resolve().then(()=>ke).then(i=>{i.default(t.mainEl,{background:t.rippleColor})}))}renderDriver(t){t.mainEl=document.createElement("a"),"getLink"in t&&(t.mainEl.href=t.getLink()),this.initDriverStyles(t),this.listenDriverEvents(t);const i=document.createElement("div");i.innerHTML=t.icon;const h=document.createElement("div");return h.innerHTML=t.getButtonText(),t.mainEl.appendChild(i),this.options.noTitle?(t.mainEl.title=t.getButtonText(),t.mainEl.classList.add("sharee__no-title")):t.mainEl.appendChild(h),t.mainEl.classList.add("sharee__driver__"+t.getName()),t.mainEl}listenDriverEvents(t){const i=this.onDriverClick(t);this.driverListeners[t.buttonText]=[i],t.mainEl.addEventListener("click",i)}}const qt={position:"top-right",noTitle:!1};class Kt extends xe{constructor(t){super();o(this,"sharee");o(this,"shareeEl");o(this,"driverListeners",{});o(this,"options");this.sharee=t,this.shareeEl=document.createElement("div"),this.options=G({},qt,t.options.modeOptions)}destroy(){window.shareeEl=this.shareeEl,console.log(this.shareeEl),this.eventListeners.forEach(t=>{t[0].removeEventListener(t[1],t[2])}),this.shareeEl.parentElement.removeChild(this.shareeEl)}reRender(){this.destroy(),setTimeout(()=>{this.render()})}getPositionClass(){}render(){this.shareeEl=document.createElement("div"),this.shareeEl.classList.add("sharee__fixed"),this.shareeEl.classList.add("sharee__"+this.sharee.lang.Direction),this.shareeEl.classList.add("sharee__position__"+this.options.position),this.shareeEl.style.transition="all "+this.sharee.options.showTransitionDuration,this.shareeEl.style.transitionProperty="transform, opacity";for(let t of this.sharee.options.drivers){if(!this.shouldRenderDriver(t))continue;const i=this.resolveDriver(t),h=new i(this.sharee.lang,{lang:this.sharee.lang,shareText:this.sharee.getShareText(),shareLink:this.sharee.getShareLink(),ripple:this.sharee.options.ripple}),d=this.renderDriver(h);this.shareeEl.appendChild(d)}document.body.appendChild(this.shareeEl)}onDriverMouseEnter(t){return()=>{t.mainEl.style.backgroundColor=t.backgroundHoverColor,t.mainEl.style.color=t.textHoverColor}}onDriverMouseLeave(t){return()=>{this.initDriverStyles(t)}}onDriverClick(t){return i=>{t.onClick(i)}}initDriverStyles(t){var i,h;t.mainEl.style.backgroundColor=t.backgroundColor,t.mainEl.style.color=t.textColor,t.mainEl.style.transition=(((i=t.options)==null?void 0:i.transitionDuration)||"200ms")+" all",(h=t.options)!=null&&h.ripple&&this.initRipple(t)}initRipple(t){t.rippleInitialized||(t.rippleInitialized=!0,Promise.resolve().then(()=>ke).then(i=>{i.default(t.mainEl,{background:t.rippleColor})}))}renderDriver(t){t.mainEl=document.createElement("a"),"getLink"in t&&(t.mainEl.href=t.getLink()),this.initDriverStyles(t);const i=document.createElement("div");i.innerHTML=t.icon;const h=document.createElement("div");return h.innerHTML=t.getButtonText(),t.mainEl.appendChild(i),this.options.noTitle?(t.mainEl.title=t.getButtonText(),t.mainEl.classList.add("sharee__no-title")):t.mainEl.appendChild(h),t.mainEl.classList.add("sharee__driver__"+t.getName()),t.mainEl}}const Yt={dropdown:it,text:Gt,normal:Zt,fixed:Kt},dr="";class Jt{constructor(s,t=w){o(this,"options");o(this,"lang",Le);o(this,"strategy");o(this,"targetElement");this.targetElement=s,this.options=G({},w,t);const i=Yt[this.options.mode];if(typeof i>"u")throw new Error('Selected mode "'+t.mode+'" not found');this.strategy=new i(this),this.init().then(()=>{this.strategy.render()})}async init(){this.targetElement.sharee=this,await this.setLang(this.options.lang,this.options.langs)}async setLang(s,t={}){const i=Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>en),"../locales/fa.json":()=>Promise.resolve().then(()=>Ht)});let h=Le;for(const d in i)d.includes(s)&&(i[d]instanceof Function?h={...await i[d]()}:h={...i[d]},t[s]&&G(h,t[s]));this.lang=h}getShareText(){return this.options.shareText||document.title}getShareLink(){return this.options.shareLink||window.location.href}destroy(){this.strategy.destroy()}}var De={exports:{}};/*! +`;class Yt extends R{constructor(t,i){super(t,i);o(this,"buttonText","Facebook");o(this,"icon",Kt);o(this,"backgroundColor","#4267B2");o(this,"backgroundHoverColor","#355696");o(this,"textColor","#fff");o(this,"textHoverColor","#fff")}getLink(){var t,i;return`https://twitter.com/share?text=${encodeURIComponent((t=this.options)==null?void 0:t.shareText)}&url=${(i=this.options)==null?void 0:i.shareLink}`}}const Jt=new Object({telegram:Nt,whatsapp:Ut,copy:Wt,twitter:Xt,linkedin:qt,facebook:Yt});class X{constructor(s,t=w){o(this,"options");o(this,"lang",xe);o(this,"strategy");o(this,"targetElement");this.targetElement=s,this.options=G({},w,t),this.options.drivers=t.drivers||this.options.drivers;const i=$t[this.options.mode];if(typeof i>"u")throw new Error('Selected mode "'+t.mode+'" not found');this.strategy=new i(this),this.init().then(()=>{this.strategy.render()})}static addDriver(s,t){this.drivers[s]=t}async init(){this.targetElement.sharee=this,await this.setLang(this.options.lang,this.options.langs)}async setLang(s,t={}){const i=Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>en),"../locales/fa.json":()=>Promise.resolve().then(()=>Ht)});let h=xe;for(const d in i)d.includes(s)&&(i[d]instanceof Function?h={...await i[d]()}:h={...i[d]},t[s]&&G(h,t[s]));this.lang=h}getShareText(){return this.options.shareText||document.title}getShareLink(){return this.options.shareLink||window.location.href}destroy(){this.strategy.destroy()}}o(X,"drivers",{...Jt});var ke={exports:{}};/*! * ripple-effects * customizable ripple effect with one line of code * * @version v1.0.2 * @author Cris FandiƱo - */(function(g,s){(function(t,i){g.exports=i()})(W,function(){function t(l,u,c){return u in l?Object.defineProperty(l,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):l[u]=c,l}function i(l,u){var c=Object.keys(l);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(l);u&&(C=C.filter(function(_){return Object.getOwnPropertyDescriptor(l,_).enumerable})),c.push.apply(c,C)}return c}function h(l){for(var u=1;u-1}function re(l){var u,c={top:0,left:0};return u=(l&&l.ownerDocument).documentElement,l.getBoundingClientRect!==void 0&&(c=l.getBoundingClientRect()),{top:c.top+window.pageYOffset-u.clientTop,left:c.left+window.pageXOffset-u.clientLeft}}function ie(l){for(var u=[],c=0;c1&&arguments[1]!==void 0?arguments[1]:document,c=l instanceof HTMLCollection||l instanceof NodeList;return c?ie(l):l instanceof Element?[l]:ie(u.querySelectorAll(l))}var oe=Object.freeze({__proto__:null,tag:M,styles:$,edit:te,isSelfTag:ne,offset:re,elementToArray:se}),Se={background:"rgb(150,150,150)",opacity:.5,zIndex:99,duration:700,timing:"ease",outDuration:800},X=M,B=te,ae=re,Z=se,Me=ne,q=$;function le(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"_",u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=u=h(h({},Se),u),C=c.background,_=c.opacity,j=c.zIndex,He=c.duration,je=c.timing,Pe=c.height,ze=c.width,ce=c.triggerOnChild,Ae=ce===void 0||ce,he=c.triggerExcept,Ie=he===void 0?"_":he,ue=c.outDuration,fe="ontouchstart"in window;function pe(b){if(!(Z(Ie,this).indexOf(b.target)>-1)&&(b.target===this||Ae)){var O,N;q(this,"position").toLowerCase()==="static"&&(this.style.position="relative");var H=ae(this).top,Y=ae(this).left;try{if(b.touches[1])return;N=b.touches[0].pageX-Y,O=b.touches[0].pageY-H}catch{N=b.pageX-Y,O=b.pageY-H}var P=this.offsetWidth,de=this.offsetHeight,F=X("div",{appendTo:this,className:"ripleParent__",style:{zIndex:j,height:de+"px",width:P+"px",borderRadius:q(this,"borderRadius"),clipPath:q(this,"clipPath"),transition:"opacity ".concat(ue,"ms linear")}});X("div",{appendTo:F,className:"riple__",style:{top:O+"px",left:N+"px",opacity:_,width:ze||P*Math.PI+"px",height:Pe||P*Math.PI+"px",background:C,animation:"ripple__ ".concat(He,"ms ").concat(je," both")}});var ge=fe?"touchend touchcancel":"mouseleave mouseup";B(this).on(ge,function me(){var Re=this;F.style.opacity=0,setTimeout(function(){return Re.removeChild(F)},ue),B(this).off(ge,me)})}}var m=Z(l),K=fe?"touchstart":"mousedown";return m.forEach(function(b){if(Me(b))return console.error("Ripple is not allowed on self closing tag you need to wrap it");B(b).on(K,pe)}),{destroy:function(){m.forEach(function(b){return B(b).off(K,pe)})}}}return X("style",{innerHTML:".ripleParent__{pointer-events:none;overflow:hidden;background:transparent;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.riple__{border-radius:50%;position: absolute;will-change:transform; pointer-events:none;}@keyframes ripple__{0%{transform: translate(-50%,-50%) scale(0);}100%{transform: translate(-50%,-50%) scale(1);}}",appendTo:document.head}),le.utils=oe,le})})(De);const Qt=De.exports,ke=x({__proto__:null,default:Qt},[De.exports]),ot="ltr",at="Copied successfully",lt="Telegram",ct="Copy Link",ht="Whatsapp",ut="Twitter",ft="Linkedin",en=Object.freeze(Object.defineProperty({__proto__:null,Direction:ot,CopiedSuccessfully:at,Telegram:lt,Copy_Link:ct,Whatsapp:ht,Twitter:ut,Linkedin:ft,default:{Direction:ot,CopiedSuccessfully:at,Telegram:lt,Copy_Link:ct,Whatsapp:ht,Twitter:ut,Linkedin:ft}},Symbol.toStringTag,{value:"Module"}));return Jt}); + */(function(g,s){(function(t,i){g.exports=i()})(W,function(){function t(l,u,c){return u in l?Object.defineProperty(l,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):l[u]=c,l}function i(l,u){var c=Object.keys(l);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(l);u&&(C=C.filter(function(_){return Object.getOwnPropertyDescriptor(l,_).enumerable})),c.push.apply(c,C)}return c}function h(l){for(var u=1;u-1}function ie(l){var u,c={top:0,left:0};return u=(l&&l.ownerDocument).documentElement,l.getBoundingClientRect!==void 0&&(c=l.getBoundingClientRect()),{top:c.top+window.pageYOffset-u.clientTop,left:c.left+window.pageXOffset-u.clientLeft}}function se(l){for(var u=[],c=0;c1&&arguments[1]!==void 0?arguments[1]:document,c=l instanceof HTMLCollection||l instanceof NodeList;return c?se(l):l instanceof Element?[l]:se(u.querySelectorAll(l))}var ae=Object.freeze({__proto__:null,tag:M,styles:$,edit:ne,isSelfTag:re,offset:ie,elementToArray:oe}),Me={background:"rgb(150,150,150)",opacity:.5,zIndex:99,duration:700,timing:"ease",outDuration:800},Z=M,B=ne,le=ie,q=oe,He=re,K=$;function ce(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"_",u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=u=h(h({},Me),u),C=c.background,_=c.opacity,j=c.zIndex,je=c.duration,Pe=c.timing,ze=c.height,Ae=c.width,he=c.triggerOnChild,Ie=he===void 0||he,ue=c.triggerExcept,Re=ue===void 0?"_":ue,fe=c.outDuration,pe="ontouchstart"in window;function de(b){if(!(q(Re,this).indexOf(b.target)>-1)&&(b.target===this||Ie)){var D,N;K(this,"position").toLowerCase()==="static"&&(this.style.position="relative");var H=le(this).top,J=le(this).left;try{if(b.touches[1])return;N=b.touches[0].pageX-J,D=b.touches[0].pageY-H}catch{N=b.pageX-J,D=b.pageY-H}var P=this.offsetWidth,ge=this.offsetHeight,F=Z("div",{appendTo:this,className:"ripleParent__",style:{zIndex:j,height:ge+"px",width:P+"px",borderRadius:K(this,"borderRadius"),clipPath:K(this,"clipPath"),transition:"opacity ".concat(fe,"ms linear")}});Z("div",{appendTo:F,className:"riple__",style:{top:D+"px",left:N+"px",opacity:_,width:Ae||P*Math.PI+"px",height:ze||P*Math.PI+"px",background:C,animation:"ripple__ ".concat(je,"ms ").concat(Pe," both")}});var me=pe?"touchend touchcancel":"mouseleave mouseup";B(this).on(me,function ve(){var $e=this;F.style.opacity=0,setTimeout(function(){return $e.removeChild(F)},fe),B(this).off(me,ve)})}}var m=q(l),Y=pe?"touchstart":"mousedown";return m.forEach(function(b){if(He(b))return console.error("Ripple is not allowed on self closing tag you need to wrap it");B(b).on(Y,de)}),{destroy:function(){m.forEach(function(b){return B(b).off(Y,de)})}}}return Z("style",{innerHTML:".ripleParent__{pointer-events:none;overflow:hidden;background:transparent;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.riple__{border-radius:50%;position: absolute;will-change:transform; pointer-events:none;}@keyframes ripple__{0%{transform: translate(-50%,-50%) scale(0);}100%{transform: translate(-50%,-50%) scale(1);}}",appendTo:document.head}),ce.utils=ae,ce})})(ke);const Qt=ke.exports,Se=x({__proto__:null,default:Qt},[ke.exports]),ot="ltr",at="Copied successfully",lt="Telegram",ct="Copy Link",ht="Whatsapp",ut="Twitter",ft="Linkedin",en=Object.freeze(Object.defineProperty({__proto__:null,Direction:ot,CopiedSuccessfully:at,Telegram:lt,Copy_Link:ct,Whatsapp:ht,Twitter:ut,Linkedin:ft,default:{Direction:ot,CopiedSuccessfully:at,Telegram:lt,Copy_Link:ct,Whatsapp:ht,Twitter:ut,Linkedin:ft}},Symbol.toStringTag,{value:"Module"}));return X}); diff --git a/dist/style.css b/dist/style.css index d77040b..8747fb0 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1 +1 @@ -.sharee__normal{min-width:13em;display:flex;flex-direction:row;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:none}.sharee__normal a[href]{text-decoration:none}.sharee__normal svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__normal.sharee__rtl{direction:rtl}.sharee__normal>*{display:flex;justify-content:start;align-items:center;background:white;padding-top:3px;padding-bottom:4px;padding-inline-end:10px;padding-inline-start:5px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__normal>*:not(.sharee__no-title):hover{max-width:10em}.sharee__normal>*>*:first-child{margin-inline-end:.3em}.sharee__normal>*:hover{background:#ebebeb}.sharee__normal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__normal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__normal.sharee__normal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__normal.sharee__normal__grid>*{border-radius:0!important}.sharee__modal{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:#0006;opacity:0;transition:.3s all}.sharee__modal.showing{display:block}.sharee__modal.show{opacity:1}.sharee__modal .sharee__modal__content{background-color:#fefefe;margin:auto;padding:20px;border:1px solid #888;width:80%}.sharee__modal__close{color:#aaa;float:right;font-size:28px;font-weight:700}.sharee__modal__close:hover,.sharee__modal__close:focus{color:#000;text-decoration:none;cursor:pointer}.sharee__modal svg{width:1.9em;max-height:1.9em}.sharee__modal.sharee__rtl{direction:rtl}.sharee__modal>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__modal>*:hover{max-width:10em}.sharee__modal>* svg{transform:translateY(.13em)}.sharee__modal>*>*:first-child{margin-inline-end:.3em}.sharee__modal>*:hover{background:#ebebeb}.sharee__modal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__modal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__modal.sharee__modal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__modal.sharee__modal__grid>*{border-radius:0!important}.sharee__fixed{display:block;position:fixed;z-index:1;overflow:auto;transition:.3s all;border-start-end-radius:5px;border-end-end-radius:5px;--border-radius: 5px}.sharee__fixed a[href]{text-decoration:none}.sharee__fixed.sharee__position__top-right{right:0;top:10vh;direction:rtl!important}.sharee__fixed.sharee__position__top-left{left:0;top:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-left{left:0;bottom:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-right{bottom:10vh;right:0;direction:ltr!important}.sharee__fixed svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__fixed.sharee__rtl{direction:rtl}.sharee__fixed>*{display:flex;justify-content:start;align-items:center;background:white;padding-inline-start:2px;padding-inline-end:9px;padding-top:5px;padding-bottom:4px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__fixed>*:not(.sharee__no-title):hover{max-width:10em}.sharee__fixed>*>*:first-child{margin-inline-end:.3em}.sharee__fixed>*:hover{background:#ebebeb}.sharee__fixed>*:not(.sharee__no-title):hover{border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__fixed>*:first-child{border-start-end-radius:var(--border-radius)}.sharee__fixed>*:last-child{border-end-end-radius:var(--border-radius)}.sharee__text.sharee__dropdown{min-width:unset;left:-1000px}.sharee__text.sharee__dropdown>*{padding:0 4px}.sharee__dropdown.sharee__text>*>*:first-child{margin-inline-end:unset}.sharee__text.sharee__dropdown svg{vertical-align:middle}.sharee__dropdown{position:fixed;min-width:13em;display:flex;flex-direction:column;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:1px solid #c5c5c5;box-shadow:#3a3d42a6 0 1px,#0000007f 0 4px 16px -7px}.sharee__dropdown a[href]{text-decoration:none}.sharee__dropdown:not(.show):not(.showing){display:none!important}.sharee__dropdown.sharee__dropdown__row{border:none;box-shadow:#0000007f 0 1px 16px -7px}.sharee__dropdown.sharee__dropdown__row{flex-direction:row}.sharee__dropdown svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__dropdown.sharee__rtl{direction:rtl}.sharee__dropdown>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;min-height:2.6em}.sharee__dropdown:not(.sharee__dropdown__row)>*:first-child:not(:last-child){border-radius:var(--border-radius) var(--border-radius) 0 0}.sharee__dropdown:not(.sharee__dropdown__row)>*:last-child:not(:first-child){border-radius:0 0 var(--border-radius) var(--border-radius)}.sharee__dropdown>*>*:first-child{margin-inline-end:.3em}.sharee__dropdown>*:hover{background:#ebebeb}.sharee__dropdown.fade:not(.show){opacity:0}.sharee__dropdown.fade.show{opacity:1}.sharee__dropdown.fade-down:not(.show){opacity:0;transform:translateY(-10px)}.sharee__dropdown.fade-down.show{opacity:1;transform:translateY(0)}.sharee__dropdown.sharee__dropdown__row>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__row>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__dropdown.sharee__dropdown__grid>*{border-radius:0!important} +.sharee__normal{min-width:13em;display:flex;flex-direction:row;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:none}.sharee__normal a[href]{text-decoration:none}.sharee__normal svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__normal.sharee__rtl{direction:rtl}.sharee__normal>*{display:flex;justify-content:start;align-items:center;background:white;padding-top:3px;padding-bottom:4px;padding-inline-end:10px;padding-inline-start:5px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__normal>*:not(.sharee__no-title):hover{max-width:10em}.sharee__normal>*>*:first-child{margin-inline-end:.3em}.sharee__normal>*:hover{background:#ebebeb}.sharee__normal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__normal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__normal.sharee__normal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__normal.sharee__normal__grid>*{border-radius:0!important}.sharee__modal{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:#0006;opacity:0;transition:.3s all}.sharee__modal.showing{display:block}.sharee__modal.show{opacity:1}.sharee__modal .sharee__modal__content{background-color:#fefefe;margin:auto;padding:20px;border:1px solid #888;width:80%}.sharee__modal__close{color:#aaa;float:right;font-size:28px;font-weight:700}.sharee__modal__close:hover,.sharee__modal__close:focus{color:#000;text-decoration:none;cursor:pointer}.sharee__modal svg{width:1.9em;max-height:1.9em}.sharee__modal.sharee__rtl{direction:rtl}.sharee__modal>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__modal>*:hover{max-width:10em}.sharee__modal>* svg{transform:translateY(.13em)}.sharee__modal>*>*:first-child{margin-inline-end:.3em}.sharee__modal>*:hover{background:#ebebeb}.sharee__modal>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__modal>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__modal.sharee__modal__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__modal.sharee__modal__grid>*{border-radius:0!important}.sharee__fixed{display:block;position:fixed;z-index:1;overflow:auto;transition:.3s all;border-start-end-radius:5px;border-end-end-radius:5px;--border-radius: 5px}.sharee__fixed a[href]{text-decoration:none}.sharee__fixed.sharee__position__top-right{right:0;top:10vh;direction:rtl!important}.sharee__fixed.sharee__position__top-left{left:0;top:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-left{left:0;bottom:10vh;direction:ltr!important}.sharee__fixed.sharee__position__bottom-right{bottom:10vh;right:0;direction:rtl!important}.sharee__fixed svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__fixed.sharee__rtl{direction:rtl}.sharee__fixed>*{display:flex;justify-content:start;align-items:center;background:white;padding-inline-start:2px;padding-inline-end:9px;padding-top:5px;padding-bottom:4px;cursor:pointer;max-width:1.58em;white-space:nowrap;overflow:hidden}.sharee__fixed>*:not(.sharee__no-title):hover{max-width:10em}.sharee__fixed>*>*:first-child{margin-inline-end:.3em}.sharee__fixed>*:hover{background:#ebebeb}.sharee__fixed>*:not(.sharee__no-title):hover{border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__fixed>*:first-child{border-start-end-radius:var(--border-radius)}.sharee__fixed>*:last-child{border-end-end-radius:var(--border-radius)}.sharee__text.sharee__dropdown{min-width:unset;left:-1000px}.sharee__text.sharee__dropdown>*{padding:0 4px}.sharee__dropdown.sharee__text>*>*:first-child{margin-inline-end:unset}.sharee__text.sharee__dropdown svg{vertical-align:middle}.sharee__dropdown{position:fixed;min-width:13em;display:flex;flex-direction:column;background:white;--border-radius: 5px;border-radius:var(--border-radius);border:1px solid #c5c5c5;box-shadow:#3a3d42a6 0 1px,#0000007f 0 4px 16px -7px}.sharee__dropdown a[href]{text-decoration:none}.sharee__dropdown:not(.show):not(.showing){display:none!important}.sharee__dropdown.sharee__dropdown__row{border:none;box-shadow:#0000007f 0 1px 16px -7px}.sharee__dropdown.sharee__dropdown__row{flex-direction:row}.sharee__dropdown svg{width:1.9em;max-height:1.9em;vertical-align:middle}.sharee__dropdown.sharee__rtl{direction:rtl}.sharee__dropdown>*{display:flex;justify-content:start;align-items:center;background:white;padding:2px 7px 2px 10px;cursor:pointer;min-height:2.6em}.sharee__dropdown:not(.sharee__dropdown__row)>*:first-child:last-child{border-radius:inherit}.sharee__dropdown:not(.sharee__dropdown__row)>*:first-child:not(:last-child){border-radius:var(--border-radius) var(--border-radius) 0 0}.sharee__dropdown:not(.sharee__dropdown__row)>*:last-child:not(:first-child){border-radius:0 0 var(--border-radius) var(--border-radius)}.sharee__dropdown>*>*:first-child{margin-inline-end:.3em}.sharee__dropdown>*:hover{background:#ebebeb}.sharee__dropdown.fade:not(.show){opacity:0}.sharee__dropdown.fade.show{opacity:1}.sharee__dropdown.fade-down:not(.show){opacity:0;transform:translateY(-10px)}.sharee__dropdown.fade-down.show{opacity:1;transform:translateY(0)}.sharee__dropdown.sharee__dropdown__row>*:first-child:not(:last-child){border-start-start-radius:var(--border-radius);border-end-start-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__row>*:last-child:not(:first-child){border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius)}.sharee__dropdown.sharee__dropdown__grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.sharee__dropdown.sharee__dropdown__grid>*{border-radius:0!important} diff --git a/package.json b/package.json index c2c9e34..c15c896 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sharee", "private": false, - "version": "1.0.9", + "version": "1.0.10", "browser": "./dist/sharee.min.js", "main": "./dist/build.js", "module": "./dist/build.js", diff --git a/src/assets/styles/style-fixed.css b/src/assets/styles/style-fixed.css index fa27ea4..97b307a 100644 --- a/src/assets/styles/style-fixed.css +++ b/src/assets/styles/style-fixed.css @@ -34,7 +34,7 @@ .sharee__fixed.sharee__position__bottom-right { bottom: 10vh; right: 0; - direction: ltr!important; + direction: rtl!important; } diff --git a/src/vue/Sharee.vue b/src/vue/Sharee.vue index ab1d763..02dc2ea 100644 --- a/src/vue/Sharee.vue +++ b/src/vue/Sharee.vue @@ -6,23 +6,24 @@ import Lang from "../common/Lang"; interface ShareeOptions { lang?: LangName; - langs?: {[key: string]: Lang}; + langs?: { [key: string]: Lang }; onLoad?: Function; drivers?: string[]; showTransitionDuration?: string; shareLink?: string; shareText?: string; ripple?: boolean; - mode?: 'dropdown'|'dropdownRow'|'dropdownGrid'|'text'|'normal'|'fixed'; + mode?: 'dropdown' | 'dropdownRow' | 'dropdownGrid' | 'text' | 'normal' | 'fixed'; modeOptions?: any } const props = defineProps() console.log(props) -const shareeEl = ref(null) -const sharee = ref(null) +const shareeEl = ref(null) +const sharee = ref(null) onMounted(() => { + // @ts-ignore sharee.value = new Sharee(shareeEl.value!, props) })