@virtualdisplay.io/client 4.0.0-alpha.10 → 4.0.0-alpha.13

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -1
  3. package/dist/browser-DfB_An57.cjs +8 -0
  4. package/dist/browser-ey6Iih3j.js +1540 -0
  5. package/dist/src/attributes/attribute.d.ts +2 -0
  6. package/dist/src/attributes/attribute.d.ts.map +1 -1
  7. package/dist/src/attributes/attributes.d.ts +2 -0
  8. package/dist/src/attributes/attributes.d.ts.map +1 -1
  9. package/dist/src/attributes/selections.d.ts +2 -1
  10. package/dist/src/attributes/selections.d.ts.map +1 -1
  11. package/dist/src/client/client.d.ts +20 -0
  12. package/dist/src/client/client.d.ts.map +1 -1
  13. package/dist/src/client/events.d.ts +22 -0
  14. package/dist/src/client/events.d.ts.map +1 -0
  15. package/dist/src/client/iframe-builder.d.ts.map +1 -1
  16. package/dist/src/client/options.d.ts +5 -0
  17. package/dist/src/client/options.d.ts.map +1 -1
  18. package/dist/src/client/types.d.ts +5 -4
  19. package/dist/src/client/types.d.ts.map +1 -1
  20. package/dist/src/configuration/configuration.d.ts +113 -0
  21. package/dist/src/configuration/configuration.d.ts.map +1 -0
  22. package/dist/src/configuration/index.d.ts +2 -0
  23. package/dist/src/configuration/index.d.ts.map +1 -0
  24. package/dist/src/configuration/resolver.d.ts +16 -0
  25. package/dist/src/configuration/resolver.d.ts.map +1 -0
  26. package/dist/src/focus/focus.d.ts +43 -0
  27. package/dist/src/focus/focus.d.ts.map +1 -0
  28. package/dist/src/focus/index.d.ts +2 -0
  29. package/dist/src/focus/index.d.ts.map +1 -0
  30. package/dist/src/index.d.ts +4 -0
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/snapshot/snapshot.d.ts +6 -0
  33. package/dist/src/snapshot/snapshot.d.ts.map +1 -1
  34. package/dist/src/ui/action-bar.d.ts +1 -1
  35. package/dist/src/ui/action-bar.d.ts.map +1 -1
  36. package/dist/src/ui/commerce-panel.d.ts +31 -0
  37. package/dist/src/ui/commerce-panel.d.ts.map +1 -0
  38. package/dist/src/ui/controls/attribute-group.d.ts.map +1 -1
  39. package/dist/src/ui/layouts/inframe-layout.d.ts +13 -0
  40. package/dist/src/ui/layouts/inframe-layout.d.ts.map +1 -0
  41. package/dist/src/ui/layouts/layout.d.ts +15 -0
  42. package/dist/src/ui/layouts/layout.d.ts.map +1 -0
  43. package/dist/src/ui/layouts/null-layout.d.ts +12 -0
  44. package/dist/src/ui/layouts/null-layout.d.ts.map +1 -0
  45. package/dist/src/ui/layouts/registry.d.ts +4 -0
  46. package/dist/src/ui/layouts/registry.d.ts.map +1 -0
  47. package/dist/src/ui/layouts/sidebar-layout.d.ts +24 -0
  48. package/dist/src/ui/layouts/sidebar-layout.d.ts.map +1 -0
  49. package/dist/src/ui/standard-interface.d.ts +6 -1
  50. package/dist/src/ui/standard-interface.d.ts.map +1 -1
  51. package/dist/src/ui/styles.d.ts.map +1 -1
  52. package/dist/virtualdisplay.client.cjs.js +193 -50
  53. package/dist/virtualdisplay.client.es.js +3099 -1958
  54. package/dist/virtualdisplay.client.umd.js +198 -55
  55. package/package.json +1 -1
  56. package/dist/browser-CDLfpTNV.cjs +0 -8
  57. package/dist/browser-DxtIwHNu.js +0 -1227
  58. package/dist/chunk-BcutgqC9.cjs +0 -1
  59. package/dist/chunk-C_CI6nMA.js +0 -13
@@ -1,11 +1,4 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.VirtualdisplayClient={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),u={NO_MAPPING:`NO_MAPPING`,ATTRIBUTE_NOT_FOUND:`ATTRIBUTE_NOT_FOUND`,VALUE_NOT_FOUND:`VALUE_NOT_FOUND`,PARENT_NOT_FOUND:`PARENT_NOT_FOUND`,INVALID_PARAMETER:`INVALID_PARAMETER`,SNAPSHOT_FAILED:`SNAPSHOT_FAILED`},d=class e extends Error{code;constructor(e,t){super(e),this.name=`VirtualdisplayError`,this.code=t}static noMapping(){return new e(`No attributes available. Waiting for server metadata.`,u.NO_MAPPING)}static attributeNotFound(t){return new e(`Attribute "${t}" not found in mapping`,u.ATTRIBUTE_NOT_FOUND)}static valueNotFound(t,n){return new e(`Value "${n}" not found for attribute "${t}"`,u.VALUE_NOT_FOUND)}static parentNotFound(t){return new e(`Parent element not found: ${t}`,u.PARENT_NOT_FOUND)}static invalidParameter(t){return new e(t,u.INVALID_PARAMETER)}static snapshotFailed(t,n){return new e(`Snapshot failed for "${t}": ${n}`,u.SNAPSHOT_FAILED)}},f=class{defaultServer=`https://server.virtualdisplay.io`;options;constructor(e){this.options=e}create(){let e=this.createContainer(),t=this.createIframe();return e.appendChild(t),this.attachToParent(e),{container:e,iframe:t}}createContainer(){let e=document.createElement(`div`);return e.className=`vd-container`,Object.assign(e.style,{position:`relative`,width:`100%`,height:`100%`,overflow:`hidden`}),e}createIframe(){let e=document.createElement(`iframe`);return e.src=this.buildUrl(),Object.assign(e.style,{width:`100%`,height:`100%`,border:`none`,display:`block`}),e.setAttribute(`allow`,`xr-spatial-tracking; fullscreen`),e}attachToParent(e){this.getParentElement().appendChild(e)}buildUrl(){let e=this.getServerUrl(),t=new URL(e);return t.searchParams.set(`license`,this.options.license),t.searchParams.set(`model`,this.options.model),this.options.language!==void 0&&t.searchParams.set(`language`,this.options.language),this.options.debug===!0&&t.searchParams.set(`debug`,`true`),this.options.traceparent!==void 0&&t.searchParams.set(`traceparent`,this.options.traceparent),t.toString()}getServerUrl(){return this.defaultServer}getParentElement(){if(typeof this.options.parent!=`string`)return this.options.parent;let e=document.querySelector(this.options.parent);if(e===null)throw d.parentNotFound(this.options.parent);return e}};function p(e){let t=new Date(e.timestamp).toLocaleTimeString(`en-GB`,{hour12:!1}),n=e.level.toUpperCase().padEnd(5),r=e.trace_id?.slice(0,8)??`--------`,i=e.msg,a=[`timestamp`,`level`,`msg`,`service`,`trace_id`,`span_id`],o=Object.entries(e).filter(([e])=>!a.includes(e)).map(([e,t])=>`${e}=${JSON.stringify(t)}`).join(` `);return`${t} ${n} [${r}] ${i}${o?` `+o:``}`}function m(e){return JSON.stringify(e)}function h(e,t){let n=t?p(e):m(e);e.level===`error`?console.error(n):e.level===`warn`?console.warn(n):console.log(n)}function g(e,t=0){let n={name:e.name,message:e.message};e.stack!==void 0&&(n.stack=e.stack);for(let t of Object.getOwnPropertyNames(e)){if(t===`name`||t===`message`||t===`stack`||t===`cause`)continue;let r=e[t];r!==void 0&&(n[t]=r)}return e.cause!==void 0&&e.cause!==null&&(n.cause=e.cause instanceof Error&&t<5?g(e.cause,t+1):String(e.cause)),n}function _(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r instanceof Error?g(r):r;return t}function v(){return new Date}function y(e){return e.toISOString()}function b(){return typeof navigator>`u`?``:navigator.userAgent}function x(){return typeof navigator>`u`?!1:navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function S(){return/iPhone|iPad|iPod/i.test(b())||x()}function C(){return/Android/i.test(b())}function ee(){return S()||C()}var te=class e{constructor(e){this.config=e}log(e,t,n={}){let r=this.config.traceProvider?.()??{};h({timestamp:y(v()),level:e,msg:t,service:this.config.service,...r,..._(n)},this.config.isDev)}debug(e,t){this.config.isDev&&this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t){this.log(`error`,e,t)}with(t){let n=new e(this.config);return n.log=((e,n,r={})=>{this.log(e,n,{...t,...r})}).bind(this),n}};function ne(e,t){return new te({service:e,isDev:t?.isDev===void 0?typeof process<`u`?process.env.NODE_ENV!==`production`:!0:t.isDev,traceProvider:t?.traceProvider})}function w(e){if(e!==void 0)return typeof e==`object`&&e&&!Array.isArray(e)&&!(e instanceof Error)?e:e instanceof Error?{error:e.message}:{value:e}}function re(e){return{debug:(t,n)=>e.debug(t,w(n)),info:(t,n)=>e.info(t,w(n)),warn:(t,n)=>e.warn(t,w(n)),error:(t,n)=>e.error(t,w(n))}}var ie=!1,T=re(ne(`client`,{isDev:!1}));function ae(){ie=!0,T=re(ne(`client`,{isDev:!0}))}function oe(){return ie}var se=class{ready=!1;onReady;constructor(e){this.onReady=e}handleMappingReceived(){this.ready||(this.ready=!0,T.info(`Mapping received from server, client is now ready`),this.onReady?.())}get isReady(){return this.ready}clear(){this.ready=!1}},E={HANDSHAKE:`handshake`,MUTATION:`mutation`,STATE:`state`,LOADING_INDICATOR:`loading_indicator`,CAMERA:`camera`,SNAPSHOT:`snapshot`,MAPPING:`mapping`,AR_ACTIVATE:`ar_activate`,CONFIG:`config`,INTERACTION:`interaction`,ANNOTATION_PLACE_MODE:`annotation_place_mode`,ANNOTATION_PLACED:`annotation_placed`,ANNOTATION_TOGGLE:`annotation_toggle`},ce=new Set(Object.values(E));function le(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.target==`string`?!1:typeof t.type==`string`&&ce.has(t.type)}function ue(e){let t=D(e);return t!==null&&t.type===E.HANDSHAKE}function de(e){let t=D(e);return t!==null&&t.type===E.MUTATION&&Array.isArray(t.results)}function fe(e){let t=D(e);return t!==null&&t.type===E.SNAPSHOT&&(`data`in t||`error`in t)}function pe(e){let t=D(e);return t!==null&&t.type===E.CAMERA&&Array.isArray(t.transforms)}function me(e){let t=D(e);return t!==null&&t.type===E.MAPPING&&Array.isArray(t.attributes)}function he(e){let t=D(e);return t!==null&&t.type===E.LOADING_INDICATOR&&typeof t.progress==`number`}function ge(e){let t=D(e);return t!==null&&t.type===E.CONFIG&&typeof t.viewerSettings==`object`}function _e(e){let t=D(e);return t!==null&&t.type===E.ANNOTATION_PLACED&&typeof t.position==`object`&&t.position!==null}function D(e){return typeof e!=`object`||!e?null:e}var ve=class{pending=[];isReady=!1;constructor(e){this.processor=e}enqueue(e){if(this.isReady){this.processor(e);return}this.pending.push(e)}markReady(){if(this.isReady||(this.isReady=!0,this.pending.length===0))return;let e=[...this.pending];this.pending.length=0;for(let t of e)this.processor(t)}get ready(){return this.isReady}get pendingCount(){return this.pending.length}hasPending(e){return this.pending.some(t=>t.type===e)}clear(){this.pending.length=0}},ye=class{handlers=new Map;publisher;consumer;shouldBuffer;listener=null;sourceId;targetOrigin;constructor(e,t){this.getTarget=e,this.sourceId=`vd-${Math.random().toString(36).slice(2,8)}`,this.targetOrigin=t?.targetOrigin??`*`,this.publisher=new ve(e=>this.post(e)),this.consumer=new ve(e=>this.routeToHandler(e)),this.shouldBuffer=t?.shouldBuffer??null,t?.bufferIncoming!==!0&&this.consumer.markReady()}on(e,t){this.handlers.set(e,t)}off(e){this.handlers.delete(e)}setTargetOrigin(e){this.targetOrigin=e}send(e){this.publisher.enqueue(e)}markReady(){this.publisher.markReady()}markConsumerReady(){this.consumer.markReady()}consumerHasPending(e){return this.consumer.hasPending(e)}start(){this.listener===null&&(this.listener=e=>{let{data:t}=e;if(!le(t)||t._source===this.sourceId)return;let n=this.getTarget();if(n!==null&&e.source!==null&&e.source!==n)return;let r=t;if(this.shouldBuffer!==null&&!this.shouldBuffer(r)){this.routeToHandler(r);return}this.consumer.enqueue(r)},window.addEventListener(`message`,this.listener))}destroy(){this.listener!==null&&(window.removeEventListener(`message`,this.listener),this.listener=null),this.publisher.clear(),this.consumer.clear(),this.handlers.clear()}get ready(){return this.publisher.ready}get pendingCount(){return this.publisher.pendingCount}post(e){let t=this.getTarget();t!==null&&t.postMessage({...e,_source:this.sourceId},this.targetOrigin)}routeToHandler(e){let t=this.handlers.get(e.type);if(t===void 0)return;let n=t(e);n instanceof Promise&&n.catch(t=>{let n=t instanceof Error?t.message:String(t);console.error(`Virtualdisplay: error handling ${e.type}: ${n}`)})}};new Set([E.CAMERA]);var be=class{placedCallbacks=[];constructor(e){this.send=e}setEnabled(e){this.send({type:E.ANNOTATION_TOGGLE,enabled:e})}startPlacing(){this.send({type:E.ANNOTATION_PLACE_MODE,enabled:!0})}stopPlacing(){this.send({type:E.ANNOTATION_PLACE_MODE,enabled:!1})}onPlaced(e){this.placedCallbacks.push(e)}handlePlaced(e){for(let t of this.placedCallbacks)t(e)}},xe=class{isSelectedValue=!1;constructor(e,t){this.value=e,this.attribute=t}get isSelected(){return this.isSelectedValue}setSelected(e){this.isSelectedValue=e}},Se=class{name;defaultValue;values;onSelect;onChangeCallback;constructor(e){this.name=e.name,this.defaultValue=e.defaultValue,this.onSelect=e.onSelect,this.values=this.createValues(e.values)}select(e){if(!this.values.has(e))throw d.valueNotFound(this.name,e);this.onSelect(this.name,e)}getValues(){return Array.from(this.values.values())}getValue(e){return this.values.get(e)}onChange(e){this.onChangeCallback=e}handleResult(e){let t;for(let n of this.values.values()){let r=n.value===e;n.setSelected(r),r&&(t=n)}t!==void 0&&this.onChangeCallback!==void 0&&this.onChangeCallback(t)}createValues(e){let t=new Map;for(let n of e){let e=new xe(n,this.name);n===this.defaultValue&&e.setSelected(!0),t.set(n,e)}return t}},Ce=class{attributes=new Map;constructor(e,t,n){for(let n of e){let e=this.buildOptions(n,t);this.attributes.set(n.name,new Se(e))}this.onMutationFailed=n}onMutationFailed;get(e){return this.attributes.get(e)}defaults(){let e=[];for(let t of this.attributes.values())t.defaultValue!==void 0&&e.push({name:t.name,value:t.defaultValue});return e}handleResults(e){for(let t of e){if(!t.success){this.onMutationFailed?.(t.name,t.value);continue}this.get(t.name)?.handleResult(t.value)}}buildOptions(e,t){let n={name:e.name,values:e.values,onSelect:(e,n)=>{t([{name:e,value:n}],!1)}};return e.defaultValue===void 0?n:{...n,defaultValue:e.defaultValue}}},we=class{registry;pendingCallbacks=[];constructor(e,t){this.send=e,this.onMutationFailed=t}handleMappingReceived(e){T.debug(`Initializing from server mapping`,{attributeCount:e.attributes.length}),this.registry=new Ce(e.attributes,(e,t)=>this.sendMutation(e,t),this.onMutationFailed),this.replayPendingCallbacks()}handleMutationResult(e){this.registry?.handleResults(e.results)}select(e,t){this.sendMutation([{name:e,value:t}],!1)}getValues(e){return this.registry?.get(e)?.getValues()??[]}getValue(e,t){return this.registry?.get(e)?.getValue(t)}onChange(e,t){if(this.registry===void 0){this.pendingCallbacks.push({name:e,callback:t});return}let n=this.registry.get(e);if(n===void 0){T.warn(`onChange: attribute "${e}" not found — callback will not fire`);return}n.onChange(t)}getAttribute(e){return this.registry?.get(e)}get hasMapping(){return this.registry!==void 0}sendMutation(e,t){let n={type:E.MUTATION,mutations:e,isInitial:t};this.send(n)}replayPendingCallbacks(){for(let{name:e,callback:t}of this.pendingCallbacks){let n=this.registry?.get(e);n===void 0&&T.warn(`onChange: attribute "${e}" not found — buffered callback will not fire`),n?.onChange(t)}this.pendingCallbacks.length=0}},Te=class{commands=[];constructor(e){this.send=e}rotate(e){return this.validateFiniteNumber(e,`rotate`),this.commands.push({action:`rotate`,value:e}),this}tilt(e){return this.validateFiniteNumber(e,`tilt`),this.commands.push({action:`tilt`,value:e}),this}zoom(e){return this.validateFiniteNumber(e,`zoom`),this.commands.push({action:`zoom`,value:e}),this}set(){if(this.commands.length===0)throw d.invalidParameter(`No camera commands to execute. Call rotate(), tilt(), or zoom() before set().`);let e={type:E.CAMERA,commands:this.commands};this.send(e),this.commands=[]}validateFiniteNumber(e,t){if(!Number.isFinite(e))throw d.invalidParameter(`${t}() requires a finite number, got ${String(e)}`)}reset(){let e={type:E.CAMERA,commands:[{action:`reset`}]};this.send(e)}},Ee=class{state;limitsState;changeCallbacks=[];constructor(){this.state={rotation:0,tilt:0,zoom:100}}get rotation(){return this.state.rotation}get tilt(){return this.state.tilt}get zoom(){return this.state.zoom}onChange(e){this.changeCallbacks.push(e)}get limits(){return this.limitsState}applyLimits(e){this.limitsState=e;let t={rotation:this.rotation,tilt:this.tilt,zoom:this.zoom};for(let e of this.changeCallbacks)e(t)}handlePositionUpdate(e){this.update(e.transforms)}update(e){let t=!1;for(let n of e)switch(n.type){case`rotation`:this.state.rotation=n.value,t=!0;break;case`tilt`:this.state.tilt=n.value,t=!0;break;case`zoom`:this.state.zoom=n.value,t=!0;break;default:break}if(t){let e={rotation:this.rotation,tilt:this.tilt,zoom:this.zoom};for(let t of this.changeCallbacks)t(e)}}},De=class{developedCallbacks=new Set;errorCallbacks=new Set;developed=!1;failed=!1;photoData=null;constructor(e){this.filename=e}onDeveloped(e){return this.developed&&this.photoData!==null?(e(this.photoData),this):(this.developedCallbacks.add(e),this)}onError(e){return this.errorCallbacks.add(e),this}getFilename(){return this.filename}develop(e){this.developed||this.failed||(this.photoData=e,this.developed=!0,this.developedCallbacks.forEach(e=>{e(this.photoData)}),this.developedCallbacks.clear(),this.errorCallbacks.clear())}fail(e){this.developed||this.failed||(this.failed=!0,this.errorCallbacks.forEach(t=>{t(e)}),this.developedCallbacks.clear(),this.errorCallbacks.clear())}},Oe=class{validExtensions=[`.png`];pendingPhotos=new Map;constructor(e){this.send=e}take(e){this.validateFilename(e),T.debug(`Taking snapshot`,{filename:e});let t=new De(e);return this.pendingPhotos.set(t.getFilename(),t),this.send({type:E.SNAPSHOT,filename:e}),t}handleSnapshotResult(e){let t=this.pendingPhotos.get(e.filename);if(t===void 0){T.warn(`No pending photo found for filename`,{filename:e.filename,pendingFilenames:Array.from(this.pendingPhotos.keys())});return}if(this.pendingPhotos.delete(e.filename),e.error!==void 0){t.fail(new d(e.error,u.SNAPSHOT_FAILED));return}e.data!==void 0&&t.develop({filename:e.filename,data:e.data})}validateFilename(e){if(e===``||typeof e!=`string`)throw new d(`Filename must be a non-empty string`,u.INVALID_PARAMETER);if(!this.validExtensions.some(t=>e.toLowerCase().endsWith(t)))throw new d(`Invalid filename: "${e}". Filename must end with one of: ${this.validExtensions.join(`, `)}`,u.INVALID_PARAMETER);if(e.includes(`..`)||e.includes(`/`)||e.includes(`\\`))throw new d(`Filename cannot contain path separators or ".."`,u.INVALID_PARAMETER)}},ke=class{container=null;attach(e){this.container=e}dispatch(e,t,n=!1){let r=new CustomEvent(e,{detail:t,cancelable:n});return this.container?.dispatchEvent(r),r}on(e,t){let n=e=>{let n=e;t({...n.detail,preventDefault:()=>{n.preventDefault()}})};return this.container?.addEventListener(e,n),()=>{this.container?.removeEventListener(e,n)}}},Ae={},je=[`en`,`nl`,`de`],O=[`baseLocale`],Me=[],Ne,Pe;function Fe(e){if(Me.length===0)return;let t=typeof e==`string`?e:e.href;if(Ne===t)return Pe;let n=new URL(t,`http://dummy.com`),r;for(let e of Me)if(new Ae(e.match,n.href).exec(n.href)){r=e;break}return Ne=t,Pe=r,r}function Ie(e){let t=Fe(e);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:O}var Le=void 0,k=typeof window>`u`;globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};var Re=!1,A=()=>{if(Le){let e=Le?.getStore()?.locale;if(e)return e}let e=O;!k&&typeof window<`u`&&window.location?.href&&(e=Ie(window.location.href));let t=ze(e,typeof window<`u`?window.location?.href:void 0);if(t)return Re||(Re=!0,Ve(t,{reload:!1})),t;throw Error(`No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found`)};function ze(e,t){let n;for(let t of e){if(t===`baseLocale`)n=`en`;else if(We(t)&&j.has(t)){let e=j.get(t);if(e){let t=e.getLocale();if(t instanceof Promise)continue;if(t!==void 0)return Ue(t)}}let e=He(n);if(e)return e}}var Be=e=>{e?window.location.href=e:window.location.reload()},Ve=(e,t)=>{let n={reload:!0,...t},r;try{r=A()}catch{}let i=[],a=O;!k&&typeof window<`u`&&window.location?.href&&(a=Ie(window.location.href));for(let t of a)if(t===`baseLocale`)continue;else if(We(t)&&j.has(t)){let n=j.get(t);if(n){let r=n.setLocale(e);r instanceof Promise&&(r=r.catch(e=>{throw Error(`Custom strategy "${t}" setLocale failed.`,{cause:e})}),i.push(r))}}let o=()=>{!k&&n.reload&&window.location&&e!==r&&Be(void 0)};if(i.length)return Promise.all(i).then(()=>{o()});o()};function He(e){if(typeof e!=`string`)return;let t=e.toLowerCase();for(let e of je)if(e.toLowerCase()===t)return e}function Ue(e){let t=He(e);if(t)return t;throw Error(`Invalid locale: ${e}. Expected one of: ${je.join(`, `)}`)}var j=new Map;function We(e){return typeof e==`string`&&/^custom-[A-Za-z0-9_-]+$/.test(e)}var Ge=()=>`Activate AR`,Ke=()=>`AR activeren`,qe=()=>`AR aktivieren`,Je=((e={},t={})=>{let n=t.locale??A();return n===`en`?Ge(e):n===`nl`?Ke(e):qe(e)}),Ye=()=>`Scan to view in AR`,Xe=()=>`Scan om in AR te bekijken`,Ze=()=>`Scannen für AR-Ansicht`,Qe=((e={},t={})=>{let n=t.locale??A();return n===`en`?Ye(e):n===`nl`?Xe(e):Ze(e)}),$e=()=>`Use your smartphone camera to scan this QR code`,et=()=>`Gebruik de camera van je smartphone om deze QR-code te scannen`,tt=()=>`Verwenden Sie die Kamera Ihres Smartphones, um diesen QR-Code zu scannen`,nt=((e={},t={})=>{let n=t.locale??A();return n===`en`?$e(e):n===`nl`?et(e):tt(e)}),rt=()=>`The 3D model will open in your phone's AR mode`,it=()=>`Het 3D-model wordt geopend in de AR-modus van je telefoon`,at=()=>`Das 3D-Modell wird im AR-Modus Ihres Telefons geöffnet`,ot=((e={},t={})=>{let n=t.locale??A();return n===`en`?rt(e):n===`nl`?it(e):at(e)}),st=()=>`Close`,ct=()=>`Sluiten`,lt=()=>`Schließen`,ut=((e={},t={})=>{let n=t.locale??A();return n===`en`?st(e):n===`nl`?ct(e):lt(e)}),dt=()=>`Toggle fullscreen`,ft=()=>`Volledig scherm`,pt=()=>`Vollbild umschalten`,mt=((e={},t={})=>{let n=t.locale??A();return n===`en`?dt(e):n===`nl`?ft(e):pt(e)}),ht=()=>`Downloading`,gt=()=>`Downloaden`,_t=()=>`Herunterladen`,vt=((e={},t={})=>{let n=t.locale??A();return n===`en`?ht(e):n===`nl`?gt(e):_t(e)}),yt=()=>`Rendering`,bt=()=>`Renderen`,xt=()=>`Rendern`,St=((e={},t={})=>{let n=t.locale??A();return n===`en`?yt(e):n===`nl`?bt(e):xt(e)}),Ct=()=>`Screenshot`,wt=()=>`Screenshot`,Tt=()=>`Screenshot`,Et=((e={},t={})=>{let n=t.locale??A();return n===`en`?Ct(e):n===`nl`?wt(e):Tt(e)}),Dt=()=>`Reset camera`,Ot=()=>`Camera resetten`,kt=()=>`Kamera zurücksetzen`,At=((e={},t={})=>{let n=t.locale??A();return n===`en`?Dt(e):n===`nl`?Ot(e):kt(e)}),jt=()=>`Zoom in`,Mt=()=>`Inzoomen`,Nt=()=>`Hineinzoomen`,Pt=((e={},t={})=>{let n=t.locale??A();return n===`en`?jt(e):n===`nl`?Mt(e):Nt(e)}),Ft=()=>`Zoom out`,It=()=>`Uitzoomen`,Lt=()=>`Herauszoomen`,Rt=((e={},t={})=>{let n=t.locale??A();return n===`en`?Ft(e):n===`nl`?It(e):Lt(e)}),zt=()=>`Rotate left`,Bt=()=>`Naar links draaien`,Vt=()=>`Nach links drehen`,Ht=((e={},t={})=>{let n=t.locale??A();return n===`en`?zt(e):n===`nl`?Bt(e):Vt(e)}),Ut=()=>`Rotate right`,Wt=()=>`Naar rechts draaien`,Gt=()=>`Nach rechts drehen`,Kt=((e={},t={})=>{let n=t.locale??A();return n===`en`?Ut(e):n===`nl`?Wt(e):Gt(e)}),qt=()=>`Tilt up`,Jt=()=>`Omhoog kantelen`,Yt=()=>`Nach oben kippen`,Xt=((e={},t={})=>{let n=t.locale??A();return n===`en`?qt(e):n===`nl`?Jt(e):Yt(e)}),Zt=()=>`Tilt down`,Qt=()=>`Omlaag kantelen`,$t=()=>`Nach unten kippen`,en=((e={},t={})=>{let n=t.locale??A();return n===`en`?Zt(e):n===`nl`?Qt(e):$t(e)}),tn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},nn=([e,t,n])=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return Object.keys(t).forEach(e=>{r.setAttribute(e,String(t[e]))}),n?.length&&n.forEach(e=>{let t=nn(e);r.appendChild(t)}),r},rn=(e,t={})=>nn([`svg`,{...tn,...t},e]),an=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]],on=[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`}],[`circle`,{cx:`12`,cy:`13`,r:`3`}]],sn=[[`path`,{d:`m6 9 6 6 6-6`}]],cn=[[`path`,{d:`m15 18-6-6 6-6`}]],ln=[[`path`,{d:`m9 18 6-6-6-6`}]],un=[[`path`,{d:`m18 15-6-6-6 6`}]],dn=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`m21 3-7 7`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M9 21H3v-6`}]],fn=[[`path`,{d:`m14 10 7-7`}],[`path`,{d:`M20 10h-6V4`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M4 14h6v6`}]],pn=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]],mn=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]],hn=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];function M(e,{size:t=20,strokeWidth:n=1.75}={}){return rn(e,{width:t,height:t,"stroke-width":n})}var N={ar:e=>M(an,e),fullscreen:e=>M(dn,e),exitFullscreen:e=>M(fn,e),screenshot:e=>M(on,e),tiltUp:e=>M(un,e),tiltDown:e=>M(sn,e),rotateLeft:e=>M(cn,e),rotateRight:e=>M(ln,e),zoomIn:e=>M(mn,e),zoomOut:e=>M(hn,e),reset:e=>M(pn,e)},P=class{element;constructor({variant:e=`default`,size:t=`default`,label:n,icon:r,onClick:i,disabled:a=!1}={}){this.element=document.createElement(`button`),this.element.className=`ui-btn ui-btn--${e} ui-btn--size-${t}`,n!==void 0&&(this.element.setAttribute(`aria-label`,n),this.element.title=n),r===void 0?n!==void 0&&(this.element.textContent=n):this.element.appendChild(r),i&&this.element.addEventListener(`click`,i),this.element.disabled=a}setIcon(e){let t=this.element.querySelector(`svg`);t===null?this.element.appendChild(e):t.replaceWith(e)}},F={brand:{DEFAULT:`#171717`,primary:`#171717`,hover:`#262626`,light:`#f5f5f5`,50:`#fafafa`,100:`#f5f5f5`,200:`#e5e5e5`,300:`#d4d4d4`,400:`#a3a3a3`,500:`#737373`,600:`#525252`,700:`#404040`,800:`#262626`,900:`#171717`,950:`#0a0a0a`},semantic:{success:`#16a34a`,warning:`#ca8a04`,error:`#dc2626`,info:`#0891b2`},neutral:{50:`#fafafa`,100:`#f5f5f5`,200:`#e5e5e5`,300:`#d4d4d4`,400:`#a3a3a3`,500:`#737373`,600:`#525252`,700:`#404040`,800:`#262626`,900:`#171717`,950:`#0a0a0a`},white:`#ffffff`,black:`#000000`},I={px:`1px`,0:`0`,.5:`0.125rem`,1:`0.25rem`,1.5:`0.375rem`,2:`0.5rem`,2.5:`0.625rem`,3:`0.75rem`,3.5:`0.875rem`,4:`1rem`,5:`1.25rem`,6:`1.5rem`,7:`1.75rem`,8:`2rem`,9:`2.25rem`,10:`2.5rem`,12:`3rem`,14:`3.5rem`,16:`4rem`,20:`5rem`,24:`6rem`};I[1],I[2],I[4],I[6],I[8],I[12];var gn=class{element;constructor(){this.element=document.createElement(`div`),Object.assign(this.element.style,{background:F.white,borderRadius:I[3],padding:I[6],boxShadow:`0 ${I[2]} ${I[8]} oklch(0% 0 0 / 20%)`,maxWidth:`20rem`,width:`100%`})}},_n=class{card;backdrop;keyHandler=null;constructor(e={}){this.options=e,this.card=new gn,this.backdrop=this.createBackdrop(),this.backdrop.appendChild(this.card.element)}open(){document.body.appendChild(this.backdrop),this.keyHandler=e=>{e.key===`Escape`&&this.close()},document.addEventListener(`keydown`,this.keyHandler)}close(){this.backdrop.remove(),this.keyHandler!==null&&(document.removeEventListener(`keydown`,this.keyHandler),this.keyHandler=null),this.options.onClose?.()}createBackdrop(){let e=document.createElement(`div`);return Object.assign(e.style,{position:`fixed`,inset:I[0],background:`oklch(0% 0 0 / 50%)`,zIndex:`9999`,display:`flex`,alignItems:`center`,justifyContent:`center`}),e.addEventListener(`click`,t=>{t.target===e&&this.close()}),e}},vn=class{element;selectCallback=null;constructor(e,t,n){this.element=document.createElement(`div`),this.element.className=`ui-toggle-group`;for(let r=0;r<e.length;r++){let i=e[r],a=document.createElement(`button`);a.className=`ui-toggle-group-item`,a.dataset.value=i,a.textContent=n?.[r]??i,a.dataset.state=i===t?`on`:`off`,a.addEventListener(`click`,()=>{this.selectCallback?.(i)}),this.element.appendChild(a)}}setSelected(e){for(let t of this.element.querySelectorAll(`.ui-toggle-group-item`))t.dataset.state=t.dataset.value===e?`on`:`off`}onSelect(e){this.selectCallback=e}},yn=class{element;select;constructor(e,t,n,r,i){this.select=document.createElement(`select`),this.select.className=`ui-native-select`,this.select.dataset.name=e;let a=document.createElement(`option`);a.value=``,a.disabled=!0,a.textContent=n,this.select.appendChild(a);let o=!1;for(let e=0;e<t.length;e++){let n=t[e],a=document.createElement(`option`);a.value=n,a.textContent=i?.[e]??n,n===r&&(a.selected=!0,o=!0),this.select.appendChild(a)}o||(a.selected=!0);let s=rn(sn,{width:16,height:16,"stroke-width":2});s.classList.add(`ui-native-select-icon`),this.element=document.createElement(`div`),this.element.className=`ui-native-select-wrap`,this.element.appendChild(this.select),this.element.appendChild(s)}setSelected(e){this.select.value=e}onSelect(e){this.select.addEventListener(`change`,()=>{e(this.select.value)})}},L={fontFamily:{sans:[`Mona Sans`,`ui-sans-serif`,`system-ui`,`sans-serif`,`Apple Color Emoji`,`Segoe UI Emoji`,`Segoe UI Symbol`,`Noto Color Emoji`],mono:[`JetBrains Mono`,`ui-monospace`,`monospace`]},fontSize:{xs:`0.75rem`,sm:`0.875rem`,base:`1rem`,lg:`1.125rem`,xl:`1.25rem`,"2xl":`1.5rem`,"3xl":`1.875rem`,"4xl":`2.25rem`},fontWeight:{normal:`400`,medium:`500`,semibold:`600`,bold:`700`},lineHeight:{tight:`1.25`,normal:`1.5`,relaxed:`1.75`}},bn=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),R=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),z=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),xn=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Sn=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Cn=s((e=>{var t=R().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),wn=s((e=>{var t=R().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Tn=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),En=s((e=>{var t=z(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Dn=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),On=s((e=>{var t=Dn();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),kn=s(((e,t)=>{var n=On();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),An=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),jn=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
- ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),B=s((e=>{var t=An(),n=jn();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Mn=s((e=>{var t=R(),n=En(),r=z(),i=B(),a=An(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),Nn=s((e=>{var t=R(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),Pn=s(((e,t)=>{var n=B();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),Fn=s(((e,t)=>{var n=B(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),In=s(((e,t)=>{var n=B();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ln=s(((e,t)=>{var n=B(),r=R();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Rn=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),zn=s((e=>{var t=B(),n=Pn(),r=Fn(),i=In(),a=Ln(),o=jn(),s=R(),c=Rn();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
- Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Bn=s((e=>{var t=R(),n=z(),r=xn(),i=Sn(),a=Cn(),o=wn(),s=Tn(),c=En(),l=kn(),u=Mn(),d=Nn(),f=B(),p=zn();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
5
- The chosen QR Code version cannot contain this amount of data.
6
- Minimum version required to store current data is: `+c+`.
7
- `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),Vn=s((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Hn=s((e=>{var t=Vn();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),Un=s((e=>{var t=Vn();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
8
- `;return typeof a==`function`&&a(null,p),p}})),Wn=s((e=>{var t=bn(),n=Bn(),r=Hn(),i=Un();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})})),Gn=L.fontFamily.sans.join(`, `),Kn=class{qrLib=null;dialog=null;async show(e){this.hide(),this.qrLib??=await Promise.resolve().then(()=>l(Wn(),1));let t=await this.qrLib.toDataURL(e,{width:256,margin:4,errorCorrectionLevel:`M`,color:{dark:F.black,light:F.white}});this.dialog=new _n({onClose:()=>{this.dialog=null}}),Object.assign(this.dialog.card.element.style,{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:I[3],fontFamily:Gn}),this.dialog.card.element.appendChild(this.createText(Qe(),{fontSize:L.fontSize.base,fontWeight:L.fontWeight.semibold,color:F.neutral[900]})),this.dialog.card.element.appendChild(this.createText(nt(),{fontSize:L.fontSize.sm,color:F.neutral[600]})),this.dialog.card.element.appendChild(this.createQrImage(t)),this.dialog.card.element.appendChild(this.createText(ot(),{fontSize:L.fontSize.xs,color:F.neutral[500]}));let n=new P({variant:`outline`,label:ut(),onClick:()=>{this.hide()}});this.dialog.card.element.appendChild(n.element),this.dialog.open()}hide(){this.dialog?.close(),this.dialog=null}createText(e,t){let n=document.createElement(`p`);return n.textContent=e,Object.assign(n.style,{margin:`0`,textAlign:`center`,...t}),n}createQrImage(e){let t=document.createElement(`img`);return t.src=e,t.alt=`QR code`,Object.assign(t.style,{width:I[24],height:I[24],borderRadius:I[1]}),t}},V=L.fontFamily.sans.join(`, `),qn=`
1
+ (function(M,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(M=typeof globalThis<"u"?globalThis:M||self,et(M.VirtualdisplayClient={}))})(this,(function(M){"use strict";function et(n,t){for(var e=0;e<t.length;e++){const i=t[e];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const r=Object.getOwnPropertyDescriptor(i,o);r&&Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const U={NO_MAPPING:"NO_MAPPING",ATTRIBUTE_NOT_FOUND:"ATTRIBUTE_NOT_FOUND",VALUE_NOT_FOUND:"VALUE_NOT_FOUND",PARENT_NOT_FOUND:"PARENT_NOT_FOUND",INVALID_PARAMETER:"INVALID_PARAMETER",SNAPSHOT_FAILED:"SNAPSHOT_FAILED"};class O extends Error{code;constructor(t,e){super(t),this.name="VirtualdisplayError",this.code=e}static noMapping(){return new O("No attributes available. Waiting for server metadata.",U.NO_MAPPING)}static attributeNotFound(t){return new O(`Attribute "${t}" not found in mapping`,U.ATTRIBUTE_NOT_FOUND)}static valueNotFound(t,e){return new O(`Value "${e}" not found for attribute "${t}"`,U.VALUE_NOT_FOUND)}static parentNotFound(t){return new O(`Parent element not found: ${t}`,U.PARENT_NOT_FOUND)}static invalidParameter(t){return new O(t,U.INVALID_PARAMETER)}static snapshotFailed(t,e){return new O(`Snapshot failed for "${t}": ${e}`,U.SNAPSHOT_FAILED)}}const pn={};class bn{defaultServer="https://server.virtualdisplay.io";options;constructor(t){this.options=t}create(){const t=this.createContainer(),e=this.createIframe();return t.appendChild(e),this.attachToParent(t),{container:t,iframe:e}}createContainer(){const t=document.createElement("div");return t.className="vd-container",Object.assign(t.style,{position:"relative",width:"100%",height:"100%",overflow:"hidden"}),t}createIframe(){const t=document.createElement("iframe");return t.src=this.buildUrl(),Object.assign(t.style,{width:"100%",height:"100%",border:"none",display:"block"}),t.setAttribute("allow","xr-spatial-tracking; fullscreen"),t}attachToParent(t){this.getParentElement().appendChild(t)}buildUrl(){const t=this.getServerUrl(),e=new URL(t);return e.searchParams.set("license",this.options.license),e.searchParams.set("model",this.options.model),this.options.language!==void 0&&e.searchParams.set("language",this.options.language),this.options.debug===!0&&e.searchParams.set("debug","true"),this.options.traceparent!==void 0&&e.searchParams.set("traceparent",this.options.traceparent),this.options.cache!==void 0&&e.searchParams.set("cache",this.options.cache?"true":"false"),e.toString()}getServerUrl(){if(pn?.VITE_VIRTUALDISPLAY_SERVER_HOST===void 0)return this.defaultServer}getParentElement(){if(typeof this.options.parent!="string")return this.options.parent;const t=document.querySelector(this.options.parent);if(t===null)throw O.parentNotFound(this.options.parent);return t}}function vn(n){const t=new Date(n.timestamp).toLocaleTimeString("en-GB",{hour12:!1}),e=n.level.toUpperCase().padEnd(5),i=n.trace_id?.slice(0,8)??"--------",o=n.msg,r=["timestamp","level","msg","service","trace_id","span_id"],s=Object.entries(n).filter(([a])=>!r.includes(a)).map(([a,l])=>`${a}=${JSON.stringify(l)}`).join(" ");return`${t} ${e} [${i}] ${o}${s?" "+s:""}`}function yn(n){return JSON.stringify(n)}function wn(n,t){const e=t?vn(n):yn(n);n.level==="error"?console.error(e):n.level==="warn"?console.warn(e):console.log(e)}function Wt(n,t=0){const e={name:n.name,message:n.message};n.stack!==void 0&&(e.stack=n.stack);for(const i of Object.getOwnPropertyNames(n)){if(i==="name"||i==="message"||i==="stack"||i==="cause")continue;const o=n[i];o!==void 0&&(e[i]=o)}return n.cause!==void 0&&n.cause!==null&&(e.cause=n.cause instanceof Error&&t<5?Wt(n.cause,t+1):String(n.cause)),e}function Cn(n){const t={};for(const[e,i]of Object.entries(n))t[e]=i instanceof Error?Wt(i):i;return t}function En(){return new Date}function _n(n){return n.toISOString()}function Qt(){return typeof navigator>"u"?"":navigator.userAgent}function An(){return typeof navigator>"u"?!1:navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1}function Sn(){return/iPhone|iPad|iPod/i.test(Qt())||An()}function kn(){return/Android/i.test(Qt())}function Tn(){return Sn()||kn()}class ct{constructor(t){this.config=t}config;log(t,e,i={}){const o=this.config.traceProvider?.()??{},r={timestamp:_n(En()),level:t,msg:e,service:this.config.service,...o,...Cn(i)};wn(r,this.config.isDev)}debug(t,e){this.config.isDev&&this.log("debug",t,e)}info(t,e){this.log("info",t,e)}warn(t,e){this.log("warn",t,e)}error(t,e){this.log("error",t,e)}with(t){const e=new ct(this.config);return e.log=((i,o,r={})=>{this.log(i,o,{...t,...r})}).bind(this),e}}function Xt(n,t){const e=t?.isDev!==void 0?t.isDev:typeof process<"u"?process.env.NODE_ENV!=="production":!0;return new ct({service:n,isDev:e,traceProvider:t?.traceProvider})}function ot(n){if(n!==void 0)return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof Error)?n:n instanceof Error?{error:n.message}:{value:n}}function te(n){return{debug:(t,e)=>n.debug(t,ot(e)),info:(t,e)=>n.info(t,ot(e)),warn:(t,e)=>n.warn(t,ot(e)),error:(t,e)=>n.error(t,ot(e))}}let ee=!1;M.logger=te(Xt("client",{isDev:!1}));function ne(){ee=!0,M.logger=te(Xt("client",{isDev:!0}))}function Rn(){return ee}class Nn{ready=!1;onReady;constructor(t){this.onReady=t}handleMappingReceived(){this.ready||(this.ready=!0,M.logger.info("Mapping received from server, client is now ready"),this.onReady?.())}get isReady(){return this.ready}clear(){this.ready=!1}}const I={HANDSHAKE:"handshake",MUTATION:"mutation",STATE:"state",LOADING_INDICATOR:"loading_indicator",CAMERA:"camera",SNAPSHOT:"snapshot",MAPPING:"mapping",AR_ACTIVATE:"ar_activate",CONFIG:"config",ANNOTATION_PLACE_MODE:"annotation_place_mode",ANNOTATION_PLACED:"annotation_placed",ANNOTATION_TOGGLE:"annotation_toggle",FOCUS:"focus",PRICING:"pricing"},ie={FOCUS:"focus",UNFOCUS:"unfocus"},In={FOCUSED:"focused"},Mn={HIDDEN:"hidden"},Pn=new Set(Object.values(I));function Bn(n){if(typeof n!="object"||n===null)return!1;const t=n;return typeof t.target=="string"?!1:typeof t.type=="string"&&Pn.has(t.type)}function Ln(n){const t=V(n);return t!==null&&t.type===I.HANDSHAKE}function On(n){const t=V(n);return t!==null&&t.type===I.MUTATION&&Array.isArray(t.results)}function xn(n){const t=V(n);return t!==null&&t.type===I.SNAPSHOT&&("data"in t||"error"in t)}function Dn(n){const t=V(n);return t!==null&&t.type===I.CAMERA&&Array.isArray(t.transforms)}function zn(n){const t=V(n);return t!==null&&t.type===I.MAPPING&&Array.isArray(t.attributes)}function Fn(n){const t=V(n);return t!==null&&t.type===I.LOADING_INDICATOR&&typeof t.progress=="number"}function Un(n){const t=V(n);return t!==null&&t.type===I.CONFIG&&typeof t.viewerSettings=="object"}function $n(n){const t=V(n);return t!==null&&t.type===I.ANNOTATION_PLACED&&typeof t.position=="object"&&t.position!==null}function Vn(n){const t=V(n);return t!==null&&t.type===I.FOCUS&&typeof t.state=="string"}function qn(n){const t=V(n);return t!==null&&t.type===I.PRICING&&typeof t.pricing=="object"&&t.pricing!==null}function V(n){return typeof n!="object"||n===null?null:n}class oe{constructor(t){this.processor=t}processor;pending=[];isReady=!1;enqueue(t){if(this.isReady){this.processor(t);return}this.pending.push(t)}markReady(){if(this.isReady||(this.isReady=!0,this.pending.length===0))return;const t=[...this.pending];this.pending.length=0;for(const e of t)this.processor(e)}get ready(){return this.isReady}get pendingCount(){return this.pending.length}hasPending(t){return this.pending.some(e=>e.type===t)}clear(){this.pending.length=0}}class jn{constructor(t,e){this.getTarget=t,this.sourceId=`vd-${Math.random().toString(36).slice(2,8)}`,this.targetOrigin=e?.targetOrigin??"*",this.publisher=new oe(i=>this.post(i)),this.consumer=new oe(i=>this.routeToHandler(i)),this.shouldBuffer=e?.shouldBuffer??null,e?.bufferIncoming!==!0&&this.consumer.markReady()}getTarget;handlers=new Map;publisher;consumer;shouldBuffer;listener=null;sourceId;targetOrigin;on(t,e){this.handlers.set(t,e)}off(t){this.handlers.delete(t)}setTargetOrigin(t){this.targetOrigin=t}send(t){this.publisher.enqueue(t)}markReady(){this.publisher.markReady()}markConsumerReady(){this.consumer.markReady()}consumerHasPending(t){return this.consumer.hasPending(t)}start(){this.listener===null&&(this.listener=t=>{const{data:e}=t;if(!Bn(e)||e._source===this.sourceId)return;const i=this.getTarget();if(i!==null&&t.source!==null&&t.source!==i)return;const o=e;if(this.shouldBuffer!==null&&!this.shouldBuffer(o)){this.routeToHandler(o);return}this.consumer.enqueue(o)},window.addEventListener("message",this.listener))}destroy(){this.listener!==null&&(window.removeEventListener("message",this.listener),this.listener=null),this.publisher.clear(),this.consumer.clear(),this.handlers.clear()}get ready(){return this.publisher.ready}get pendingCount(){return this.publisher.pendingCount}post(t){const e=this.getTarget();e!==null&&e.postMessage({...t,_source:this.sourceId},this.targetOrigin)}routeToHandler(t){const e=this.handlers.get(t.type);if(e===void 0)return;const i=e(t);i instanceof Promise&&i.catch(o=>{const r=o instanceof Error?o.message:String(o);console.error(`Virtualdisplay: error handling ${t.type}: ${r}`)})}}class re{constructor(t){this.send=t}send;placedCallbacks=[];setEnabled(t){this.send({type:I.ANNOTATION_TOGGLE,enabled:t})}startPlacing(){this.send({type:I.ANNOTATION_PLACE_MODE,enabled:!0})}stopPlacing(){this.send({type:I.ANNOTATION_PLACE_MODE,enabled:!1})}onPlaced(t){this.placedCallbacks.push(t)}handlePlaced(t){for(const e of this.placedCallbacks)e(t)}}class se{constructor(t,e){this.value=t,this.attribute=e}value;attribute;isSelectedValue=!1;get isSelected(){return this.isSelectedValue}setSelected(t){this.isSelectedValue=t}}class ae{name;defaultValue;values;onSelect;onChangeCallback;constructor(t){this.name=t.name,this.defaultValue=t.defaultValue,this.onSelect=t.onSelect,this.values=this.createValues(t.values)}select(t){if(!this.values.has(t))throw O.valueNotFound(this.name,t);this.onSelect(this.name,t)}getValues(){return Array.from(this.values.values())}getValue(t){return this.values.get(t)}get selected(){for(const t of this.values.values())if(t.isSelected)return t.value}onChange(t){this.onChangeCallback=t}handleResult(t){let e;for(const i of this.values.values()){const o=i.value===t;i.setSelected(o),o&&(e=i)}e!==void 0&&this.onChangeCallback!==void 0&&this.onChangeCallback(e)}createValues(t){const e=new Map;for(const i of t){const o=new se(i,this.name);i===this.defaultValue&&o.setSelected(!0),e.set(i,o)}return e}}class Hn{attributes=new Map;constructor(t,e,i){for(const o of t){const r=this.buildOptions(o,e);this.attributes.set(o.name,new ae(r))}this.onMutationFailed=i}onMutationFailed;get(t){return this.attributes.get(t)}getSelection(){const t={};for(const[e,i]of this.attributes){const o=i.selected;o!==void 0&&(t[e]=o)}return t}handleResults(t){for(const e of t){if(!e.success){this.onMutationFailed?.(e.name,e.value);continue}this.get(e.name)?.handleResult(e.value)}}buildOptions(t,e){const i={name:t.name,values:t.values,onSelect:(o,r)=>{e([{name:o,value:r}],!1)}};return t.defaultValue!==void 0?{...i,defaultValue:t.defaultValue}:i}}class Gn{constructor(t,e){this.send=t,this.onMutationFailed=e}send;onMutationFailed;registry;pendingCallbacks=[];handleMappingReceived(t){M.logger.debug("Initializing from server mapping",{attributeCount:t.attributes.length}),this.registry=new Hn(t.attributes,(e,i)=>this.sendMutation(e,i),this.onMutationFailed),this.replayPendingCallbacks()}handleMutationResult(t){this.registry?.handleResults(t.results)}select(t,e){this.sendMutation([{name:t,value:e}],!1)}getValues(t){return this.registry?.get(t)?.getValues()??[]}getValue(t,e){return this.registry?.get(t)?.getValue(e)}onChange(t,e){if(this.registry===void 0){this.pendingCallbacks.push({name:t,callback:e});return}const i=this.registry.get(t);if(i===void 0){M.logger.warn(`onChange: attribute "${t}" not found — callback will not fire`);return}i.onChange(e)}getAttribute(t){return this.registry?.get(t)}getSelection(){return this.registry?.getSelection()??{}}get hasMapping(){return this.registry!==void 0}sendMutation(t,e){const i={type:I.MUTATION,mutations:t,isInitial:e};this.send(i)}replayPendingCallbacks(){for(const{name:t,callback:e}of this.pendingCallbacks){const i=this.registry?.get(t);i===void 0&&M.logger.warn(`onChange: attribute "${t}" not found — buffered callback will not fire`),i?.onChange(e)}this.pendingCallbacks.length=0}}let le=class{constructor(t){this.send=t}send;commands=[];rotate(t){return this.validateFiniteNumber(t,"rotate"),this.commands.push({action:"rotate",value:t}),this}tilt(t){return this.validateFiniteNumber(t,"tilt"),this.commands.push({action:"tilt",value:t}),this}zoom(t){return this.validateFiniteNumber(t,"zoom"),this.commands.push({action:"zoom",value:t}),this}set(){if(this.commands.length===0)throw O.invalidParameter("No camera commands to execute. Call rotate(), tilt(), or zoom() before set().");const t={type:I.CAMERA,commands:this.commands};this.send(t),this.commands=[]}validateFiniteNumber(t,e){if(!Number.isFinite(t))throw O.invalidParameter(`${e}() requires a finite number, got ${String(t)}`)}reset(){const t={type:I.CAMERA,commands:[{action:"reset"}]};this.send(t)}};class Kn{state;limitsState;changeCallbacks=[];constructor(){this.state={rotation:0,tilt:0,zoom:100}}get rotation(){return this.state.rotation}get tilt(){return this.state.tilt}get zoom(){return this.state.zoom}onChange(t){this.changeCallbacks.push(t)}get limits(){return this.limitsState}applyLimits(t){this.limitsState=t;const e={rotation:this.rotation,tilt:this.tilt,zoom:this.zoom};for(const i of this.changeCallbacks)i(e)}handlePositionUpdate(t){this.update(t.transforms)}update(t){let e=!1;for(const i of t)switch(i.type){case"rotation":this.state.rotation=i.value,e=!0;break;case"tilt":this.state.tilt=i.value,e=!0;break;case"zoom":this.state.zoom=i.value,e=!0;break}if(e){const i={rotation:this.rotation,tilt:this.tilt,zoom:this.zoom};for(const o of this.changeCallbacks)o(i)}}}const Z={SELECT:"ui:select",SELECTED:"ui:selected",FOCUS_CHANGE:"vd:focus-change",CONFIGURATION_CHANGE:"vd:configuration-change",CONFIGURATION_SUBMIT:"vd:configuration-submit"};class ce{constructor(t,e){this.send=t,this.dispatch=e}send;dispatch;focused=null;attributes=[];changeCallbacks=[];get current(){return this.focused}set(t){if(typeof t!="string"||t.length===0)throw O.invalidParameter(`set() requires a non-empty component name, got ${String(t)}`);this.send({type:I.FOCUS,action:ie.FOCUS,component:t})}clear(){this.send({type:I.FOCUS,action:ie.UNFOCUS})}onChange(t){this.changeCallbacks.push(t)}handleStateReceived(t){t.state===In.FOCUSED&&t.component!==void 0?(this.focused=t.component,this.attributes=t.attributes??[]):(this.focused=null,this.attributes=[]);const e=this.focused!==null?{component:this.focused,attributes:this.attributes}:null;for(const i of this.changeCallbacks)i(e);this.dispatch(e)}}function Yn(n,t){const e=n.filter(r=>Jn(r,t));if(e.length===0)return;const i=Math.max(...e.map(ue)),o=e.filter(r=>ue(r)===i);return o.length===1?o[0]:void 0}function Jn(n,t){return Object.entries(n.attributes).every(([e,i])=>t[e]===i)}function ue(n){return Object.keys(n.attributes).length}class de{constructor(t,e){this.dispatchChange=t,this.dispatchSubmit=e}dispatchChange;dispatchSubmit;pricing;selection={};resolved;changeCallbacks=[];renderCallbacks=[];submitCallback;submitDefaultLabel;get current(){return this.resolved}get vatDisplay(){return this.pricing?.vatDisplay}get buttonLabel(){const t=this.pricing?.buttonLabel;if(t!=null&&t!=="")return t;if(this.submitDefaultLabel!==void 0&&this.submitDefaultLabel!=="")return this.submitDefaultLabel}get submittable(){return this.submitCallback===void 0?!1:this.pricing===void 0?!0:this.resolved?.availability==="available"}get submitEnabled(){return this.submittable&&this.buttonLabel!==void 0}onChange(t){this.changeCallbacks.push(t)}onSubmit(t,e){this.submitCallback=t,this.submitDefaultLabel=e?.defaultLabel,this.notifyRender()}onRender(t){return this.renderCallbacks.push(t),()=>{const e=this.renderCallbacks.indexOf(t);e!==-1&&this.renderCallbacks.splice(e,1)}}async submit(){if(!this.submittable)return;const t=this.resolved!==void 0?{attributes:this.resolved.attributes,reference:this.resolved.reference}:{attributes:{...this.selection},reference:""};this.dispatchSubmit(t),await this.submitCallback?.(t)}handlePricingReceived(t){this.pricing=t,this.recompute()}handleSelectionChanged(t){this.selection=t,this.recompute()}recompute(){this.resolved=this.resolve();for(const t of this.changeCallbacks)t(this.resolved);this.dispatchChange(this.resolved),this.notifyRender()}notifyRender(){for(const t of this.renderCallbacks)t()}resolve(){if(this.pricing===void 0)return;const t=Yn(this.pricing.rules,this.selection);if(!(t===void 0||t.availability===Mn.HIDDEN))return{attributes:{...this.selection},reference:t.reference,price:t.priceCents,currency:this.pricing.currency,availability:t.availability}}}class he{constructor(t){this.filename=t}filename;developedCallbacks=new Set;errorCallbacks=new Set;developed=!1;failed=!1;photoData=null;onDeveloped(t){return this.developed&&this.photoData!==null?(t(this.photoData),this):(this.developedCallbacks.add(t),this)}onError(t){return this.errorCallbacks.add(t),this}getFilename(){return this.filename}develop(t){this.developed||this.failed||(this.photoData=t,this.developed=!0,this.developedCallbacks.forEach(e=>{e(this.photoData)}),this.developedCallbacks.clear(),this.errorCallbacks.clear())}fail(t){this.developed||this.failed||(this.failed=!0,this.errorCallbacks.forEach(e=>{e(t)}),this.developedCallbacks.clear(),this.errorCallbacks.clear())}}class fe{constructor(t){this.send=t}send;validExtensions=[".png"];pendingPhotos=new Map;take(t){this.validateFilename(t),M.logger.debug("Taking snapshot",{filename:t});const e=new he(t);return this.pendingPhotos.set(e.getFilename(),e),this.send({type:I.SNAPSHOT,filename:t}),e}handleSnapshotResult(t){const e=this.pendingPhotos.get(t.filename);if(e===void 0){M.logger.warn("No pending photo found for filename",{filename:t.filename,pendingFilenames:Array.from(this.pendingPhotos.keys())});return}if(this.pendingPhotos.delete(t.filename),t.error!==void 0){e.fail(new O(t.error,U.SNAPSHOT_FAILED));return}t.data!==void 0&&e.develop({filename:t.filename,data:t.data})}clear(){if(this.pendingPhotos.size===0)return;const t=new O("Client destroyed before snapshot completed",U.SNAPSHOT_FAILED);for(const e of this.pendingPhotos.values())e.fail(t);this.pendingPhotos.clear()}validateFilename(t){if(t===""||typeof t!="string")throw new O("Filename must be a non-empty string",U.INVALID_PARAMETER);if(!this.validExtensions.some(i=>t.toLowerCase().endsWith(i)))throw new O(`Invalid filename: "${t}". Filename must end with one of: ${this.validExtensions.join(", ")}`,U.INVALID_PARAMETER);if(t.includes("..")||t.includes("/")||t.includes("\\"))throw new O('Filename cannot contain path separators or ".."',U.INVALID_PARAMETER)}}class Zn{container=null;attach(t){this.container=t}dispatch(t,e,i=!1){const o=new CustomEvent(t,{detail:e,cancelable:i});return this.container?.dispatchEvent(o),o}on(t,e){const i=o=>{const r=o,s={...r.detail,preventDefault:()=>{r.preventDefault()}};e(s)};return this.container?.addEventListener(t,i),()=>{this.container?.removeEventListener(t,i)}}}const Wn={},Qn="en",ge=["en","nl","de"],ut=["baseLocale"],me=[];let pe,be;function Xn(n){if(me.length===0)return;const t=typeof n=="string"?n:n.href;if(pe===t)return be;const e=new URL(t,"http://dummy.com");let i;for(const o of me)if(new Wn(o.match,e.href).exec(e.href)){i=o;break}return pe=t,be=i,i}function ve(n){const t=Xn(n);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:ut}const dt=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let ye=!1,P=()=>{let n=ut;!dt&&typeof window<"u"&&window.location?.href&&(n=ve(window.location.href));const t=ti(n);if(t)return ye||(ye=!0,we(t,{reload:!1})),t;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function ti(n,t){let e;for(const i of n){if(i==="baseLocale")e=Qn;else if(Ee(i)&&rt.has(i)){const r=rt.get(i);if(r){const s=r.getLocale();if(s instanceof Promise)continue;if(s!==void 0)return ni(s)}}const o=Ce(e);if(o)return o}}const ei=n=>{window.location.reload()};let we=(n,t)=>{const e={reload:!0,...t};let i;try{i=P()}catch{}const o=[];let r=ut;!dt&&typeof window<"u"&&window.location?.href&&(r=ve(window.location.href));for(const a of r)if(a!=="baseLocale"&&Ee(a)&&rt.has(a)){const l=rt.get(a);if(l){let c=l.setLocale(n);c instanceof Promise&&(c=c.catch(u=>{throw new Error(`Custom strategy "${a}" setLocale failed.`,{cause:u})}),o.push(c))}}const s=()=>{!dt&&e.reload&&window.location&&n!==i&&ei()};if(o.length)return Promise.all(o).then(()=>{s()});s()};function Ce(n){if(typeof n!="string")return;const t=n.toLowerCase();for(const e of ge)if(e.toLowerCase()===t)return e}function ni(n){const t=Ce(n);if(t)return t;throw new Error(`Invalid locale: ${n}. Expected one of: ${ge.join(", ")}`)}const rt=new Map;function Ee(n){return typeof n=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(n)}const ii=()=>"Activate AR",oi=()=>"AR activeren",ri=()=>"AR aktivieren",si=((n={},t={})=>{const e=t.locale??P();return e==="en"?ii():e==="nl"?oi():ri()}),ai=()=>"Scan to view in AR",li=()=>"Scan om in AR te bekijken",ci=()=>"Scannen für AR-Ansicht",ui=((n={},t={})=>{const e=t.locale??P();return e==="en"?ai():e==="nl"?li():ci()}),di=()=>"Use your smartphone camera to scan this QR code",hi=()=>"Gebruik de camera van je smartphone om deze QR-code te scannen",fi=()=>"Verwenden Sie die Kamera Ihres Smartphones, um diesen QR-Code zu scannen",gi=((n={},t={})=>{const e=t.locale??P();return e==="en"?di():e==="nl"?hi():fi()}),mi=()=>"Your phone will open the 3D model in AR mode.",pi=()=>"Je telefoon opent het 3D-model in AR-modus.",bi=()=>"Das 3D-Modell wird im AR-Modus Ihres Telefons geöffnet",vi=((n={},t={})=>{const e=t.locale??P();return e==="en"?mi():e==="nl"?pi():bi()}),yi=()=>"Close",wi=()=>"Sluiten",Ci=()=>"Schließen",Ei=((n={},t={})=>{const e=t.locale??P();return e==="en"?yi():e==="nl"?wi():Ci()}),_i=()=>"Fullscreen",Ai=()=>"Volledig scherm",Si=()=>"Vollbild",ki=((n={},t={})=>{const e=t.locale??P();return e==="en"?_i():e==="nl"?Ai():Si()}),Ti=()=>"Downloading",Ri=()=>"Downloaden",Ni=()=>"Herunterladen",_e=((n={},t={})=>{const e=t.locale??P();return e==="en"?Ti():e==="nl"?Ri():Ni()}),Ii=()=>"Rendering",Mi=()=>"Renderen",Pi=()=>"Rendern",Bi=((n={},t={})=>{const e=t.locale??P();return e==="en"?Ii():e==="nl"?Mi():Pi()}),Li=()=>"Screenshot",Oi=()=>"Screenshot",xi=()=>"Screenshot",Di=((n={},t={})=>{const e=t.locale??P();return e==="en"?Li():e==="nl"?Oi():xi()}),zi=()=>"Configure",Fi=()=>"Configureer",Ui=()=>"Konfigurieren",$i=((n={},t={})=>{const e=t.locale??P();return e==="en"?zi():e==="nl"?Fi():Ui()}),Vi=()=>"Close",qi=()=>"Sluiten",ji=()=>"Schließen",Hi=((n={},t={})=>{const e=t.locale??P();return e==="en"?Vi():e==="nl"?qi():ji()}),Gi=()=>"Reset camera",Ki=()=>"Camera resetten",Yi=()=>"Kamera zurücksetzen",Ji=((n={},t={})=>{const e=t.locale??P();return e==="en"?Gi():e==="nl"?Ki():Yi()}),Zi=()=>"Zoom in",Wi=()=>"Inzoomen",Qi=()=>"Hineinzoomen",Xi=((n={},t={})=>{const e=t.locale??P();return e==="en"?Zi():e==="nl"?Wi():Qi()}),to=()=>"Zoom out",eo=()=>"Uitzoomen",no=()=>"Herauszoomen",io=((n={},t={})=>{const e=t.locale??P();return e==="en"?to():e==="nl"?eo():no()}),oo=()=>"Rotate left",ro=()=>"Naar links draaien",so=()=>"Nach links drehen",ao=((n={},t={})=>{const e=t.locale??P();return e==="en"?oo():e==="nl"?ro():so()}),lo=()=>"Rotate right",co=()=>"Naar rechts draaien",uo=()=>"Nach rechts drehen",ho=((n={},t={})=>{const e=t.locale??P();return e==="en"?lo():e==="nl"?co():uo()}),fo=()=>"Tilt up",go=()=>"Omhoog kantelen",mo=()=>"Nach oben kippen",po=((n={},t={})=>{const e=t.locale??P();return e==="en"?fo():e==="nl"?go():mo()}),bo=()=>"Tilt down",vo=()=>"Omlaag kantelen",yo=()=>"Nach unten kippen",wo=((n={},t={})=>{const e=t.locale??P();return e==="en"?bo():e==="nl"?vo():yo()}),Co=()=>"Working…",Eo=()=>"Bezig…",_o=()=>"Läuft…",Ao=((n={},t={})=>{const e=t.locale??P();return e==="en"?Co():e==="nl"?Eo():_o()}),So=()=>"Done",ko=()=>"Gelukt",To=()=>"Fertig",Ro=((n={},t={})=>{const e=t.locale??P();return e==="en"?So():e==="nl"?ko():To()}),No=()=>"Failed",Io=()=>"Mislukt",Mo=()=>"Fehlgeschlagen",Po=((n={},t={})=>{const e=t.locale??P();return e==="en"?No():e==="nl"?Io():Mo()});const Bo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Ae=([n,t,e])=>{const i=document.createElementNS("http://www.w3.org/2000/svg",n);return Object.keys(t).forEach(o=>{i.setAttribute(o,String(t[o]))}),e?.length&&e.forEach(o=>{const r=Ae(o);i.appendChild(r)}),i},Se=(n,t={})=>{const i={...Bo,...t};return Ae(["svg",i,n])};const Lo=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];const Oo=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];const ke=[["path",{d:"m6 9 6 6 6-6"}]];const xo=[["path",{d:"m15 18-6-6 6-6"}]];const Do=[["path",{d:"m9 18 6-6-6-6"}]];const zo=[["path",{d:"m18 15-6-6-6 6"}]];const Fo=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]];const Uo=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]];const $o=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];const Vo=[["path",{d:"M10 5H3"}],["path",{d:"M12 19H3"}],["path",{d:"M14 3v4"}],["path",{d:"M16 17v4"}],["path",{d:"M21 12h-9"}],["path",{d:"M21 19h-5"}],["path",{d:"M21 5h-7"}],["path",{d:"M8 10v4"}],["path",{d:"M8 12H3"}]];const qo=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];const jo=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];const Ho=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];function F(n,{size:t=20,strokeWidth:e=1.75}={}){return Se(n,{width:t,height:t,"stroke-width":e})}const D={ar:n=>F(Lo,n),fullscreen:n=>F(Fo,n),exitFullscreen:n=>F(Uo,n),screenshot:n=>F(Oo,n),tiltUp:n=>F(zo,n),tiltDown:n=>F(ke,n),rotateLeft:n=>F(xo,n),rotateRight:n=>F(Do,n),zoomIn:n=>F(jo,n),zoomOut:n=>F(Ho,n),reset:n=>F($o,n),configurator:n=>F(Vo,n),close:n=>F(qo,n)};class z{element;constructor({variant:t="default",size:e="default",label:i,icon:o,onClick:r,disabled:s=!1}={}){this.element=document.createElement("button"),this.element.className=`ui-btn ui-btn--${t} ui-btn--size-${e}`,i!==void 0&&(this.element.setAttribute("aria-label",i),this.element.title=i),o!==void 0?this.element.appendChild(o):i!==void 0&&(this.element.textContent=i),r&&this.element.addEventListener("click",r),this.element.disabled=s}setIcon(t){const e=this.element.querySelector("svg");e!==null?e.replaceWith(t):this.element.appendChild(t)}}const L={semantic:{error:"#dc2626"},neutral:{500:"#737373",600:"#525252",900:"#171717"},white:"#ffffff",black:"#000000"},_={0:"0",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",9:"2.25rem",24:"6rem"};class Go{element;constructor(){this.element=document.createElement("div"),Object.assign(this.element.style,{background:L.white,borderRadius:_[3],padding:_[6],boxShadow:`0 ${_[2]} ${_[8]} oklch(0% 0 0 / 20%)`,maxWidth:"20rem",width:"100%"})}}class Ko{constructor(t={}){this.options=t,this.card=new Go,this.backdrop=this.createBackdrop(),this.backdrop.appendChild(this.card.element)}options;card;backdrop;keyHandler=null;open(){document.body.appendChild(this.backdrop),this.keyHandler=t=>{t.key==="Escape"&&this.close()},document.addEventListener("keydown",this.keyHandler)}close(){this.backdrop.remove(),this.keyHandler!==null&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null),this.options.onClose?.()}createBackdrop(){const t=document.createElement("div");return Object.assign(t.style,{position:"fixed",inset:_[0],background:"oklch(0% 0 0 / 50%)",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center"}),t.addEventListener("click",e=>{e.target===t&&this.close()}),t}}class Yo{element;selectCallback=null;constructor(t,e,i){this.element=document.createElement("div"),this.element.className="ui-toggle-group";for(let o=0;o<t.length;o++){const r=t[o],s=document.createElement("button");s.className="ui-toggle-group-item",s.dataset.value=r,s.textContent=i?.[o]??r,s.dataset.state=r===e?"on":"off",s.setAttribute("aria-pressed",r===e?"true":"false"),s.addEventListener("click",()=>{this.selectCallback?.(r)}),this.element.appendChild(s)}}setSelected(t){for(const e of this.element.querySelectorAll(".ui-toggle-group-item")){const i=e.dataset.value===t;e.dataset.state=i?"on":"off",e.setAttribute("aria-pressed",i?"true":"false")}}onSelect(t){this.selectCallback=t}}class Jo{element;select;constructor(t,e,i,o,r){this.select=document.createElement("select"),this.select.className="ui-native-select",this.select.dataset.name=t,this.select.setAttribute("aria-label",i);const s=document.createElement("option");s.value="",s.disabled=!0,s.textContent=i,this.select.appendChild(s);let a=!1;for(let c=0;c<e.length;c++){const u=e[c],h=document.createElement("option");h.value=u,h.textContent=r?.[c]??u,u===o&&(h.selected=!0,a=!0),this.select.appendChild(h)}a||(s.selected=!0);const l=Se(ke,{width:16,height:16,"stroke-width":2});l.classList.add("ui-native-select-icon"),this.element=document.createElement("div"),this.element.className="ui-native-select-wrap",this.element.appendChild(this.select),this.element.appendChild(l)}setSelected(t){this.select.value=t}onSelect(t){this.select.addEventListener("change",()=>{t(this.select.value)})}}const $={fontFamily:{sans:["Mona Sans","ui-sans-serif","system-ui","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"]},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem"},fontWeight:{medium:"500",semibold:"600"}},Zo=$.fontFamily.sans.join(", ");class Wo{qrLib=null;dialog=null;async show(t){this.hide(),this.qrLib??=await Promise.resolve().then(()=>Yr);const e=await this.qrLib.toDataURL(t,{width:256,margin:4,errorCorrectionLevel:"M",color:{dark:L.black,light:L.white}});this.dialog=new Ko({onClose:()=>{this.dialog=null}}),Object.assign(this.dialog.card.element.style,{display:"flex",flexDirection:"column",alignItems:"center",gap:_[3],fontFamily:Zo}),this.dialog.card.element.appendChild(this.createText(ui(),{fontSize:$.fontSize.base,fontWeight:$.fontWeight.semibold,color:L.neutral[900]})),this.dialog.card.element.appendChild(this.createText(gi(),{fontSize:$.fontSize.sm,color:L.neutral[600]})),this.dialog.card.element.appendChild(this.createQrImage(e)),this.dialog.card.element.appendChild(this.createText(vi(),{fontSize:$.fontSize.xs,color:L.neutral[500]}));const i=new z({variant:"outline",label:Ei(),onClick:()=>{this.hide()}});this.dialog.card.element.appendChild(i.element),this.dialog.open()}hide(){this.dialog?.close(),this.dialog=null}createText(t,e){const i=document.createElement("p");return i.textContent=t,Object.assign(i.style,{margin:"0",textAlign:"center",...e}),i}createQrImage(t){const e=document.createElement("img");return e.src=t,e.alt="QR code",Object.assign(e.style,{width:_[24],height:_[24],borderRadius:_[1]}),e}}const W=$.fontFamily.sans.join(", "),Qo=`
9
2
  :root {
10
3
  --primary: oklch(5% 0 0);
11
4
  --primary-foreground: oklch(100% 0 0);
@@ -29,7 +22,7 @@ Minimum version required to store current data is: `+c+`.
29
22
  gap: 0.5rem;
30
23
  border: 1px solid transparent;
31
24
  border-radius: var(--radius);
32
- font-family: ${V};
25
+ font-family: ${W};
33
26
  font-size: 0.875rem;
34
27
  font-weight: 600;
35
28
  white-space: nowrap;
@@ -86,7 +79,7 @@ Minimum version required to store current data is: `+c+`.
86
79
  border-radius: var(--radius);
87
80
  background: var(--background);
88
81
  color: var(--foreground);
89
- font-family: ${V};
82
+ font-family: ${W};
90
83
  font-size: 0.875rem;
91
84
  font-weight: 600;
92
85
  cursor: pointer;
@@ -96,6 +89,11 @@ Minimum version required to store current data is: `+c+`.
96
89
  }
97
90
  .ui-toggle-group-item:hover { background: var(--accent); border-color: oklch(85% 0 0); }
98
91
  .ui-toggle-group-item:active { transform: scale(0.98); }
92
+ .ui-toggle-group-item:focus-visible {
93
+ outline: none;
94
+ border-color: var(--ring);
95
+ box-shadow: 0 0 0 3px oklch(5% 0 0 / 12%);
96
+ }
99
97
  .ui-toggle-group-item[data-state="on"] {
100
98
  background: var(--primary);
101
99
  color: var(--primary-foreground);
@@ -120,7 +118,7 @@ Minimum version required to store current data is: `+c+`.
120
118
  background: var(--background);
121
119
  appearance: none;
122
120
  color: var(--foreground);
123
- font-family: ${V};
121
+ font-family: ${W};
124
122
  font-size: 0.875rem;
125
123
  font-weight: 400;
126
124
  cursor: pointer;
@@ -154,6 +152,10 @@ Minimum version required to store current data is: `+c+`.
154
152
  overflow: visible !important; /* override CSS2DRenderer inline style */
155
153
  }
156
154
 
155
+ .vd-annotation-anchor {
156
+ position: relative;
157
+ }
158
+
157
159
  .vd-annotation-marker {
158
160
  display: flex;
159
161
  align-items: center;
@@ -164,7 +166,7 @@ Minimum version required to store current data is: `+c+`.
164
166
  border: 2px solid oklch(100% 0 0);
165
167
  background: var(--primary);
166
168
  color: var(--primary-foreground);
167
- font-family: ${V};
169
+ font-family: ${W};
168
170
  font-size: 0.8125rem;
169
171
  font-weight: 600;
170
172
  cursor: pointer;
@@ -174,6 +176,10 @@ Minimum version required to store current data is: `+c+`.
174
176
  position: relative;
175
177
  }
176
178
  .vd-annotation-marker:hover { transform: scale(1.1); }
179
+ .vd-annotation-marker:focus-visible {
180
+ outline: 2px solid var(--ring);
181
+ outline-offset: 2px;
182
+ }
177
183
 
178
184
  .vd-annotation-popup {
179
185
  position: absolute;
@@ -190,6 +196,37 @@ Minimum version required to store current data is: `+c+`.
190
196
  pointer-events: auto;
191
197
  white-space: normal;
192
198
  }
199
+ .vd-annotation-popup:focus { outline: none; }
200
+
201
+ .vd-annotation-popup-close {
202
+ position: absolute;
203
+ inset-block-start: 0.375rem;
204
+ inset-inline-end: 0.375rem;
205
+ display: flex;
206
+ align-items: center;
207
+ justify-content: center;
208
+ inline-size: 1.25rem;
209
+ block-size: 1.25rem;
210
+ padding: 0;
211
+ border: none;
212
+ border-radius: calc(var(--radius) - 4px);
213
+ background: transparent;
214
+ color: var(--muted-foreground);
215
+ cursor: pointer;
216
+ pointer-events: auto;
217
+ }
218
+ .vd-annotation-popup-close:hover {
219
+ color: var(--foreground);
220
+ background: var(--secondary);
221
+ }
222
+ .vd-annotation-popup-close:focus-visible {
223
+ outline: 2px solid var(--ring);
224
+ outline-offset: 1px;
225
+ }
226
+ .vd-annotation-popup-close svg {
227
+ inline-size: 0.875rem;
228
+ block-size: 0.875rem;
229
+ }
193
230
 
194
231
  @media (prefers-reduced-motion: no-preference) {
195
232
  .vd-annotation-popup {
@@ -203,86 +240,81 @@ Minimum version required to store current data is: `+c+`.
203
240
  }
204
241
 
205
242
  .vd-annotation-popup-title {
206
- font-family: ${V};
243
+ font-family: ${W};
207
244
  font-size: 0.875rem;
208
245
  font-weight: 600;
209
246
  line-height: 1.25rem;
247
+ /* Keep the title clear of the absolutely positioned close button. */
248
+ padding-inline-end: 1.5rem;
210
249
  }
211
250
 
212
251
  .vd-annotation-popup-description {
213
- font-family: ${V};
252
+ font-family: ${W};
214
253
  font-size: 0.8125rem;
215
254
  font-weight: 400;
216
255
  line-height: 1.125rem;
217
256
  color: var(--muted-foreground);
218
257
  margin-block-start: 0.25rem;
219
258
  }
220
- `,Jn=!1;function Yn(){if(Jn||typeof document>`u`)return;Jn=!0;let e=document.createElement(`style`);e.id=`vd-ui-vanilla`,e.textContent=qn,document.head.appendChild(e)}function H(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function Xn(e,t,n,r,i,a){let[o,s,c]=e,l=Math.cos(t),u=Math.sin(t),d=l*o+u*c,f=-u*o+l*c,p=Math.cos(n),m=Math.sin(n),h=p*s-m*f,g=m*s+p*f,_=.55;return[r+d*a*_,i-h*a*_,g]}function Zn(e,t,n){e.beginPath(),e.moveTo(t[0],t[1]),e.lineTo(n[0],n[1]),e.strokeStyle=`#000`,e.lineWidth=2,e.stroke()}function Qn(e,t,n,r,i){let a=t(n),o=t(r);Zn(e,a,[a[0]+(o[0]-a[0])*i,a[1]+(o[1]-a[1])*i,a[2]])}var U=[-1,-1,1],W=[1,-1,1],G=[1,-1,-1],K=[-1,-1,-1],q=[-1,1,1],J=[1,1,1],Y=[1,1,-1],X=[-1,1,-1],$n=[[U,W],[W,G],[G,K],[K,U],[U,q],[W,J],[G,Y],[K,X],[q,J],[J,Y],[Y,X],[X,q]],er=400,tr=`-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`;function nr(){let e=document.createElement(`div`);Object.assign(e.style,{position:`absolute`,inset:`0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,background:`#fff`,zIndex:`20`,opacity:`0`,transition:`opacity 0.3s ease-in-out`});let t=document.createElement(`canvas`);Object.assign(t.style,{width:`100%`,height:`100%`,position:`absolute`,inset:`0`});let n=document.createElement(`div`);Object.assign(n.style,{position:`absolute`,top:`56%`,left:`0`,right:`0`,textAlign:`center`,pointerEvents:`none`});let r=document.createElement(`span`);Object.assign(r.style,{fontSize:`13px`,fontWeight:`400`,color:`#000`,fontVariantNumeric:`tabular-nums`,fontFamily:tr});let i=document.createElement(`span`);return Object.assign(i.style,{fontSize:`13px`,color:`#000`,fontFamily:tr}),i.textContent=vt(),n.appendChild(r),n.appendChild(i),e.appendChild(t),e.appendChild(n),{overlay:e,canvas:t,pctEl:r,phaseEl:i}}var rr=class{overlay;canvas;ctx;pctEl;phaseEl;animationId=null;showTimerId=null;startTime;hidden=!1;visible=!1;constructor(e,t={}){this.startTime=performance.now();let n=nr();this.overlay=n.overlay,this.canvas=n.canvas,this.pctEl=n.pctEl,this.phaseEl=n.phaseEl,e.appendChild(this.overlay),this.ctx=this.canvas.getContext(`2d`),this.ctx!==null&&(this.sizeCanvas(),this.tick());let r=t.showDelay??er;this.showTimerId=setTimeout(()=>{this.reveal()},r)}get loadingTexts(){return{downloading:vt(),rendering:St()}}updateProgress(e,t){this.hidden||(this.pctEl.textContent=`${Math.round(e)}%`,this.phaseEl.textContent=t===``?``:` \u00B7 ${t}`)}showError(e){if(this.hidden=!1,this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null),this.ctx!==null){let e=Math.min(devicePixelRatio,2),t=this.canvas.width/e,n=this.canvas.height/e;this.ctx.fillStyle=`#fff`,this.ctx.fillRect(0,0,t*e,n*e)}this.pctEl.textContent=``,this.phaseEl.textContent=e,this.phaseEl.style.color=`#b91c1c`,this.reveal()}hide(){if(!this.hidden){if(this.hidden=!0,this.cancelShowTimer(),!this.visible){this.destroy();return}this.overlay.style.opacity=`0`,this.overlay.addEventListener(`transitionend`,()=>{this.destroy()},{once:!0}),setTimeout(()=>{this.destroy()},500)}}destroy(){this.cancelShowTimer(),this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null),this.overlay.remove()}reveal(){this.hidden||this.visible||(this.visible=!0,this.overlay.style.opacity=`1`)}cancelShowTimer(){this.showTimerId!==null&&(clearTimeout(this.showTimerId),this.showTimerId=null)}sizeCanvas(){if(this.ctx===null)return;let e=Math.min(devicePixelRatio,2),t=this.overlay.clientWidth||440,n=this.overlay.clientHeight||360;this.canvas.width=t*e,this.canvas.height=n*e,this.ctx.scale(e,e),this.ctx.lineCap=`round`,this.ctx.lineJoin=`round`}tick=()=>{this.hidden||(this.drawFrame(),this.animationId=requestAnimationFrame(this.tick))};drawFrame(){if(this.ctx===null)return;let e=this.canvas.width/Math.min(devicePixelRatio,2),t=this.canvas.height/Math.min(devicePixelRatio,2),n=(performance.now()-this.startTime)/1e3;this.ctx.fillStyle=`#fff`,this.ctx.fillRect(0,0,e,t);let r=e/2,i=t*.44,a=Math.min(e,t)*.08,o=e=>Xn(e,.785,.615,r,i,a),s=n%6/6,c=$n.length,l;l=s<.35?H(s/.35)*c:s<.55?c:s<.9?(1-H((s-.55)/.35))*c:0,this.ctx.shadowBlur=5,this.ctx.shadowColor=`rgba(30,30,30,0.08)`;for(let e=0;e<c&&!(e>=l);e++){let t=$n[e];if(t===void 0)continue;let n=Math.min(1,l-e);Qn(this.ctx,o,t[0],t[1],n)}this.ctx.shadowBlur=0}},ir=class{element;arBtn=null;fullscreenBtn=null;onFullscreenChange;constructor(e){this.options=e,this.element=document.createElement(`div`),Object.assign(this.element.style,{display:`flex`,gap:`0.375rem`}),this.onFullscreenChange=()=>{this.setFullscreenIcon(document.fullscreenElement!==null)},document.addEventListener(`fullscreenchange`,this.onFullscreenChange)}setFullscreenIcon(e){this.fullscreenBtn!==null&&this.fullscreenBtn.setIcon(e?N.exitFullscreen():N.fullscreen())}syncButton(e,t,n){if(t&&e===null){let e=n();return this.element.appendChild(e.element),e}return!t&&e!==null?(e.element.remove(),null):e}applySettings(e){this.arBtn=this.syncButton(this.arBtn,e.ar!==!1&&this.options.onAr!==void 0,()=>new P({variant:`outline`,size:`icon`,label:Je(),icon:N.ar(),onClick:()=>{this.options.onAr?.()}})),this.fullscreenBtn=this.syncButton(this.fullscreenBtn,e.fullscreen!==!1&&this.options.onFullscreen!==void 0,()=>new P({variant:`outline`,size:`icon`,label:mt(),icon:N.fullscreen(),onClick:()=>{this.options.onFullscreen?.()}}))}destroy(){document.removeEventListener(`fullscreenchange`,this.onFullscreenChange)}},Z=.5,ar=class e{element;constructor(t,n){this.element=Object.assign(document.createElement(`div`),{className:`vd-camera-controls`});let r={targetRotation:n.rotation,targetTilt:n.tilt,targetZoom:n.zoom,thetaOffset:0},i=or(t,n,r);n.onChange(e=>{r.targetRotation=e.rotation-r.thetaOffset,r.targetTilt=e.tilt,r.targetZoom=e.zoom,sr(i,n,e)}),this.element.appendChild(e.buildZoom(i.zoomOut,i.zoomIn)),this.element.appendChild(e.buildDpad(i.tiltUp,i.rotateLeft,i.reset,i.rotateRight,i.tiltDown))}static buildZoom(e,t){let n=document.createElement(`div`);return n.className=`vd-zoom`,n.appendChild(e.element),n.appendChild(t.element),n}static buildDpad(e,t,n,r,i){let a=document.createElement(`div`);a.className=`vd-dpad`;for(let[o,s]of[[e,`up`],[t,`left`],[n,`center`],[r,`right`],[i,`down`]])o.element.classList.add(`vd-dpad-${s}`),a.appendChild(o.element);return a}};function or(e,t,n){let r=e=>Math.max(t.limits?.minZoom??1,Math.min(t.limits?.maxZoom??1/0,e)),i=e=>{let n=t.limits?.minRotate,r=t.limits?.maxRotate;return n!==void 0||r!==void 0?Math.max(n??-1/0,Math.min(r??1/0,e)):e},a=r=>{let i=t.limits?.minTilt,a=t.limits?.maxTilt;if(i!==void 0||a!==void 0){n.targetTilt=Math.max(i??0,Math.min(a??180,n.targetTilt+r)),e.tilt(n.targetTilt).set();return}let o=n.targetTilt+r;o>180||o<0?(n.targetTilt=o>180?360-o:-o,n.thetaOffset=(n.thetaOffset+180)%360,e.tilt(n.targetTilt).rotate(n.targetRotation+n.thetaOffset).set()):(n.targetTilt=o,e.tilt(n.targetTilt).set())};return{zoomOut:new P({variant:`outline`,size:`icon`,label:Rt(),icon:N.zoomOut(),onClick:()=>{n.targetZoom=r(n.targetZoom-10),e.zoom(n.targetZoom).set()}}),zoomIn:new P({variant:`outline`,size:`icon`,label:Pt(),icon:N.zoomIn(),onClick:()=>{n.targetZoom=r(n.targetZoom+10),e.zoom(n.targetZoom).set()}}),tiltUp:new P({variant:`outline`,size:`icon`,label:Xt(),icon:N.tiltUp(),onClick:()=>{a(-15)}}),rotateLeft:new P({variant:`outline`,size:`icon`,label:Ht(),icon:N.rotateLeft(),onClick:()=>{n.targetRotation=i(n.targetRotation-15),e.rotate(n.targetRotation+n.thetaOffset).set()}}),reset:new P({variant:`outline`,size:`icon`,label:At(),icon:N.reset(),onClick:()=>{n.thetaOffset=0,e.reset()}}),rotateRight:new P({variant:`outline`,size:`icon`,label:Kt(),icon:N.rotateRight(),onClick:()=>{n.targetRotation=i(n.targetRotation+15),e.rotate(n.targetRotation+n.thetaOffset).set()}}),tiltDown:new P({variant:`outline`,size:`icon`,label:en(),icon:N.tiltDown(),onClick:()=>{a(15)}})}}function sr(e,t,n){let r=t.limits;r!==void 0&&(e.zoomOut.element.disabled=r.minZoom!==void 0&&n.zoom<=r.minZoom+Z,e.zoomIn.element.disabled=r.maxZoom!==void 0&&n.zoom>=r.maxZoom-Z,e.tiltUp.element.disabled=r.minTilt!==void 0&&n.tilt<=r.minTilt+Z,e.tiltDown.element.disabled=r.maxTilt!==void 0&&n.tilt>=r.maxTilt-Z,e.rotateLeft.element.disabled=r.minRotate!==void 0&&n.rotation<=r.minRotate+Z,e.rotateRight.element.disabled=r.maxRotate!==void 0&&n.rotation>=r.maxRotate-Z)}var cr=5;function Q(e){let t=e.replace(/([A-Z])/g,` $1`).trim();return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function lr(e,t,n,r,i){let a=document.createElement(`div`);a.className=`vd-attribute`,a.dataset.name=e.name;let o=document.createElement(`span`);o.className=`vd-attribute-label`,o.textContent=Q(e.name),a.appendChild(o);let s=e.values.find(n=>t.getValue(e.name,n)?.isSelected===!0),c=e.values.map(Q),l=e.values.length<=cr?new vn(e.values,s,c):new yn(e.name,e.values,Q(e.name),s,c);return l.onSelect(t=>{n.dispatch(`ui:select`,{attribute:e.name,value:t},!0).defaultPrevented||r(e.name,t)}),i(e.name,t=>{l.setSelected(t.value),n.dispatch(`ui:selected`,{attribute:e.name,value:t.value})}),a.appendChild(l.element),a}var ur=L.fontFamily.sans.join(`, `),$=`
259
+ `;let Te=!1;function Xo(){if(Te||typeof document>"u")return;Te=!0;const n=document.createElement("style");n.id="vd-ui-vanilla",n.textContent=Qo,document.head.appendChild(n)}function Re(n){const t=Math.max(0,Math.min(1,n));return t*t*(3-2*t)}function tr(n,t,e,i,o,r){const[s,a,l]=n,c=Math.cos(t),u=Math.sin(t),h=c*s+u*l,f=-u*s+c*l,d=Math.cos(e),p=Math.sin(e),k=d*a-p*f,B=p*a+d*f,E=.55;return[i+h*r*E,o-k*r*E,B]}function er(n,t,e){n.beginPath(),n.moveTo(t[0],t[1]),n.lineTo(e[0],e[1]),n.strokeStyle="#000",n.lineWidth=2,n.stroke()}function nr(n,t,e,i,o){const r=t(e),s=t(i),a=[r[0]+(s[0]-r[0])*o,r[1]+(s[1]-r[1])*o,r[2]];er(n,r,a)}const ht=[-1,-1,1],ft=[1,-1,1],gt=[1,-1,-1],mt=[-1,-1,-1],pt=[-1,1,1],bt=[1,1,1],vt=[1,1,-1],yt=[-1,1,-1],Ne=[[ht,ft],[ft,gt],[gt,mt],[mt,ht],[ht,pt],[ft,bt],[gt,vt],[mt,yt],[pt,bt],[bt,vt],[vt,yt],[yt,pt]],ir=400,Ie='-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif';function or(){const n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#fff",zIndex:"20",opacity:"0",transition:"opacity 0.3s ease-in-out"});const t=document.createElement("canvas");Object.assign(t.style,{width:"100%",height:"100%",position:"absolute",inset:"0"});const e=document.createElement("div");Object.assign(e.style,{position:"absolute",top:"56%",left:"0",right:"0",textAlign:"center",pointerEvents:"none"});const i=document.createElement("span");Object.assign(i.style,{fontSize:"13px",fontWeight:"400",color:"#000",fontVariantNumeric:"tabular-nums",fontFamily:Ie});const o=document.createElement("span");return Object.assign(o.style,{fontSize:"13px",color:"#000",fontFamily:Ie}),o.textContent=_e(),e.appendChild(i),e.appendChild(o),n.appendChild(t),n.appendChild(e),{overlay:n,canvas:t,pctEl:i,phaseEl:o}}class rr{overlay;canvas;ctx;pctEl;phaseEl;animationId=null;showTimerId=null;startTime;hidden=!1;visible=!1;constructor(t,e={}){this.startTime=performance.now();const i=or();this.overlay=i.overlay,this.canvas=i.canvas,this.pctEl=i.pctEl,this.phaseEl=i.phaseEl,t.appendChild(this.overlay),this.ctx=this.canvas.getContext("2d"),this.ctx!==null&&(this.sizeCanvas(),this.tick());const o=e.showDelay??ir;this.showTimerId=setTimeout(()=>{this.reveal()},o)}get loadingTexts(){return{downloading:_e(),rendering:Bi()}}updateProgress(t,e){this.hidden||(this.pctEl.textContent=`${Math.round(t)}%`,this.phaseEl.textContent=e!==""?` · ${e}`:"")}showError(t){if(this.hidden=!1,this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null),this.ctx!==null){const e=Math.min(devicePixelRatio,2),i=this.canvas.width/e,o=this.canvas.height/e;this.ctx.fillStyle="#fff",this.ctx.fillRect(0,0,i*e,o*e)}this.pctEl.textContent="",this.phaseEl.textContent=t,this.phaseEl.style.color="#b91c1c",this.reveal()}hide(){if(!this.hidden){if(this.hidden=!0,this.cancelShowTimer(),!this.visible){this.destroy();return}this.overlay.style.opacity="0",this.overlay.addEventListener("transitionend",()=>{this.destroy()},{once:!0}),setTimeout(()=>{this.destroy()},500)}}destroy(){this.cancelShowTimer(),this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null),this.overlay.remove()}reveal(){this.hidden||this.visible||(this.visible=!0,this.overlay.style.opacity="1")}cancelShowTimer(){this.showTimerId!==null&&(clearTimeout(this.showTimerId),this.showTimerId=null)}sizeCanvas(){if(this.ctx===null)return;const t=Math.min(devicePixelRatio,2),e=this.overlay.clientWidth||440,i=this.overlay.clientHeight||360;this.canvas.width=e*t,this.canvas.height=i*t,this.ctx.scale(t,t),this.ctx.lineCap="round",this.ctx.lineJoin="round"}tick=()=>{this.hidden||(this.drawFrame(),this.animationId=requestAnimationFrame(this.tick))};drawFrame(){if(this.ctx===null)return;const t=this.canvas.width/Math.min(devicePixelRatio,2),e=this.canvas.height/Math.min(devicePixelRatio,2),i=(performance.now()-this.startTime)/1e3;this.ctx.fillStyle="#fff",this.ctx.fillRect(0,0,t,e);const o=t/2,r=e*.44,s=Math.min(t,e)*.08,a=.785,l=.615,c=p=>tr(p,a,l,o,r,s),u=6,h=i%u/u,f=Ne.length;let d;h<.35?d=Re(h/.35)*f:h<.55?d=f:h<.9?d=(1-Re((h-.55)/.35))*f:d=0,this.ctx.shadowBlur=5,this.ctx.shadowColor="rgba(30,30,30,0.08)";for(let p=0;p<f&&!(p>=d);p++){const k=Ne[p];if(k===void 0)continue;const B=Math.min(1,d-p);nr(this.ctx,c,k[0],k[1],B)}this.ctx.shadowBlur=0}}class sr{constructor(t){this.options=t,this.element=document.createElement("div"),Object.assign(this.element.style,{display:"flex",gap:"0.375rem"}),this.onFullscreenChange=()=>{this.setFullscreenIcon(document.fullscreenElement!==null)},document.addEventListener("fullscreenchange",this.onFullscreenChange)}options;element;arBtn=null;fullscreenBtn=null;onFullscreenChange;setFullscreenIcon(t){this.fullscreenBtn!==null&&this.fullscreenBtn.setIcon(t?D.exitFullscreen():D.fullscreen())}syncButton(t,e,i){if(e&&t===null){const o=i();return this.element.appendChild(o.element),o}return!e&&t!==null?(t.element.remove(),null):t}applySettings(t){this.arBtn=this.syncButton(this.arBtn,t.ar!==!1&&this.options.onAr!==void 0,()=>new z({variant:"outline",size:"icon",label:si(),icon:D.ar(),onClick:()=>{this.options.onAr?.()}})),this.fullscreenBtn=this.syncButton(this.fullscreenBtn,t.fullscreen!==!1&&this.options.onFullscreen!==void 0,()=>new z({variant:"outline",size:"icon",label:ki(),icon:D.fullscreen(),onClick:()=>{this.options.onFullscreen?.()}}))}destroy(){document.removeEventListener("fullscreenchange",this.onFullscreenChange)}}const Q=.5;class st{element;constructor(t,e){this.element=Object.assign(document.createElement("div"),{className:"vd-camera-controls"});const i={targetRotation:e.rotation,targetTilt:e.tilt,targetZoom:e.zoom,thetaOffset:0},o=ar(t,e,i);e.onChange(r=>{i.targetRotation=r.rotation-i.thetaOffset,i.targetTilt=r.tilt,i.targetZoom=r.zoom,lr(o,e,r)}),this.element.appendChild(st.buildZoom(o.zoomOut,o.zoomIn)),this.element.appendChild(st.buildDpad(o.tiltUp,o.rotateLeft,o.reset,o.rotateRight,o.tiltDown))}static buildZoom(t,e){const i=document.createElement("div");return i.className="vd-zoom",i.appendChild(t.element),i.appendChild(e.element),i}static buildDpad(t,e,i,o,r){const s=document.createElement("div");s.className="vd-dpad";for(const[a,l]of[[t,"up"],[e,"left"],[i,"center"],[o,"right"],[r,"down"]])a.element.classList.add(`vd-dpad-${l}`),s.appendChild(a.element);return s}}function ar(n,t,e){const i=s=>Math.max(t.limits?.minZoom??1,Math.min(t.limits?.maxZoom??1/0,s)),o=s=>{const a=t.limits?.minRotate,l=t.limits?.maxRotate;return a!==void 0||l!==void 0?Math.max(a??-1/0,Math.min(l??1/0,s)):s},r=s=>{const a=t.limits?.minTilt,l=t.limits?.maxTilt;if(a!==void 0||l!==void 0){e.targetTilt=Math.max(a??0,Math.min(l??180,e.targetTilt+s)),n.tilt(e.targetTilt).set();return}const c=e.targetTilt+s;c>180||c<0?(e.targetTilt=c>180?360-c:-c,e.thetaOffset=(e.thetaOffset+180)%360,n.tilt(e.targetTilt).rotate(e.targetRotation+e.thetaOffset).set()):(e.targetTilt=c,n.tilt(e.targetTilt).set())};return{zoomOut:new z({variant:"outline",size:"icon",label:io(),icon:D.zoomOut(),onClick:()=>{e.targetZoom=i(e.targetZoom-10),n.zoom(e.targetZoom).set()}}),zoomIn:new z({variant:"outline",size:"icon",label:Xi(),icon:D.zoomIn(),onClick:()=>{e.targetZoom=i(e.targetZoom+10),n.zoom(e.targetZoom).set()}}),tiltUp:new z({variant:"outline",size:"icon",label:po(),icon:D.tiltUp(),onClick:()=>{r(-15)}}),rotateLeft:new z({variant:"outline",size:"icon",label:ao(),icon:D.rotateLeft(),onClick:()=>{e.targetRotation=o(e.targetRotation-15),n.rotate(e.targetRotation+e.thetaOffset).set()}}),reset:new z({variant:"outline",size:"icon",label:Ji(),icon:D.reset(),onClick:()=>{e.thetaOffset=0,n.reset()}}),rotateRight:new z({variant:"outline",size:"icon",label:ho(),icon:D.rotateRight(),onClick:()=>{e.targetRotation=o(e.targetRotation+15),n.rotate(e.targetRotation+e.thetaOffset).set()}}),tiltDown:new z({variant:"outline",size:"icon",label:wo(),icon:D.tiltDown(),onClick:()=>{r(15)}})}}function lr(n,t,e){const i=t.limits;i!==void 0&&(n.zoomOut.element.disabled=i.minZoom!==void 0&&e.zoom<=i.minZoom+Q,n.zoomIn.element.disabled=i.maxZoom!==void 0&&e.zoom>=i.maxZoom-Q,n.tiltUp.element.disabled=i.minTilt!==void 0&&e.tilt<=i.minTilt+Q,n.tiltDown.element.disabled=i.maxTilt!==void 0&&e.tilt>=i.maxTilt-Q,n.rotateLeft.element.disabled=i.minRotate!==void 0&&e.rotation<=i.minRotate+Q,n.rotateRight.element.disabled=i.maxRotate!==void 0&&e.rotation>=i.maxRotate-Q)}const cr=5;let ur=0;function wt(n){const t=n.replace(/([A-Z])/g," $1").trim();return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function dr(n,t,e,i,o){const r=document.createElement("div");r.className="vd-attribute",r.dataset.name=n.name;const s=document.createElement("span");s.className="vd-attribute-label",s.textContent=wt(n.name),s.id=`vd-attribute-label-${ur++}`,r.appendChild(s),r.setAttribute("role","group"),r.setAttribute("aria-labelledby",s.id);const a=n.values.find(u=>t.getValue(n.name,u)?.isSelected===!0),l=n.values.map(wt),c=n.values.length<=cr?new Yo(n.values,a,l):new Jo(n.name,n.values,wt(n.name),a,l);return c.onSelect(u=>{e.dispatch(Z.SELECT,{attribute:n.name,value:u},!0).defaultPrevented||i(n.name,u)}),o(n.name,u=>{c.setSelected(u.value),e.dispatch(Z.SELECTED,{attribute:n.name,value:u.value})}),r.appendChild(c.element),r}const hr=80,fr=2500;class gr{constructor(t,e=fr){this.configuration=t,this.resetMs=e,this.element=document.createElement("div"),this.element.className="vd-commerce vd-hidden";const i=document.createElement("div");i.className="vd-commerce-price",this.priceEl=document.createElement("span"),this.priceEl.className="vd-price",this.vatEl=document.createElement("span"),this.vatEl.className="vd-vat",i.append(this.priceEl,this.vatEl),this.button=new z({variant:"default",onClick:()=>{this.handleSubmit()}}),this.button.element.classList.add("vd-cta","vd-hidden"),this.element.append(i,this.button.element),this.unsubscribe=this.configuration.onRender(()=>{this.update()}),this.update()}configuration;resetMs;element;priceEl;vatEl;button;unsubscribe;state="idle";resetTimer;update(){this.renderPrice(this.configuration.current),this.renderButton();const t=this.configuration.current!==void 0||this.configuration.submitEnabled;this.element.classList.toggle("vd-hidden",!t)}destroy(){this.unsubscribe(),this.resetTimer!==void 0&&clearTimeout(this.resetTimer),this.element.remove()}renderPrice(t){if(t===void 0){this.priceEl.textContent="",this.vatEl.textContent="";return}this.priceEl.textContent=mr(t.price,t.currency),this.vatEl.textContent=Me(this.configuration.vatDisplay)}renderButton(){const t=this.configuration.submitEnabled;this.button.element.classList.toggle("vd-hidden",!t),t&&this.state==="idle"&&this.setButtonText(Me(this.configuration.buttonLabel))}async handleSubmit(){if(this.state!=="busy"){this.setState("busy",Ao());try{await this.configuration.submit(),this.setState("success",Ro())}catch{this.setState("failed",Po())}this.scheduleReset()}}scheduleReset(){this.resetTimer!==void 0&&clearTimeout(this.resetTimer),this.resetTimer=setTimeout(()=>{this.state="idle",this.update()},this.resetMs)}setState(t,e){this.state=t,this.element.dataset.submit=t,this.button.element.disabled=t==="busy",this.setButtonText(e)}setButtonText(t){this.button.element.textContent=t,this.button.element.setAttribute("aria-label",t)}}function Me(n){return(n??"").slice(0,hr)}function mr(n,t){try{const e=new Intl.NumberFormat(P(),{style:"currency",currency:t}),i=e.resolvedOptions().maximumFractionDigits??2;return e.format(n/10**i)}catch{return`${t} ${(n/100).toFixed(2)}`}}class Pe{slot=null;panel=null;attach(t,e){this.panel=e,e.style.display="none",this.slot=document.createElement("div"),this.slot.className="vd-slot-bottom-left",this.slot.appendChild(e),t.appendChild(this.slot)}setVisible(t){this.panel!==null&&(this.panel.style.display=t?"flex":"none")}destroy(){this.slot?.remove(),this.slot=null,this.panel=null}}const pr=572;class br{element=null;body=null;openButton=null;closeButton=null;container=null;observer=null;collapsible=!1;expanded=!0;visible=!1;attach(t,e){this.container=t,e.classList.add("vd-attributes-sidebar"),this.closeButton=new z({variant:"ghost",size:"icon-sm",label:Hi(),icon:D.close({size:18}),onClick:()=>{this.expanded=!1,this.render()}});const i=document.createElement("div");i.className="vd-sidebar-header",i.appendChild(this.closeButton.element),this.body=document.createElement("div"),this.body.className="vd-sidebar-body",this.body.appendChild(e),this.element=document.createElement("div"),this.element.className="vd-sidebar vd-hidden",this.element.append(i,this.body),t.appendChild(this.element),this.openButton=new z({variant:"outline",size:"default",label:$i(),icon:D.configurator({size:18}),onClick:()=>{this.expanded=!0,this.render()}}),this.openButton.element.classList.add("vd-configurator-toggle","vd-hidden"),t.appendChild(this.openButton.element),this.observe()}setVisible(t){this.visible=t,this.render()}destroy(){this.observer?.disconnect(),this.observer=null,this.openButton?.element.remove(),this.element?.remove(),this.container?.classList.remove("vd-layout-sidebar-right"),this.container=null}observe(){typeof ResizeObserver>"u"||this.container===null||(this.observer=new ResizeObserver(t=>{const e=t[0]?.contentRect.width??0;this.setCollapsible(e>0&&e<pr)}),this.observer.observe(this.container))}setCollapsible(t){t!==this.collapsible&&(this.collapsible=t,this.expanded=!t,this.render())}render(){if(this.element===null||this.openButton===null||this.closeButton===null||this.container===null)return;const t=this.visible&&this.expanded;this.element.classList.toggle("vd-hidden",!this.visible),this.element.classList.toggle("vd-sidebar-collapsed",this.visible&&!this.expanded),this.openButton.element.classList.toggle("vd-hidden",!(this.visible&&!this.expanded)),this.closeButton.element.style.display=this.collapsible?"":"none",this.container.classList.toggle("vd-layout-sidebar-right",t)}}class vr{attach(t,e){}setVisible(t){}destroy(){}}const yr={"inframe-bottom-left":()=>new Pe,"sidebar-right":()=>new br,hidden:()=>new vr};function wr(n){return(yr[n??""]??(()=>new Pe))()}const Ct=$.fontFamily.sans.join(", "),Et=`
221
260
  position: absolute;
222
261
  display: flex;
223
262
  z-index: 10;
224
- `,dr=`
263
+ transition: inset-inline-end 0.18s ease;
264
+ `,Cr=`
225
265
  /* Override browser's default black fullscreen backdrop */
226
266
  .vd-container:fullscreen {
227
267
  background: oklch(100% 0 0);
228
268
  }
229
269
 
230
- /* Pseudo-fullscreen fallback for iPhone Safari, which lacks the Fullscreen API on non-video elements */
231
- .vd-container.vd-pseudo-fullscreen {
232
- position: fixed;
233
- inset: 0;
234
- z-index: 2147483647;
235
- background: oklch(100% 0 0);
236
- }
237
-
238
270
  /* Layout slots — four corners */
239
271
  .vd-slot-top-right {
240
- ${$}
241
- inset-block-start: ${I[3]};
242
- inset-inline-end: ${I[3]};
272
+ ${Et}
273
+ inset-block-start: ${_[3]};
274
+ inset-inline-end: ${_[3]};
243
275
  flex-direction: column;
244
276
  align-items: flex-end;
245
- gap: ${I[1.5]};
277
+ gap: ${_[1.5]};
246
278
  }
247
279
 
248
280
  .vd-slot-bottom-left {
249
- ${$}
250
- inset-block-end: ${I[3]};
251
- inset-inline-start: ${I[3]};
281
+ ${Et}
282
+ inset-block-end: ${_[3]};
283
+ inset-inline-start: ${_[3]};
252
284
  flex-direction: column;
253
285
  align-items: flex-start;
254
- gap: ${I[1.5]};
286
+ gap: ${_[1.5]};
255
287
  }
256
288
 
257
289
  .vd-slot-bottom-right {
258
- ${$}
259
- inset-block-end: ${I[3]};
260
- inset-inline-end: ${I[3]};
290
+ ${Et}
291
+ inset-block-end: ${_[3]};
292
+ inset-inline-end: ${_[3]};
261
293
  flex-direction: row;
262
- gap: ${I[1.5]};
294
+ gap: ${_[1.5]};
263
295
  }
264
296
 
265
297
  /* Component styles — no positioning */
266
298
  .vd-camera-controls {
267
299
  display: flex;
268
300
  flex-direction: column;
269
- gap: ${I[1]};
270
- background: color-mix(in oklch, ${F.white} 85%, transparent);
301
+ gap: ${_[1]};
302
+ background: color-mix(in oklch, ${L.white} 85%, transparent);
271
303
  backdrop-filter: blur(8px);
272
- border-radius: ${I[2]};
273
- padding: ${I[2]};
304
+ border-radius: ${_[2]};
305
+ padding: ${_[2]};
274
306
  }
275
307
 
276
308
  .vd-zoom {
277
309
  display: flex;
278
- gap: ${I[.5]};
310
+ gap: ${_[.5]};
279
311
  }
280
312
 
281
313
  .vd-dpad {
282
314
  display: grid;
283
- grid-template-columns: repeat(3, ${I[9]});
284
- grid-template-rows: repeat(3, ${I[9]});
285
- gap: ${I[.5]};
315
+ grid-template-columns: repeat(3, ${_[9]});
316
+ grid-template-rows: repeat(3, ${_[9]});
317
+ gap: ${_[.5]};
286
318
  }
287
319
 
288
320
  .vd-dpad-up { grid-column: 2; grid-row: 1; }
@@ -294,25 +326,136 @@ Minimum version required to store current data is: `+c+`.
294
326
  .vd-attributes {
295
327
  display: flex;
296
328
  flex-direction: column;
297
- gap: ${I[2]};
298
- background: color-mix(in oklch, ${F.white} 85%, transparent);
329
+ gap: ${_[3]};
330
+ background: color-mix(in oklch, ${L.white} 85%, transparent);
299
331
  backdrop-filter: blur(8px);
300
- border-radius: ${I[2]};
301
- padding: ${I[2]};
302
- font-family: ${ur};
332
+ border: 1px solid color-mix(in oklch, ${L.neutral[900]} 8%, transparent);
333
+ border-radius: ${_[3]};
334
+ padding: ${_[3]};
335
+ box-shadow: 0 ${_[1]} ${_[4]} color-mix(in oklch, ${L.neutral[900]} 6%, transparent);
336
+ font-family: ${Ct};
303
337
  }
304
338
 
305
339
  .vd-attribute {
306
340
  display: flex;
307
341
  flex-direction: column;
308
- gap: ${I[1]};
342
+ gap: ${_[1.5]};
309
343
  }
310
344
 
345
+ /* Micro-label: recedes so the controls lead. */
311
346
  .vd-attribute-label {
312
- font-size: ${L.fontSize.xs};
313
- font-weight: ${L.fontWeight.medium};
314
- color: ${F.neutral[900]};
315
- font-family: ${ur};
347
+ font-size: ${$.fontSize.xs};
348
+ font-weight: ${$.fontWeight.medium};
349
+ color: ${L.neutral[500]};
350
+ text-transform: uppercase;
351
+ letter-spacing: 0.05em;
352
+ font-family: ${Ct};
353
+ }
354
+
355
+ /* sidebar-right layout — a docked, full-height right panel */
356
+ .vd-container { --vd-sidebar-width: 300px; }
357
+
358
+ .vd-hidden { display: none !important; }
359
+
360
+ .vd-sidebar {
361
+ position: absolute;
362
+ inset-block: 0;
363
+ inset-inline-end: 0;
364
+ inline-size: var(--vd-sidebar-width);
365
+ z-index: 11;
366
+ display: flex;
367
+ flex-direction: column;
368
+ background: color-mix(in oklch, ${L.white} 90%, transparent);
369
+ backdrop-filter: blur(10px);
370
+ border-inline-start: 1px solid color-mix(in oklch, ${L.neutral[900]} 8%, transparent);
371
+ box-shadow: -${_[1]} 0 ${_[4]} color-mix(in oklch, ${L.neutral[900]} 5%, transparent);
316
372
  }
317
373
 
318
- `;function fr(){if(Yn(),document.getElementById(`vd-styles`)!==null)return;let e=document.createElement(`style`);e.id=`vd-styles`,e.textContent=dr,document.head.appendChild(e)}function pr(e,t){let n=document.createElement(`a`);n.href=`data:image/png;base64,${e}`,n.download=t,n.click()}var mr=class{options;settings={};container=null;loading=null;slots={topRight:null,bottomLeft:null,bottomRight:null};screenshotBtn=null;actionBar=null;cameraControls=null;attributes=null;constructor(e){this.options=e}attach(e){fr(),this.container=e,this.loading=new rr(e),this.slots.topRight=this.createSlot(e,`vd-slot-top-right`),this.slots.bottomLeft=this.createSlot(e,`vd-slot-bottom-left`),this.slots.bottomRight=this.createSlot(e,`vd-slot-bottom-right`)}onReady(){this.loading?.hide(),this.loading=null,this.mountToolbar(),this.cameraControls!==null&&(this.cameraControls.element.style.display=`flex`),this.attributes!==null&&(this.attributes.style.display=`flex`)}pseudoFullscreen=!1;mountToolbar(){this.actionBar!==null||this.slots.bottomRight===null||(this.actionBar=new ir({onAr:this.options.onAr,onFullscreen:()=>{this.toggleFullscreen()}}),this.actionBar.applySettings(this.settings),this.slots.bottomRight.appendChild(this.actionBar.element),this.syncScreenshotButton(),this.placeScreenshotButton())}toggleFullscreen(){if(this.container!==null){if(typeof this.container.requestFullscreen==`function`){document.fullscreenElement===null?this.container.requestFullscreen():document.exitFullscreen();return}this.pseudoFullscreen=!this.pseudoFullscreen,this.container.classList.toggle(`vd-pseudo-fullscreen`,this.pseudoFullscreen),this.actionBar?.setFullscreenIcon(this.pseudoFullscreen)}}updateProgress(e,t){this.loading?.updateProgress(e,t)}showError(e){this.loading?.showError(e)}applyViewerSettings(e){this.settings=e,e.language!==void 0&&Ve(e.language,{reload:!1}),this.syncScreenshotButton(),this.actionBar?.applySettings(e),this.cameraControls!==null&&(this.cameraControls.element.style.display=e.cameraControls===!0?`flex`:`none`),this.placeScreenshotButton()}renderAttributeControls(e,t){if(!(this.container===null||this.slots.topRight===null)&&(this.cameraControls?.element.remove(),this.cameraControls=null,this.attributes?.remove(),this.attributes=null,this.settings.cameraControls===!0&&(this.cameraControls=new ar(this.options.cameraApi,this.options.cameraPositionApi),this.cameraControls.element.style.display=`none`,this.slots.topRight.appendChild(this.cameraControls.element)),this.placeScreenshotButton(),!(t.length===0||this.settings.attributeControls===!1))){this.attributes=document.createElement(`div`),this.attributes.className=`vd-attributes`,this.attributes.style.display=`none`;for(let n of t)this.attributes.appendChild(lr(n,e,this.options.eventBus,this.options.onSelect,this.options.onSubscribe));this.slots.bottomLeft.appendChild(this.attributes)}}get viewerSettings(){return this.settings}destroy(){this.loading?.destroy(),this.screenshotBtn?.element.remove(),this.actionBar?.destroy(),this.actionBar?.element.remove(),this.cameraControls?.element.remove(),this.attributes?.remove();for(let e of Object.values(this.slots))e?.remove();this.container=null}createSlot(e,t){let n=document.createElement(`div`);return n.className=t,e.appendChild(n),n}syncScreenshotButton(){let e=this.settings.screenshot===!0;e&&this.screenshotBtn===null&&(this.screenshotBtn=new P({variant:`outline`,size:`icon`,label:Et(),icon:N.screenshot(),onClick:()=>{this.options.snapshotApi.take(`snapshot.png`).onDeveloped(({data:e,filename:t})=>{pr(e,t)})}})),!e&&this.screenshotBtn!==null&&(this.screenshotBtn.element.remove(),this.screenshotBtn=null)}placeScreenshotButton(){this.screenshotBtn===null||this.slots.topRight===null||(this.cameraControls===null?this.slots.topRight.appendChild(this.screenshotBtn.element):this.cameraControls.element.appendChild(this.screenshotBtn.element))}},hr=class{attributes;readyStateTracker;messenger;cameraApi;cameraPositionApi;snapshotApi;annotationsApi;eventBus;ui;qrModal;options;iframe;container;readyCallbacks=[];mutationFailedCallbacks=[];constructor(e){this.options=e,this.initializeLogging(),this.messenger=new ye(()=>this.iframe?.contentWindow??null);let t=e=>{this.messenger.send(e)};this.attributes=new we(t,(e,t)=>{for(let n of this.mutationFailedCallbacks)n({attribute:e,value:t})}),this.snapshotApi=new Oe(t),this.annotationsApi=new be(t),this.cameraApi=new Te(t),this.cameraPositionApi=new Ee,this.eventBus=new ke,this.qrModal=new Kn,this.readyStateTracker=new se(()=>{let e=this.readyCallbacks;this.readyCallbacks=[];for(let t of e)t(this);this.ui.onReady()}),this.ui=new mr({snapshotApi:this.snapshotApi,cameraApi:this.cameraApi,cameraPositionApi:this.cameraPositionApi,eventBus:this.eventBus,onSelect:(e,t)=>this.attributes.select(e,t),onSubscribe:(e,t)=>this.attributes.onChange(e,t),onAr:()=>{this.activateAr()}}),this.registerHandlers(),this.messenger.start(),this.createAndConnectIframe()}registerHandlers(){this.messenger.on(E.HANDSHAKE,e=>{ue(e)&&(T.info(`Server handshake received, flushing publisher queue`),this.messenger.markReady())}),this.messenger.on(E.MUTATION,e=>{de(e)&&this.attributes.handleMutationResult(e)}),this.messenger.on(E.SNAPSHOT,e=>{fe(e)&&this.snapshotApi.handleSnapshotResult(e)}),this.messenger.on(E.CAMERA,e=>{pe(e)&&this.cameraPositionApi.handlePositionUpdate(e)}),this.messenger.on(E.LOADING_INDICATOR,e=>{he(e)&&(e.error===void 0?this.ui.updateProgress(e.progress,e.phase):this.ui.showError(e.error))}),this.messenger.on(E.CONFIG,e=>{ge(e)&&this.handleConfig(e)}),this.messenger.on(E.ANNOTATION_PLACED,e=>{_e(e)&&this.annotationsApi.handlePlaced(e.position)}),this.messenger.on(E.MAPPING,e=>{me(e)&&(this.attributes.handleMappingReceived(e),this.ui.renderAttributeControls(this.attributes,e.attributes),this.readyStateTracker.handleMappingReceived())})}handleConfig(e){let t=e.viewerSettings,n=this.options.viewerSettings;if(t!==void 0||n!==void 0){let e=n===void 0?t:{...t??{},...n};if(n!==void 0&&t!==void 0){let e=Object.entries(n).filter(([e,n])=>t[e]!==n).map(([e,n])=>`${e} (metadata: ${t[e]??`undefined`}, override: ${n})`);e.length>0&&T.warn(`Viewer settings override active: ${e.join(`, `)}`)}this.ui.applyViewerSettings(e),this.annotationsApi.setEnabled(e.annotations!==!1)}this.cameraPositionApi.applyLimits(e.cameraLimits)}activateAr(){if(ee()){this.messenger.send({type:E.AR_ACTIVATE});return}this.qrModal.show(this.iframe?.src??``)}initializeLogging(){this.options.debug===!0&&ae(),T.info(`Initializing Virtualdisplay client`,{model:this.options.model})}createAndConnectIframe(){let e=new f(this.options).create();this.container=e.container,this.iframe=e.iframe,this.eventBus.attach(this.container),this.ui.attach(this.container);try{let e=new URL(this.iframe.src).origin;this.messenger.setTargetOrigin(e)}catch{}}select(e,t){this.attributes.select(e,t)}getValues(e){return this.attributes.getValues(e)}getValue(e,t){return this.attributes.getValue(e,t)}onChange(e,t){this.attributes.onChange(e,t)}getAttribute(e){return this.attributes.getAttribute(e)}get isReady(){return this.readyStateTracker.isReady}onReady(e){if(this.readyStateTracker.isReady){e(this);return}this.readyCallbacks.push(e)}onMutationFailed(e){this.mutationFailedCallbacks.push(e)}on(e,t){this.eventBus.on(e,t)}get annotations(){return this.annotationsApi}get camera(){return this.cameraApi}get cameraPosition(){return this.cameraPositionApi}get snapshot(){return this.snapshotApi}get viewerSettings(){return this.ui.viewerSettings}destroy(){this.readyStateTracker.clear(),this.readyCallbacks=[],this.messenger.destroy(),this.qrModal.hide(),this.ui.destroy(),this.container?.parentElement!==null&&this.container?.parentElement!==void 0&&this.container.parentElement.removeChild(this.container),this.container=void 0,this.iframe=void 0}};e.Annotations=be,e.Attribute=Se,e.AttributeValue=xe,e.Camera=Te,e.ERROR_CODES=u,e.Photo=De,e.Snapshot=Oe,e.VirtualdisplayClient=hr,e.VirtualdisplayError=d,e.enableDebugMode=ae,e.isDebugMode=oe,Object.defineProperty(e,`logger`,{enumerable:!0,get:function(){return T}})});
374
+ @media (prefers-reduced-motion: no-preference) {
375
+ .vd-sidebar { transition: transform 0.18s ease; }
376
+ }
377
+
378
+ .vd-sidebar-collapsed { transform: translateX(100%); }
379
+
380
+ .vd-sidebar-header {
381
+ display: flex;
382
+ justify-content: flex-end;
383
+ padding: ${_[1.5]} ${_[1.5]} 0;
384
+ }
385
+
386
+ .vd-sidebar-body {
387
+ flex: 1;
388
+ overflow-y: auto;
389
+ padding: ${_[4]};
390
+ }
391
+
392
+ /* attributes inside the sidebar: flat and full-width — the panel provides the frosting */
393
+ .vd-attributes.vd-attributes-sidebar {
394
+ background: transparent;
395
+ backdrop-filter: none;
396
+ border: none;
397
+ border-radius: 0;
398
+ padding: 0;
399
+ box-shadow: none;
400
+ gap: ${_[5]};
401
+ }
402
+
403
+ /* floating toggle, shown when the sidebar is collapsed on narrow embeds */
404
+ .vd-configurator-toggle {
405
+ position: absolute;
406
+ inset-block-end: ${_[3]};
407
+ inset-inline-end: ${_[3]};
408
+ z-index: 12;
409
+ }
410
+
411
+ /* while the panel is open, keep the corner controls clear of it */
412
+ .vd-layout-sidebar-right .vd-slot-top-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${_[3]}); }
413
+ .vd-layout-sidebar-right .vd-slot-bottom-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${_[3]}); }
414
+
415
+ /* Price + CTA — sit under the attribute controls, separated by a hairline */
416
+ .vd-commerce {
417
+ display: flex;
418
+ flex-direction: column;
419
+ gap: ${_[2]};
420
+ padding-block-start: ${_[3]};
421
+ border-block-start: 1px solid color-mix(in oklch, ${L.neutral[900]} 8%, transparent);
422
+ font-family: ${Ct};
423
+ }
424
+
425
+ .vd-commerce-price {
426
+ display: flex;
427
+ align-items: baseline;
428
+ gap: ${_[1.5]};
429
+ }
430
+
431
+ .vd-price {
432
+ font-size: ${$.fontSize.lg};
433
+ font-weight: ${$.fontWeight.semibold};
434
+ color: ${L.neutral[900]};
435
+ }
436
+
437
+ .vd-vat {
438
+ font-size: ${$.fontSize.xs};
439
+ color: ${L.neutral[500]};
440
+ }
441
+
442
+ .vd-cta {
443
+ inline-size: 100%;
444
+ justify-content: center;
445
+ }
446
+
447
+ /* Failed submit is the one place red belongs: a clear, recoverable error state. */
448
+ .vd-commerce[data-submit="failed"] .vd-cta {
449
+ background: ${L.semantic.error};
450
+ border-color: ${L.semantic.error};
451
+ color: ${L.white};
452
+ }
453
+
454
+ `;function Er(){if(Xo(),document.getElementById("vd-styles")!==null)return;const n=document.createElement("style");n.id="vd-styles",n.textContent=Cr,document.head.appendChild(n)}function _r(n,t){const e=document.createElement("a");e.href=`data:image/png;base64,${n}`,e.download=t,e.click()}class Ar{options;settings={};container=null;loading=null;slots={topRight:null,bottomRight:null};screenshotBtn=null;actionBar=null;cameraControls=null;attributes=null;layout=null;commerce=null;constructor(t){this.options=t}attach(t){Er(),this.container=t,this.loading=new rr(t),this.slots.topRight=this.createSlot(t,"vd-slot-top-right"),this.slots.bottomRight=this.createSlot(t,"vd-slot-bottom-right")}onReady(){this.loading?.hide(),this.loading=null,this.mountToolbar(),this.cameraControls!==null&&(this.cameraControls.element.style.display="flex"),this.layout?.setVisible(!0)}mountToolbar(){if(this.actionBar!==null||this.slots.bottomRight===null||this.container===null)return;const t=typeof this.container.requestFullscreen=="function";this.actionBar=new sr({onAr:this.options.onAr,onFullscreen:t?()=>{this.toggleFullscreen()}:void 0}),this.actionBar.applySettings(this.settings),this.slots.bottomRight.appendChild(this.actionBar.element),this.syncScreenshotButton(),this.placeScreenshotButton()}toggleFullscreen(){this.container!==null&&(document.fullscreenElement!==null?document.exitFullscreen():this.container.requestFullscreen())}updateProgress(t,e){this.loading?.updateProgress(t,e)}showError(t){this.loading?.showError(t)}applyViewerSettings(t){this.settings=t,t.language!==void 0&&we(t.language,{reload:!1}),this.syncScreenshotButton(),this.actionBar?.applySettings(t),this.cameraControls!==null&&(this.cameraControls.element.style.display=t.cameraControls===!0?"flex":"none"),this.placeScreenshotButton()}renderAttributeControls(t,e){if(!(this.container===null||this.slots.topRight===null)&&(this.cameraControls?.element.remove(),this.cameraControls=null,this.teardownConfigurator(),this.settings.cameraControls===!0&&(this.cameraControls=new st(this.options.cameraApi,this.options.cameraPositionApi),this.cameraControls.element.style.display="none",this.slots.topRight.appendChild(this.cameraControls.element)),this.placeScreenshotButton(),e.length!==0)){this.attributes=document.createElement("div"),this.attributes.className="vd-attributes";for(const i of e)this.attributes.appendChild(dr(i,t,this.options.eventBus,this.options.onSelect,this.options.onSubscribe));this.commerce=new gr(this.options.configuration),this.attributes.appendChild(this.commerce.element),this.layout=wr(this.settings.configuratorLayout),this.layout.attach(this.container,this.attributes)}}get viewerSettings(){return this.settings}teardownConfigurator(){this.commerce?.destroy(),this.commerce=null,this.attributes?.remove(),this.attributes=null,this.layout?.destroy(),this.layout=null}destroy(){this.loading?.destroy(),this.screenshotBtn?.element.remove(),this.actionBar?.destroy(),this.actionBar?.element.remove(),this.cameraControls?.element.remove(),this.teardownConfigurator();for(const t of Object.values(this.slots))t?.remove();this.container=null}createSlot(t,e){const i=document.createElement("div");return i.className=e,t.appendChild(i),i}syncScreenshotButton(){const t=this.settings.screenshot===!0;t&&this.screenshotBtn===null&&(this.screenshotBtn=new z({variant:"outline",size:"icon",label:Di(),icon:D.screenshot(),onClick:()=>{this.options.snapshotApi.take("snapshot.png").onDeveloped(({data:e,filename:i})=>{_r(e,i)})}})),!t&&this.screenshotBtn!==null&&(this.screenshotBtn.element.remove(),this.screenshotBtn=null)}placeScreenshotButton(){this.screenshotBtn===null||this.slots.topRight===null||(this.cameraControls!==null?this.cameraControls.element.appendChild(this.screenshotBtn.element):this.slots.topRight.appendChild(this.screenshotBtn.element))}}class Sr{attributes;readyStateTracker;messenger;cameraApi;cameraPositionApi;focusApi;configurationApi;snapshotApi;annotationsApi;eventBus;ui;qrModal;options;iframe;container;readyCallbacks=[];mutationFailedCallbacks=[];constructor(t){this.options=t,this.initializeLogging(),this.messenger=new jn(()=>this.iframe?.contentWindow??null);const e=i=>{this.messenger.send(i)};this.attributes=new Gn(e,(i,o)=>{for(const r of this.mutationFailedCallbacks)r({attribute:i,value:o})}),this.snapshotApi=new fe(e),this.annotationsApi=new re(e),this.cameraApi=new le(e),this.cameraPositionApi=new Kn,this.focusApi=new ce(e,i=>{this.dispatchFocusChange(i)}),this.configurationApi=new de(i=>{this.dispatchConfigurationChange(i)},i=>{this.dispatchConfigurationSubmit(i)}),this.eventBus=new Zn,this.qrModal=new Wo,this.readyStateTracker=new Nn(()=>{const i=this.readyCallbacks;this.readyCallbacks=[];for(const o of i)o(this);this.ui.onReady()}),this.ui=new Ar({snapshotApi:this.snapshotApi,cameraApi:this.cameraApi,cameraPositionApi:this.cameraPositionApi,eventBus:this.eventBus,configuration:this.configurationApi,onSelect:(i,o)=>this.attributes.select(i,o),onSubscribe:(i,o)=>this.attributes.onChange(i,o),onAr:()=>{this.activateAr()}}),this.registerHandlers(),this.messenger.start(),this.createAndConnectIframe()}registerHandlers(){this.messenger.on(I.HANDSHAKE,t=>{Ln(t)&&(M.logger.info("Server handshake received, flushing publisher queue"),this.messenger.markReady())}),this.messenger.on(I.MUTATION,t=>{On(t)&&(this.attributes.handleMutationResult(t),this.configurationApi.handleSelectionChanged(this.attributes.getSelection()))}),this.messenger.on(I.SNAPSHOT,t=>{xn(t)&&this.snapshotApi.handleSnapshotResult(t)}),this.messenger.on(I.CAMERA,t=>{Dn(t)&&this.cameraPositionApi.handlePositionUpdate(t)}),this.messenger.on(I.LOADING_INDICATOR,t=>{Fn(t)&&(t.error!==void 0?this.ui.showError(t.error):this.ui.updateProgress(t.progress,t.phase))}),this.messenger.on(I.CONFIG,t=>{Un(t)&&this.handleConfig(t)}),this.messenger.on(I.ANNOTATION_PLACED,t=>{$n(t)&&this.annotationsApi.handlePlaced(t.position)}),this.messenger.on(I.MAPPING,t=>{zn(t)&&(this.attributes.handleMappingReceived(t),this.configurationApi.handleSelectionChanged(this.attributes.getSelection()),this.ui.renderAttributeControls(this.attributes,t.attributes),this.readyStateTracker.handleMappingReceived())}),this.registerFacadeStateHandlers()}registerFacadeStateHandlers(){this.messenger.on(I.FOCUS,t=>{Vn(t)&&this.focusApi.handleStateReceived(t)}),this.messenger.on(I.PRICING,t=>{qn(t)&&this.configurationApi.handlePricingReceived(t.pricing)})}dispatchFocusChange(t){this.container?.dispatchEvent(new CustomEvent(Z.FOCUS_CHANGE,{detail:t,bubbles:!0}))}dispatchConfigurationChange(t){this.container?.dispatchEvent(new CustomEvent(Z.CONFIGURATION_CHANGE,{detail:t??null,bubbles:!0}))}dispatchConfigurationSubmit(t){this.container?.dispatchEvent(new CustomEvent(Z.CONFIGURATION_SUBMIT,{detail:t,bubbles:!0}))}handleConfig(t){const e=t.viewerSettings,i=this.options.viewerSettings;if(e!==void 0||i!==void 0){const o=i!==void 0?{...e??{},...i}:e;if(i!==void 0&&e!==void 0){const r=Object.entries(i).filter(([s,a])=>e[s]!==a).map(([s,a])=>`${s} (metadata: ${e[s]??"undefined"}, override: ${a})`);r.length>0&&M.logger.warn(`Viewer settings override active: ${r.join(", ")}`)}this.ui.applyViewerSettings(o),this.annotationsApi.setEnabled(o.annotations!==!1)}this.cameraPositionApi.applyLimits(t.cameraLimits)}activateAr(){if(Tn()){this.messenger.send({type:I.AR_ACTIVATE});return}this.qrModal.show(this.iframe?.src??"")}initializeLogging(){this.options.debug===!0&&ne(),M.logger.info("Initializing Virtualdisplay client",{model:this.options.model})}createAndConnectIframe(){const e=new bn(this.options).create();this.container=e.container,this.iframe=e.iframe,this.eventBus.attach(this.container),this.ui.attach(this.container);try{const i=new URL(this.iframe.src).origin;this.messenger.setTargetOrigin(i)}catch{}}select(t,e){this.attributes.select(t,e)}getValues(t){return this.attributes.getValues(t)}getValue(t,e){return this.attributes.getValue(t,e)}onChange(t,e){this.attributes.onChange(t,e)}getAttribute(t){return this.attributes.getAttribute(t)}get isReady(){return this.readyStateTracker.isReady}onReady(t){if(this.readyStateTracker.isReady){t(this);return}this.readyCallbacks.push(t)}onMutationFailed(t){this.mutationFailedCallbacks.push(t)}on(t,e){this.eventBus.on(t,e)}get annotations(){return this.annotationsApi}get camera(){return this.cameraApi}get focus(){return this.focusApi}get configuration(){return this.configurationApi}get cameraPosition(){return this.cameraPositionApi}get snapshot(){return this.snapshotApi}get viewerSettings(){return this.ui.viewerSettings}destroy(){this.readyStateTracker.clear(),this.readyCallbacks=[],this.mutationFailedCallbacks.length=0,this.snapshotApi.clear(),this.messenger.destroy(),this.qrModal.hide(),this.ui.destroy(),this.container?.parentElement!==null&&this.container?.parentElement!==void 0&&this.container.parentElement.removeChild(this.container),this.container=void 0,this.iframe=void 0}}function kr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var X={},_t,Be;function Tr(){return Be||(Be=1,_t=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),_t}var At={},G={},Le;function Y(){if(Le)return G;Le=1;let n;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return G.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},G.getSymbolTotalCodewords=function(i){return t[i]},G.getBCHDigit=function(e){let i=0;for(;e!==0;)i++,e>>>=1;return i},G.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');n=i},G.isKanjiModeEnabled=function(){return typeof n<"u"},G.toSJIS=function(i){return n(i)},G}var St={},Oe;function kt(){return Oe||(Oe=1,(function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function t(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+e)}}n.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},n.from=function(i,o){if(n.isValid(i))return i;try{return t(i)}catch{return o}}})(St)),St}var Tt,xe;function Rr(){if(xe)return Tt;xe=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let i=0;i<e;i++)this.putBit((t>>>e-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},Tt=n,Tt}var Rt,De;function Nr(){if(De)return Rt;De=1;function n(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return n.prototype.set=function(t,e,i,o){const r=t*this.size+e;this.data[r]=i,o&&(this.reservedBit[r]=!0)},n.prototype.get=function(t,e){return this.data[t*this.size+e]},n.prototype.xor=function(t,e,i){this.data[t*this.size+e]^=i},n.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},Rt=n,Rt}var Nt={},ze;function Ir(){return ze||(ze=1,(function(n){const t=Y().getSymbolSize;n.getRowColCoords=function(i){if(i===1)return[];const o=Math.floor(i/7)+2,r=t(i),s=r===145?26:Math.ceil((r-13)/(2*o-2))*2,a=[r-7];for(let l=1;l<o-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},n.getPositions=function(i){const o=[],r=n.getRowColCoords(i),s=r.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||o.push([r[a],r[l]]);return o}})(Nt)),Nt}var It={},Fe;function Mr(){if(Fe)return It;Fe=1;const n=Y().getSymbolSize,t=7;return It.getPositions=function(i){const o=n(i);return[[0,0],[o-t,0],[0,o-t]]},It}var Mt={},Ue;function Pr(){return Ue||(Ue=1,(function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};n.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},n.from=function(o){return n.isValid(o)?parseInt(o,10):void 0},n.getPenaltyN1=function(o){const r=o.size;let s=0,a=0,l=0,c=null,u=null;for(let h=0;h<r;h++){a=l=0,c=u=null;for(let f=0;f<r;f++){let d=o.get(h,f);d===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=d,a=1),d=o.get(f,h),d===u?l++:(l>=5&&(s+=t.N1+(l-5)),u=d,l=1)}a>=5&&(s+=t.N1+(a-5)),l>=5&&(s+=t.N1+(l-5))}return s},n.getPenaltyN2=function(o){const r=o.size;let s=0;for(let a=0;a<r-1;a++)for(let l=0;l<r-1;l++){const c=o.get(a,l)+o.get(a,l+1)+o.get(a+1,l)+o.get(a+1,l+1);(c===4||c===0)&&s++}return s*t.N2},n.getPenaltyN3=function(o){const r=o.size;let s=0,a=0,l=0;for(let c=0;c<r;c++){a=l=0;for(let u=0;u<r;u++)a=a<<1&2047|o.get(c,u),u>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|o.get(u,c),u>=10&&(l===1488||l===93)&&s++}return s*t.N3},n.getPenaltyN4=function(o){let r=0;const s=o.data.length;for(let l=0;l<s;l++)r+=o.data[l];return Math.abs(Math.ceil(r*100/s/5)-10)*t.N4};function e(i,o,r){switch(i){case n.Patterns.PATTERN000:return(o+r)%2===0;case n.Patterns.PATTERN001:return o%2===0;case n.Patterns.PATTERN010:return r%3===0;case n.Patterns.PATTERN011:return(o+r)%3===0;case n.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(r/3))%2===0;case n.Patterns.PATTERN101:return o*r%2+o*r%3===0;case n.Patterns.PATTERN110:return(o*r%2+o*r%3)%2===0;case n.Patterns.PATTERN111:return(o*r%3+(o+r)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}n.applyMask=function(o,r){const s=r.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)r.isReserved(l,a)||r.xor(l,a,e(o,l,a))},n.getBestMask=function(o,r){const s=Object.keys(n.Patterns).length;let a=0,l=1/0;for(let c=0;c<s;c++){r(c),n.applyMask(c,o);const u=n.getPenaltyN1(o)+n.getPenaltyN2(o)+n.getPenaltyN3(o)+n.getPenaltyN4(o);n.applyMask(c,o),u<l&&(l=u,a=c)}return a}})(Mt)),Mt}var at={},$e;function Ve(){if($e)return at;$e=1;const n=kt(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],e=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return at.getBlocksCount=function(o,r){switch(r){case n.L:return t[(o-1)*4+0];case n.M:return t[(o-1)*4+1];case n.Q:return t[(o-1)*4+2];case n.H:return t[(o-1)*4+3];default:return}},at.getTotalCodewordsCount=function(o,r){switch(r){case n.L:return e[(o-1)*4+0];case n.M:return e[(o-1)*4+1];case n.Q:return e[(o-1)*4+2];case n.H:return e[(o-1)*4+3];default:return}},at}var Pt={},nt={},qe;function Br(){if(qe)return nt;qe=1;const n=new Uint8Array(512),t=new Uint8Array(256);return(function(){let i=1;for(let o=0;o<255;o++)n[o]=i,t[i]=o,i<<=1,i&256&&(i^=285);for(let o=255;o<512;o++)n[o]=n[o-255]})(),nt.log=function(i){if(i<1)throw new Error("log("+i+")");return t[i]},nt.exp=function(i){return n[i]},nt.mul=function(i,o){return i===0||o===0?0:n[t[i]+t[o]]},nt}var je;function Lr(){return je||(je=1,(function(n){const t=Br();n.mul=function(i,o){const r=new Uint8Array(i.length+o.length-1);for(let s=0;s<i.length;s++)for(let a=0;a<o.length;a++)r[s+a]^=t.mul(i[s],o[a]);return r},n.mod=function(i,o){let r=new Uint8Array(i);for(;r.length-o.length>=0;){const s=r[0];for(let l=0;l<o.length;l++)r[l]^=t.mul(o[l],s);let a=0;for(;a<r.length&&r[a]===0;)a++;r=r.slice(a)}return r},n.generateECPolynomial=function(i){let o=new Uint8Array([1]);for(let r=0;r<i;r++)o=n.mul(o,new Uint8Array([1,t.exp(r)]));return o}})(Pt)),Pt}var Bt,He;function Or(){if(He)return Bt;He=1;const n=Lr();function t(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(i){this.degree=i,this.genPoly=n.generateECPolynomial(this.degree)},t.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(i.length+this.degree);o.set(i);const r=n.mod(o,this.genPoly),s=this.degree-r.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(r,s),a}return r},Bt=t,Bt}var Lt={},Ot={},xt={},Ge;function Ke(){return Ge||(Ge=1,xt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),xt}var q={},Ye;function Je(){if(Ye)return q;Ye=1;const n="[0-9]+",t="[A-Z $%*+\\-./:]+";let e="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";e=e.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+e+`)(?:.|[\r
455
+ ]))+`;q.KANJI=new RegExp(e,"g"),q.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),q.BYTE=new RegExp(i,"g"),q.NUMERIC=new RegExp(n,"g"),q.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+e+"$"),r=new RegExp("^"+n+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return q.testKanji=function(l){return o.test(l)},q.testNumeric=function(l){return r.test(l)},q.testAlphanumeric=function(l){return s.test(l)},q}var Ze;function J(){return Ze||(Ze=1,(function(n){const t=Ke(),e=Je();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},n.getBestModeForData=function(r){return e.testNumeric(r)?n.NUMERIC:e.testAlphanumeric(r)?n.ALPHANUMERIC:e.testKanji(r)?n.KANJI:n.BYTE},n.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},n.isValid=function(r){return r&&r.bit&&r.ccBits};function i(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+o)}}n.from=function(r,s){if(n.isValid(r))return r;try{return i(r)}catch{return s}}})(Ot)),Ot}var We;function xr(){return We||(We=1,(function(n){const t=Y(),e=Ve(),i=kt(),o=J(),r=Ke(),s=7973,a=t.getBCHDigit(s);function l(f,d,p){for(let k=1;k<=40;k++)if(d<=n.getCapacity(k,p,f))return k}function c(f,d){return o.getCharCountIndicator(f,d)+4}function u(f,d){let p=0;return f.forEach(function(k){const B=c(k.mode,d);p+=B+k.getBitsLength()}),p}function h(f,d){for(let p=1;p<=40;p++)if(u(f,p)<=n.getCapacity(p,d,o.MIXED))return p}n.from=function(d,p){return r.isValid(d)?parseInt(d,10):p},n.getCapacity=function(d,p,k){if(!r.isValid(d))throw new Error("Invalid QR Code version");typeof k>"u"&&(k=o.BYTE);const B=t.getSymbolTotalCodewords(d),E=e.getTotalCodewordsCount(d,p),N=(B-E)*8;if(k===o.MIXED)return N;const T=N-c(k,d);switch(k){case o.NUMERIC:return Math.floor(T/10*3);case o.ALPHANUMERIC:return Math.floor(T/11*2);case o.KANJI:return Math.floor(T/13);case o.BYTE:default:return Math.floor(T/8)}},n.getBestVersionForData=function(d,p){let k;const B=i.from(p,i.M);if(Array.isArray(d)){if(d.length>1)return h(d,B);if(d.length===0)return 1;k=d[0]}else k=d;return l(k.mode,k.getLength(),B)},n.getEncodedBits=function(d){if(!r.isValid(d)||d<7)throw new Error("Invalid QR Code version");let p=d<<12;for(;t.getBCHDigit(p)-a>=0;)p^=s<<t.getBCHDigit(p)-a;return d<<12|p}})(Lt)),Lt}var Dt={},Qe;function Dr(){if(Qe)return Dt;Qe=1;const n=Y(),t=1335,e=21522,i=n.getBCHDigit(t);return Dt.getEncodedBits=function(r,s){const a=r.bit<<3|s;let l=a<<10;for(;n.getBCHDigit(l)-i>=0;)l^=t<<n.getBCHDigit(l)-i;return(a<<10|l)^e},Dt}var zt={},Ft,Xe;function zr(){if(Xe)return Ft;Xe=1;const n=J();function t(e){this.mode=n.NUMERIC,this.data=e.toString()}return t.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){let o,r,s;for(o=0;o+3<=this.data.length;o+=3)r=this.data.substr(o,3),s=parseInt(r,10),i.put(s,10);const a=this.data.length-o;a>0&&(r=this.data.substr(o),s=parseInt(r,10),i.put(s,a*3+1))},Ft=t,Ft}var Ut,tn;function Fr(){if(tn)return Ut;tn=1;const n=J(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function e(i){this.mode=n.ALPHANUMERIC,this.data=i}return e.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(o){let r;for(r=0;r+2<=this.data.length;r+=2){let s=t.indexOf(this.data[r])*45;s+=t.indexOf(this.data[r+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[r]),6)},Ut=e,Ut}var $t,en;function Ur(){if(en)return $t;en=1;const n=J();function t(e){this.mode=n.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}return t.getBitsLength=function(i){return i*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(e){for(let i=0,o=this.data.length;i<o;i++)e.put(this.data[i],8)},$t=t,$t}var Vt,nn;function $r(){if(nn)return Vt;nn=1;const n=J(),t=Y();function e(i){this.mode=n.KANJI,this.data=i}return e.getBitsLength=function(o){return o*13},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){let o;for(o=0;o<this.data.length;o++){let r=t.toSJIS(this.data[o]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
456
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),i.put(r,13)}},Vt=e,Vt}var qt={exports:{}},on;function Vr(){return on||(on=1,(function(n){var t={single_source_shortest_paths:function(e,i,o){var r={},s={};s[i]=0;var a=t.PriorityQueue.make();a.push(i,0);for(var l,c,u,h,f,d,p,k,B;!a.empty();){l=a.pop(),c=l.value,h=l.cost,f=e[c]||{};for(u in f)f.hasOwnProperty(u)&&(d=f[u],p=h+d,k=s[u],B=typeof s[u]>"u",(B||k>p)&&(s[u]=p,a.push(u,p),r[u]=c))}if(typeof o<"u"&&typeof s[o]>"u"){var E=["Could not find a path from ",i," to ",o,"."].join("");throw new Error(E)}return r},extract_shortest_path_from_predecessor_list:function(e,i){for(var o=[],r=i;r;)o.push(r),e[r],r=e[r];return o.reverse(),o},find_path:function(e,i,o){var r=t.single_source_shortest_paths(e,i,o);return t.extract_shortest_path_from_predecessor_list(r,o)},PriorityQueue:{make:function(e){var i=t.PriorityQueue,o={},r;e=e||{};for(r in i)i.hasOwnProperty(r)&&(o[r]=i[r]);return o.queue=[],o.sorter=e.sorter||i.default_sorter,o},default_sorter:function(e,i){return e.cost-i.cost},push:function(e,i){var o={value:e,cost:i};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=t})(qt)),qt.exports}var rn;function qr(){return rn||(rn=1,(function(n){const t=J(),e=zr(),i=Fr(),o=Ur(),r=$r(),s=Je(),a=Y(),l=Vr();function c(E){return unescape(encodeURIComponent(E)).length}function u(E,N,T){const A=[];let x;for(;(x=E.exec(T))!==null;)A.push({data:x[0],index:x.index,mode:N,length:x[0].length});return A}function h(E){const N=u(s.NUMERIC,t.NUMERIC,E),T=u(s.ALPHANUMERIC,t.ALPHANUMERIC,E);let A,x;return a.isKanjiModeEnabled()?(A=u(s.BYTE,t.BYTE,E),x=u(s.KANJI,t.KANJI,E)):(A=u(s.BYTE_KANJI,t.BYTE,E),x=[]),N.concat(T,A,x).sort(function(w,y){return w.index-y.index}).map(function(w){return{data:w.data,mode:w.mode,length:w.length}})}function f(E,N){switch(N){case t.NUMERIC:return e.getBitsLength(E);case t.ALPHANUMERIC:return i.getBitsLength(E);case t.KANJI:return r.getBitsLength(E);case t.BYTE:return o.getBitsLength(E)}}function d(E){return E.reduce(function(N,T){const A=N.length-1>=0?N[N.length-1]:null;return A&&A.mode===T.mode?(N[N.length-1].data+=T.data,N):(N.push(T),N)},[])}function p(E){const N=[];for(let T=0;T<E.length;T++){const A=E[T];switch(A.mode){case t.NUMERIC:N.push([A,{data:A.data,mode:t.ALPHANUMERIC,length:A.length},{data:A.data,mode:t.BYTE,length:A.length}]);break;case t.ALPHANUMERIC:N.push([A,{data:A.data,mode:t.BYTE,length:A.length}]);break;case t.KANJI:N.push([A,{data:A.data,mode:t.BYTE,length:c(A.data)}]);break;case t.BYTE:N.push([{data:A.data,mode:t.BYTE,length:c(A.data)}])}}return N}function k(E,N){const T={},A={start:{}};let x=["start"];for(let m=0;m<E.length;m++){const w=E[m],y=[];for(let g=0;g<w.length;g++){const S=w[g],b=""+m+g;y.push(b),T[b]={node:S,lastCount:0},A[b]={};for(let C=0;C<x.length;C++){const v=x[C];T[v]&&T[v].node.mode===S.mode?(A[v][b]=f(T[v].lastCount+S.length,S.mode)-f(T[v].lastCount,S.mode),T[v].lastCount+=S.length):(T[v]&&(T[v].lastCount=S.length),A[v][b]=f(S.length,S.mode)+4+t.getCharCountIndicator(S.mode,N))}}x=y}for(let m=0;m<x.length;m++)A[x[m]].end=0;return{map:A,table:T}}function B(E,N){let T;const A=t.getBestModeForData(E);if(T=t.from(N,A),T!==t.BYTE&&T.bit<A.bit)throw new Error('"'+E+'" cannot be encoded with mode '+t.toString(T)+`.
457
+ Suggested mode is: `+t.toString(A));switch(T===t.KANJI&&!a.isKanjiModeEnabled()&&(T=t.BYTE),T){case t.NUMERIC:return new e(E);case t.ALPHANUMERIC:return new i(E);case t.KANJI:return new r(E);case t.BYTE:return new o(E)}}n.fromArray=function(N){return N.reduce(function(T,A){return typeof A=="string"?T.push(B(A,null)):A.data&&T.push(B(A.data,A.mode)),T},[])},n.fromString=function(N,T){const A=h(N,a.isKanjiModeEnabled()),x=p(A),m=k(x,T),w=l.find_path(m.map,"start","end"),y=[];for(let g=1;g<w.length-1;g++)y.push(m.table[w[g]].node);return n.fromArray(d(y))},n.rawSplit=function(N){return n.fromArray(h(N,a.isKanjiModeEnabled()))}})(zt)),zt}var sn;function jr(){if(sn)return At;sn=1;const n=Y(),t=kt(),e=Rr(),i=Nr(),o=Ir(),r=Mr(),s=Pr(),a=Ve(),l=Or(),c=xr(),u=Dr(),h=J(),f=qr();function d(m,w){const y=m.size,g=r.getPositions(w);for(let S=0;S<g.length;S++){const b=g[S][0],C=g[S][1];for(let v=-1;v<=7;v++)if(!(b+v<=-1||y<=b+v))for(let R=-1;R<=7;R++)C+R<=-1||y<=C+R||(v>=0&&v<=6&&(R===0||R===6)||R>=0&&R<=6&&(v===0||v===6)||v>=2&&v<=4&&R>=2&&R<=4?m.set(b+v,C+R,!0,!0):m.set(b+v,C+R,!1,!0))}}function p(m){const w=m.size;for(let y=8;y<w-8;y++){const g=y%2===0;m.set(y,6,g,!0),m.set(6,y,g,!0)}}function k(m,w){const y=o.getPositions(w);for(let g=0;g<y.length;g++){const S=y[g][0],b=y[g][1];for(let C=-2;C<=2;C++)for(let v=-2;v<=2;v++)C===-2||C===2||v===-2||v===2||C===0&&v===0?m.set(S+C,b+v,!0,!0):m.set(S+C,b+v,!1,!0)}}function B(m,w){const y=m.size,g=c.getEncodedBits(w);let S,b,C;for(let v=0;v<18;v++)S=Math.floor(v/3),b=v%3+y-8-3,C=(g>>v&1)===1,m.set(S,b,C,!0),m.set(b,S,C,!0)}function E(m,w,y){const g=m.size,S=u.getEncodedBits(w,y);let b,C;for(b=0;b<15;b++)C=(S>>b&1)===1,b<6?m.set(b,8,C,!0):b<8?m.set(b+1,8,C,!0):m.set(g-15+b,8,C,!0),b<8?m.set(8,g-b-1,C,!0):b<9?m.set(8,15-b-1+1,C,!0):m.set(8,15-b-1,C,!0);m.set(g-8,8,1,!0)}function N(m,w){const y=m.size;let g=-1,S=y-1,b=7,C=0;for(let v=y-1;v>0;v-=2)for(v===6&&v--;;){for(let R=0;R<2;R++)if(!m.isReserved(S,v-R)){let K=!1;C<w.length&&(K=(w[C]>>>b&1)===1),m.set(S,v-R,K),b--,b===-1&&(C++,b=7)}if(S+=g,S<0||y<=S){S-=g,g=-g;break}}}function T(m,w,y){const g=new e;y.forEach(function(R){g.put(R.mode.bit,4),g.put(R.getLength(),h.getCharCountIndicator(R.mode,m)),R.write(g)});const S=n.getSymbolTotalCodewords(m),b=a.getTotalCodewordsCount(m,w),C=(S-b)*8;for(g.getLengthInBits()+4<=C&&g.put(0,4);g.getLengthInBits()%8!==0;)g.putBit(0);const v=(C-g.getLengthInBits())/8;for(let R=0;R<v;R++)g.put(R%2?17:236,8);return A(g,m,w)}function A(m,w,y){const g=n.getSymbolTotalCodewords(w),S=a.getTotalCodewordsCount(w,y),b=g-S,C=a.getBlocksCount(w,y),v=g%C,R=C-v,K=Math.floor(g/C),it=Math.floor(b/C),Jr=it+1,fn=K-it,Zr=new l(fn);let Kt=0;const lt=new Array(C),gn=new Array(C);let Yt=0;const Wr=new Uint8Array(m.buffer);for(let tt=0;tt<C;tt++){const Zt=tt<R?it:Jr;lt[tt]=Wr.slice(Kt,Kt+Zt),gn[tt]=Zr.encode(lt[tt]),Kt+=Zt,Yt=Math.max(Yt,Zt)}const Jt=new Uint8Array(g);let mn=0,j,H;for(j=0;j<Yt;j++)for(H=0;H<C;H++)j<lt[H].length&&(Jt[mn++]=lt[H][j]);for(j=0;j<fn;j++)for(H=0;H<C;H++)Jt[mn++]=gn[H][j];return Jt}function x(m,w,y,g){let S;if(Array.isArray(m))S=f.fromArray(m);else if(typeof m=="string"){let K=w;if(!K){const it=f.rawSplit(m);K=c.getBestVersionForData(it,y)}S=f.fromString(m,K||40)}else throw new Error("Invalid data");const b=c.getBestVersionForData(S,y);if(!b)throw new Error("The amount of data is too big to be stored in a QR Code");if(!w)w=b;else if(w<b)throw new Error(`
458
+ The chosen QR Code version cannot contain this amount of data.
459
+ Minimum version required to store current data is: `+b+`.
460
+ `);const C=T(w,y,S),v=n.getSymbolSize(w),R=new i(v);return d(R,w),p(R),k(R,w),E(R,y,0),w>=7&&B(R,w),N(R,C),isNaN(g)&&(g=s.getBestMask(R,E.bind(null,R,y))),s.applyMask(g,R),E(R,y,g),{modules:R,version:w,errorCorrectionLevel:y,maskPattern:g,segments:S}}return At.create=function(w,y){if(typeof w>"u"||w==="")throw new Error("No input text");let g=t.M,S,b;return typeof y<"u"&&(g=t.from(y.errorCorrectionLevel,t.M),S=c.from(y.version),b=s.from(y.maskPattern),y.toSJISFunc&&n.setToSJISFunction(y.toSJISFunc)),x(w,S,g,b)},At}var jt={},Ht={},an;function ln(){return an||(an=1,(function(n){function t(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let i=e.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+e);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const o=parseInt(i.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+i.slice(0,6).join("")}}n.getOptions=function(i){i||(i={}),i.color||(i.color={});const o=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,r=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:r,scale:r?4:s,margin:o,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},n.getScale=function(i,o){return o.width&&o.width>=i+o.margin*2?o.width/(i+o.margin*2):o.scale},n.getImageWidth=function(i,o){const r=n.getScale(i,o);return Math.floor((i+o.margin*2)*r)},n.qrToImageData=function(i,o,r){const s=o.modules.size,a=o.modules.data,l=n.getScale(s,r),c=Math.floor((s+r.margin*2)*l),u=r.margin*l,h=[r.color.light,r.color.dark];for(let f=0;f<c;f++)for(let d=0;d<c;d++){let p=(f*c+d)*4,k=r.color.light;if(f>=u&&d>=u&&f<c-u&&d<c-u){const B=Math.floor((f-u)/l),E=Math.floor((d-u)/l);k=h[a[B*s+E]?1:0]}i[p++]=k.r,i[p++]=k.g,i[p++]=k.b,i[p]=k.a}}})(Ht)),Ht}var cn;function Hr(){return cn||(cn=1,(function(n){const t=ln();function e(o,r,s){o.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=s,r.width=s,r.style.height=s+"px",r.style.width=s+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}n.render=function(r,s,a){let l=a,c=s;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=i()),l=t.getOptions(l);const u=t.getImageWidth(r.modules.size,l),h=c.getContext("2d"),f=h.createImageData(u,u);return t.qrToImageData(f.data,r,l),e(h,c,u),h.putImageData(f,0,0),c},n.renderToDataURL=function(r,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=n.render(r,s,l),u=l.type||"image/png",h=l.rendererOpts||{};return c.toDataURL(u,h.quality)}})(jt)),jt}var Gt={},un;function Gr(){if(un)return Gt;un=1;const n=ln();function t(o,r){const s=o.a/255,a=r+'="'+o.hex+'"';return s<1?a+" "+r+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function e(o,r,s){let a=o+r;return typeof s<"u"&&(a+=" "+s),a}function i(o,r,s){let a="",l=0,c=!1,u=0;for(let h=0;h<o.length;h++){const f=Math.floor(h%r),d=Math.floor(h/r);!f&&!c&&(c=!0),o[h]?(u++,h>0&&f>0&&o[h-1]||(a+=c?e("M",f+s,.5+d+s):e("m",l,0),l=0,c=!1),f+1<r&&o[h+1]||(a+=e("h",u),u=0)):l++}return a}return Gt.render=function(r,s,a){const l=n.getOptions(s),c=r.modules.size,u=r.modules.data,h=c+l.margin*2,f=l.color.light.a?"<path "+t(l.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",d="<path "+t(l.color.dark,"stroke")+' d="'+i(u,c,l.margin)+'"/>',p='viewBox="0 0 '+h+" "+h+'"',B='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+p+' shape-rendering="crispEdges">'+f+d+`</svg>
461
+ `;return typeof a=="function"&&a(null,B),B},Gt}var dn;function Kr(){if(dn)return X;dn=1;const n=Tr(),t=jr(),e=Hr(),i=Gr();function o(r,s,a,l,c){const u=[].slice.call(arguments,1),h=u.length,f=typeof u[h-1]=="function";if(!f&&!n())throw new Error("Callback required as last argument");if(f){if(h<2)throw new Error("Too few arguments provided");h===2?(c=a,a=s,s=l=void 0):h===3&&(s.getContext&&typeof c>"u"?(c=l,l=void 0):(c=l,l=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=l=void 0):h===2&&!s.getContext&&(l=a,a=s,s=void 0),new Promise(function(d,p){try{const k=t.create(a,l);d(r(k,s,l))}catch(k){p(k)}})}try{const d=t.create(a,l);c(null,r(d,s,l))}catch(d){c(d)}}return X.create=t.create,X.toCanvas=o.bind(null,e.render),X.toDataURL=o.bind(null,e.renderToDataURL),X.toString=o.bind(null,function(r,s,a){return i.render(r,a)}),X}var hn=Kr();const Yr=et({__proto__:null,default:kr(hn)},[hn]);M.Annotations=re,M.Attribute=ae,M.AttributeValue=se,M.Camera=le,M.Configuration=de,M.ERROR_CODES=U,M.Focus=ce,M.Photo=he,M.Snapshot=fe,M.VD_EVENTS=Z,M.VirtualdisplayClient=Sr,M.VirtualdisplayError=O,M.enableDebugMode=ne,M.isDebugMode=Rn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));