@pictogrammers/components 0.4.7 → 0.4.9

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 (72) hide show
  1. package/index.html +1 -1
  2. package/main.js +1 -1
  3. package/package.json +1 -1
  4. package/pg/app/app.css +1 -1
  5. package/pg/app/app.ts +8 -2
  6. package/pg/inputPixelEditor/inputPixelEditor.ts +3 -2
  7. package/pg/inputPixelEditor/utils/getEllipsePixels.ts +131 -19
  8. package/pg/modal/README.md +29 -0
  9. package/pg/modal/__examples__/basic/basic.html +4 -0
  10. package/pg/modal/__examples__/basic/basic.ts +42 -0
  11. package/pg/modal/index.ts +3 -0
  12. package/pg/modal/modal.css +40 -0
  13. package/pg/modal/modal.html +9 -0
  14. package/pg/modal/modal.ts +14 -0
  15. package/pg/tree/README.md +10 -1
  16. package/pg/tree/__examples__/basic/basic.html +1 -0
  17. package/pg/tree/__examples__/basic/basic.ts +6 -0
  18. package/pg/tree/tree.css +1 -0
  19. package/pgAnnoy.js +1 -1
  20. package/pgApp.js +1 -1
  21. package/pgAvatar.js +1 -1
  22. package/pgButton.js +1 -1
  23. package/pgButtonGroup.js +1 -1
  24. package/pgButtonLink.js +1 -1
  25. package/pgButtonMenu.js +1 -1
  26. package/pgButtonToggle.js +1 -1
  27. package/pgCard.js +1 -1
  28. package/pgCardUser.js +1 -1
  29. package/pgColor.js +1 -1
  30. package/pgDatabase.js +1 -1
  31. package/pgDropdown.js +1 -1
  32. package/pgGrid.js +1 -1
  33. package/pgHeader.js +1 -1
  34. package/pgIcon.js +1 -1
  35. package/pgInputCheck.js +1 -1
  36. package/pgInputCheckList.js +1 -1
  37. package/pgInputFileLocal.js +1 -1
  38. package/pgInputHexRgb.js +1 -1
  39. package/pgInputPixelEditor.js +1 -1
  40. package/pgInputRange.js +1 -1
  41. package/pgInputSelect.js +1 -1
  42. package/pgInputText.js +1 -1
  43. package/pgInputTextIcon.js +1 -1
  44. package/pgInputUserSelect.js +1 -1
  45. package/pgListTag.js +1 -1
  46. package/pgMarkdown.js +1 -1
  47. package/pgMenu.js +1 -1
  48. package/pgMenuDivider.js +1 -1
  49. package/pgMenuIcon.js +1 -1
  50. package/pgMenuItem.js +1 -1
  51. package/pgMenuItemIcon.js +1 -1
  52. package/pgModal.js +1 -0
  53. package/pgModalAlert.js +1 -1
  54. package/pgModification.js +1 -1
  55. package/pgNav.js +1 -1
  56. package/pgOverlay.js +1 -1
  57. package/pgOverlayContextMenu.js +1 -1
  58. package/pgOverlayMenu.js +1 -1
  59. package/pgOverlaySelectMenu.js +1 -1
  60. package/pgOverlaySubMenu.js +1 -1
  61. package/pgPicker.js +1 -1
  62. package/pgPreview.js +1 -1
  63. package/pgScroll.js +1 -1
  64. package/pgSearch.js +1 -1
  65. package/pgTab.js +1 -1
  66. package/pgTabs.js +1 -1
  67. package/pgToast.js +1 -1
  68. package/pgToasts.js +1 -1
  69. package/pgTooltip.js +1 -1
  70. package/pgTree.js +1 -1
  71. package/pgTreeButtonIcon.js +1 -1
  72. package/pgTreeItem.js +1 -1
@@ -1 +1 @@
1
- (()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},891:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),s=n(314),i=n.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: 10rem;\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n}',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case s:return u.has(e);case i:return(t,n)=>{const r=u.get(e);r.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=r.get(s);u.has(n)?u.get(n).has(s)?u.get(n).get(s).push(r.get(s)):u.get(n).set(s,r.get(s)):u.set(n,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,d.swap,[n])}))}}))};case r:return(t,n)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(n):u.get(e).set(t,[n]):u.set(e,new Map([[t,[n]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return u.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(u.has(e)){u.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const d={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[p]||void 0!==e.template||void 0!==e.style)if(this[p]){if(this[p]&&e.style);else if(this[p]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,s.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[g(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[p]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),u=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const n=E(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const n=t[a]?t[l]:t;e[i](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=e?e(t):t,S(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=v(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===P)return this[u]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function $(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var O=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},k=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(891),T=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},z=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const L=[],D=[];(()=>{let e,t,n,r,o,s,i,a,l,c,u=[b({selector:"pg-overlay-context-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],d=A,p=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[],O=[],k=[],C=[],j=[],M=[],N=[];(class extends d{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[$()],r=[$()],o=[x()],s=[x()],i=[x()],a=[x()],l=[x()],c=[x()],T(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},p,f),T(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},m,y),T(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},v,g),T(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:b},w,S),T(null,null,i,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:b},E,P),T(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},O,k),T(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},C,j),T(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},M,N),T(null,e={value:t},u,{kind:"class",name:t.name,metadata:b},null,h),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),z(t,h)}$overlay=z(this,p,void 0);$menu=(z(this,f),z(this,m,void 0));source=(z(this,y),z(this,v,null));x=(z(this,g),z(this,w,0));y=(z(this,S),z(this,E,0));default=(z(this,P),z(this,O,null));items=(z(this,k),z(this,C,[]));value=(z(this,j),z(this,M,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){L.pop()?.close(),L.push(this),D.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));const e=this.source?.getBoundingClientRect(),t=this.x-(e?.left||0),n=this.y-(e?.top||0);this.$overlay.style.setProperty("--pg-overlay-menu-_x",`${t}px`),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${n}px`),this.$menu.focus(0),this.#r=this.#o.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(z(this,N),!1);#r;#o(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&(this.close(),0===D.length&&this.#s&&(console.log(e),this.source?.focus()))}disconnectedCallback(){D.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){this.close(),this.source?.focus()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}})})()})();
1
+ (()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},891:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),s=n(314),i=n.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: 10rem;\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n}',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case s:return t=>{const n=u.get(e);return n?.has(t)};case i:return(t,n)=>{const r=u.get(e);if(r){const e=r.get(t);e&&e.forEach(((r,o)=>{if(!r)throw new Error("Unreachable");{const e=u.get(n);if(e){const n=e.get(t);n?n.set(o,r):e.set(t,new Map([[o,r]]))}else u.set(n,new Map([[t,new Map([[o,r]])]]))}e.delete(o),r.forEach((e=>{e(null,d.swap,[n])}))}))}};case r:return(t,n)=>{const r=t.getRootNode().host,o=u.get(e);if(o){const e=o.get(r);if(e){const r=e.get(t);r?r.push(n):e.set(t,[n])}else o.set(r,new Map([[t,[n]]]))}else u.set(e,new Map([[r,new Map([[t,[n]]])]]))};case o:return t=>{const n=t.getRootNode().host,r=u.get(e);r&&(r.delete(n),0===r.size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments),r=u.get(t);return r?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,n,arguments)}))}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(u.has(e)){const r=u.get(e);r?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,n)}))}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const d={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):r.match(/<child\/>/)?r.replace(/<child\/>/,o||""):`${r}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[p]||void 0!==e.template||void 0!==e.style)if(this[p]){if(this[p]&&e.style);else if(this[p]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var n=new CSSStyleSheet;return n.replaceSync(t.toString()),e.push(n),e}),[]),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,s.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[g(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[p]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),u=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const n=E(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s](this)){const n=t[a]?t[l]:t;e[i](this,n),this[o]=t}else this[o]=t}else this[o]=e?e(t):t,S(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=v(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===P)return this[u]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function $(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var O=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},k=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(891),T=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},z=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const M=[],L=[];(()=>{let e,t,n,r,o,s,i,a,l,c,u=[b({selector:"pg-overlay-context-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],d=A,p=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[],O=[],k=[],C=[],j=[],N=[],D=[];(class extends d{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[$()],r=[$()],o=[x()],s=[x()],i=[x()],a=[x()],l=[x()],c=[x()],T(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},p,f),T(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},m,y),T(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},v,g),T(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:b},w,S),T(null,null,i,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:b},E,P),T(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},O,k),T(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},C,j),T(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},N,D),T(null,e={value:t},u,{kind:"class",name:t.name,metadata:b},null,h),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),z(t,h)}$overlay=z(this,p,void 0);$menu=(z(this,f),z(this,m,void 0));source=(z(this,y),z(this,v,null));x=(z(this,g),z(this,w,0));y=(z(this,S),z(this,E,0));default=(z(this,P),z(this,O,null));items=(z(this,k),z(this,C,[]));value=(z(this,j),z(this,N,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){M.pop()?.close(),M.push(this),L.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));const e=this.source?.getBoundingClientRect(),t=this.x-(e?.left||0),n=this.y-(e?.top||0);this.$overlay.style.setProperty("--pg-overlay-menu-_x",`${t}px`),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${n}px`),this.$menu.focus(0),this.#r=this.#o.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(z(this,D),!1);#r;#o(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&(this.close(),0===L.length&&this.#s&&(console.log(e),this.source?.focus()))}disconnectedCallback(){L.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){this.close(),this.source?.focus()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}})})()})();
package/pgOverlayMenu.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&a[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},697:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),s=r(314),a=r.n(s)()(o());a.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(bottom) - 0.25rem);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n overflow: visible;\n}',""]);var i=new CSSStyleSheet;i.replaceSync(a.toString());const l=i}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),a=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case i:return!0;case l:return t;case s:return u.has(e);case a:return(t,r)=>{const n=u.get(e);n.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=n.get(s);u.has(r)?u.get(r).has(s)?u.get(r).get(s).push(n.get(s)):u.get(r).set(s,n.get(s)):u.set(r,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,p.swap,[r])}))}}))};case n:return(t,r)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(r):u.get(e).set(t,[r]):u.set(e,new Map([[t,[r]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?h(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return u.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return u.get(t).forEach(((e,n)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return h(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(u.has(e)){u.get(e).forEach(((e,n)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(n=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[m].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),n.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const n=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===n.length?(this[d]=!0,s.call(this),o()):Promise.all(n).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[g(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),u=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][i]?this[o]:h(this[o]):this[o],set:t=>{const r=E(e?e(t):t);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const r=t[i]?t[l]:t;e[a](this,r),this[o]=t,console.log(">>> trigger render???",this,n)}else this[o]=t}else this[o]=e?e(t):t,S(this,n)}})})),function(t){if(void 0===t&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==t&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=v(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===x?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===x)return this[u]=r,!0;const s=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||S(this,n),this[o]=r,s}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function P(){return function(e,t){const r=t.name,n=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const x=Symbol("meta");var O=function(e,t,r,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(i=a(y.get))&&(h.get=i),(i=a(y.set))&&(h.set=i),(i=a(y.init))&&o.unshift(i)}else(i=a(y))&&("field"===l?o.unshift(i):h[c]=i)}u&&Object.defineProperty(u,n.name,h),p=!0},j=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};const k=new Set,C=new Map;const A=(()=>{let e,t,r=[b()],n=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),j(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),k.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),k.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var R=r(697),z=function(e,t,r,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(i=a(y.get))&&(h.get=i),(i=a(y.set))&&(h.set=i),(i=a(y.init))&&o.unshift(i)}else(i=a(y))&&("field"===l?o.unshift(i):h[c]=i)}u&&Object.defineProperty(u,n.name,h),p=!0},T=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};(()=>{let e,t,r,n,o,s,a,i,l=[b({selector:"pg-overlay-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],c=[],u=A,h=[],p=[],d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],x=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;r=[P()],n=[P()],o=[$()],s=[$()],a=[$()],i=[$()],z(null,null,r,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,p),z(null,null,n,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},m,y),z(null,null,s,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},v,g),z(null,null,a,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},w,S),z(null,null,i,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},E,x),z(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,c)}$overlay=T(this,h,void 0);$menu=(T(this,p),T(this,d,void 0));source=(T(this,f),T(this,m,null));default=(T(this,y),T(this,v,null));items=(T(this,g),T(this,w,[]));value=(T(this,S),T(this,E,null));render(e){}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));this.source?.getBoundingClientRect();const e=null===this.value||"object"!=typeof this.value?this.value:this.value.value,t=null===this.value?0:this.items.findIndex((t=>t.value===e));this.$menu.focus(t)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),T(this,x)}})})()})();
1
+ (()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&a[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},697:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),s=r(314),a=r.n(s)()(o());a.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(bottom) - 0.25rem);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n overflow: visible;\n}',""]);var i=new CSSStyleSheet;i.replaceSync(a.toString());const l=i}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),a=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case i:return!0;case l:return t;case s:return t=>{const r=u.get(e);return r?.has(t)};case a:return(t,r)=>{const n=u.get(e);if(n){const e=n.get(t);e&&e.forEach(((n,o)=>{if(!n)throw new Error("Unreachable");{const e=u.get(r);if(e){const r=e.get(t);r?r.set(o,n):e.set(t,new Map([[o,n]]))}else u.set(r,new Map([[t,new Map([[o,n]])]]))}e.delete(o),n.forEach((e=>{e(null,p.swap,[r])}))}))}};case n:return(t,r)=>{const n=t.getRootNode().host,o=u.get(e);if(o){const e=o.get(n);if(e){const n=e.get(t);n?n.push(r):e.set(t,[r])}else o.set(n,new Map([[t,[r]]]))}else u.set(e,new Map([[n,new Map([[t,[r]]])]]))};case o:return t=>{const r=t.getRootNode().host,n=u.get(e);n&&(n.delete(r),0===n.size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?h(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return u.has(t)?function(){const e=Array.prototype[r].apply(t,arguments),n=u.get(t);return n?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,r,arguments)}))}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return h(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(u.has(e)){const n=u.get(e);n?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,r)}))}))}))}return Reflect.set(e,t,r)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(n=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):n.match(/<child\/>/)?n.replace(/<child\/>/,o||""):`${n}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[m].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var r=new CSSStyleSheet;return r.replaceSync(t.toString()),e.push(r),e}),[]),n.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const n=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===n.length?(this[d]=!0,s.call(this),o()):Promise.all(n).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[g(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),u=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][i]?this[o]:h(this[o]):this[o],set:t=>{const r=E(e?e(t):t);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s](this)){const r=t[i]?t[l]:t;e[a](this,r),this[o]=t}else this[o]=t}else this[o]=e?e(t):t,S(this,n)}})})),function(t){if(void 0===t&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==t&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=v(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===x?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===x)return this[u]=r,!0;const s=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||S(this,n),this[o]=r,s}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function P(){return function(e,t){const r=t.name,n=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const x=Symbol("meta");var O=function(e,t,r,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(i=a(y.get))&&(h.get=i),(i=a(y.set))&&(h.set=i),(i=a(y.init))&&o.unshift(i)}else(i=a(y))&&("field"===l?o.unshift(i):h[c]=i)}u&&Object.defineProperty(u,n.name,h),p=!0},j=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};const k=new Set,C=new Map;const A=(()=>{let e,t,r=[b()],n=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),j(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),k.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),k.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var R=r(697),z=function(e,t,r,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(i=a(y.get))&&(h.get=i),(i=a(y.set))&&(h.set=i),(i=a(y.init))&&o.unshift(i)}else(i=a(y))&&("field"===l?o.unshift(i):h[c]=i)}u&&Object.defineProperty(u,n.name,h),p=!0},T=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};(()=>{let e,t,r,n,o,s,a,i,l=[b({selector:"pg-overlay-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],c=[],u=A,h=[],p=[],d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],x=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;r=[P()],n=[P()],o=[$()],s=[$()],a=[$()],i=[$()],z(null,null,r,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,p),z(null,null,n,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},m,y),z(null,null,s,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},v,g),z(null,null,a,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},w,S),z(null,null,i,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},E,x),z(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,c)}$overlay=T(this,h,void 0);$menu=(T(this,p),T(this,d,void 0));source=(T(this,f),T(this,m,null));default=(T(this,y),T(this,v,null));items=(T(this,g),T(this,w,[]));value=(T(this,S),T(this,E,null));render(e){}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));this.source?.getBoundingClientRect();const e=null===this.value||"object"!=typeof this.value?this.value:this.value.value,t=null===this.value?0:this.items.findIndex((t=>t.value===e));this.$menu.focus(t)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),T(this,x)}})})()})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={97:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),s=r(314),i=r.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n overflow: visible;\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return t;case s:return u.has(e);case i:return(t,r)=>{const n=u.get(e);n.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=n.get(s);u.has(r)?u.get(r).has(s)?u.get(r).get(s).push(n.get(s)):u.get(r).set(s,n.get(s)):u.set(r,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,p.swap,[r])}))}}))};case n:return(t,r)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(r):u.get(e).set(t,[r]):u.set(e,new Map([[t,[r]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?h(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return u.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return u.get(t).forEach(((e,n)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return h(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(u.has(e)){u.get(e).forEach(((e,n)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(n=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[m].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),n.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const n=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===n.length?(this[d]=!0,s.call(this),o()):Promise.all(n).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[g(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),u=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const r=E(e?e(t):t);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const r=t[a]?t[l]:t;e[i](this,r),this[o]=t,console.log(">>> trigger render???",this,n)}else this[o]=t}else this[o]=e?e(t):t,S(this,n)}})})),function(t){if(void 0===t&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==t&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=v(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===P)return this[u]=r,!0;const s=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||S(this,n),this[o]=r,s}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function x(){return function(e,t){const r=t.name,n=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var O=function(e,t,r,n,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,n.name,h),p=!0},k=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};const j=new Set,C=new Map;const A=(()=>{let e,t,r=[b()],n=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),j.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),j.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var R=r(97),z=function(e,t,r,n,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,n.name,h),p=!0},T=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};(()=>{let e,t,r,n,o,s,i,a,l=[b({selector:"pg-overlay-select-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],c=[],u=A,h=[],p=[],d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;r=[x()],n=[x()],o=[$()],s=[$()],i=[$()],a=[$()],z(null,null,r,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,p),z(null,null,n,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},m,y),z(null,null,s,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},v,g),z(null,null,i,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},w,S),z(null,null,a,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},E,P),z(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,c)}$overlay=T(this,h,void 0);$menu=(T(this,p),T(this,d,void 0));source=(T(this,f),T(this,m,null));default=(T(this,y),T(this,v,null));items=(T(this,g),T(this,w,[]));value=(T(this,S),T(this,E,null));render(e){e.items&&null!==this.value&&(this.items.forEach((e=>e.checked=!1)),this.items.find((e=>e.value===this.value.value)).checked=!0)}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));const e=this.source?.getBoundingClientRect();let t=0;const r=null===this.value||"object"!=typeof this.value?this.value:this.value.value,n=null===this.value?-1:this.items.findIndex((e=>e.value===r));if(-1!==n){const r=this.$menu.getItemHeight(n);t-=this.$menu.getItemOffset(0,n),e?.height!==r&&e?.height&&(t+=(e.height-r)/2)}else if(this.items.length>0){this.default&&(this.default.checked=!0,this.$menu.items.unshift(this.default));const r=this.$menu.getItemHeight(0);t-=this.$menu.getItemOffset(0,0),e?.height!==r&&e?.height&&(t+=(e.height-r)/2)}this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${t}px`),this.$menu.focus(n)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),T(this,P)}})})()})();
1
+ (()=>{"use strict";var e={97:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),s=r(314),i=r.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n overflow: visible;\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return t;case s:return t=>{const r=u.get(e);return r?.has(t)};case i:return(t,r)=>{const n=u.get(e);if(n){const e=n.get(t);e&&e.forEach(((n,o)=>{if(!n)throw new Error("Unreachable");{const e=u.get(r);if(e){const r=e.get(t);r?r.set(o,n):e.set(t,new Map([[o,n]]))}else u.set(r,new Map([[t,new Map([[o,n]])]]))}e.delete(o),n.forEach((e=>{e(null,p.swap,[r])}))}))}};case n:return(t,r)=>{const n=t.getRootNode().host,o=u.get(e);if(o){const e=o.get(n);if(e){const n=e.get(t);n?n.push(r):e.set(t,[r])}else o.set(n,new Map([[t,[r]]]))}else u.set(e,new Map([[n,new Map([[t,[r]]])]]))};case o:return t=>{const r=t.getRootNode().host,n=u.get(e);n&&(n.delete(r),0===n.size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?h(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return u.has(t)?function(){const e=Array.prototype[r].apply(t,arguments),n=u.get(t);return n?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,r,arguments)}))}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return h(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(u.has(e)){const n=u.get(e);n?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,r)}))}))}))}return Reflect.set(e,t,r)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(n=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):n.match(/<child\/>/)?n.replace(/<child\/>/,o||""):`${n}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[m].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var r=new CSSStyleSheet;return r.replaceSync(t.toString()),e.push(r),e}),[]),n.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const n=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===n.length?(this[d]=!0,s.call(this),o()):Promise.all(n).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[g(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),u=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const r=E(e?e(t):t);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s](this)){const r=t[a]?t[l]:t;e[i](this,r),this[o]=t}else this[o]=t}else this[o]=e?e(t):t,S(this,n)}})})),function(t){if(void 0===t&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==t&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=v(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===P)return this[u]=r,!0;const s=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||S(this,n),this[o]=r,s}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function x(){return function(e,t){const r=t.name,n=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var O=function(e,t,r,n,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,n.name,h),p=!0},k=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};const j=new Set,C=new Map;const A=(()=>{let e,t,r=[b()],n=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),j.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),j.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var R=r(97),z=function(e,t,r,n,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,n.name,h),p=!0},T=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};(()=>{let e,t,r,n,o,s,i,a,l=[b({selector:"pg-overlay-select-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],c=[],u=A,h=[],p=[],d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;r=[x()],n=[x()],o=[$()],s=[$()],i=[$()],a=[$()],z(null,null,r,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,p),z(null,null,n,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},m,y),z(null,null,s,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},v,g),z(null,null,i,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},w,S),z(null,null,a,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},E,P),z(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,c)}$overlay=T(this,h,void 0);$menu=(T(this,p),T(this,d,void 0));source=(T(this,f),T(this,m,null));default=(T(this,y),T(this,v,null));items=(T(this,g),T(this,w,[]));value=(T(this,S),T(this,E,null));render(e){e.items&&null!==this.value&&(this.items.forEach((e=>e.checked=!1)),this.items.find((e=>e.value===this.value.value)).checked=!0)}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));const e=this.source?.getBoundingClientRect();let t=0;const r=null===this.value||"object"!=typeof this.value?this.value:this.value.value,n=null===this.value?-1:this.items.findIndex((e=>e.value===r));if(-1!==n){const r=this.$menu.getItemHeight(n);t-=this.$menu.getItemOffset(0,n),e?.height!==r&&e?.height&&(t+=(e.height-r)/2)}else if(this.items.length>0){this.default&&(this.default.checked=!0,this.$menu.items.unshift(this.default));const r=this.$menu.getItemHeight(0);t-=this.$menu.getItemOffset(0,0),e?.height!==r&&e?.height&&(t+=(e.height-r)/2)}this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${t}px`),this.$menu.focus(n)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),T(this,P)}})})()})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),s=n(314),i=n.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case s:return u.has(e);case i:return(t,n)=>{const r=u.get(e);r.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=r.get(s);u.has(n)?u.get(n).has(s)?u.get(n).get(s).push(r.get(s)):u.get(n).set(s,r.get(s)):u.set(n,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,p.swap,[n])}))}}))};case r:return(t,n)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(n):u.get(e).set(t,[n]):u.set(e,new Map([[t,[n]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return u.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(u.has(e)){u.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===r.length?(this[d]=!0,s.call(this),o()):Promise.all(r).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[g(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),u=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const n=E(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const n=t[a]?t[l]:t;e[i](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=e?e(t):t,S(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=v(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===P)return this[u]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function $(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var O=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),p=!0},k=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(217),z=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),p=!0},T=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const L=[],D=[];(()=>{let e,t,n,r,o,s,i,a,l,c,u=[b({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],p=A,d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[],O=[],k=[],C=[],j=[],M=[],N=[];(class extends p{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[$()],r=[$()],o=[x()],s=[x()],i=[x()],a=[x()],l=[x()],c=[x()],z(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},d,f),z(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},m,y),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},v,g),z(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:b},w,S),z(null,null,i,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:b},E,P),z(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},O,k),z(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},C,j),z(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},M,N),z(null,e={value:t},u,{kind:"class",name:t.name,metadata:b},null,h),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,h)}$overlay=T(this,d,void 0);$menu=(T(this,f),T(this,m,void 0));source=(T(this,y),T(this,v,null));x=(T(this,g),T(this,w,0));y=(T(this,S),T(this,E,0));default=(T(this,P),T(this,O,null));items=(T(this,k),T(this,C,[]));value=(T(this,j),T(this,M,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){L.pop()?.close(),L.push(this),D.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#o.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(T(this,N),!1);#r;#o(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===D.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){D.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}})})()})();
1
+ (()=>{"use strict";var e={217:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),r=n.n(o),s=n(314),i=n.n(s)()(r());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);o&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={id:o,exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=Symbol("addObserver"),r=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case s:return t=>{const n=u.get(e);return n?.has(t)};case i:return(t,n)=>{const o=u.get(e);if(o){const e=o.get(t);e&&e.forEach(((o,r)=>{if(!o)throw new Error("Unreachable");{const e=u.get(n);if(e){const n=e.get(t);n?n.set(r,o):e.set(t,new Map([[r,o]]))}else u.set(n,new Map([[t,new Map([[r,o]])]]))}e.delete(r),o.forEach((e=>{e(null,p.swap,[n])}))}))}};case o:return(t,n)=>{const o=t.getRootNode().host,r=u.get(e);if(r){const e=r.get(o);if(e){const o=e.get(t);o?o.push(n):e.set(t,[n])}else r.set(o,new Map([[t,[n]]]))}else u.set(e,new Map([[o,new Map([[t,[n]]])]]))};case r:return t=>{const n=t.getRootNode().host,o=u.get(e);o&&(o.delete(n),0===o.size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments),o=u.get(t);return o?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,n,arguments)}))}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(u.has(e)){const o=u.get(e);o?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,n)}))}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,r;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(o=t.prototype[f],(r=e.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,o):o.match(/<child\/>/)?o.replace(/<child\/>/,r||""):`${o}${r||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const n=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[m].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var n=new CSSStyleSheet;return n.replaceSync(t.toString()),e.push(n),e}),[]),o.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const o=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),r=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===o.length?(this[d]=!0,s.call(this),r()):Promise.all(o).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));r()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[g(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function x(e){return function(t,n){const o=n.name,r=Symbol(o),c=Symbol(`${o}:type`),u=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[c]||"array"===this[c]?this[r][a]?this[r]:h(this[r]):this[r],set:t=>{const n=E(e?e(t):t);if("index"!==o&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${o} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[r]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[r]);if(e[s](this)){const n=t[a]?t[l]:t;e[i](this,n),this[r]=t}else this[r]=t}else this[r]=e?e(t):t,S(this,o)}})})),function(t){if(void 0===t&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==t&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=v(o);t[o]||(e.observedAttributes.push(n),t[o]=r)}return this[c]=E(t),"array"===this[c]?(this[r]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[r],t)),set:(e,t,n)=>{if(t===P)return this[u]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[r].length===n||S(this,o),this[r]=n,s}})):(this[r]=e?e(this.getAttribute(o)??t):this.getAttribute(o)??t,this[r])}}}function $(){return function(e,t){const n=t.name,o=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var O=function(e,t,n,o,r,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?o.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),p=!1,d=n.length-1;d>=0;d--){var f={};for(var m in o)f[m]="access"===m?{}:o[m];for(var m in o.access)f.access[m]=o.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&r.unshift(a)}else(a=i(y))&&("field"===l?r.unshift(a):h[c]=a)}u&&Object.defineProperty(u,o.name,h),p=!0},k=function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0};const C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],o=[],r=HTMLElement;(class extends r{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,o),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,o)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(217),z=function(e,t,n,o,r,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?o.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),p=!1,d=n.length-1;d>=0;d--){var f={};for(var m in o)f[m]="access"===m?{}:o[m];for(var m in o.access)f.access[m]=o.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&r.unshift(a)}else(a=i(y))&&("field"===l?r.unshift(a):h[c]=a)}u&&Object.defineProperty(u,o.name,h),p=!0},T=function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0};const M=[],L=[];(()=>{let e,t,n,o,r,s,i,a,l,c,u=[b({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],p=A,d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[],O=[],k=[],C=[],j=[],N=[],D=[];(class extends p{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[$()],o=[$()],r=[x()],s=[x()],i=[x()],a=[x()],l=[x()],c=[x()],z(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},m,y),z(null,null,r,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},v,g),z(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:b},w,S),z(null,null,i,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:b},E,P),z(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},O,k),z(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},C,j),z(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},N,D),z(null,e={value:t},u,{kind:"class",name:t.name,metadata:b},null,h),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,h)}$overlay=T(this,d,void 0);$menu=(T(this,f),T(this,m,void 0));source=(T(this,y),T(this,v,null));x=(T(this,g),T(this,w,0));y=(T(this,S),T(this,E,0));default=(T(this,P),T(this,O,null));items=(T(this,k),T(this,C,[]));value=(T(this,j),T(this,N,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){M.pop()?.close(),M.push(this),L.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#o=this.#r.bind(this),document.addEventListener("pointerdown",this.#o)}#s=(T(this,D),!1);#o;#r(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===L.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){L.pop(),document.removeEventListener("pointerdown",this.#o)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}})})()})();
package/pgPicker.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={71:(e,t,r)=>{r.d(t,{A:()=>l});var o=r(601),n=r.n(o),a=r(314),i=r.n(a)()(n());i.push([e.id,"[part~=popover] {\n background: #FFF;\n padding: 0.5rem;\n border-radius: 0.5rem;\n box-shadow: 0 1px 14px rgba(0, 0, 0, 0.2);\n border: 4px solid #4F8FF9;\n}\n\n[part~=search] {\n border: 2px solid #453C4F;\n border-radius: 0.125rem;\n padding: 0.25rem 0.5rem;\n font-size: 1rem;\n width: 27.25rem;\n margin-bottom: 0.25rem;\n outline: none;\n}\n\n[part~=arrow],\n[part~=arrow]::before {\n position: absolute;\n width: 10px;\n height: 10px;\n}\n\n[part~=arrow]::before {\n content: '';\n transform: rotate(45deg);\n background: #FFF;\n}\n\n[part~=popover][data-popper-placement^='top'] > [part~=arrow] {\n bottom: -5px;\n}\n[part~=popover][data-popper-placement^='top'] > [part~=arrow]::before {\n border-bottom: 4px solid #4F8FF9;\n border-right: 4px solid #4F8FF9;\n border-bottom-right-radius: 0.25rem;\n}\n\n[part~=popover][data-popper-placement^='bottom'] > [part~=arrow] {\n top: -10px;\n}\n[part~=popover][data-popper-placement^='bottom'] > [part~=arrow]::before {\n border-top: 4px solid #4F8FF9;\n border-left: 4px solid #4F8FF9;\n border-top-left-radius: 0.25rem;\n}\n\n[part~=popover][data-popper-placement^='left'] > [part~=arrow] {\n right: -5px;\n}\n\n[part~=popover][data-popper-placement^='right'] > [part~=arrow] {\n left: -5px;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",o=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),o&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),o&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,o,n,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);o&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),n&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=n):p[4]="".concat(n)),t.push(p))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=Symbol("addObserver"),n=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("swapObserver"),s=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function d(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case s:return!0;case l:return t;case a:return p.has(e);case i:return(t,r)=>{const o=p.get(e);o.forEach(((n,a)=>{if(a.getRootNode().host===t){const t=o.get(a);p.has(r)?p.get(r).has(a)?p.get(r).get(a).push(o.get(a)):p.get(r).set(a,o.get(a)):p.set(r,new Map([[a,t]])),p.delete(e),t.forEach((e=>{e(null,h.swap,[r])}))}}))};case o:return(t,r)=>{p.has(e)?p.get(e).has(t)?p.get(e).get(t).push(r):p.get(e).set(t,[r]):p.set(e,new Map([[t,[r]]]))};case n:return t=>{p.has(e)&&(p.get(e).delete(t),0===p.get(e).size&&p.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?d(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return p.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return p.get(t).forEach(((e,o)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return d(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(p.has(e)){p.get(e).forEach(((e,o)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=p;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function g(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function v(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var o,n;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(o=t.prototype[f],(n=e.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):`${o}${n||""}`));const a=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[u]||void 0!==e.template||void 0!==e.style)if(this[u]){if(this[u]&&e.style);else if(this[u]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[m].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),o.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const o=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),n=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[b(t)]=!0,e)),{}):{})}))};0===o.length?(this[u]=!0,a.call(this),n()):Promise.all(o).then((()=>{this[u]=!0,a.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));n()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[b(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[u]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function x(e){return null===e?"null":w(e)?"array":typeof e}function E(){return function(e,t){const r=t.name,o=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const $=Symbol("meta");var P=r(71),F=function(e,t,r,o,n,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!t&&e?o.static?e:e.prototype:null,d=t||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),h=!1,u=r.length-1;u>=0;u--){var f={};for(var m in o)f[m]="access"===m?{}:o[m];for(var m in o.access)f.access[m]=o.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var y=(0,r[u])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(d.get=s),(s=i(y.set))&&(d.set=s),(s=i(y.init))&&n.unshift(s)}else(s=i(y))&&("field"===l?n.unshift(s):d[c]=s)}p&&Object.defineProperty(p,o.name,d),h=!0},k=function(e,t,r){for(var o=arguments.length>2,n=0;n<t.length;n++)r=o?t[n].call(e,r):t[n].call(e);return o?r:void 0};window.process={env:{}};(()=>{let e,t,r,o,n,c,p,h=[v({selector:"pg-picker",style:P.A,template:'<parent/> <div part="popover"> <div part="arrow"></div> <input part="search" type="text"/> <div part="scroll"> <pg-grid part="grid" height="12rem"></pg-grid> </div> </div>'})],u=[],f=HTMLElement,m=[],y=[],b=[],A=[],O=[],C=[],R=[],j=[],z=[],T=[];(class extends f{static{t=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;var P;r=[function(e,t){const r=t.name,o=Symbol(r),n=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return t.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[n]||"array"===this[n]?this[o][s]?this[o]:d(this[o]):this[o],set:e=>{const t=x(P?P(e):e);if("index"!==r&&this[n]!==t&&"null"!==this[n]&&"null"!==t)throw new Error(`@Prop() ${r} with type '${this[n]}' cannot be set to ${t}.`);if("array"===this[n]){if(!w(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=d(this[o]);if(t[a]){const n=e[s]?e[l]:e;t[i](this,n),this[o]=e,console.log(">>> trigger render???",this,r)}else this[o]=e}else this[o]=P?P(e):e,S(this,r)}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!t.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=g(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[n]=x(e),"array"===this[n]?(this[o]=e,new Proxy(e,{get:(e,t)=>t===$?this[c]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===$)return this[c]=n,!0;const a=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,a}})):(this[o]=P?P(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}],o=[E()],n=[E()],c=[E()],p=[E()],F(null,null,r,{kind:"field",name:"icons",static:!1,private:!1,access:{has:e=>"icons"in e,get:e=>e.icons,set:(e,t)=>{e.icons=t}},metadata:v},m,y),F(null,null,o,{kind:"field",name:"$popover",static:!1,private:!1,access:{has:e=>"$popover"in e,get:e=>e.$popover,set:(e,t)=>{e.$popover=t}},metadata:v},b,A),F(null,null,n,{kind:"field",name:"$arrow",static:!1,private:!1,access:{has:e=>"$arrow"in e,get:e=>e.$arrow,set:(e,t)=>{e.$arrow=t}},metadata:v},O,C),F(null,null,c,{kind:"field",name:"$search",static:!1,private:!1,access:{has:e=>"$search"in e,get:e=>e.$search,set:(e,t)=>{e.$search=t}},metadata:v},R,j),F(null,null,p,{kind:"field",name:"$grid",static:!1,private:!1,access:{has:e=>"$grid"in e,get:e=>e.$grid,set:(e,t)=>{e.$grid=t}},metadata:v},z,T),F(null,e={value:t},h,{kind:"class",name:t.name,metadata:v},null,u),t=e.value,v&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),k(t,u)}icons=k(this,m,[]);$popover=(k(this,y),k(this,b,void 0));$arrow=(k(this,A),k(this,O,void 0));$search=(k(this,C),k(this,R,void 0));$grid=(k(this,j),k(this,z,void 0));isVisible=(k(this,T),!1);connectedCallback(){}search="";render(){this.$grid.icons=this.icons.filter((e=>-1!==e.name.indexOf(this.search)))}})})()})();
1
+ (()=>{"use strict";var e={71:(e,t,r)=>{r.d(t,{A:()=>c});var o=r(601),n=r.n(o),a=r(314),s=r.n(a)()(n());s.push([e.id,"[part~=popover] {\n background: #FFF;\n padding: 0.5rem;\n border-radius: 0.5rem;\n box-shadow: 0 1px 14px rgba(0, 0, 0, 0.2);\n border: 4px solid #4F8FF9;\n}\n\n[part~=search] {\n border: 2px solid #453C4F;\n border-radius: 0.125rem;\n padding: 0.25rem 0.5rem;\n font-size: 1rem;\n width: 27.25rem;\n margin-bottom: 0.25rem;\n outline: none;\n}\n\n[part~=arrow],\n[part~=arrow]::before {\n position: absolute;\n width: 10px;\n height: 10px;\n}\n\n[part~=arrow]::before {\n content: '';\n transform: rotate(45deg);\n background: #FFF;\n}\n\n[part~=popover][data-popper-placement^='top'] > [part~=arrow] {\n bottom: -5px;\n}\n[part~=popover][data-popper-placement^='top'] > [part~=arrow]::before {\n border-bottom: 4px solid #4F8FF9;\n border-right: 4px solid #4F8FF9;\n border-bottom-right-radius: 0.25rem;\n}\n\n[part~=popover][data-popper-placement^='bottom'] > [part~=arrow] {\n top: -10px;\n}\n[part~=popover][data-popper-placement^='bottom'] > [part~=arrow]::before {\n border-top: 4px solid #4F8FF9;\n border-left: 4px solid #4F8FF9;\n border-top-left-radius: 0.25rem;\n}\n\n[part~=popover][data-popper-placement^='left'] > [part~=arrow] {\n right: -5px;\n}\n\n[part~=popover][data-popper-placement^='right'] > [part~=arrow] {\n left: -5px;\n}",""]);var i=new CSSStyleSheet;i.replaceSync(s.toString());const c=i},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",o=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),o&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),o&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,o,n,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(o)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var p=[].concat(e[l]);o&&s[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),n&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=n):p[4]="".concat(n)),t.push(p))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=Symbol("addObserver"),n=Symbol("removeObserver"),a=Symbol("getObservers"),s=Symbol("swapObserver"),i=Symbol("isProxy"),c=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function d(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case i:return!0;case c:return t;case a:return t=>{const r=p.get(e);return r?.has(t)};case s:return(t,r)=>{const o=p.get(e);if(o){const e=o.get(t);e&&e.forEach(((o,n)=>{if(!o)throw new Error("Unreachable");{const e=p.get(r);if(e){const r=e.get(t);r?r.set(n,o):e.set(t,new Map([[n,o]]))}else p.set(r,new Map([[t,new Map([[n,o]])]]))}e.delete(n),o.forEach((e=>{e(null,h.swap,[r])}))}))}};case o:return(t,r)=>{const o=t.getRootNode().host,n=p.get(e);if(n){const e=n.get(o);if(e){const o=e.get(t);o?o.push(r):e.set(t,[r])}else n.set(o,new Map([[t,[r]]]))}else p.set(e,new Map([[o,new Map([[t,[r]]])]]))};case n:return t=>{const r=t.getRootNode().host,o=p.get(e);o&&(o.delete(r),0===o.size&&p.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?d(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return p.has(t)?function(){const e=Array.prototype[r].apply(t,arguments),o=p.get(t);return o?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,r,arguments)}))}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return d(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(p.has(e)){const o=p.get(e);o?.forEach((e=>{e.forEach((e=>{e.forEach((e=>{e(t,r)}))}))}))}return Reflect.set(e,t,r)}})}window.observers=p;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function b(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function w(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var o,n;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(o=t.prototype[f],(n=e.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):o.match(/<child\/>/)?o.replace(/<child\/>/,n||""):`${o}${n||""}`));const a=t.prototype.connectedCallback||(()=>{}),s=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[u]||void 0!==e.template||void 0!==e.style)if(this[u]){if(this[u]&&e.style);else if(this[u]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[m].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var r=new CSSStyleSheet;return r.replaceSync(t.toString()),e.push(r),e}),[]),o.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const o=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),n=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===o.length?(this[u]=!0,a.call(this),n()):Promise.all(o).then((()=>{this[u]=!0,a.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));n()}))},t.prototype.disconnectedCallback=function(){s.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[g(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function v(e){return!!e&&e.constructor===Array}function S(e,t){e[u]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":v(e)?"array":typeof e}function x(){return function(e,t){const r=t.name,o=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const $=Symbol("meta");var P=r(71),F=function(e,t,r,o,n,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",p=!t&&e?o.static?e:e.prototype:null,d=t||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),h=!1,u=r.length-1;u>=0;u--){var f={};for(var m in o)f[m]="access"===m?{}:o[m];for(var m in o.access)f.access[m]=o.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,r[u])("accessor"===c?{get:d.get,set:d.set}:d[l],f);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(i=s(y.get))&&(d.get=i),(i=s(y.set))&&(d.set=i),(i=s(y.init))&&n.unshift(i)}else(i=s(y))&&("field"===c?n.unshift(i):d[l]=i)}p&&Object.defineProperty(p,o.name,d),h=!0},k=function(e,t,r){for(var o=arguments.length>2,n=0;n<t.length;n++)r=o?t[n].call(e,r):t[n].call(e);return o?r:void 0};window.process={env:{}};(()=>{let e,t,r,o,n,l,p,h=[w({selector:"pg-picker",style:P.A,template:'<parent/> <div part="popover"> <div part="arrow"></div> <input part="search" type="text"/> <div part="scroll"> <pg-grid part="grid" height="12rem"></pg-grid> </div> </div>'})],u=[],f=HTMLElement,m=[],y=[],g=[],A=[],O=[],C=[],R=[],j=[],z=[],M=[];(class extends f{static{t=this}static{const w="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;var P;r=[function(e,t){const r=t.name,o=Symbol(r),n=Symbol(`${r}:type`),l=Symbol(`${r}:meta`);return t.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[n]||"array"===this[n]?this[o][i]?this[o]:d(this[o]):this[o],set:e=>{const t=E(P?P(e):e);if("index"!==r&&this[n]!==t&&"null"!==this[n]&&"null"!==t)throw new Error(`@Prop() ${r} with type '${this[n]}' cannot be set to ${t}.`);if("array"===this[n]){if(!v(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=d(this[o]);if(t[a](this)){const r=e[i]?e[c]:e;t[s](this,r),this[o]=e}else this[o]=e}else this[o]=P?P(e):e,S(this,r)}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!t.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=b(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[n]=E(e),"array"===this[n]?(this[o]=e,new Proxy(e,{get:(e,t)=>t===$?this[l]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===$)return this[l]=n,!0;const a=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,a}})):(this[o]=P?P(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}],o=[x()],n=[x()],l=[x()],p=[x()],F(null,null,r,{kind:"field",name:"icons",static:!1,private:!1,access:{has:e=>"icons"in e,get:e=>e.icons,set:(e,t)=>{e.icons=t}},metadata:w},m,y),F(null,null,o,{kind:"field",name:"$popover",static:!1,private:!1,access:{has:e=>"$popover"in e,get:e=>e.$popover,set:(e,t)=>{e.$popover=t}},metadata:w},g,A),F(null,null,n,{kind:"field",name:"$arrow",static:!1,private:!1,access:{has:e=>"$arrow"in e,get:e=>e.$arrow,set:(e,t)=>{e.$arrow=t}},metadata:w},O,C),F(null,null,l,{kind:"field",name:"$search",static:!1,private:!1,access:{has:e=>"$search"in e,get:e=>e.$search,set:(e,t)=>{e.$search=t}},metadata:w},R,j),F(null,null,p,{kind:"field",name:"$grid",static:!1,private:!1,access:{has:e=>"$grid"in e,get:e=>e.$grid,set:(e,t)=>{e.$grid=t}},metadata:w},z,M),F(null,e={value:t},h,{kind:"class",name:t.name,metadata:w},null,u),t=e.value,w&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),k(t,u)}icons=k(this,m,[]);$popover=(k(this,y),k(this,g,void 0));$arrow=(k(this,A),k(this,O,void 0));$search=(k(this,C),k(this,R,void 0));$grid=(k(this,j),k(this,z,void 0));isVisible=(k(this,M),!1);connectedCallback(){}search="";render(){this.$grid.icons=this.icons.filter((e=>-1!==e.name.indexOf(this.search)))}})})()})();
package/pgPreview.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);n&&s[p[0]]||(void 0!==o&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=o),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),i&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=i):p[4]="".concat(i)),e.push(p))}},e}},601:t=>{t.exports=function(t){return t[1]}},781:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),i=r.n(n),o=r(314),s=r.n(o)()(i());s.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #222);\n}\n\n[part=svg] {\n position: relative;\n width: 1.5rem;\n height: 1.5rem;\n z-index: 1;\n}\n\n[part="grid"] {\n position: relative;\n background-image:\n repeating-linear-gradient(rgba(83, 137, 164, 0.5) 0 2px, transparent 2px 100%),\n repeating-linear-gradient(90deg, rgba(83, 137, 164, 0.5) 0 2px, transparent 2px 100%);\n background-size: var(--pg-preview-size, 4px) var(--pg-preview-size, 4px);\n background-position: calc(var(--pg-preview-size, 4px) - 1px) calc(var(--pg-preview-size, 4px) - 1px);\n}\n\n[part="grid"]::after {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \' \';\n background-image:\n repeating-linear-gradient(#5389a4 0 2px, transparent 2px 100%),\n repeating-linear-gradient(90deg, #5389a4 0 2px, transparent 2px 100%);\n background-size: calc(var(--pg-preview-size, 4px) * 4) calc(var(--pg-preview-size, 4px) * 4);\n background-position: calc(var(--pg-preview-size, 4px) * 4 - 1px) calc(var(--pg-preview-size, 4px) * 4 - 1px);\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),i=Symbol("removeObserver"),o=Symbol("getObservers"),s=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function h(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return e;case o:return p.has(t);case s:return(e,r)=>{const n=p.get(t);n.forEach(((i,o)=>{if(o.getRootNode().host===e){const e=n.get(o);p.has(r)?p.get(r).has(o)?p.get(r).get(o).push(n.get(o)):p.get(r).set(o,n.get(o)):p.set(r,new Map([[o,e]])),p.delete(t),e.forEach((t=>{t(null,d.swap,[r])}))}}))};case n:return(e,r)=>{p.has(t)?p.get(t).has(e)?p.get(t).get(e).push(r):p.get(t).set(e,[r]):p.set(t,new Map([[e,[r]]]))};case i:return e=>{p.has(t)&&(p.get(t).delete(e),0===p.get(t).size&&p.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?h(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return p.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return p.get(e).forEach(((t,n)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return h(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(p.has(t)){p.get(t).forEach(((t,n)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=p;const d={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),f=Symbol("template"),g=Symbol("style"),y=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function w(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,i;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[y]||e.prototype[y][e.prototype[y].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[y]=[e.prototype],e.prototype[g]=t.style?[t.style]:[],e.prototype[f]=t.template||""):(e.prototype[y].push(e.prototype),e.prototype[g].push(t.style),e.prototype[f]=(n=e.prototype[f],(i=t.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,n):`${n}${i||""}`));const o=e.prototype.connectedCallback||(()=>{}),s=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[f]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[g].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),i=()=>{this[y].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[v(e)]=!0,t)),{}):{})}))};0===n.length?(this[u]=!0,o.call(this),i()):Promise.all(n).then((()=>{this[u]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));i()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[v(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function b(t){return!!t&&t.constructor===Array}function S(t,e){t[u]&&t[y].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function x(t){return null===t?"null":b(t)?"array":typeof t}function $(t){return function(e,r){const n=r.name,i=Symbol(n),c=Symbol(`${n}:type`),p=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[i][a]?this[i]:h(this[i]):this[i],set:e=>{const r=x(t?t(e):e);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!b(e))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[i]===e)throw new Error("Setting an array to itself is not allowed.");const t=h(this[i]);if(t[o]){const r=e[a]?e[l]:e;t[s](this,r),this[i]=e,console.log(">>> trigger render???",this,n)}else this[i]=e}else this[i]=t?t(e):e,S(this,n)}})})),function(e){if(void 0===e&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==e&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=m(n);e[n]||(t.observedAttributes.push(r),e[n]=i)}return this[c]=x(e),"array"===this[c]?(this[i]=e,new Proxy(e,{get:(t,e)=>e===z?this[p]:(console.log("errr???"),Reflect.get(this[i],e)),set:(t,e,r)=>{if(e===z)return this[p]=r,!0;const o=Reflect.set(t,e,r);return"length"===e&&this[i].length===r||S(this,n),this[i]=r,o}})):(this[i]=t?t(this.getAttribute(n)??e):this.getAttribute(n)??e,this[i])}}}function E(){return function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const z=Symbol("meta");var P=r(781),k=function(t,e,r,n,i,o){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?n.static?t:t.prototype:null,h=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),d=!1,u=r.length-1;u>=0;u--){var f={};for(var g in n)f[g]="access"===g?{}:n[g];for(var g in n.access)f.access[g]=n.access[g];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(t||null))};var y=(0,r[u])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=s(y.get))&&(h.get=a),(a=s(y.set))&&(h.set=a),(a=s(y.init))&&i.unshift(a)}else(a=s(y))&&("field"===l?i.unshift(a):h[c]=a)}p&&Object.defineProperty(p,n.name,h),d=!0},A=function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0};(()=>{let t,e,r,n,i,o,s,a,l,c=[w({selector:"pg-preview",style:P.A,template:'<div part="grid"> <svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/> </svg> </div>'})],p=[],h=HTMLElement,d=[],u=[],f=[],g=[],y=[],m=[],v=[],b=[],S=[],x=[],z=[],O=[],C=[],R=[];(class extends h{static{e=this}static{const w="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;r=[$()],n=[$()],i=[$()],o=[$()],s=[E()],a=[E()],l=[E()],k(null,null,r,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:w},d,u),k(null,null,n,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:w},f,g),k(null,null,i,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:w},y,m),k(null,null,o,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:w},v,b),k(null,null,s,{kind:"field",name:"$svg",static:!1,private:!1,access:{has:t=>"$svg"in t,get:t=>t.$svg,set:(t,e)=>{t.$svg=e}},metadata:w},S,x),k(null,null,a,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:w},z,O),k(null,null,l,{kind:"field",name:"$grid",static:!1,private:!1,access:{has:t=>"$grid"in t,get:t=>t.$grid,set:(t,e)=>{t.$grid=e}},metadata:w},C,R),k(null,t={value:e},c,{kind:"class",name:e.name,metadata:w},null,p),e=t.value,w&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),A(e,p)}path=A(this,d,"M0 0h24v24H0V0zm2 2v20h20V2H2z");width=(A(this,u),A(this,f,24));height=(A(this,g),A(this,y,24));size=(A(this,m),A(this,v,8));$svg=(A(this,b),A(this,S,void 0));$path=(A(this,x),A(this,z,void 0));$grid=(A(this,O),A(this,C,void 0));render(t){if(t.path&&this.$path.setAttribute("d",this.path),t.size){const t=parseInt(`${this.width}`,10),e=parseInt(`${this.height}`,10),r=parseInt(`${this.size}`,10);this.$svg.style.width=t*r+"px",this.$svg.style.height=e*r+"px",this.$grid.style.width=t*r+"px",this.$grid.style.height=e*r+"px",this.$grid.style.setProperty("--pg-preview-size",`${r}px`)}}constructor(){super(...arguments),A(this,R)}})})()})();
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);n&&s[p[0]]||(void 0!==o&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=o),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),i&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=i):p[4]="".concat(i)),e.push(p))}},e}},601:t=>{t.exports=function(t){return t[1]}},781:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),i=r.n(n),o=r(314),s=r.n(o)()(i());s.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #222);\n}\n\n[part=svg] {\n position: relative;\n width: 1.5rem;\n height: 1.5rem;\n z-index: 1;\n}\n\n[part="grid"] {\n position: relative;\n background-image:\n repeating-linear-gradient(rgba(83, 137, 164, 0.5) 0 2px, transparent 2px 100%),\n repeating-linear-gradient(90deg, rgba(83, 137, 164, 0.5) 0 2px, transparent 2px 100%);\n background-size: var(--pg-preview-size, 4px) var(--pg-preview-size, 4px);\n background-position: calc(var(--pg-preview-size, 4px) - 1px) calc(var(--pg-preview-size, 4px) - 1px);\n}\n\n[part="grid"]::after {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \' \';\n background-image:\n repeating-linear-gradient(#5389a4 0 2px, transparent 2px 100%),\n repeating-linear-gradient(90deg, #5389a4 0 2px, transparent 2px 100%);\n background-size: calc(var(--pg-preview-size, 4px) * 4) calc(var(--pg-preview-size, 4px) * 4);\n background-position: calc(var(--pg-preview-size, 4px) * 4 - 1px) calc(var(--pg-preview-size, 4px) * 4 - 1px);\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),i=Symbol("removeObserver"),o=Symbol("getObservers"),s=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function h(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return e;case o:return e=>{const r=p.get(t);return r?.has(e)};case s:return(e,r)=>{const n=p.get(t);if(n){const t=n.get(e);t&&t.forEach(((n,i)=>{if(!n)throw new Error("Unreachable");{const t=p.get(r);if(t){const r=t.get(e);r?r.set(i,n):t.set(e,new Map([[i,n]]))}else p.set(r,new Map([[e,new Map([[i,n]])]]))}t.delete(i),n.forEach((t=>{t(null,d.swap,[r])}))}))}};case n:return(e,r)=>{const n=e.getRootNode().host,i=p.get(t);if(i){const t=i.get(n);if(t){const n=t.get(e);n?n.push(r):t.set(e,[r])}else i.set(n,new Map([[e,[r]]]))}else p.set(t,new Map([[n,new Map([[e,[r]]])]]))};case i:return e=>{const r=e.getRootNode().host,n=p.get(t);n&&(n.delete(r),0===n.size&&p.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?h(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return p.has(e)?function(){const t=Array.prototype[r].apply(e,arguments),n=p.get(e);return n?.forEach((t=>{t.forEach((t=>{t.forEach((t=>{t(e,r,arguments)}))}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return h(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(p.has(t)){const n=p.get(t);n?.forEach((t=>{t.forEach((t=>{t.forEach((t=>{t(e,r)}))}))}))}return Reflect.set(t,e,r)}})}window.observers=p;const d={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),f=Symbol("template"),g=Symbol("style"),y=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function w(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,i;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[y]||e.prototype[y][e.prototype[y].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[y]=[e.prototype],e.prototype[g]=t.style?[t.style]:[],e.prototype[f]=t.template||""):(e.prototype[y].push(e.prototype),e.prototype[g].push(t.style),e.prototype[f]=(n=e.prototype[f],(i=t.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,n):n.match(/<child\/>/)?n.replace(/<child\/>/,i||""):`${n}${i||""}`));const o=e.prototype.connectedCallback||(()=>{}),s=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[f]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[g].reduce(((t,e)=>{if(!e)return t;if(e instanceof CSSStyleSheet)return t.push(e),t;var r=new CSSStyleSheet;return r.replaceSync(e.toString()),t.push(r),t}),[]),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),i=()=>{this[y].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[v(e)]=!0,t)),{}):{})}))};0===n.length?(this[u]=!0,o.call(this),i()):Promise.all(n).then((()=>{this[u]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));i()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[v(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function b(t){return!!t&&t.constructor===Array}function S(t,e){t[u]&&t[y].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function x(t){return null===t?"null":b(t)?"array":typeof t}function $(t){return function(e,r){const n=r.name,i=Symbol(n),c=Symbol(`${n}:type`),p=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[i][a]?this[i]:h(this[i]):this[i],set:e=>{const r=x(t?t(e):e);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!b(e))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[i]===e)throw new Error("Setting an array to itself is not allowed.");const t=h(this[i]);if(t[o](this)){const r=e[a]?e[l]:e;t[s](this,r),this[i]=e}else this[i]=e}else this[i]=t?t(e):e,S(this,n)}})})),function(e){if(void 0===e&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==e&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=m(n);e[n]||(t.observedAttributes.push(r),e[n]=i)}return this[c]=x(e),"array"===this[c]?(this[i]=e,new Proxy(e,{get:(t,e)=>e===z?this[p]:(console.log("errr???"),Reflect.get(this[i],e)),set:(t,e,r)=>{if(e===z)return this[p]=r,!0;const o=Reflect.set(t,e,r);return"length"===e&&this[i].length===r||S(this,n),this[i]=r,o}})):(this[i]=t?t(this.getAttribute(n)??e):this.getAttribute(n)??e,this[i])}}}function E(){return function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const z=Symbol("meta");var P=r(781),k=function(t,e,r,n,i,o){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?n.static?t:t.prototype:null,h=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),d=!1,u=r.length-1;u>=0;u--){var f={};for(var g in n)f[g]="access"===g?{}:n[g];for(var g in n.access)f.access[g]=n.access[g];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(t||null))};var y=(0,r[u])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=s(y.get))&&(h.get=a),(a=s(y.set))&&(h.set=a),(a=s(y.init))&&i.unshift(a)}else(a=s(y))&&("field"===l?i.unshift(a):h[c]=a)}p&&Object.defineProperty(p,n.name,h),d=!0},A=function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0};(()=>{let t,e,r,n,i,o,s,a,l,c=[w({selector:"pg-preview",style:P.A,template:'<div part="grid"> <svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/> </svg> </div>'})],p=[],h=HTMLElement,d=[],u=[],f=[],g=[],y=[],m=[],v=[],b=[],S=[],x=[],z=[],O=[],C=[],R=[];(class extends h{static{e=this}static{const w="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;r=[$()],n=[$()],i=[$()],o=[$()],s=[E()],a=[E()],l=[E()],k(null,null,r,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:w},d,u),k(null,null,n,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:w},f,g),k(null,null,i,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:w},y,m),k(null,null,o,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:w},v,b),k(null,null,s,{kind:"field",name:"$svg",static:!1,private:!1,access:{has:t=>"$svg"in t,get:t=>t.$svg,set:(t,e)=>{t.$svg=e}},metadata:w},S,x),k(null,null,a,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:w},z,O),k(null,null,l,{kind:"field",name:"$grid",static:!1,private:!1,access:{has:t=>"$grid"in t,get:t=>t.$grid,set:(t,e)=>{t.$grid=e}},metadata:w},C,R),k(null,t={value:e},c,{kind:"class",name:e.name,metadata:w},null,p),e=t.value,w&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),A(e,p)}path=A(this,d,"M0 0h24v24H0V0zm2 2v20h20V2H2z");width=(A(this,u),A(this,f,24));height=(A(this,g),A(this,y,24));size=(A(this,m),A(this,v,8));$svg=(A(this,b),A(this,S,void 0));$path=(A(this,x),A(this,z,void 0));$grid=(A(this,O),A(this,C,void 0));render(t){if(t.path&&this.$path.setAttribute("d",this.path),t.size){const t=parseInt(`${this.width}`,10),e=parseInt(`${this.height}`,10),r=parseInt(`${this.size}`,10);this.$svg.style.width=t*r+"px",this.$svg.style.height=e*r+"px",this.$grid.style.width=t*r+"px",this.$grid.style.height=e*r+"px",this.$grid.style.setProperty("--pg-preview-size",`${r}px`)}}constructor(){super(...arguments),A(this,R)}})})()})();
package/pgScroll.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var h=[].concat(t[c]);n&&s[h[0]]||(void 0!==i&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=i),r&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=r):h[2]=r),o&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=o):h[4]="".concat(o)),e.push(h))}},e}},601:t=>{t.exports=function(t){return t[1]}},713:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),o=r.n(n),i=r(314),s=r.n(i)()(o());s.push([t.id,":host {\n display: block;\n}\n\ndiv {\n transform: translateY(0);\n}",""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],h=new Map;function u(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return e;case i:return h.has(t);case s:return(e,r)=>{const n=h.get(t);n.forEach(((o,i)=>{if(i.getRootNode().host===e){const e=n.get(i);h.has(r)?h.get(r).has(i)?h.get(r).get(i).push(n.get(i)):h.get(r).set(i,n.get(i)):h.set(r,new Map([[i,e]])),h.delete(t),e.forEach((t=>{t(null,p.swap,[r])}))}}))};case n:return(e,r)=>{h.has(t)?h.get(t).has(e)?h.get(t).get(e).push(r):h.get(t).set(e,[r]):h.set(t,new Map([[e,[r]]]))};case o:return e=>{h.has(t)&&(h.get(t).delete(e),0===h.get(t).size&&h.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?u(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return h.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return h.get(e).forEach(((t,n)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return u(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(h.has(t)){h.get(t).forEach(((t,n)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=h;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const f=Symbol("init"),d=Symbol("template"),y=Symbol("style"),g=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[g]||e.prototype[g][e.prototype[g].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[g]=[e.prototype],e.prototype[y]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[g].push(e.prototype),e.prototype[y].push(t.style),e.prototype[d]=(n=e.prototype[d],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const i=e.prototype.connectedCallback||(()=>{}),s=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[f]||void 0!==t.template||void 0!==t.style)if(this[f]){if(this[f]&&t.style);else if(this[f]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[d]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[y].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[g].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[v(e)]=!0,t)),{}):{})}))};0===n.length?(this[f]=!0,i.call(this),o()):Promise.all(n).then((()=>{this[f]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[v(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function w(t){return!!t&&t.constructor===Array}function S(t,e){t[f]&&t[g].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function E(t){return null===t?"null":w(t)?"array":typeof t}Symbol("hasProxy");const x=Symbol("meta");const O=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const $="object"==typeof global&&global&&global.Object===Object&&global;var P="object"==typeof self&&self&&self.Object===Object&&self;const j=$||P||Function("return this")();const C=function(){return j.Date.now()};var A=/\s/;const R=function(t){for(var e=t.length;e--&&A.test(t.charAt(e)););return e};var T=/^\s+/;const z=function(t){return t?t.slice(0,R(t)+1).replace(T,""):t};const k=j.Symbol;var H=Object.prototype,N=H.hasOwnProperty,M=H.toString,W=k?k.toStringTag:void 0;const I=function(t){var e=N.call(t,W),r=t[W];try{t[W]=void 0;var n=!0}catch(t){}var o=M.call(t);return n&&(e?t[W]=r:delete t[W]),o};var V=Object.prototype.toString;const L=function(t){return V.call(t)};var D=k?k.toStringTag:void 0;const U=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":D&&D in Object(t)?I(t):L(t)};const Y=function(t){return null!=t&&"object"==typeof t};const q=function(t){return"symbol"==typeof t||Y(t)&&"[object Symbol]"==U(t)};var B=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,Z=/^0o[0-7]+$/i,_=parseInt;const G=function(t){if("number"==typeof t)return t;if(q(t))return NaN;if(O(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=O(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=z(t);var r=F.test(t);return r||Z.test(t)?_(t.slice(2),r?2:8):B.test(t)?NaN:+t};var J=Math.max,K=Math.min;const Q=function(t,e,r){var n,o,i,s,a,l,c=0,h=!1,u=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var r=n,i=o;return n=o=void 0,c=e,s=t.apply(i,r)}function d(t){var r=t-l;return void 0===l||r>=e||r<0||u&&t-c>=i}function y(){var t=C();if(d(t))return g(t);a=setTimeout(y,function(t){var r=e-(t-l);return u?K(r,i-(t-c)):r}(t))}function g(t){return a=void 0,p&&n?f(t):(n=o=void 0,s)}function m(){var t=C(),r=d(t);if(n=arguments,o=this,l=t,r){if(void 0===a)return function(t){return c=t,a=setTimeout(y,e),h?f(t):s}(l);if(u)return clearTimeout(a),a=setTimeout(y,e),f(l)}return void 0===a&&(a=setTimeout(y,e)),s}return e=G(e)||0,O(r)&&(h=!!r.leading,i=(u="maxWait"in r)?J(G(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=o=a=void 0},m.flush=function(){return void 0===a?s:g(C())},m};const X=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return O(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Q(t,e,{leading:n,maxWait:e,trailing:o})};var tt=r(713),et=function(t,e,r,n,o,i){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",h=!e&&t?n.static?t:t.prototype:null,u=e||(h?Object.getOwnPropertyDescriptor(h,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var d={};for(var y in n)d[y]="access"===y?{}:n[y];for(var y in n.access)d.access[y]=n.access[y];d.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var g=(0,r[f])("accessor"===l?{get:u.get,set:u.set}:u[c],d);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=s(g.get))&&(u.get=a),(a=s(g.set))&&(u.set=a),(a=s(g.init))&&o.unshift(a)}else(a=s(g))&&("field"===l?o.unshift(a):u[c]=a)}h&&Object.defineProperty(h,n.name,u),p=!0},rt=function(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0};(()=>{let t,e,r,n,o=[b({selector:"pg-scroll",style:tt.A,template:'<div part="scroll"> <slot></slot> </div>'})],c=[],h=HTMLElement,p=[],f=[],d=[],y=[];(class extends h{static{e=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;var v;r=[function(t,e){const r=e.name,n=Symbol(r),o=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return e.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[o]||"array"===this[o]?this[n][a]?this[n]:u(this[n]):this[n],set:t=>{const e=E(v?v(t):t);if("index"!==r&&this[o]!==e&&"null"!==this[o]&&"null"!==e)throw new Error(`@Prop() ${r} with type '${this[o]}' cannot be set to ${e}.`);if("array"===this[o]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[n]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[n]);if(e[i]){const o=t[a]?t[l]:t;e[s](this,o),this[n]=t,console.log(">>> trigger render???",this,r)}else this[n]=t}else this[n]=v?v(t):t,S(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!e.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,o=m(r);e[r]||(t.observedAttributes.push(o),e[r]=n)}return this[o]=E(t),"array"===this[o]?(this[n]=t,new Proxy(t,{get:(t,e)=>e===x?this[c]:(console.log("errr???"),Reflect.get(this[n],e)),set:(t,e,o)=>{if(e===x)return this[c]=o,!0;const i=Reflect.set(t,e,o);return"length"===e&&this[n].length===o||S(this,r),this[n]=o,i}})):(this[n]=v?v(this.getAttribute(r)??t):this.getAttribute(r)??t,this[n])}}],n=[function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],et(null,null,r,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:g},p,f),et(null,null,n,{kind:"field",name:"$scroll",static:!1,private:!1,access:{has:t=>"$scroll"in t,get:t=>t.$scroll,set:(t,e)=>{t.$scroll=e}},metadata:g},d,y),et(null,t={value:e},o,{kind:"class",name:e.name,metadata:g},null,c),e=t.value,g&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),rt(e,c)}height=rt(this,p,0);$scroll=(rt(this,f),rt(this,d,void 0));scrollElement=rt(this,y);currentHeight=-1;columns=10;size=44;visible=!1;y=-1;width=0;resizeObserver=new ResizeObserver(X((t=>{const{width:e}=t[0].contentRect;this.columns=Math.floor(e/(this.size+20)),this.y=-1,this.width=e,this.calculateScroll()}),100));connectedCallback(){this.resizeObserver.observe(this.$scroll)}getInnerHeight(){let t=this.parentElement;for(;t;){if("auto"===t.style.overflow)return t.getBoundingClientRect().height;t=t.parentElement}return window.innerHeight}get isWindow(){return this.scrollElement===window}getView(){const t=this.getInnerHeight(),e=this.getBoundingClientRect(),{y:r,height:n}=this.isWindow?{y:e.top,height:e.height}:{y:e.top-this.scrollElement.getBoundingClientRect().top,height:e.height},o=r<0?-1*r:0,i=n-o-t<0?n-t<0?0:n-t:o,s=n<t?n:r+n-t>0?t:r+n-t;return{visible:r<t&&n+r>0||!this.isWindow,y:i,height:s<0?t:s,atEnd:s<0}}calculateScroll(){const{visible:t,y:e,height:r}=this.getView();t&&(this.$scroll.style.transform=`translateY(${e}px)`,this.$scroll.style.height=`${r}px`),this.visible!==t&&(this.visible=t,this.visible?this.enterView():this.leaveView()),this.visible&&this.y!==e&&(this.dispatchEvent(new CustomEvent("calculate",{detail:{offsetY:e,viewWidth:this.width,viewHeight:r,height:this.height}})),this.y=e)}enterView(){this.dispatchEvent(new CustomEvent("enter"))}leaveView(){this.dispatchEvent(new CustomEvent("leave"))}getParentElement(){let t=this.parentElement;for(;t;){if("auto"===t.style.overflow)return t;t=t.parentElement}return window}updateHeight(){this.scrollElement=this.getParentElement(),this.scrollElement.addEventListener("scroll",X((()=>{this.calculateScroll()}),100)),this.style.height=`${this.currentHeight}px`,this.y=-1,this.calculateScroll()}render(t){console.log("changes",t);const e=parseInt(`${this.height}`,10);console.log("set",this.height),this.currentHeight!==e&&(this.currentHeight=e,this.updateHeight())}})})()})();
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var h=[].concat(t[c]);n&&s[h[0]]||(void 0!==i&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=i),r&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=r):h[2]=r),o&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=o):h[4]="".concat(o)),e.push(h))}},e}},601:t=>{t.exports=function(t){return t[1]}},713:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),o=r.n(n),i=r(314),s=r.n(i)()(o());s.push([t.id,":host {\n display: block;\n}\n\ndiv {\n transform: translateY(0);\n}",""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],h=new Map;function u(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return e;case i:return e=>{const r=h.get(t);return r?.has(e)};case s:return(e,r)=>{const n=h.get(t);if(n){const t=n.get(e);t&&t.forEach(((n,o)=>{if(!n)throw new Error("Unreachable");{const t=h.get(r);if(t){const r=t.get(e);r?r.set(o,n):t.set(e,new Map([[o,n]]))}else h.set(r,new Map([[e,new Map([[o,n]])]]))}t.delete(o),n.forEach((t=>{t(null,p.swap,[r])}))}))}};case n:return(e,r)=>{const n=e.getRootNode().host,o=h.get(t);if(o){const t=o.get(n);if(t){const n=t.get(e);n?n.push(r):t.set(e,[r])}else o.set(n,new Map([[e,[r]]]))}else h.set(t,new Map([[n,new Map([[e,[r]]])]]))};case o:return e=>{const r=e.getRootNode().host,n=h.get(t);n&&(n.delete(r),0===n.size&&h.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?u(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return h.has(e)?function(){const t=Array.prototype[r].apply(e,arguments),n=h.get(e);return n?.forEach((t=>{t.forEach((t=>{t.forEach((t=>{t(e,r,arguments)}))}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return u(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(h.has(t)){const n=h.get(t);n?.forEach((t=>{t.forEach((t=>{t.forEach((t=>{t(e,r)}))}))}))}return Reflect.set(t,e,r)}})}window.observers=h;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const f=Symbol("init"),d=Symbol("template"),y=Symbol("style"),m=Symbol("parent");function g(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[m]||e.prototype[m][e.prototype[m].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[m]=[e.prototype],e.prototype[y]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[m].push(e.prototype),e.prototype[y].push(t.style),e.prototype[d]=(n=e.prototype[d],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):n.match(/<child\/>/)?n.replace(/<child\/>/,o||""):`${n}${o||""}`));const i=e.prototype.connectedCallback||(()=>{}),s=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[f]||void 0!==t.template||void 0!==t.style)if(this[f]){if(this[f]&&t.style);else if(this[f]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[d]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[y].reduce(((t,e)=>{if(!e)return t;if(e instanceof CSSStyleSheet)return t.push(e),t;var r=new CSSStyleSheet;return r.replaceSync(e.toString()),t.push(r),t}),[]),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[m].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[v(e)]=!0,t)),{}):{})}))};0===n.length?(this[f]=!0,i.call(this),o()):Promise.all(n).then((()=>{this[f]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[v(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function w(t){return!!t&&t.constructor===Array}function S(t,e){t[f]&&t[m].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function E(t){return null===t?"null":w(t)?"array":typeof t}Symbol("hasProxy");const x=Symbol("meta");const O=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const $="object"==typeof global&&global&&global.Object===Object&&global;var P="object"==typeof self&&self&&self.Object===Object&&self;const j=$||P||Function("return this")();const C=function(){return j.Date.now()};var R=/\s/;const A=function(t){for(var e=t.length;e--&&R.test(t.charAt(e)););return e};var T=/^\s+/;const z=function(t){return t?t.slice(0,A(t)+1).replace(T,""):t};const k=j.Symbol;var M=Object.prototype,N=M.hasOwnProperty,H=M.toString,W=k?k.toStringTag:void 0;const I=function(t){var e=N.call(t,W),r=t[W];try{t[W]=void 0;var n=!0}catch(t){}var o=H.call(t);return n&&(e?t[W]=r:delete t[W]),o};var V=Object.prototype.toString;const L=function(t){return V.call(t)};var U=k?k.toStringTag:void 0;const D=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":U&&U in Object(t)?I(t):L(t)};const Y=function(t){return null!=t&&"object"==typeof t};const q=function(t){return"symbol"==typeof t||Y(t)&&"[object Symbol]"==D(t)};var B=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,Z=/^0o[0-7]+$/i,_=parseInt;const G=function(t){if("number"==typeof t)return t;if(q(t))return NaN;if(O(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=O(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=z(t);var r=F.test(t);return r||Z.test(t)?_(t.slice(2),r?2:8):B.test(t)?NaN:+t};var J=Math.max,K=Math.min;const Q=function(t,e,r){var n,o,i,s,a,l,c=0,h=!1,u=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var r=n,i=o;return n=o=void 0,c=e,s=t.apply(i,r)}function d(t){var r=t-l;return void 0===l||r>=e||r<0||u&&t-c>=i}function y(){var t=C();if(d(t))return m(t);a=setTimeout(y,function(t){var r=e-(t-l);return u?K(r,i-(t-c)):r}(t))}function m(t){return a=void 0,p&&n?f(t):(n=o=void 0,s)}function g(){var t=C(),r=d(t);if(n=arguments,o=this,l=t,r){if(void 0===a)return function(t){return c=t,a=setTimeout(y,e),h?f(t):s}(l);if(u)return clearTimeout(a),a=setTimeout(y,e),f(l)}return void 0===a&&(a=setTimeout(y,e)),s}return e=G(e)||0,O(r)&&(h=!!r.leading,i=(u="maxWait"in r)?J(G(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p),g.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=o=a=void 0},g.flush=function(){return void 0===a?s:m(C())},g};const X=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return O(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Q(t,e,{leading:n,maxWait:e,trailing:o})};var tt=r(713),et=function(t,e,r,n,o,i){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",h=!e&&t?n.static?t:t.prototype:null,u=e||(h?Object.getOwnPropertyDescriptor(h,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var d={};for(var y in n)d[y]="access"===y?{}:n[y];for(var y in n.access)d.access[y]=n.access[y];d.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var m=(0,r[f])("accessor"===l?{get:u.get,set:u.set}:u[c],d);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===l?o.unshift(a):u[c]=a)}h&&Object.defineProperty(h,n.name,u),p=!0},rt=function(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0};(()=>{let t,e,r,n,o=[b({selector:"pg-scroll",style:tt.A,template:'<div part="scroll"> <slot></slot> </div>'})],c=[],h=HTMLElement,p=[],f=[],d=[],y=[];(class extends h{static{e=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;var v;r=[function(t,e){const r=e.name,n=Symbol(r),o=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return e.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[o]||"array"===this[o]?this[n][a]?this[n]:u(this[n]):this[n],set:t=>{const e=E(v?v(t):t);if("index"!==r&&this[o]!==e&&"null"!==this[o]&&"null"!==e)throw new Error(`@Prop() ${r} with type '${this[o]}' cannot be set to ${e}.`);if("array"===this[o]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[n]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[n]);if(e[i](this)){const r=t[a]?t[l]:t;e[s](this,r),this[n]=t}else this[n]=t}else this[n]=v?v(t):t,S(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!e.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,o=g(r);e[r]||(t.observedAttributes.push(o),e[r]=n)}return this[o]=E(t),"array"===this[o]?(this[n]=t,new Proxy(t,{get:(t,e)=>e===x?this[c]:(console.log("errr???"),Reflect.get(this[n],e)),set:(t,e,o)=>{if(e===x)return this[c]=o,!0;const i=Reflect.set(t,e,o);return"length"===e&&this[n].length===o||S(this,r),this[n]=o,i}})):(this[n]=v?v(this.getAttribute(r)??t):this.getAttribute(r)??t,this[n])}}],n=[function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],et(null,null,r,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:m},p,f),et(null,null,n,{kind:"field",name:"$scroll",static:!1,private:!1,access:{has:t=>"$scroll"in t,get:t=>t.$scroll,set:(t,e)=>{t.$scroll=e}},metadata:m},d,y),et(null,t={value:e},o,{kind:"class",name:e.name,metadata:m},null,c),e=t.value,m&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:m}),rt(e,c)}height=rt(this,p,0);$scroll=(rt(this,f),rt(this,d,void 0));scrollElement=rt(this,y);currentHeight=-1;columns=10;size=44;visible=!1;y=-1;width=0;resizeObserver=new ResizeObserver(X((t=>{const{width:e}=t[0].contentRect;this.columns=Math.floor(e/(this.size+20)),this.y=-1,this.width=e,this.calculateScroll()}),100));connectedCallback(){this.resizeObserver.observe(this.$scroll)}getInnerHeight(){let t=this.parentElement;for(;t;){if("auto"===t.style.overflow)return t.getBoundingClientRect().height;t=t.parentElement}return window.innerHeight}get isWindow(){return this.scrollElement===window}getView(){const t=this.getInnerHeight(),e=this.getBoundingClientRect(),{y:r,height:n}=this.isWindow?{y:e.top,height:e.height}:{y:e.top-this.scrollElement.getBoundingClientRect().top,height:e.height},o=r<0?-1*r:0,i=n-o-t<0?n-t<0?0:n-t:o,s=n<t?n:r+n-t>0?t:r+n-t;return{visible:r<t&&n+r>0||!this.isWindow,y:i,height:s<0?t:s,atEnd:s<0}}calculateScroll(){const{visible:t,y:e,height:r}=this.getView();t&&(this.$scroll.style.transform=`translateY(${e}px)`,this.$scroll.style.height=`${r}px`),this.visible!==t&&(this.visible=t,this.visible?this.enterView():this.leaveView()),this.visible&&this.y!==e&&(this.dispatchEvent(new CustomEvent("calculate",{detail:{offsetY:e,viewWidth:this.width,viewHeight:r,height:this.height}})),this.y=e)}enterView(){this.dispatchEvent(new CustomEvent("enter"))}leaveView(){this.dispatchEvent(new CustomEvent("leave"))}getParentElement(){let t=this.parentElement;for(;t;){if("auto"===t.style.overflow)return t;t=t.parentElement}return window}updateHeight(){this.scrollElement=this.getParentElement(),this.scrollElement.addEventListener("scroll",X((()=>{this.calculateScroll()}),100)),this.style.height=`${this.currentHeight}px`,this.y=-1,this.calculateScroll()}render(t){console.log("changes",t);const e=parseInt(`${this.height}`,10);console.log("set",this.height),this.currentHeight!==e&&(this.currentHeight=e,this.updateHeight())}})})()})();