@fynd-design-engineering/fynd-one-v2 3.4.6 → 3.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
.iti{position:relative;display:flex;width:100%}.iti__country-container{position:absolute;z-index:2;height:38px;top:1px;left:1px}.iti input,.iti input[type=tel],.iti input[type=text]{z-index:1}button.iti__selected-country{display:flex;align-items:center;gap:8px;height:100%;padding-left:10px;padding-right:20px;border-radius:6px}.iti__arrow{margin-left:6px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555;position:absolute;right:6px;top:19px}.iti__dropdown-content{background:#fff;top:6px;position:relative;border:1px solid #E3E3E3;border-radius:10px;overflow:hidden}span.iti__search-icon,span.iti__a11y-text{display:none}input.iti__search-input{border:1px solid var(--_color-palette---button--secondary--button-border-default);background-color:var(--background--background-light);color:var(--_primitives---neutral--neutral-100);border-radius:.5rem;width:100%;height:2rem;margin-bottom:0;padding:.5rem .75rem;font-weight:400;transition:all .3s;position:relative;z-index:1;font-size:.85rem}.iti__search-input-wrapper{position:relative;z-index:2;padding:8px;border-bottom:1px solid #E3E3E3}button.iti__search-clear{position:absolute;right:10px;top:8px;z-index:3;background:#fff}input#phone-number{padding-left:102px!important}.iti__arrow.iti__arrow--up{display:none}.iti__country-list{width:100%;position:static;z-index:2;list-style:none;text-align:left;padding:0;margin:0;box-shadow:none;background-color:#fff;border:0px solid #ccc;white-space:nowrap;max-height:200px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.iti__no-results{padding:40px 16px;text-align:center;background:#0000000a}.iti__country{padding:5px 10px;outline:0;display:flex;align-items:center;gap:10px}.iti__country-name,.iti__flag-box{margin-right:0}@media (max-width:500px){.iti--fullscreen-popup{padding:0!important;z-index:1000000000}.iti__country-list{position:static}.
|
|
1
|
+
.iti{position:relative;display:flex;width:100%}.iti__country-container{position:absolute;z-index:2;height:38px;top:1px;left:1px}.iti input,.iti input[type=tel],.iti input[type=text]{z-index:1}button.iti__selected-country{display:flex;align-items:center;gap:8px;height:100%;padding-left:10px;padding-right:20px;border-radius:6px}.iti__arrow{margin-left:6px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555;position:absolute;right:6px;top:19px}.iti__dropdown-content{background:#fff;top:6px;position:relative;border:1px solid #E3E3E3;border-radius:10px;overflow:hidden}span.iti__search-icon,span.iti__a11y-text{display:none}input.iti__search-input{border:1px solid var(--_color-palette---button--secondary--button-border-default);background-color:var(--background--background-light);color:var(--_primitives---neutral--neutral-100);border-radius:.5rem;width:100%;height:2rem;margin-bottom:0;padding:.5rem .75rem;font-weight:400;transition:all .3s;position:relative;z-index:1;font-size:.85rem}.iti__search-input-wrapper{position:relative;z-index:2;padding:8px;border-bottom:1px solid #E3E3E3}button.iti__search-clear{position:absolute;right:10px;top:8px;z-index:3;background:#fff}input#phone-number{padding-left:102px!important}.iti__arrow.iti__arrow--up{display:none}.iti__country-list{width:100%;position:static;z-index:2;list-style:none;text-align:left;padding:0;margin:0;box-shadow:none;background-color:#fff;border:0px solid #ccc;white-space:nowrap;max-height:200px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.iti__no-results{padding:40px 16px;text-align:center;background:#0000000a}.iti__country{padding:5px 10px;outline:0;display:flex;align-items:center;gap:10px}.iti__country-name,.iti__flag-box{margin-right:0}@media (max-width:500px){.iti--fullscreen-popup{padding:0!important;z-index:1000000000;position:fixed;top:0;left:0}.iti__country-list{position:static}.iti--fullscreen-popup .iti__dropdown-content{height:100vh;width:100%}.iti--flexible-dropdown-width .iti__country-list{height:calc(100vh - 60px);max-height:none}.iti input,.iti input[type=tel],.iti input[type=text]{height:40px}.iti__dropdown-content{background:#fff;top:0;border:0px solid #E3E3E3;border-radius:0;overflow:hidden}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/form/country-dropdown.css"],
|
|
4
|
-
"sourcesContent": [".iti {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n.iti__country-container {\n position: absolute;\n z-index: 2;\n height: 38px;\n top: 1px;\n left: 1px;\n}\n\n.iti input,\n.iti input[type=tel],\n.iti input[type=text] {\n z-index: 1;\n}\n\nbutton.iti__selected-country {\n display: flex;\n align-items: center;\n gap: 8px;\n height: 100%;\n padding-left: 10px;\n padding-right: 20px;\n border-radius: 6px;\n}\n\n.iti__arrow {\n margin-left: 6px;\n width: 0;\n height: 0;\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n border-top: 4px solid #555;\n position: absolute;\n right: 6px;\n top: 19px;\n}\n\n.iti__dropdown-content {\n background: white;\n\n top: 6px;\n position: relative;\n border: 1px solid #E3E3E3;\n border-radius: 10px;\n overflow: hidden;\n\n}\n\nspan.iti__search-icon {\n display: none;\n}\n\nspan.iti__a11y-text {\n display: none;\n}\n\ninput.iti__search-input {\n border: 1px solid var(--_color-palette---button--secondary--button-border-default);\n background-color: var(--background--background-light);\n color: var(--_primitives---neutral--neutral-100);\n border-radius: .5rem;\n width: 100%;\n height: 2rem;\n margin-bottom: 0;\n padding: .5rem .75rem;\n font-weight: 400;\n transition: all .3s;\n position: relative;\n z-index: 1;\n font-size: 0.85rem;\n}\n\n.iti__search-input-wrapper {\n position: relative;\n z-index: 2;\n padding: 8px;\n border-bottom: 1px solid #E3E3E3;\n}\n\nbutton.iti__search-clear {\n position: absolute;\n right: 10px;\n top: 8px;\n z-index: 3;\n background: white;\n}\n\ninput#phone-number {\n padding-left: 102px !important;\n}\n\n.iti__arrow.iti__arrow--up {\n display: none;\n}\n\n.iti__country-list {\n width: 100%;\n position: static;\n z-index: 2;\n list-style: none;\n text-align: left;\n padding: 0;\n margin: 0px;\n box-shadow: none;\n background-color: #fff;\n border: 0px solid #ccc;\n white-space: nowrap;\n max-height: 200px;\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n}\n\n.iti__no-results {\n padding-top: 40px;\n padding-bottom: 40px;\n padding-right: 16px;\n padding-left: 16px;\n text-align: center;\n background: #0000000a;\n}\n.iti__country {\n padding: 5px 10px;\n outline: 0;\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.iti__country-name, .iti__flag-box {\n margin-right: 0px;\n}\n\n\n\n\n@media (max-width:500px){\n.iti--fullscreen-popup{\npadding: 0px !important;\nz-index: 1000000000;\n}\n
|
|
5
|
-
"mappings": ";AAAA,CAAC;AACG,YAAU;AACV,WAAS;AACT,SAAO;AACX;AAEA,CAAC;AACG,YAAU;AACV,WAAS;AACT,UAAQ;AACR,OAAK;AACL,QAAM;AACV;AAEA,CAdC,IAcI;AACL,CAfC,IAeI,KAAK,CAAC;AACX,CAhBC,IAgBI,KAAK,CAAC;AACP,WAAS;AACb;AAEA,MAAM,CAAC;AACH,WAAS;AACT,eAAa;AACb,OAAK;AACL,UAAQ;AACR,gBAAc;AACd,iBAAe;AACf,iBAAe;AACnB;AAEA,CAAC;AACG,eAAa;AACb,SAAO;AACP,UAAQ;AACR,eAAa,IAAI,MAAM;AACvB,gBAAc,IAAI,MAAM;AACxB,cAAY,IAAI,MAAM;AACtB,YAAU;AACV,SAAO;AACP,OAAK;AACT;AAEA,CAAC;AACG,cAAY;AAEZ,OAAK;AACL,YAAU;AACV,UAAQ,IAAI,MAAM;AAClB,iBAAe;AACf,YAAU;AAEd;AAEA,IAAI,CAAC;AACD,WAAS;AACb;AAEA,IAAI,CAAC;AACD,WAAS;AACb;AAEA,KAAK,CAAC;AACF,UAAQ,IAAI,MAAM,IAAI;AACtB,oBAAkB,IAAI;AACtB,SAAO,IAAI;AACX,iBAAe;AACf,SAAO;AACP,UAAQ;AACR,iBAAe;AACf,WAAS,MAAM;AACf,eAAa;AACb,cAAY,IAAI;AAChB,YAAU;AACV,WAAS;AACT,aAAW;AACf;AAEA,CAAC;AACG,YAAU;AACV,WAAS;AACT,WAAS;AACT,iBAAe,IAAI,MAAM;AAC7B;AAEA,MAAM,CAAC;AACH,YAAU;AACV,SAAO;AACP,OAAK;AACL,WAAS;AACT,cAAY;AAChB;AAEA,KAAK,CAAC;AACF,gBAAc;AAClB;AAEA,CAlEC,UAkEU,CAAC;AACR,WAAS;AACb;AAEA,CAAC;AACG,SAAO;AACP,YAAU;AACV,WAAS;AACT,cAAY;AACZ,cAAY;AACZ,WAAS;AACT,UAAQ;AACR,cAAY;AACZ,oBAAkB;AAClB,UAAQ,IAAI,MAAM;AAClB,eAAa;AACb,cAAY;AACZ,cAAY;AACZ,8BAA4B;AAChC;AAEA,CAAC;AACG,eAAa;AACb,kBAAgB;AAChB,iBAAe;AACf,gBAAc;AACd,cAAY;AACZ,cAAY;AAChB;AACA,CAAC;AACG,WAAS,IAAI;AACb,WAAS;AACT,WAAS;AACT,eAAa;AACb,OAAK;AACT;AACA,CAAC;AAAmB,CAAC;AACjB,gBAAc;AAClB;AAKA,OAAO,CAAC,SAAS,CAAC;AAClB,GAAC;AACD,aAAS;AACT,aAAS;
|
|
4
|
+
"sourcesContent": [".iti {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n.iti__country-container {\n position: absolute;\n z-index: 2;\n height: 38px;\n top: 1px;\n left: 1px;\n}\n\n.iti input,\n.iti input[type=tel],\n.iti input[type=text] {\n z-index: 1;\n}\n\nbutton.iti__selected-country {\n display: flex;\n align-items: center;\n gap: 8px;\n height: 100%;\n padding-left: 10px;\n padding-right: 20px;\n border-radius: 6px;\n}\n\n.iti__arrow {\n margin-left: 6px;\n width: 0;\n height: 0;\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n border-top: 4px solid #555;\n position: absolute;\n right: 6px;\n top: 19px;\n}\n\n.iti__dropdown-content {\n background: white;\n\n top: 6px;\n position: relative;\n border: 1px solid #E3E3E3;\n border-radius: 10px;\n overflow: hidden;\n\n}\n\nspan.iti__search-icon {\n display: none;\n}\n\nspan.iti__a11y-text {\n display: none;\n}\n\ninput.iti__search-input {\n border: 1px solid var(--_color-palette---button--secondary--button-border-default);\n background-color: var(--background--background-light);\n color: var(--_primitives---neutral--neutral-100);\n border-radius: .5rem;\n width: 100%;\n height: 2rem;\n margin-bottom: 0;\n padding: .5rem .75rem;\n font-weight: 400;\n transition: all .3s;\n position: relative;\n z-index: 1;\n font-size: 0.85rem;\n}\n\n.iti__search-input-wrapper {\n position: relative;\n z-index: 2;\n padding: 8px;\n border-bottom: 1px solid #E3E3E3;\n}\n\nbutton.iti__search-clear {\n position: absolute;\n right: 10px;\n top: 8px;\n z-index: 3;\n background: white;\n}\n\ninput#phone-number {\n padding-left: 102px !important;\n}\n\n.iti__arrow.iti__arrow--up {\n display: none;\n}\n\n.iti__country-list {\n width: 100%;\n position: static;\n z-index: 2;\n list-style: none;\n text-align: left;\n padding: 0;\n margin: 0px;\n box-shadow: none;\n background-color: #fff;\n border: 0px solid #ccc;\n white-space: nowrap;\n max-height: 200px;\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n}\n\n.iti__no-results {\n padding-top: 40px;\n padding-bottom: 40px;\n padding-right: 16px;\n padding-left: 16px;\n text-align: center;\n background: #0000000a;\n}\n.iti__country {\n padding: 5px 10px;\n outline: 0;\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.iti__country-name, .iti__flag-box {\n margin-right: 0px;\n}\n\n\n\n\n@media (max-width:500px){\n.iti--fullscreen-popup{\npadding: 0px !important;\nz-index: 1000000000;\n position: fixed;\ntop: 0px;\nleft: 0px;\n}\n.iti__country-list {\nposition: static;\n}\n/* .iti__flag {\nbackground-position: var(--iti-flag-offset) 0 !important;\n} */\n.iti--fullscreen-popup .iti__dropdown-content {\nheight: 100vh;\nwidth: 100%;\n}\n.iti--flexible-dropdown-width .iti__country-list {\nheight: calc(100vh - 60px);\nmax-height: none;\n}\n.iti input, .iti input[type=tel], .iti input[type=text] {\nheight: 40px;\n}\n\n.iti__dropdown-content {\n background: white;\n top: 0px;\n border: 0px solid #E3E3E3;\n border-radius: 0px;\n overflow: hidden;\n}\n}\n\n"],
|
|
5
|
+
"mappings": ";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AM;AAClB,eAAa;AACb,cAAY;AACZ,cAAY;AACZ,8BAA4B;AAChC;AAEA,CAAC;AACG,eAAa;AACb,kBAAgB;AAChB,iBAAe;AACf,gBAAc;AACd,cAAY;AACZ,cAAY;AAChB;AACA,CAAC;AACG,WAAS,IAAI;AACb,WAAS;AACT,WAAS;AACT,eAAa;AACb,OAAK;AACT;AACA,CAAC;AAAmB,CAAC;AACjB,gBAAc;AAClB;AAKA,OAAO,CAAC,SAAS,CAAC;AAClB,GAAC;AACD,aAAS;AACT,aAAS;AACD,cAAU;AAClB,SAAK;AACL,UAAM;AACN;AACA,GA/CC;AAgDD,cAAU;AACV;AAIA,GAbC,sBAasB,CA/GtB;AAgHD,YAAQ;AACR,WAAO;AACP;AACA,GAAC,6BAA6B,CAzD7B;AA0DD,YAAQ,KAAK,MAAM,EAAE;AACrB,gBAAY;AACZ;AACA,GAjKC,IAiKI;AAAA,EAAO,CAjKX,IAiKgB,KAAK,CAAC;AAAA,EAAW,CAjKjC,IAiKsC,KAAK,CAAC;AAC7C,YAAQ;AACR;AAEA,GA3HC;AA4HG,gBAAY;AACZ,SAAK;AACL,YAAQ,IAAI,MAAM;AAClB,mBAAe;AACf,cAAU;AACd;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var c="user-id";function s(e,
|
|
1
|
+
"use strict";(()=>{var c="user-id";function s(e,t,r=365){let n=new Date(Date.now()+r*864e5).toUTCString(),o=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(t)}; Expires=${n}; Path=/; SameSite=Lax${o}`}function d(e){let t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null}function i(){let e=d(c);return e||(crypto&&"randomUUID"in crypto?e=crypto.randomUUID():e=`rid_${Date.now()}_${Math.random().toString(36).slice(2,10)}`,s(c,e,365*5),console.log("Created new RID:",e),e)}window.getRid=function(){return i()};document.addEventListener("DOMContentLoaded",()=>{let e=i();document.querySelectorAll('a[href*="console.fynd.com"], a[href^="https://console.fynd.com/"], a[href="https://console.fynd.com"]').forEach(n=>{try{let o=new URL(n.href);o.searchParams.set("referrer_uuid",e),n.href=o.toString()}catch{console.warn("Invalid URL in link:",n.href)}}),document.querySelectorAll("[fynd-form-field='uuid']").forEach(n=>{n instanceof HTMLInputElement&&(n.value=e)})});})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/tracking/custom-id.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "const COOKIE_RID = \"user-id\";\n\nfunction setCookie(name: string, value: string, days = 365): void {\n const expires = new Date(Date.now() + days * 864e5).toUTCString();\n const secure = location.protocol === \"https:\" ? \"; Secure\" : \"\";\n document.cookie = `${name}=${encodeURIComponent(value)}; Expires=${expires}; Path=/; SameSite=Lax${secure}`;\n}\n\nfunction getCookie(name: string): string | null {\n const match = document.cookie.match(new RegExp(\"(^| )\" + name + \"=([^;]+)\"));\n return match ? decodeURIComponent(match[2]) : null;\n}\n\nfunction getOrCreateStableRid(): string {\n let rid = getCookie(COOKIE_RID);\n if (rid) return rid;\n\n if (crypto && \"randomUUID\" in crypto) {\n rid = crypto.randomUUID();\n } else {\n rid = `rid_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`;\n }\n\n setCookie(COOKIE_RID, rid, 365 * 5);\n console.log(\"Created new RID:\", rid);\n return rid;\n}\n\n(window as any).getRid = function (): string {\n return getOrCreateStableRid();\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const rid = getOrCreateStableRid();\n // console.log(\"RID ready:\", rid);\n\n // --- 1. Add RID to console.fynd.com links ---\n const links = document.querySelectorAll<HTMLAnchorElement>(\n 'a[href*=\"console.fynd.com\"], a[href^=\"https://console.fynd.com/\"], a[href=\"https://console.fynd.com\"]'\n );\n\n links.forEach(link => {\n try {\n const url = new URL(link.href);\n url.searchParams.set(\"referrer_uuid\", rid);\n link.href = url.toString();\n } catch (err) {\n console.warn(\"Invalid URL in link:\", link.href);\n }\n });\n\n // --- 2. Fill RID into input#UUID if it exists ---\n const
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACVA,MAAM,aAAa;AAEnB,WAAS,UAAU,MAAc,OAAe,OAAO,KAAW;AAC9D,UAAM,UAAU,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,EAAE,YAAY;AAChE,UAAM,SAAS,SAAS,aAAa,WAAW,aAAa;AAC7D,aAAS,SAAS,GAAG,IAAI,IAAI,mBAAmB,KAAK,CAAC,aAAa,OAAO,yBAAyB,MAAM;AAAA,EAC7G;AAEA,WAAS,UAAU,MAA6B;AAC5C,UAAM,QAAQ,SAAS,OAAO,MAAM,IAAI,OAAO,UAAU,OAAO,UAAU,CAAC;AAC3E,WAAO,QAAQ,mBAAmB,MAAM,CAAC,CAAC,IAAI;AAAA,EAClD;AAEA,WAAS,uBAA+B;AACpC,QAAI,MAAM,UAAU,UAAU;AAC9B,QAAI,IAAK,QAAO;AAEhB,QAAI,UAAU,gBAAgB,QAAQ;AAClC,YAAM,OAAO,WAAW;AAAA,IAC5B,OAAO;AACH,YAAM,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAAA,IACtE;AAEA,cAAU,YAAY,KAAK,MAAM,CAAC;AAClC,YAAQ,IAAI,oBAAoB,GAAG;AACnC,WAAO;AAAA,EACX;AAEA,EAAC,OAAe,SAAS,WAAoB;AACzC,WAAO,qBAAqB;AAAA,EAChC;AAEA,WAAS,iBAAiB,oBAAoB,MAAM;AAChD,UAAM,MAAM,qBAAqB;AAIjC,UAAM,QAAQ,SAAS;AAAA,MACnB;AAAA,IACJ;AAEA,UAAM,QAAQ,UAAQ;AAClB,UAAI;AACA,cAAM,MAAM,IAAI,IAAI,KAAK,IAAI;AAC7B,YAAI,aAAa,IAAI,iBAAiB,GAAG;AACzC,aAAK,OAAO,IAAI,SAAS;AAAA,MAC7B,SAAS,KAAK;AACV,gBAAQ,KAAK,wBAAwB,KAAK,IAAI;AAAA,MAClD;AAAA,IACJ,CAAC;
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "const COOKIE_RID = \"user-id\";\n\nfunction setCookie(name: string, value: string, days = 365): void {\n const expires = new Date(Date.now() + days * 864e5).toUTCString();\n const secure = location.protocol === \"https:\" ? \"; Secure\" : \"\";\n document.cookie = `${name}=${encodeURIComponent(value)}; Expires=${expires}; Path=/; SameSite=Lax${secure}`;\n}\n\nfunction getCookie(name: string): string | null {\n const match = document.cookie.match(new RegExp(\"(^| )\" + name + \"=([^;]+)\"));\n return match ? decodeURIComponent(match[2]) : null;\n}\n\nfunction getOrCreateStableRid(): string {\n let rid = getCookie(COOKIE_RID);\n if (rid) return rid;\n\n if (crypto && \"randomUUID\" in crypto) {\n rid = crypto.randomUUID();\n } else {\n rid = `rid_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`;\n }\n\n setCookie(COOKIE_RID, rid, 365 * 5);\n console.log(\"Created new RID:\", rid);\n return rid;\n}\n\n(window as any).getRid = function (): string {\n return getOrCreateStableRid();\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const rid = getOrCreateStableRid();\n // console.log(\"RID ready:\", rid);\n\n // --- 1. Add RID to console.fynd.com links ---\n const links = document.querySelectorAll<HTMLAnchorElement>(\n 'a[href*=\"console.fynd.com\"], a[href^=\"https://console.fynd.com/\"], a[href=\"https://console.fynd.com\"]'\n );\n\n links.forEach(link => {\n try {\n const url = new URL(link.href);\n url.searchParams.set(\"referrer_uuid\", rid);\n link.href = url.toString();\n } catch (err) {\n console.warn(\"Invalid URL in link:\", link.href);\n }\n });\n\n // --- 2. Fill RID into input#UUID if it exists ---\n // Select all elements with fynd-form-field=\"uuid\"\n const uuidFields = document.querySelectorAll(\"[fynd-form-field='uuid']\");\n\n // Fill each field with the logo value (whatever 'rid' represents for you)\n uuidFields.forEach((el) => {\n if (el instanceof HTMLInputElement) {\n el.value = rid;\n }\n });\n});"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACVA,MAAM,aAAa;AAEnB,WAAS,UAAU,MAAc,OAAe,OAAO,KAAW;AAC9D,UAAM,UAAU,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,EAAE,YAAY;AAChE,UAAM,SAAS,SAAS,aAAa,WAAW,aAAa;AAC7D,aAAS,SAAS,GAAG,IAAI,IAAI,mBAAmB,KAAK,CAAC,aAAa,OAAO,yBAAyB,MAAM;AAAA,EAC7G;AAEA,WAAS,UAAU,MAA6B;AAC5C,UAAM,QAAQ,SAAS,OAAO,MAAM,IAAI,OAAO,UAAU,OAAO,UAAU,CAAC;AAC3E,WAAO,QAAQ,mBAAmB,MAAM,CAAC,CAAC,IAAI;AAAA,EAClD;AAEA,WAAS,uBAA+B;AACpC,QAAI,MAAM,UAAU,UAAU;AAC9B,QAAI,IAAK,QAAO;AAEhB,QAAI,UAAU,gBAAgB,QAAQ;AAClC,YAAM,OAAO,WAAW;AAAA,IAC5B,OAAO;AACH,YAAM,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAAA,IACtE;AAEA,cAAU,YAAY,KAAK,MAAM,CAAC;AAClC,YAAQ,IAAI,oBAAoB,GAAG;AACnC,WAAO;AAAA,EACX;AAEA,EAAC,OAAe,SAAS,WAAoB;AACzC,WAAO,qBAAqB;AAAA,EAChC;AAEA,WAAS,iBAAiB,oBAAoB,MAAM;AAChD,UAAM,MAAM,qBAAqB;AAIjC,UAAM,QAAQ,SAAS;AAAA,MACnB;AAAA,IACJ;AAEA,UAAM,QAAQ,UAAQ;AAClB,UAAI;AACA,cAAM,MAAM,IAAI,IAAI,KAAK,IAAI;AAC7B,YAAI,aAAa,IAAI,iBAAiB,GAAG;AACzC,aAAK,OAAO,IAAI,SAAS;AAAA,MAC7B,SAAS,KAAK;AACV,gBAAQ,KAAK,wBAAwB,KAAK,IAAI;AAAA,MAClD;AAAA,IACJ,CAAC;AAID,UAAM,aAAa,SAAS,iBAAiB,0BAA0B;AAGvE,eAAW,QAAQ,CAAC,OAAO;AACvB,UAAI,cAAc,kBAAkB;AAChC,WAAG,QAAQ;AAAA,MACf;AAAA,IACJ,CAAC;AAAA,EACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/tracking/fill-form-fields.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// formFiller.ts - Auto-fill form fields with user journey data\nimport { UserJourney, TouchPoint } from './types';\n\n/**\n * Fills form input fields with user journey data based on fynd-queryparam-name attributes\n */\nfunction fillFormWithUserJourney(): void {\n try {\n // Get user journey data from session storage\n const journey: UserJourney | null = getUserJourneyData();\n\n if (!journey || journey.userJourney.length === 0) {\n //console.log('No user journey data available to fill form fields');\n return;\n }\n\n // Get first page (landing page) and last page data\n const firstPage: TouchPoint = journey.userJourney[0];\n let lastPage: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n\n // If current page is contact-us, use the previous page as last page\n if (journey.userJourney.length > 1 &&\n journey.userJourney[journey.userJourney.length - 1].page === '/contact-us') {\n lastPage = journey.userJourney[journey.userJourney.length - 2];\n }\n\n // Define the mapping of attribute values to data\n const fieldMappings: Record<string, string> = {\n // UTM parameters\n 'utm_source': firstPage.utm.source,\n 'utm_medium': firstPage.utm.medium,\n 'utm_campaign': firstPage.utm.campaign,\n\n // First Page (Landing Page) data\n 'fp_custom_page_title': firstPage.title,\n 'fp_custom_page_category': firstPage.category.join(', '),\n 'fp_custom_page_type': firstPage.type,\n 'fp_timestamp': firstPage.time,\n 'fp_path': firstPage.page,\n\n // Last Page data\n 'lp_custom_page_title': lastPage.title,\n 'lp_custom_page_category': lastPage.category.join(', '),\n 'lp_custom_page_type': lastPage.type,\n 'lp_timestamp': lastPage.time,\n 'lp_path': lastPage.page,\n\n // Journey metadata\n 'userjourney': JSON.stringify(journey.userJourney),\n 'device': journey.deviceCategory,\n 'browser': journey.browser,\n\n // Refferer\n 'refferer_domain': window.location.hostname,\n\n //current page URL\n 'current-page-url': window.location.href,\n };\n\n // Find and fill each form field\n Object.entries(fieldMappings).forEach(([attributeValue, data]) => {\n fillFormField(attributeValue, data);\n });\n\n //console.log('Form fields filled with user journey data');\n\n } catch (error: unknown) {\n console.error('Error filling form with user journey data:', error);\n }\n}\n\n/**\n * Helper function to get user journey data from session storage\n */\nfunction getUserJourneyData(): UserJourney | null {\n try {\n const storedData: string | null = sessionStorage.getItem('userJourney');\n return storedData ? JSON.parse(storedData) as UserJourney : null;\n } catch (error: unknown) {\n console.error('Error getting user journey data:', error);\n return null;\n }\n}\n\n/**\n * Helper function to find and fill a specific form field\n */\nfunction fillFormField(attributeValue: string, data: string): void {\n try {\n
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACJA,WAAS,0BAAgC;AACrC,QAAI;AAEA,YAAM,UAA8B,mBAAmB;AAEvD,UAAI,CAAC,WAAW,QAAQ,YAAY,WAAW,GAAG;AAE9C;AAAA,MACJ;AAGA,YAAM,YAAwB,QAAQ,YAAY,CAAC;AACnD,UAAI,WAAuB,QAAQ,YAAY,QAAQ,YAAY,SAAS,CAAC;AAG7E,UAAI,QAAQ,YAAY,SAAS,KAC7B,QAAQ,YAAY,QAAQ,YAAY,SAAS,CAAC,EAAE,SAAS,eAAe;AAC5E,mBAAW,QAAQ,YAAY,QAAQ,YAAY,SAAS,CAAC;AAAA,MACjE;AAGA,YAAM,gBAAwC;AAAA;AAAA,QAE1C,cAAc,UAAU,IAAI;AAAA,QAC5B,cAAc,UAAU,IAAI;AAAA,QAC5B,gBAAgB,UAAU,IAAI;AAAA;AAAA,QAG9B,wBAAwB,UAAU;AAAA,QAClC,2BAA2B,UAAU,SAAS,KAAK,IAAI;AAAA,QACvD,uBAAuB,UAAU;AAAA,QACjC,gBAAgB,UAAU;AAAA,QAC1B,WAAW,UAAU;AAAA;AAAA,QAGrB,wBAAwB,SAAS;AAAA,QACjC,2BAA2B,SAAS,SAAS,KAAK,IAAI;AAAA,QACtD,uBAAuB,SAAS;AAAA,QAChC,gBAAgB,SAAS;AAAA,QACzB,WAAW,SAAS;AAAA;AAAA,QAGpB,eAAe,KAAK,UAAU,QAAQ,WAAW;AAAA,QACjD,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA;AAAA,QAGnB,mBAAmB,OAAO,SAAS;AAAA;AAAA,QAGnC,oBAAoB,OAAO,SAAS;AAAA,MACxC;AAGA,aAAO,QAAQ,aAAa,EAAE,QAAQ,CAAC,CAAC,gBAAgB,IAAI,MAAM;AAC9D,sBAAc,gBAAgB,IAAI;AAAA,MACtC,CAAC;AAAA,IAIL,SAAS,OAAgB;AACrB,cAAQ,MAAM,8CAA8C,KAAK;AAAA,IACrE;AAAA,EACJ;AAKA,WAAS,qBAAyC;AAC9C,QAAI;AACA,YAAM,aAA4B,eAAe,QAAQ,aAAa;AACtE,aAAO,aAAa,KAAK,MAAM,UAAU,IAAmB;AAAA,IAChE,SAAS,OAAgB;AACrB,cAAQ,MAAM,oCAAoC,KAAK;AACvD,aAAO;AAAA,IACX;AAAA,EACJ;AAKA,WAAS,cAAc,gBAAwB,MAAoB;AAC/D,QAAI;
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// formFiller.ts - Auto-fill form fields with user journey data\nimport { UserJourney, TouchPoint } from './types';\n\n/**\n * Fills form input fields with user journey data based on fynd-queryparam-name attributes\n */\nfunction fillFormWithUserJourney(): void {\n try {\n // Get user journey data from session storage\n const journey: UserJourney | null = getUserJourneyData();\n\n if (!journey || journey.userJourney.length === 0) {\n //console.log('No user journey data available to fill form fields');\n return;\n }\n\n // Get first page (landing page) and last page data\n const firstPage: TouchPoint = journey.userJourney[0];\n let lastPage: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n\n // If current page is contact-us, use the previous page as last page\n if (journey.userJourney.length > 1 &&\n journey.userJourney[journey.userJourney.length - 1].page === '/contact-us') {\n lastPage = journey.userJourney[journey.userJourney.length - 2];\n }\n\n // Define the mapping of attribute values to data\n const fieldMappings: Record<string, string> = {\n // UTM parameters\n 'utm_source': firstPage.utm.source,\n 'utm_medium': firstPage.utm.medium,\n 'utm_campaign': firstPage.utm.campaign,\n\n // First Page (Landing Page) data\n 'fp_custom_page_title': firstPage.title,\n 'fp_custom_page_category': firstPage.category.join(', '),\n 'fp_custom_page_type': firstPage.type,\n 'fp_timestamp': firstPage.time,\n 'fp_path': firstPage.page,\n\n // Last Page data\n 'lp_custom_page_title': lastPage.title,\n 'lp_custom_page_category': lastPage.category.join(', '),\n 'lp_custom_page_type': lastPage.type,\n 'lp_timestamp': lastPage.time,\n 'lp_path': lastPage.page,\n\n // Journey metadata\n 'userjourney': JSON.stringify(journey.userJourney),\n 'device': journey.deviceCategory,\n 'browser': journey.browser,\n\n // Refferer\n 'refferer_domain': window.location.hostname,\n\n //current page URL\n 'current-page-url': window.location.href,\n };\n\n // Find and fill each form field\n Object.entries(fieldMappings).forEach(([attributeValue, data]) => {\n fillFormField(attributeValue, data);\n });\n\n //console.log('Form fields filled with user journey data');\n\n } catch (error: unknown) {\n console.error('Error filling form with user journey data:', error);\n }\n}\n\n/**\n * Helper function to get user journey data from session storage\n */\nfunction getUserJourneyData(): UserJourney | null {\n try {\n const storedData: string | null = sessionStorage.getItem('userJourney');\n return storedData ? JSON.parse(storedData) as UserJourney : null;\n } catch (error: unknown) {\n console.error('Error getting user journey data:', error);\n return null;\n }\n}\n\n/**\n * Helper function to find and fill a specific form field\n */\nfunction fillFormField(attributeValue: string, data: string): void {\n try {\n const selector = `[fynd-queryparam-name=\"${attributeValue}\"]`;\n const elements = document.querySelectorAll(selector);\n\n if (elements.length > 0) {\n elements.forEach((element: any) => {\n element.value = data;\n\n // Trigger input event\n const inputEvent = new Event('input', { bubbles: true });\n element.dispatchEvent(inputEvent);\n\n // Trigger change event\n const changeEvent = new Event('change', { bubbles: true });\n element.dispatchEvent(changeEvent);\n });\n } else {\n // console.log(`No fields found for attribute [${attributeValue}]`);\n }\n } catch (error) {\n console.error(`Error filling field [${attributeValue}]:`, error);\n }\n}\n\n// Execute the function on DOM load with 500ms delay\ndocument.addEventListener('DOMContentLoaded', (): void => {\n setTimeout(() => {\n fillFormWithUserJourney();\n }, 500);\n});\n\n// Also execute immediately if DOM is already loaded\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', (): void => {\n setTimeout(() => {\n fillFormWithUserJourney();\n }, 500);\n });\n} else {\n setTimeout(() => {\n fillFormWithUserJourney();\n }, 500);\n}\n\n// Make function globally accessible\ndeclare global {\n interface Window {\n fillFormWithUserJourney: () => void;\n }\n}\n\n// Attach function to window object for global access\nwindow.fillFormWithUserJourney = fillFormWithUserJourney;\n\n// Export function for module usage\nexport { fillFormWithUserJourney };"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACJA,WAAS,0BAAgC;AACrC,QAAI;AAEA,YAAM,UAA8B,mBAAmB;AAEvD,UAAI,CAAC,WAAW,QAAQ,YAAY,WAAW,GAAG;AAE9C;AAAA,MACJ;AAGA,YAAM,YAAwB,QAAQ,YAAY,CAAC;AACnD,UAAI,WAAuB,QAAQ,YAAY,QAAQ,YAAY,SAAS,CAAC;AAG7E,UAAI,QAAQ,YAAY,SAAS,KAC7B,QAAQ,YAAY,QAAQ,YAAY,SAAS,CAAC,EAAE,SAAS,eAAe;AAC5E,mBAAW,QAAQ,YAAY,QAAQ,YAAY,SAAS,CAAC;A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