webhook-action/node_modules/prettier/esm/parser-glimmer.mjs

2 lines
137 KiB
JavaScript
Raw Normal View History

var t,e,r=(function(t,e){var r="\n",n=function(){function t(t){this.string=t;for(var e=[0],n=0;n<t.length;)switch(t[n]){case r:n+=r.length,e.push(n);break;case"\r":t[n+="\r".length]===r&&(n+=r.length),e.push(n);break;default:n++}this.offsets=e}return t.prototype.locationForIndex=function(t){if(t<0||t>this.string.length)return null;for(var e=0,r=this.offsets;r[e+1]<=t;)e++;return{line:e,column:t-r[e]}},t.prototype.indexForLocation=function(t){var e=t.line,r=t.column;return e<0||e>=this.offsets.length||r<0||r>this.lengthOfLine(e)?null:this.offsets[e]+r},t.prototype.lengthOfLine=function(t){var e=this.offsets[t];return(t===this.offsets.length-1?this.string.length:this.offsets[t+1])-e},t}();e.__esModule=!0,e.default=n}(e={path:t,exports:{},require:function(t,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&e.path)}},e.exports),e.exports);var n=function(t,e){const r=new SyntaxError(t+" ("+e.start.line+":"+e.start.column+")");return r.loc=e,r};var s={locStart:function(t){return t.loc.start.offset},locEnd:function(t){return t.loc.end.offset}};Object.freeze([]);function a(){return Object.create(null)}const{keys:i}=Object;function o(t){for(let e=1;e<arguments.length;e++){let r=arguments[e];if(null===r||"object"!=typeof r)continue;let n=i(r);for(let e=0;e<n.length;e++){let s=n[e];t[s]=r[s]}}return t}const l=(...t)=>t;function c(t){return t.length>0}function h(t,e="unexpected empty list"){if(!c(t))throw new Error(e)}const u=console;const p=Object.freeze({line:1,column:0}),d=Object.freeze({source:"(synthetic)",start:p,end:p}),m=(Object.freeze({source:"(temporary)",start:p,end:p}),Object.freeze({source:"(nonexistent)",start:p,end:p})),f=Object.freeze({source:"(broken)",start:p,end:p});class g{constructor(t){this.loc=t.loc,this.chars=t.chars}static synthetic(t){let e=U.synthetic(t);return new g({loc:e,chars:t})}static load(t,e){return new g({loc:U.load(t,e[1]),chars:e[0]})}getString(){return this.chars}serialize(){return[this.chars,this.loc.serialize()]}}var b,y,k,v=function(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r},w=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};class S{constructor(t){b.set(this,void 0),v(this,b,t)}first(t){for(let e of w(this,b)){let r=e.match(t);if(c(r))return r[0]}return null}}b=new WeakMap;class E{constructor(){y.set(this,new Map)}get(t,e){let r=w(this,y).get(t);return r||(r=e(),w(this,y).set(t,r),r)}add(t,e){w(this,y).set(t,e)}match(t){let e=function(t){switch(t){case"Broken":case"InternalsSynthetic":case"NonExistent":return"IS_INVISIBLE";default:return t}}(t),r=[],n=w(this,y).get(e),s=w(this,y).get("MATCH_ANY");return n&&r.push(n),s&&r.push(s),r}}function x(t){return t(new N).check()}y=new WeakMap;class N{constructor(){k.set(this,new E)}check(){return(t,e)=>this.matchFor(t.kind,e.kind)(t,e)}matchFor(t,e){let r=w(this,k).match(t);return new S(r).first(e)}when(t,e,r){return w(this,k).get(t,(()=>new E)).add(e,r),this}}k=new WeakMap;var T,A,P=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)},C=function(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r};class L{constructor(t){this.data=t}static forHbsPos(t,e){return new q(t,e,null).wrap()}static broken(t=p){return new O("Broken",t).wrap()}get offset(){let t=this.data.toCharPos();return null===t?null:t.offset}eql(t){return _(this.data,t.data)}until(t){return $(this.data,t.data)}move(t){let e=this.data.toCharPos();if(null===e)return L.broken();{let r=e.offset+t;return e.source.check(r)?new B(e.source,r).wrap():L.broken()}}collapsed(){return $(this.data,this.data)}toJSON(){return this.data.toJSON()}}class B{constructor(t,e){this.source=t,this.charPos=e,this.kind="CharPosition",T.set(this,null)}toCharPos(){return this}toJSON(){let t=this.toHbsPos();return null===t?p:t.toJSON()}wrap(){return new L(this)}get offset(){return this.charPos}toHbsP