(()=>{"use strict";var e,t,r={},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var o=a[e]={exports:{}};return r[e](o,o.exports,i),o.exports}i.m=r,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+"/bfba63ca3870acbc5783.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="[name]Destination:",i.l=(r,a,o,n)=>{if(e[r])e[r].push(a);else{var s,l;if(void 0!==o)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var u=d[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+o){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",t+o),s.src=r),e[r]=[a];var p=(t,a)=>{s.onerror=s.onload=null,clearTimeout(b);var i=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(a))),t)return t(a)},b=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{var e={17:0};i.f.j=(t,r)=>{var a=i.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{var o=new Promise(((r,i)=>a=e[t]=[r,i]));r.push(a[2]=o);var n=i.p+i.u(t),s=new Error;i.l(n,(r=>{if(i.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",s.name="ChunkLoadError",s.type=o,s.request=n,a[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var a,o,[n,s,l]=r,d=0;if(n.some((t=>0!==e[t]))){for(a in s)i.o(s,a)&&(i.m[a]=s[a]);if(l)l(i)}for(t&&t(r);d<n.length;d++)o=n[d],i.o(e,o)&&e[o]&&e[o][0](),e[n[d]]=0},r=self.webpackChunk_name_Destination=self.webpackChunk_name_Destination||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var o={};i.d(o,{default:()=>s});const n={title:"Attach",description:"Attach a device to the user.",defaultSubscription:'type = "identify"',platform:"web",fields:{user_id:{type:"string",required:!0,label:"User ID",description:"The ID of the user ",default:{"@path":"$.userId"}},metadata:{type:"object",required:!1,label:"Metadata",description:"A key-value object that will be stored alongside the user, device and access records. This will be available to in any webhooks or API calls. Useful if you want to remote logout a device or invalidate a session from the backend via webhook."}},async perform(e,{settings:t,payload:r}){"string"==typeof r.user_id&&await e.attach({user:r.user_id,client_id:t.client_id,debug:!0})}},s=(l={name:"Sabil",slug:"actions-sabil",mode:"device",settings:{client_id:{description:"Your project API client ID. You can find it in your Sabil [dashboard](https://dashboard.sabil.io/api_keys)",label:"Client ID",required:!0,type:"string"}},initialize:async(e,t)=>{try{return await t.loadScript("https://cdn.sabil.io/global.js"),await t.resolveWhen((()=>Object.prototype.hasOwnProperty.call(window,"Sabil")),100),window.Sabil}catch(e){throw new Error("Could not load the Sabil js package")}},actions:{attach:n}},async e=>(await i.e(688).then(i.bind(i,8688))).generatePlugins(l,e,e.subscriptions||[]));var l;window.sabilDestination=o.default})();
//# sourceMappingURL=8127ad4776840319522f.js.map