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AA,CAAA,CAAA,CAAA,CACzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAK;AAElE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA","sourcesContent":["import { run } from 'remix/ui';\n\ndeclare global {\n\tinterface Window {\n\t\tchatwootSettings: Record<string, string>;\n\t\tchatwootSDK: {\n\t\t\trun(options: { websiteToken: string; baseUrl: string }): void;\n\t\t};\n\t\t$chatwoot: {\n\t\t\ttoggle(state?: 'open' | 'close'): void;\n\t\t\tsetUser(\n\t\t\t\tidentifier: string,\n\t\t\t\tattributes: {\n\t\t\t\t\tname?: string;\n\t\t\t\t\temail?: string;\n\t\t\t\t\tidentifier_hash?: string;\n\t\t\t\t}\n\t\t\t): void;\n\t\t};\n\t}\n}\n\n// Identity from the SSO round trip, rendered into the document head by the\n// server. Absent when the visitor arrived without a session.\nfunction readMeta(name: string) {\n\treturn document\n\t\t.querySelector<HTMLMetaElement>(`meta[name=\"${name}\"]`)\n\t\t?.content?.trim();\n}\n\nconst app = run({\n\tasync loadModule(moduleUrl, exportName) {\n\t\tlet mod = await import(moduleUrl);\n\t\treturn mod[exportName];\n\t},\n\tasync resolveFrame(src, options) {\n\t\tlet response = await fetch(src, {\n\t\t\theaders: { Accept: 'text/html' },\n\t\t\tmethod: options?.method,\n\t\t\tbody: getRequestBody(\n\t\t\t\toptions?.formData,\n\t\t\t\toptions?.method,\n\t\t\t\toptions?.encType\n\t\t\t),\n\t\t\tsignal: options?.signal\n\t\t});\n\t\tif (!response.ok) {\n\t\t\treturn `<pre>Frame error: ${response.status} ${response.statusText}</pre>`;\n\t\t}\n\n\t\tif (response.body) return response.body;\n\t\treturn await response.text();\n\t}\n});\n\n// Loaded here rather than an inline <script> — the SSR renderer escapes text.\n// Substituted by the `define` in app/assets.ts; neither value is a secret.\nconst CHATWOOT_BASE_URL = process.env.CHATWOOT_BASE_URL;\nconst CHATWOOT_WEBSITE_TOKEN = process.env.CHATWOOT_WEBSITE_TOKEN;\n\n// The gate, enforced where it counts: no identity, no widget. Otherwise the SDK\n// opens a conversation for an anonymous visitor whatever the page rendered.\nconst HOTLINE_USER_SUB = readMeta('hotline-user-sub');\n\nif (CHATWOOT_BASE_URL && CHATWOOT_WEBSITE_TOKEN && HOTLINE_USER_SUB) {\n\twindow.chatwootSettings = {\n\t\tposition: 'right',\n\t\ttype: 'expanded_bubble',\n\t\tlauncherTitle: 'Hubungi Sekarang'\n\t};\n\n\t// Dock the launcher into the page's slot so it sits in the card, not floating.\n\t// Handlers travel with the node and the SDK finds its elements by class.\n\tlet dockLauncher = () => {\n\t\tlet slot = document.getElementById('chatwoot-launcher-slot');\n\t\tlet holder = document.getElementById('cw-bubble-holder');\n\t\tif (slot && holder) slot.append(holder);\n\t};\n\t// Keyed on `sub` — an email can change, the subject cannot. Only ever from\n\t// 'chatwoot:ready': setUser posts to the iframe unqueued, then caches the send.\n\tlet identifyUser = () => {\n\t\tlet name = readMeta('hotline-user-name');\n\t\tlet email = readMeta('hotline-user-email');\n\t\t// Rejected outright when both are empty, which would abort this handler.\n\t\tif (!window.$chatwoot?.setUser || (!name && !email)) return;\n\n\t\ttry {\n\t\t\twindow.$chatwoot.setUser(HOTLINE_USER_SUB, {\n\t\t\t\tname,\n\t\t\t\temail,\n\t\t\t\t// Only present when the server had an HMAC token to sign with.\n\t\t\t\tidentifier_hash: readMeta('hotline-user-identifier-hash')\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error('[hotline] chatwoot setUser failed', error);\n\t\t}\n\t};\n\n\twindow.addEventListener('chatwoot:ready', () => {\n\t\tdockLauncher();\n\t\tidentifyUser();\n\t});\n\n\t// The panel covers the docked launcher on desktop and the SDK draws no close\n\t// button there, so the backdrop is the way out. Same selector the CSS keys on.\n\tconst PANEL_OPEN =\n\t\t'#cw-widget-holder.woot-widget-holder:not(.woot--hide):not(.has-unread-view)';\n\tdocument.addEventListener('click', (event) => {\n\t\t// The backdrop is body::before, so its clicks report <body> as the target.\n\t\tif (event.target !== document.body) return;\n\t\tif (document.querySelector(PANEL_OPEN)) window.$chatwoot.toggle('close');\n\t});\n\n\t// Identification fails inside the widget iframe, so nothing above can catch it.\n\t// Without this the only symptom is a pre-chat form still asking for name+email.\n\twindow.addEventListener('chatwoot:error', (event) => {\n\t\tconsole.error('[hotline] chatwoot error', (event as CustomEvent).detail);\n\t});\n\n\t// Publish the card's height so the open panel can match it. ResizeObserver\n\t// fires once on observe, so this covers the initial value too.\n\tlet card = document.getElementById('chat-card');\n\tif (card) {\n\t\tnew ResizeObserver(() => {\n\t\t\tdocument.documentElement.style.setProperty(\n\t\t\t\t'--cw-card-height',\n\t\t\t\t`${card.getBoundingClientRect().height}px`\n\t\t\t);\n\t\t}).observe(card);\n\t}\n\n\tlet script = document.createElement('script');\n\tscript.src = `${CHATWOOT_BASE_URL}/packs/js/sdk.js`;\n\tscript.async = true;\n\tscript.onload = () => {\n\t\twindow.chatwootSDK.run({\n\t\t\twebsiteToken: CHATWOOT_WEBSITE_TOKEN,\n\t\t\tbaseUrl: CHATWOOT_BASE_URL\n\t\t});\n\t\tdockLauncher();\n\t};\n\tdocument.head.append(script);\n\n\t// The SDK only does 'left' | 'right', so centre the panel in CSS. margin auto,\n\t// not translateX — the SDK animates open/close with `transform`.\n\tlet style = document.createElement('style');\n\tstyle.textContent = `\n    /* Always present so opacity has something to animate — a :has() that stops\n       matching would remove the box outright and the fade-out with it. */\n    body::before {\n      content: '';\n      position: fixed;\n      inset: 0;\n      background: rgb(0 0 0 / 0.4);\n      z-index: 2147482999;\n      opacity: 0;\n      pointer-events: none;\n      /* Matches the SDK's own 'opacity 200ms ease' on the panel. */\n      transition: opacity 200ms ease;\n    }\n\n    /* Open, keyed off the SDK's .woot--hide. Takes clicks so the backdrop can\n       close the panel — same selector as PANEL_OPEN above. */\n    body:has(#cw-widget-holder.woot-widget-holder:not(.woot--hide):not(.has-unread-view))::before {\n      opacity: 1;\n      pointer-events: auto;\n    }\n\n    @media (prefers-reduced-motion: reduce) {\n      body::before { transition: none; }\n    }\n\n    @media only screen and (min-width: 668px) {\n      /* Rounded only while the panel floats; it's edge-to-edge fullscreen below. */\n      #cw-widget-holder.woot-widget-holder { border-radius: 20px; }\n\n      #cw-widget-holder.woot-widget-holder:not(.has-unread-view) {\n        left: 0;\n        right: 0;\n        top: 0;\n        bottom: 0;\n        margin: auto;\n        /* Match the card, measured at runtime: it's content-driven at md+\n           (h-auto + min-h), which CSS can't derive from breakpoints. */\n        height: calc(var(--cw-card-height) - 24px) !important;\n        max-height: none !important;\n      }\n    }\n\n    /* Launcher docked into the page's slot instead of floating. Scoped to the\n       slot id, which also out-specifies the SDK's .woot-elements--right. */\n    #chatwoot-launcher-slot .woot-widget-bubble {\n      position: absolute;\n      inset: 0;\n      width: 100% !important;\n      height: 48px !important;\n      margin: 0;\n      padding: 0;\n      border-radius: 12px;\n      justify-content: center;\n      background: var(--color-primary, #004a74) !important;\n    }\n    #chatwoot-launcher-slot .woot-widget-bubble:hover {\n      box-shadow: none!important;\n    }\n    /* The SDK's entrance animation on the expanded bubble reads as a floating\n       launcher popping in; docked in the card it just looks like a glitch. */\n    #chatwoot-launcher-slot .woot-widget-bubble.woot-widget--expanded {\n      animation: none;\n      transition: none;\n    }\n    /* Open state is text-only; the SDK's icon is dropped. */\n    #chatwoot-launcher-slot .woot-widget-bubble:not(.woot--close) svg,\n    #chatwoot-launcher-slot .woot-widget-bubble:not(.woot--close) img {\n      display: none;\n    }\n    /* With the icon gone the SDK's asymmetric label margins would push the text\n       off-centre. Matched on \"any child\" so there's no SDK class to track. */\n    #chatwoot-launcher-slot .woot-widget-bubble:not(.woot--close) > * {\n      margin: 0;\n      text-align: center;\n      padding-right: 0;\n    }\n\n    /* The SDK draws its X purely from ::before/::after, so repurposing them into\n       icon + label needs no JS and no waiting for the SDK to build anything. */\n    #chatwoot-launcher-slot .woot-widget-bubble.woot--close {\n      display: flex;\n      align-items: center;\n      /* SDK rotates 45deg and scales down on close, which read fine as an X but\n         not as text. Keep the slide, drop the rotate+scale. */\n      transform: none;\n    }\n    #chatwoot-launcher-slot .woot-widget-bubble.woot--close.woot--hide { transform: translateX(8px); }\n    /* Metrics copied from the SDK's own .woot-widget--expanded rules (20px icon,\n       8px gap) so the two buttons match. */\n    #chatwoot-launcher-slot .woot-widget-bubble.woot--close::before,\n    #chatwoot-launcher-slot .woot-widget-bubble.woot--close::after {\n      position: static;\n      transform: none;\n      background: none;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      color: #fff;\n      font: 500 16px system-ui, -apple-system, Segoe UI, Roboto, sans-serif;\n    }\n    #chatwoot-launcher-slot .woot-widget-bubble.woot--close::before {\n      content: '✕';\n      width: 20px;\n      height: 20px;\n      margin: 0 8px 0 0;\n      font-size: 18px;\n    }\n    #chatwoot-launcher-slot .woot-widget-bubble.woot--close::after {\n      content: 'Tutup';\n      width: auto;\n      height: auto;\n    }\n  `;\n\tdocument.head.append(style);\n}\n\n// Auto-hide custom scrollbars when scrolling stops\nconst scrollTimeouts = new WeakMap<HTMLElement, number>();\n\nwindow.addEventListener(\n\t'scroll',\n\t(event) => {\n\t\tconst target = event.target;\n\t\tif (\n\t\t\ttarget instanceof HTMLElement &&\n\t\t\ttarget.classList.contains('custom-scrollbar')\n\t\t) {\n\t\t\ttarget.classList.add('is-scrolling');\n\t\t\tconst existing = scrollTimeouts.get(target);\n\t\t\tif (existing) clearTimeout(existing);\n\t\t\tconst timeout = window.setTimeout(() => {\n\t\t\t\ttarget.classList.remove('is-scrolling');\n\t\t\t\tscrollTimeouts.delete(target);\n\t\t\t}, 1000);\n\t\t\tscrollTimeouts.set(target, timeout);\n\t\t}\n\t},\n\t{ capture: true, passive: true }\n);\n\n\nif (import.meta.hot) {\n\timport.meta.hot.on('server:update', async () => {\n\t\ttry {\n\t\t\tawait app.ready();\n\t\t\tawait app.frames.top.reload();\n\t\t} catch (error) {\n\t\t\tconsole.error('Error reloading top frame on server update', error);\n\t\t}\n\t});\n}\n\nfunction getRequestBody(\n\tformData?: FormData,\n\tmethod?: string,\n\tencType?: string\n): BodyInit | undefined {\n\tif (!formData || method?.toLowerCase() === 'get') return;\n\tif (encType !== 'application/x-www-form-urlencoded') return formData;\n\n\tlet body = new URLSearchParams();\n\tfor (let [name, value] of formData) {\n\t\tbody.append(name, typeof value === 'string' ? value : value.name);\n\t}\n\treturn body;\n}\n"]}