{"version":3,"file":"scripts/chunks/_app_app_scripts_core_views_O34-slide-cards-mobile-tablet_ts.c9e48c7594e0416123a7.mjs","mappings":"wMAyBA,WAAeA,EAAAA,EAAAA,GAAgB,kBAJfC,IAZMA,KACpB,IAAIC,EAAAA,EAAO,CACTD,GAAIA,EAAGE,cACPC,MAAO,gCACPC,SAAU,EACVC,UAAW,UACXC,MAAO,QACPC,UAAU,EACVC,aAAc,QACdC,sBAAsB,GACtB,EAGFC,CAAaV,EAAG,IAG6C,M,wDCvBxD,MAAMD,EAAkB,SAACY,EAAcC,EAA4BC,GAAyC,IAAnBC,IAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACrG,MAAMG,EAAWC,SAASC,iBAAiBN,EAAU,IAAIH,IAASA,GAsBlE,MAAO,CAAEU,OApBMA,KACb,GAAGC,QAAQC,KAAKL,GAAWlB,IACa,MAAlCA,EAAGwB,QAAQC,qBAAgCzB,EAAGwB,QAAQC,oBAAoBC,SAASf,KACrFC,EAAOZ,GACPA,EAAGwB,QAAQC,oBAAsB,GAAGzB,EAAGwB,QAAQC,qBAAuB,MAAMd,IAC9E,GACA,EAcaE,QAXOc,KAClBd,GACF,GAAGS,QAAQC,KAAKL,GAAWlB,IACzBa,IACIb,EAAGwB,QAAQC,sBACbzB,EAAGwB,QAAQC,oBAAsBzB,EAAGwB,QAAQC,oBAAoBG,QAAQjB,EAAM,IAChF,GAEJ,EAIJ,C","sources":["webpack://rockworld/./app/scripts/core/views/O34-slide-cards-mobile-tablet.ts","webpack://rockworld/./app/scripts/core/views/vanilla/elementsFactory.ts"],"sourcesContent":["/**\r\n * O34 Slide cards\r\n *\r\n * @author Johannes Greve <jgreve@vertic.com>\r\n */\r\n\r\nimport Slider from '../../framework/slider';\r\nimport { elementsFactory } from './vanilla/elementsFactory';\r\n\r\nconst createSlider = (el: Element): Slider =>\r\n  new Slider({\r\n    el: el.parentElement,\r\n    inner: '.card-list--swipe-stack-cards',\r\n    perSlide: 2,\r\n    bpMaxSize: 'desktop',\r\n    slide: '.card',\r\n    controls: true,\r\n    controlsType: 'arrow',\r\n    hideDraggableElemnts: true,\r\n  });\r\n\r\nconst render = (el: Element): void => {\r\n  createSlider(el);\r\n};\r\n\r\nexport default elementsFactory('js-card-slider', render).create;\r\n","import type { FuncCreateElements } from './types';\r\n\r\nexport const elementsFactory = (name: string, render: FuncCreateElements, destroy?: () => void, isClass = true) => {\r\n  const elements = document.querySelectorAll(isClass ? `.${name}` : name);\r\n\r\n  const create = () => {\r\n    [].forEach.call(elements, (el: HTMLElement) => {\r\n      if (el.dataset.initilaizedElements == null || !el.dataset.initilaizedElements.includes(name)) {\r\n        render(el);\r\n        el.dataset.initilaizedElements = `${el.dataset.initilaizedElements ?? ''} ${name}`;\r\n      }\r\n    });\r\n  };\r\n\r\n  const destroyElements = () => {\r\n    if (destroy) {\r\n      [].forEach.call(elements, (el: { dataset: { initilaizedElements: string } }) => {\r\n        destroy();\r\n        if (el.dataset.initilaizedElements) {\r\n          el.dataset.initilaizedElements = el.dataset.initilaizedElements.replace(name, '');\r\n        }\r\n      });\r\n    }\r\n  };\r\n\r\n  return { create, destroy: destroyElements };\r\n};\r\n"],"names":["elementsFactory","el","Slider","parentElement","inner","perSlide","bpMaxSize","slide","controls","controlsType","hideDraggableElemnts","createSlider","name","render","destroy","isClass","arguments","length","undefined","elements","document","querySelectorAll","create","forEach","call","dataset","initilaizedElements","includes","destroyElements","replace"],"sourceRoot":""}